triggers: suggest proxies in editor
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
<label class="gf-form-label query-keyword width-7">Proxy</label>
|
<label class="gf-form-label query-keyword width-7">Proxy</label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
ng-model="ctrl.panel.targets[ds].proxy.filter"
|
ng-model="ctrl.panel.targets[ds].proxy.filter"
|
||||||
bs-typeahead="editor.getHostNames[ds]"
|
bs-typeahead="editor.getProxyNames[ds]"
|
||||||
ng-blur="editor.parseTarget()"
|
ng-blur="editor.parseTarget()"
|
||||||
data-min-length=0
|
data-min-length=0
|
||||||
data-items=100
|
data-items=100
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class TriggersTabCtrl {
|
|||||||
getGroupNames: {},
|
getGroupNames: {},
|
||||||
getHostNames: {},
|
getHostNames: {},
|
||||||
getApplicationNames: {},
|
getApplicationNames: {},
|
||||||
|
getProxyNames: {},
|
||||||
oldTarget: _.cloneDeep(this.panel.targets)
|
oldTarget: _.cloneDeep(this.panel.targets)
|
||||||
};
|
};
|
||||||
_.defaultsDeep(this, scopeDefaults);
|
_.defaultsDeep(this, scopeDefaults);
|
||||||
@@ -40,6 +41,7 @@ class TriggersTabCtrl {
|
|||||||
this.getGroupNames[ds] = _.bind(this.suggestGroups, this, datasource);
|
this.getGroupNames[ds] = _.bind(this.suggestGroups, this, datasource);
|
||||||
this.getHostNames[ds] = _.bind(this.suggestHosts, this, datasource);
|
this.getHostNames[ds] = _.bind(this.suggestHosts, this, datasource);
|
||||||
this.getApplicationNames[ds] = _.bind(this.suggestApps, this, datasource);
|
this.getApplicationNames[ds] = _.bind(this.suggestApps, this, datasource);
|
||||||
|
this.getProxyNames[ds] = _.bind(this.suggestProxies, this, datasource);
|
||||||
}
|
}
|
||||||
|
|
||||||
suggestGroups(datasource, query, callback) {
|
suggestGroups(datasource, query, callback) {
|
||||||
@@ -69,6 +71,12 @@ class TriggersTabCtrl {
|
|||||||
.then(callback);
|
.then(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suggestProxies(datasource, query, callback) {
|
||||||
|
return datasource.zabbix.getProxies()
|
||||||
|
.then(proxies => _.map(proxies, 'host'))
|
||||||
|
.then(callback);
|
||||||
|
}
|
||||||
|
|
||||||
datasourcesChanged() {
|
datasourcesChanged() {
|
||||||
_.each(this.panel.datasources, (ds) => {
|
_.each(this.panel.datasources, (ds) => {
|
||||||
if (!this.panel.targets[ds]) {
|
if (!this.panel.targets[ds]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user