mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux: dashboard settings work progress
This commit is contained in:
@@ -89,11 +89,10 @@
|
|||||||
<div ng-if="ctrl.dashboard.meta.canSave">
|
<div ng-if="ctrl.dashboard.meta.canSave">
|
||||||
<div class="p-b-2" ng-if="ctrl.alertCount > 1">
|
<div class="p-b-2" ng-if="ctrl.alertCount > 1">
|
||||||
<h5>This dashboard contains {{ctrl.alertCount}} alerts. Deleting this dashboard will also delete those alerts</h5>
|
<h5>This dashboard contains {{ctrl.alertCount}} alerts. Deleting this dashboard will also delete those alerts</h5>
|
||||||
<input type="text" class="gf-form-input width-16" style="display: inline-block;" placeholder="Type DELETE to confirm"
|
<input type="text" class="gf-form-input width-16" style="display: inline-block;" placeholder="Type DELETE to confirm" ng-model="ctrl.confirmText" ng-change="ctrl.confirmTextChanged()">
|
||||||
ng-model="ctrl.confirmText" ng-change="ctrl.confirmTextChanged()">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-danger" ng-click="ctrl.deleteDashboard()" ng-disabled="ctrl.confirmValid" >
|
<button class="btn btn-danger" ng-click="ctrl.deleteDashboard()" ng-disabled="!ctrl.confirmValid" >
|
||||||
<i class="fa fa-trash"></i>
|
<i class="fa fa-trash"></i>
|
||||||
Delete
|
Delete
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ export class SettingsCtrl {
|
|||||||
return panel.alert ? 1 : 0;
|
return panel.alert ? 1 : 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.confirmValid = this.alertCount === 0;
|
||||||
|
|
||||||
this.onRouteUpdated();
|
this.onRouteUpdated();
|
||||||
$rootScope.onAppEvent("$routeUpdate", this.onRouteUpdated.bind(this), $scope);
|
$rootScope.onAppEvent("$routeUpdate", this.onRouteUpdated.bind(this), $scope);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user