@@ -352,17 +273,9 @@ export default {
},
computed: {
language () { return this.$store.getters.getLanguage },
- // 是否展示新版导入
- importNew () {
- // chartTemplate dashboard
- const arr = ['/visual/panel/import']
- return !arr.some(item => item === this.importUrl)
- },
- // 是否展示新版导入结果
- resultNew () {
- // chartTemplate dashboard导入样式维持原状
- const arr = ['/visual/panel/import']
- return !arr.some(item => item === this.importUrl)
+ // 判断是否是dashboard
+ isDashboard () {
+ return this.importUrl === '/visual/panel/import'
},
// 是否同步更新关联的dashboard
showSyncDashboard () {
@@ -484,10 +397,8 @@ export default {
this.prevent_opt.import = true
const form = new FormData()
form.append('file', this.importFile.raw)
- if (this.importNew) {
- form.append('existed', this.importBox.existed)
- form.append('ignoreError', Number(this.importBox.ignoreError))
- }
+ form.append('existed', this.importBox.existed)
+ form.append('ignoreError', Number(this.importBox.ignoreError))
if (this.showSyncDashboard) {
form.append('syncDashboard', Number(this.importBox.syncDashboard))
}
@@ -782,6 +693,10 @@ export default {
showImportBox (type) {
this.importBox.show = true
this.importBox.type = type
+ // isDashboard 只支持JSON
+ if (this.isDashboard) {
+ this.importBox.format = 3
+ }
if (type == 2 && (!this.showCur)) {
this.exportCur()
return
diff --git a/nezha-fronted/src/components/common/table/settings/dashboardTmplTable.vue b/nezha-fronted/src/components/common/table/settings/dashboardTmplTable.vue
index 7594be7b3..ff9548828 100644
--- a/nezha-fronted/src/components/common/table/settings/dashboardTmplTable.vue
+++ b/nezha-fronted/src/components/common/table/settings/dashboardTmplTable.vue
@@ -59,13 +59,13 @@
{{$t('overall.option')}}
-
+
- {{$t('overall.edit')}}
-
+ {{$t('overall.edit')}}
+
- {{$t('overall.duplicate')}}
- {{$t('overall.syncChart')}}
+ {{$t('overall.duplicate')}}
+ {{$t('overall.syncChart')}}
diff --git a/nezha-fronted/src/components/page/config/template/dashboardTemp.vue b/nezha-fronted/src/components/page/config/template/dashboardTemp.vue
index 831bc7ce0..e631fcba0 100644
--- a/nezha-fronted/src/components/page/config/template/dashboardTemp.vue
+++ b/nezha-fronted/src/components/page/config/template/dashboardTemp.vue
@@ -11,7 +11,7 @@
@getTableData="getTableData"
>
-