Triggers panel: remove 'default' from datasources list (cause error), iss #340
This commit is contained in:
@@ -61,13 +61,8 @@ class TriggerPanelEditorCtrl {
|
||||
};
|
||||
_.defaults(this, scopeDefaults);
|
||||
|
||||
// Get zabbix data sources
|
||||
var datasources = _.filter(this.datasourceSrv.getMetricSources(), datasource => {
|
||||
return datasource.meta.id === 'alexanderzobnin-zabbix-datasource';
|
||||
});
|
||||
this.datasources = _.map(datasources, 'name');
|
||||
|
||||
// Set default datasource
|
||||
this.datasources = _.map(this.getZabbixDataSources(), 'name');
|
||||
if (!this.panel.datasource) {
|
||||
this.panel.datasource = this.datasources[0];
|
||||
}
|
||||
@@ -170,6 +165,13 @@ class TriggerPanelEditorCtrl {
|
||||
isVariable(str) {
|
||||
return utils.isTemplateVariable(str, this.templateSrv.variables);
|
||||
}
|
||||
|
||||
getZabbixDataSources() {
|
||||
let ZABBIX_DS_ID = 'alexanderzobnin-zabbix-datasource';
|
||||
return _.filter(this.datasourceSrv.getMetricSources(), datasource => {
|
||||
return datasource.meta.id === ZABBIX_DS_ID && datasource.value;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Get list of metric names for bs-typeahead directive
|
||||
|
||||
Reference in New Issue
Block a user