mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
This commit is contained in:
parent
634a26d2eb
commit
be34417b3a
@ -70,6 +70,10 @@ export class AnnotationsEditorCtrl {
|
||||
this.mode = 'list';
|
||||
}
|
||||
|
||||
move(index, dir) {
|
||||
_.move(this.annotations, index, index + dir);
|
||||
}
|
||||
|
||||
add() {
|
||||
this.annotations.push(this.currentAnnotation);
|
||||
this.reset();
|
||||
|
@ -33,8 +33,8 @@
|
||||
<td class="pointer" ng-click="ctrl.edit(annotation)">
|
||||
{{annotation.datasource || 'Default'}}
|
||||
</td>
|
||||
<td style="width: 1%"><i ng-click="_.move(ctrl.annotations,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
||||
<td style="width: 1%"><i ng-click="_.move(ctrl.annotations,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
||||
<td style="width: 1%"><i ng-click="ctrl.move($index,-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
||||
<td style="width: 1%"><i ng-click="ctrl.move($index,1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
||||
<td style="width: 1%">
|
||||
<a ng-click="ctrl.removeAnnotation(annotation)" class="btn btn-danger btn-mini" ng-hide="annotation.builtIn">
|
||||
<i class="fa fa-remove"></i>
|
||||
|
@ -48,7 +48,7 @@ export class SaveProvisionedDashboardModalCtrl {
|
||||
constructor(dashboardSrv) {
|
||||
this.dash = dashboardSrv.getCurrent().getSaveModelClone();
|
||||
delete this.dash.id;
|
||||
this.dashboardJson = JSON.stringify(this.dash, null, 2);
|
||||
this.dashboardJson = angular.toJson(this.dash, true);
|
||||
}
|
||||
|
||||
save() {
|
||||
|
@ -2,6 +2,7 @@ import { coreModule, appEvents, contextSrv } from 'app/core/core';
|
||||
import { DashboardModel } from '../dashboard_model';
|
||||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
import config from 'app/core/config';
|
||||
|
||||
export class SettingsCtrl {
|
||||
@ -118,7 +119,7 @@ export class SettingsCtrl {
|
||||
this.viewId = this.$location.search().editview;
|
||||
|
||||
if (this.viewId) {
|
||||
this.json = JSON.stringify(this.dashboard.getSaveModelClone(), null, 2);
|
||||
this.json = angular.toJson(this.dashboard.getSaveModelClone(), true);
|
||||
}
|
||||
|
||||
if (this.viewId === 'settings' && this.dashboard.meta.canMakeEditable) {
|
||||
|
Loading…
Reference in New Issue
Block a user