Просмотр исходного кода

fix(dashboard): minor fix to schema upgrade when schemaVersion is not correct, fixes #6650

Torkel Ödegaard 9 лет назад
Родитель
Сommit
34790e1fab

+ 0 - 2
public/app/features/dashboard/model.ts

@@ -493,8 +493,6 @@ export class DashboardModel {
             templateVariable.hide = 2;
           } else if (templateVariable.hideLabel) {
             templateVariable.hide = 1;
-          } else {
-            templateVariable.hide = 0;
           }
         });
       }

+ 1 - 0
public/app/features/dashboard/submenu/submenu.ts

@@ -15,6 +15,7 @@ export class SubmenuCtrl {
               private $location) {
     this.annotations = this.dashboard.templating.list;
     this.variables = this.variableSrv.variables;
+    console.log(this.variables);
   }
 
   annotationStateChanged() {

+ 10 - 9
public/dashboards/scripted_templated.js

@@ -25,8 +25,10 @@ var ARGS;
 // Intialize a skeleton with nothing but a rows array and service object
 dashboard = {
   rows : [],
+  schemaVersion: 13,
 };
 
+
 // Set a title
 dashboard.title = 'Scripted and templated dash';
 
@@ -39,23 +41,22 @@ dashboard.time = {
 };
 
 dashboard.templating = {
-  enable: true,
   list: [
     {
       name: 'test',
       query: 'apps.backend.*',
-      refresh: true,
-      options: [],
-      current: null,
-      type: 'custom'
+      refresh: 1,
+      type: 'query',
+      datasource: null,
+      hide: 2,
     },
     {
       name: 'test2',
       query: '*',
-      refresh: true,
-      options: [],
-      current: null,
-      type: 'custom'
+      refresh: 1,
+      type: 'query',
+      datasource: null,
+      hide: 2,
     }
   ]
 };