Skip to content

Commit

Permalink
Make top menu dynamic on WebUI
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Nov 21, 2024
1 parent 9e945f1 commit 55d42d3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
16 changes: 10 additions & 6 deletions glances/outputs/static/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,22 @@ body {
height: 30px;
}

.top {
height: 140px;
.top-min {
height: 100px;
}

.left-sidebar {
.top-max {
height: 180px;
}

.sidebar-min {
overflow-y: auto;
height: calc(100vh - 30px - 140px);
height: calc(100vh - 30px - 100px);
}

.right-sidebar {
.sidebar-max {
overflow-y: auto;
height: calc(100vh - 30px - 140px);
height: calc(100vh - 30px - 180px);
}

// Table
Expand Down
7 changes: 4 additions & 3 deletions glances/outputs/static/js/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
</div>
</div>
<div class="container-fluid top">
<div class="container-fluid" :class="{ 'top-min': !args.percpu, 'top-max': args.percpu }">
<div class="row justify-content-between">
<!-- Quicklook -->
<div class="col-3 d-none d-lg-block d-xl-block d-xxl-block" v-if="!args.disable_quicklook">
Expand Down Expand Up @@ -65,14 +65,15 @@
</div>
<div class="container-fluid">
<div class="row">
<div class="col-3 left-sidebar" v-if="!args.disable_left_sidebar">
<div class="col-3" :class="{ 'sidebar-min': !args.percpu, 'sidebar-max': args.percpu }"
v-if="!args.disable_left_sidebar">
<template v-for="plugin in leftMenu">
<component v-if="!args[`disable_${plugin}`]" :is="`glances-plugin-${plugin}`"
:id="`plugin-${plugin}`" :data="data">
</component>
</template>
</div>
<div class="col right-sidebar">
<div class="col" :class="{ 'sidebar-min': !args.percpu, 'sidebar-max': args.percpu }">
<glances-plugin-vms v-if="!args.disable_vms" :data="data"></glances-plugin-vms>
<glances-plugin-containers v-if="!args.disable_containers" :data="data"></glances-plugin-containers>
<glances-plugin-process :data="data"></glances-plugin-process>
Expand Down
2 changes: 1 addition & 1 deletion glances/outputs/static/js/components/plugin-quicklook.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</td>
<td scope="col" class="text-end">{{ percpu.total }}%</td>
</tr>
<tr v-if="!args.percpu" v-for="(key) in stats_list_after_cpu">
<tr v-for="(key) in stats_list_after_cpu">
<td scope="col">{{ key.toUpperCase() }}</td>
<td scope="col" class="progress">
<div :class="`progress-bar progress-bar-${getDecoration(key)}`" role="progressbar"
Expand Down
2 changes: 1 addition & 1 deletion glances/outputs/static/public/browser.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions glances/outputs/static/public/glances.js

Large diffs are not rendered by default.

0 comments on commit 55d42d3

Please sign in to comment.