-
diff --git a/src/app/services/dashboard/dashboardSrv.js b/src/app/services/dashboard/dashboardSrv.js
index e88092a4c16..c618e5074da 100644
--- a/src/app/services/dashboard/dashboardSrv.js
+++ b/src/app/services/dashboard/dashboardSrv.js
@@ -116,11 +116,12 @@ function (angular, $, kbn, _, moment) {
};
p.updateSchema = function(old) {
+ var i, j, k;
var oldVersion = this.version;
var panelUpgrades = [];
- this.version = 5;
+ this.version = 6;
- if (oldVersion === 5) {
+ if (oldVersion === 6) {
return;
}
@@ -195,7 +196,7 @@ function (angular, $, kbn, _, moment) {
});
}
- if (oldVersion < 5) {
+ if (oldVersion < 6) {
// move pulldowns to new schema
var filtering = _.findWhere(old.pulldowns, { type: 'filtering' });
var annotations = _.findWhere(old.pulldowns, { type: 'annotations' });
@@ -208,16 +209,24 @@ function (angular, $, kbn, _, moment) {
enable: annotations.enable
};
}
+
+ // update template variables
+ for (i = 0 ; i < this.templating.list.length; i++) {
+ var variable = this.templating.list[i];
+ if (variable.datasource === void 0) { variable.datasource = null; }
+ if (variable.type === void 0) { variable.type = 'query'; }
+ if (variable.allFormat === void 0) { variable.allFormat = 'Glob'; }
+ }
}
if (panelUpgrades.length === 0) {
return;
}
- for (var i = 0; i < this.rows.length; i++) {
+ for (i = 0; i < this.rows.length; i++) {
var row = this.rows[i];
- for (var j = 0; j < row.panels.length; j++) {
- for (var k = 0; k < panelUpgrades.length; k++) {
+ for (j = 0; j < row.panels.length; j++) {
+ for (k = 0; k < panelUpgrades.length; k++) {
panelUpgrades[k](row.panels[j]);
}
}
diff --git a/src/app/services/templateValuesSrv.js b/src/app/services/templateValuesSrv.js
index a076fef1028..fd766d07700 100644
--- a/src/app/services/templateValuesSrv.js
+++ b/src/app/services/templateValuesSrv.js
@@ -68,12 +68,7 @@ function (angular, _) {
});
if (variable.includeAll) {
- var allExpr = '{';
- _.each(variable.options, function(option) {
- allExpr += option.text + ',';
- });
- allExpr = allExpr.substring(0, allExpr.length - 1) + '}';
- variable.options.unshift({text: 'All', value: allExpr});
+ self.addAllOption(variable);
}
// if parameter has current value
@@ -89,6 +84,26 @@ function (angular, _) {
});
};
+ this.addAllOption = function(variable) {
+ var allValue = '';
+ switch(variable.allFormat) {
+ case 'wildcard':
+ allValue = '*';
+ break;
+ case 'regex wildcard':
+ allValue = '.*';
+ break;
+ default:
+ allValue = '{';
+ _.each(variable.options, function(option) {
+ allValue += option.text + ',';
+ });
+ allValue = allValue.substring(0, allValue.length - 1) + '}';
+ }
+
+ variable.options.unshift({text: 'All', value: allValue});
+ };
+
});
});
diff --git a/src/css/less/tables_lists.less b/src/css/less/tables_lists.less
index 4f95c1a1082..57cc6dce56c 100644
--- a/src/css/less/tables_lists.less
+++ b/src/css/less/tables_lists.less
@@ -24,11 +24,32 @@
td:last-child {
border-right: 1px solid @grafanaListBorderBottom;
}
+}
- .max-width {
- overflow: hidden;
- text-overflow: ellipsis;
- -o-text-overflow: ellipsis;
- white-space: nowrap;
+.max-width {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -o-text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.grafana-options-list {
+ list-style: none;
+ margin: 0;
+ max-width: 450px;
+
+ li:nth-child(odd) {
+ background-color: lighten(@grayDarker, 2%);
+ }
+
+ li {
+ float: left;
+ margin: 2px;
+ padding: 5px 10px;
+ border: 1px solid @grafanaListBorderBottom;
+ border: 1px solid @grafanaListBorderBottom;
+ }
+ li:first-child {
+ border: 1px solid @grafanaListBorderBottom;
}
}
diff --git a/src/test/specs/dashboardSrv-specs.js b/src/test/specs/dashboardSrv-specs.js
index c141b746cd3..f916279db98 100644
--- a/src/test/specs/dashboardSrv-specs.js
+++ b/src/test/specs/dashboardSrv-specs.js
@@ -156,9 +156,8 @@ define([
expect(model.annotations.list[0].name).to.be('old');
});
-
it('dashboard schema version should be set to latest', function() {
- expect(model.version).to.be(5);
+ expect(model.version).to.be(6);
});
});