Skip to content

Commit c957541

Browse files
authored
Merge branch 'develop' into custom-theming
2 parents 1ebcdee + 384712a commit c957541

33 files changed

Lines changed: 1685 additions & 143 deletions

package-lock.json

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"vue-echarts": "^6.2.3",
6060
"vue-i18n": "^8.27.2",
6161
"vue-inline-svg": "^2.1.0",
62+
"vue-json-viewer": "^2.2.22",
6263
"vue-meta": "^2.4.0",
6364
"vue-property-decorator": "^9.1.2",
6465
"vue-router": "^3.5.4",

src/App.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@
3838
<!-- <pre>authenticated {{ authenticated }}, socketConnected {{ socketConnected }}, apiConnected {{ apiConnected }}</pre> -->
3939
<v-container
4040
fluid
41-
:class="{ 'fill-height': $route.meta && $route.meta.fillHeight }"
42-
class="pa-2 pa-sm-4"
41+
:class="{
42+
'fill-height': $route.meta && $route.meta.fillHeight,
43+
[['single', 'double', 'triple', 'quad'][columnCount - 1]]: true
44+
}"
45+
class="constrained-width pa-2 pa-sm-4"
4346
>
4447
<v-row
4548
v-if="
@@ -119,6 +122,10 @@ export default class App extends Mixins(StateMixin, FilesMixin) {
119122
return (this.$store.state.config.layoutMode)
120123
}
121124
125+
get columnCount () {
126+
return this.$store.state.config.containerColumnCount
127+
}
128+
122129
get loading () {
123130
return this.$store.getters['wait/hasWait'](Waits.onLoadLanguage)
124131
}

src/components/common/CollapsableCard.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100

101101
<script lang="ts">
102102
import { LayoutConfig } from '@/store/layout/types'
103-
import { kebabCase } from 'lodash-es'
104103
import { Component, Vue, Prop, Watch } from 'vue-property-decorator'
105104
106105
@Component({})
@@ -256,7 +255,7 @@ export default class CollapsableCard extends Vue {
256255
const split = this.layoutPath.split('.')
257256
return {
258257
name: split[0],
259-
id: kebabCase(split[1])
258+
id: split[1]
260259
}
261260
} else {
262261
throw new Error('invalid layout path')

src/components/layout/AppBar.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,16 @@ export default class AppBar extends Mixins(StateMixin, ServicesMixin) {
241241
}
242242
243243
handleResetLayout () {
244-
const layout = defaultState()
244+
const pathLayouts = {
245+
'/diagnostics': 'diagnostics'
246+
} as { [key: string]: string }
247+
248+
const toReset = pathLayouts[this.$route.path] ?? 'dashboard'
249+
const layoutDefaultState = defaultState()
250+
245251
this.$store.dispatch('layout/onLayoutChange', {
246-
name: 'dashboard',
247-
value: {
248-
container1: layout.layouts.dashboard.container1,
249-
container2: layout.layouts.dashboard.container2
250-
}
252+
name: toReset,
253+
value: layoutDefaultState.layouts[toReset]
251254
})
252255
}
253256

src/components/layout/AppNavDrawer.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@
7676
{{ $t('app.general.title.tune') }}
7777
</app-nav-item>
7878

79+
<app-nav-item
80+
v-if="enableDiagnostics"
81+
icon="$chart"
82+
to="/diagnostics"
83+
>
84+
{{ $t('app.general.title.diagnostics') }}
85+
</app-nav-item>
86+
7987
<app-nav-item
8088
icon="$codeJson"
8189
to="/configure"
@@ -133,6 +141,10 @@ export default class AppNavDrawer extends Mixins(StateMixin) {
133141
return this.$store.getters['server/componentSupport']('update_manager')
134142
}
135143
144+
get enableDiagnostics () {
145+
return this.$store.state.config.uiSettings.general.enableDiagnostics
146+
}
147+
136148
get hasSubNavigation () {
137149
return this.$route.meta?.hasSubNavigation ?? false
138150
}

src/components/settings/GeneralSettings.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,19 @@
139139
/>
140140
</app-setting>
141141
</template>
142+
143+
<v-divider />
144+
145+
<app-setting
146+
:title="$t('app.setting.label.enable_diagnostics')"
147+
:sub-title="$t('app.setting.tooltip.diagnostics_performance')"
148+
>
149+
<v-switch
150+
v-model="enableDiagnostics"
151+
hide-details
152+
class="mt-0 mb-4"
153+
/>
154+
</app-setting>
142155
</v-card>
143156
</div>
144157
</template>
@@ -279,6 +292,18 @@ export default class GeneralSettings extends Mixins(StateMixin) {
279292
})
280293
}
281294
295+
get enableDiagnostics () {
296+
return this.$store.state.config.uiSettings.general.enableDiagnostics
297+
}
298+
299+
set enableDiagnostics (value: boolean) {
300+
this.$store.dispatch('config/saveByPath', {
301+
path: 'uiSettings.general.enableDiagnostics',
302+
value,
303+
server: true
304+
})
305+
}
306+
282307
get current_time () {
283308
return Math.floor(Date.now() / 1000)
284309
}

0 commit comments

Comments
 (0)