From c1163ed3c19f61ba877724288ac3f50cb66c8155 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Tue, 26 Sep 2023 16:55:30 -0300 Subject: [PATCH] Allow exporting any cockpit view --- src/components/EditMenu.vue | 2 +- src/stores/widgetManager.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/EditMenu.vue b/src/components/EditMenu.vue index 21671e566..439f27d20 100644 --- a/src/components/EditMenu.vue +++ b/src/components/EditMenu.vue @@ -62,6 +62,7 @@ >

{{ view.name }}

+
@@ -78,7 +79,6 @@
-
diff --git a/src/stores/widgetManager.ts b/src/stores/widgetManager.ts index c59a812c5..681e529c0 100644 --- a/src/stores/widgetManager.ts +++ b/src/stores/widgetManager.ts @@ -259,8 +259,8 @@ export const useWidgetManagerStore = defineStore('widget-manager', () => { currentViewIndex.value = index } - const exportCurrentView = (): void => { - const blob = new Blob([JSON.stringify(currentView.value)], { type: 'text/plain;charset=utf-8' }) + const exportView = (view: View): void => { + const blob = new Blob([JSON.stringify(view)], { type: 'text/plain;charset=utf-8' }) saveAs(blob, `cockpit-widget-view.json`) } @@ -449,7 +449,7 @@ export const useWidgetManagerStore = defineStore('widget-manager', () => { deleteView, renameView, selectView, - exportCurrentView, + exportView, importView, addWidget, deleteWidget,