Merge branch 'master' into alerting_definitions
This commit is contained in:
@@ -61,7 +61,6 @@ func UpdatePluginSetting(cmd *m.UpdatePluginSettingCmd) error {
|
|||||||
for key, data := range cmd.SecureJsonData {
|
for key, data := range cmd.SecureJsonData {
|
||||||
pluginSetting.SecureJsonData[key] = util.Encrypt([]byte(data), setting.SecretKey)
|
pluginSetting.SecureJsonData[key] = util.Encrypt([]byte(data), setting.SecretKey)
|
||||||
}
|
}
|
||||||
pluginSetting.SecureJsonData = cmd.GetEncryptedJsonData()
|
|
||||||
pluginSetting.Updated = time.Now()
|
pluginSetting.Updated = time.Now()
|
||||||
pluginSetting.Enabled = cmd.Enabled
|
pluginSetting.Enabled = cmd.Enabled
|
||||||
pluginSetting.JsonData = cmd.JsonData
|
pluginSetting.JsonData = cmd.JsonData
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ export default class TableModel {
|
|||||||
if (options.desc) {
|
if (options.desc) {
|
||||||
this.rows.reverse();
|
this.rows.reverse();
|
||||||
this.columns[options.col].desc = true;
|
this.columns[options.col].desc = true;
|
||||||
|
} else {
|
||||||
|
this.columns[options.col].desc = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ function (angular, _, queryDef) {
|
|||||||
$scope.agg.query = '*';
|
$scope.agg.query = '*';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'geohash_grid': {
|
||||||
|
$scope.agg.settings.precision = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.validateModel();
|
$scope.validateModel();
|
||||||
@@ -121,6 +125,13 @@ function (angular, _, queryDef) {
|
|||||||
if (settings.trimEdges && settings.trimEdges > 0) {
|
if (settings.trimEdges && settings.trimEdges > 0) {
|
||||||
settingsLinkText += ', Trim edges: ' + settings.trimEdges;
|
settingsLinkText += ', Trim edges: ' + settings.trimEdges;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'geohash_grid': {
|
||||||
|
// limit precision to 7
|
||||||
|
settings.precision = Math.max(Math.min(settings.precision, 7), 1);
|
||||||
|
settingsLinkText = 'Precision: ' + settings.precision;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="agg.type === 'geohash_grid'">
|
||||||
|
<div class="gf-form offset-width-7">
|
||||||
|
<label class="gf-form-label">Precision</label>
|
||||||
|
<input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.precision" spellcheck='false' placeholder="3" ng-blur="onChangeInternal()">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,10 @@ function (queryDef) {
|
|||||||
this.buildTermsAgg(aggDef, esAgg, target);
|
this.buildTermsAgg(aggDef, esAgg, target);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'geohash_grid': {
|
||||||
|
esAgg['geohash_grid'] = {field: aggDef.field, precision: aggDef.settings.precision};
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nestedAggs.aggs = nestedAggs.aggs || {};
|
nestedAggs.aggs = nestedAggs.aggs || {};
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ function (_) {
|
|||||||
bucketAggTypes: [
|
bucketAggTypes: [
|
||||||
{text: "Terms", value: 'terms', requiresField: true},
|
{text: "Terms", value: 'terms', requiresField: true},
|
||||||
{text: "Filters", value: 'filters' },
|
{text: "Filters", value: 'filters' },
|
||||||
|
{text: "Geo Hash Grid", value: 'geohash_grid', requiresField: true},
|
||||||
{text: "Date Histogram", value: 'date_histogram', requiresField: true},
|
{text: "Date Histogram", value: 'date_histogram', requiresField: true},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,11 @@ class TablePanelCtrl extends MetricsPanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleColumnSort(col, colIndex) {
|
toggleColumnSort(col, colIndex) {
|
||||||
|
// remove sort flag from current column
|
||||||
|
if (this.table.columns[this.panel.sort.col]) {
|
||||||
|
this.table.columns[this.panel.sort.col].sort = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.panel.sort.col === colIndex) {
|
if (this.panel.sort.col === colIndex) {
|
||||||
if (this.panel.sort.desc) {
|
if (this.panel.sort.desc) {
|
||||||
this.panel.sort.desc = false;
|
this.panel.sort.desc = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user