|
@@ -50,8 +50,17 @@ const template = `
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="gf-form-button-row text-center">
|
|
<div class="gf-form-button-row text-center">
|
|
|
- <button type="submit" class="btn btn-success" ng-disabled="ctrl.saveForm.$invalid">Save</button>
|
|
|
|
|
- <a class="btn btn-link" ng-click="ctrl.dismiss();">Cancel</a>
|
|
|
|
|
|
|
+ <button
|
|
|
|
|
+ id="saveBtn"
|
|
|
|
|
+ type="submit"
|
|
|
|
|
+ class="btn btn-success"
|
|
|
|
|
+ ng-class="{'btn-success--processing': ctrl.isSaving}"
|
|
|
|
|
+ ng-disabled="ctrl.saveForm.$invalid || ctrl.isSaving"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span ng-if="!ctrl.isSaving">Save</span>
|
|
|
|
|
+ <span ng-if="ctrl.isSaving === true">Saving...</span>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button class="btn btn-inverse" ng-click="ctrl.dismiss();">Cancel</button>
|
|
|
</div>
|
|
</div>
|
|
|
</form>
|
|
</form>
|
|
|
</div>
|
|
</div>
|
|
@@ -68,6 +77,7 @@ export class SaveDashboardModalCtrl {
|
|
|
originalCurrent = [];
|
|
originalCurrent = [];
|
|
|
max: number;
|
|
max: number;
|
|
|
saveForm: any;
|
|
saveForm: any;
|
|
|
|
|
+ isSaving: boolean;
|
|
|
dismiss: () => void;
|
|
dismiss: () => void;
|
|
|
timeChange = false;
|
|
timeChange = false;
|
|
|
variableValueChange = false;
|
|
variableValueChange = false;
|
|
@@ -76,6 +86,7 @@ export class SaveDashboardModalCtrl {
|
|
|
constructor(private dashboardSrv) {
|
|
constructor(private dashboardSrv) {
|
|
|
this.message = '';
|
|
this.message = '';
|
|
|
this.max = 64;
|
|
this.max = 64;
|
|
|
|
|
+ this.isSaving = false;
|
|
|
this.templating = dashboardSrv.dash.templating.list;
|
|
this.templating = dashboardSrv.dash.templating.list;
|
|
|
|
|
|
|
|
this.compareTemplating();
|
|
this.compareTemplating();
|
|
@@ -126,6 +137,8 @@ export class SaveDashboardModalCtrl {
|
|
|
var dashboard = this.dashboardSrv.getCurrent();
|
|
var dashboard = this.dashboardSrv.getCurrent();
|
|
|
var saveModel = dashboard.getSaveModelClone(options);
|
|
var saveModel = dashboard.getSaveModelClone(options);
|
|
|
|
|
|
|
|
|
|
+ this.isSaving = true;
|
|
|
|
|
+
|
|
|
return this.dashboardSrv.save(saveModel, options).then(this.dismiss);
|
|
return this.dashboardSrv.save(saveModel, options).then(this.dismiss);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|