diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index c5f578a4..26dc9d19 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -122,6 +122,7 @@ const msg = { editWarning: "You are entering edit mode", viewWarning: "You are entering view mode", virtualDatabase: "Virtual Database", + reloadDashboards: "Reload dashboards", hourTip: "Select Hour", minuteTip: "Select Minute", secondTip: "Select Second", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index 3a37d58b..f8702996 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -122,6 +122,7 @@ const msg = { editWarning: "你正在进入编辑模式", viewWarning: "你正在进入预览模式", virtualDatabase: "虚拟数据库", + reloadDashboards: "重新加载仪表盘", hourTip: "选择小时", minuteTip: "选择分钟", secondTip: "选择秒数", diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 6e7d33a0..c3a688b1 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -326,6 +326,17 @@ export const dashboardStore = defineStore({ sessionStorage.getItem("dashboards") || "[]" ); }, + async resetTemplates() { + const res = await this.fetchTemplates(); + if (res.errors) { + this.dashboards = []; + ElMessage.error(res.errors); + return; + } + this.dashboards = JSON.parse( + sessionStorage.getItem("dashboards") || "[]" + ); + }, async updateDashboard(setting: { id: string; configuration: string }) { const res: AxiosResponse = await graphql.query("updateTemplate").params({ setting, diff --git a/src/views/dashboard/List.vue b/src/views/dashboard/List.vue index 9211c0cd..9a4c8908 100644 --- a/src/views/dashboard/List.vue +++ b/src/views/dashboard/List.vue @@ -18,7 +18,7 @@ limitations under the License. --> @@ -28,6 +28,10 @@ limitations under the License. --> + + + {{ t("reloadDashboards") }} + + {{ t("newDashboard") }} @@ -37,7 +41,7 @@ limitations under the License. -->
- + - +