From 2e2d328cde82488f002c12ec4a62304a94a74596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Beims=20Br=C3=A4scher?= Date: Tue, 11 Jan 2022 17:00:30 +0100 Subject: [PATCH] Add toggle button on the UI for list including elements in projects. (#5790) * Allow to use projectid=-1 and list all resources (e.g. VMs) regardless of their project. --- ui/src/store/getters.js | 1 + ui/src/store/modules/app.js | 7 +++++++ ui/src/views/AutogenView.vue | 16 ++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/ui/src/store/getters.js b/ui/src/store/getters.js index b3734d6ffe4..f6489ee6e35 100644 --- a/ui/src/store/getters.js +++ b/ui/src/store/getters.js @@ -30,6 +30,7 @@ const getters = { userInfo: state => state.user.info, addRouters: state => state.permission.addRouters, multiTab: state => state.app.multiTab, + listAllProjects: state => state.app.listAllProjects, headerNotices: state => state.user.headerNotices, isLdapEnabled: state => state.user.isLdapEnabled, cloudian: state => state.user.cloudian, diff --git a/ui/src/store/modules/app.js b/ui/src/store/modules/app.js index eff828d33ce..90be53bd97a 100644 --- a/ui/src/store/modules/app.js +++ b/ui/src/store/modules/app.js @@ -46,6 +46,7 @@ const app = { inverted: true, multiTab: true, metrics: false, + listAllProjects: false, server: '' }, mutations: { @@ -99,6 +100,9 @@ const app = { SET_METRICS: (state, bool) => { state.metrics = bool }, + SET_LIST_ALL_PROJECTS: (state, bool) => { + state.listAllProjects = bool + }, SET_USE_BROWSER_TIMEZONE: (state, bool) => { Vue.ls.set(USE_BROWSER_TIMEZONE, bool) state.usebrowsertimezone = bool @@ -151,6 +155,9 @@ const app = { SetMetrics ({ commit }, bool) { commit('SET_METRICS', bool) }, + SetListAllProjects ({ commit }, bool) { + commit('SET_LIST_ALL_PROJECTS', bool) + }, SetUseBrowserTimezone ({ commit }, bool) { commit('SET_USE_BROWSER_TIMEZONE', bool) }, diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 4c128a78090..5baf0646120 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -39,6 +39,13 @@ :un-checked-children="$t('label.metrics')" :checked="$store.getters.metrics" @change="(checked, event) => { $store.dispatch('SetMetrics', checked) }"/> +