From 96116fa17d9533590a7573b7703d02904deb56b3 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Mon, 21 Mar 2022 16:25:03 +0800 Subject: [PATCH] add mode --- src/store/modules/dashboard.ts | 5 +++++ src/views/Layer.vue | 1 + src/views/dashboard/Edit.vue | 4 ++-- src/views/dashboard/controls/Log.vue | 4 +--- src/views/dashboard/controls/Profile.vue | 5 ++--- src/views/dashboard/controls/Tab.vue | 9 +++------ src/views/dashboard/controls/Topology.vue | 4 +--- src/views/dashboard/controls/Trace.vue | 4 +--- src/views/dashboard/controls/Widget.vue | 6 ++---- .../dashboard/related/topology/components/Settings.vue | 1 + 10 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 48392963..c77af644 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -41,6 +41,7 @@ interface DashboardState { currentTabItems: LayoutConfig[]; dashboards: DashboardItem[]; currentDashboard: Nullable; + editMode: boolean; } export const dashboardStore = defineStore({ @@ -58,11 +59,15 @@ export const dashboardStore = defineStore({ currentTabItems: [], dashboards: [], currentDashboard: null, + editMode: true, }), actions: { setLayout(data: LayoutConfig[]) { this.layout = data; }, + setMode(mode: boolean) { + this.editMode = mode; + }, resetDashboards(list: DashboardItem[]) { this.dashboards = list; sessionStorage.setItem("dashboards", JSON.stringify(list)); diff --git a/src/views/Layer.vue b/src/views/Layer.vue index c8323349..08e4c84a 100644 --- a/src/views/Layer.vue +++ b/src/views/Layer.vue @@ -46,6 +46,7 @@ const layer = ref("GENERAL"); getDashboard(); async function getDashboard() { + dashboardStore.setMode(false); dashboardStore.setCurrentDashboard(null); setLayer(String(route.name)); await dashboardStore.setDashboards(); diff --git a/src/views/dashboard/Edit.vue b/src/views/dashboard/Edit.vue index 99a7faed..ab33ad15 100644 --- a/src/views/dashboard/Edit.vue +++ b/src/views/dashboard/Edit.vue @@ -13,11 +13,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->