Skip to content

Commit

Permalink
Frontend: update networking bandwidth widget style
Browse files Browse the repository at this point in the history
Frontend: allow showing bandwidth for wifi
frontend: update networking widgets for using the a blueos-on-sbc  with css colors
  • Loading branch information
Williangalvani committed Feb 26, 2025
1 parent 028ce71 commit db6b26d
Show file tree
Hide file tree
Showing 8 changed files with 405 additions and 25 deletions.
7 changes: 6 additions & 1 deletion core/frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ import autopilot_data from './store/autopilot'
import Cpu from './widgets/Cpu.vue'
import Disk from './widgets/Disk.vue'
import Networking from './widgets/Networking.vue'
import WifiNetworking from './widgets/WifiNetworking.vue'
export default Vue.extend({
name: 'App',
Expand Down Expand Up @@ -472,7 +473,11 @@ export default Vue.extend({
},
{
component: Networking,
name: 'Networking',
name: 'Eth0 Networking',
},
{
component: WifiNetworking,
name: 'Wifi Networking',
},
],
selected_widgets: settings.user_top_widgets,
Expand Down
44 changes: 44 additions & 0 deletions core/frontend/src/assets/img/icons/RX.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions core/frontend/src/assets/img/icons/TX.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions core/frontend/src/assets/img/icons/pi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core/frontend/src/components/wifi/WifiTrayMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default Vue.extend({
},
mounted() {
commander.getEnvironmentVariables().then((environment_variables) => {
this.disabled_services = ((environment_variables?.BLUEOS_DISABLE_SERVICES as string) ?? '').split(',') as string[]
this.disabled_services = (environment_variables?.BLUEOS_DISABLE_SERVICES as string ?? '').split(',') as string[]
})
},
})
Expand Down
5 changes: 5 additions & 0 deletions core/frontend/src/utils/networking.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function formatBandwidth(bytesPerSecond: number): string {
const mbps = (bytesPerSecond / 1024 / 1024)
const decimal_places = mbps < 10 ? 2 : mbps < 100 ? 1 : 0
return `${mbps.toFixed(decimal_places)}Mbps`
}
Loading

0 comments on commit db6b26d

Please sign in to comment.