Update datasource config editor

This commit is contained in:
Alexander Zobnin
2020-06-01 18:05:50 +03:00
parent 875e611400
commit 48767fe479
15 changed files with 730 additions and 487 deletions

View File

@@ -16,6 +16,8 @@ import (
var NotCachedMethods = map[string]bool{
"history.get": true,
"trend.get": true,
"problem.get": true,
"trigger.get": true,
}
// ZabbixQuery handles query requests to Zabbix
@@ -36,7 +38,11 @@ func (ds *ZabbixDatasourceInstance) ZabbixQuery(ctx context.Context, apiReq *Zab
return nil, err
}
} else {
resultJson = cachedResult.(*simplejson.Json)
var ok bool
resultJson, ok = cachedResult.(*simplejson.Json)
if !ok {
resultJson = simplejson.New()
}
}
return resultJson, nil