|
@@ -4,6 +4,8 @@ import angular from 'angular';
|
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
|
import appEvents from 'app/core/app_events';
|
|
import appEvents from 'app/core/app_events';
|
|
|
|
|
|
|
|
|
|
+import {WizardFlow} from './wizard';
|
|
|
|
|
+
|
|
|
export class PluginEditCtrl {
|
|
export class PluginEditCtrl {
|
|
|
model: any;
|
|
model: any;
|
|
|
pluginIcon: string;
|
|
pluginIcon: string;
|
|
@@ -81,20 +83,58 @@ export class PluginEditCtrl {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
update() {
|
|
update() {
|
|
|
- this.preUpdateHook().then(() => {
|
|
|
|
|
- var updateCmd = _.extend({
|
|
|
|
|
- enabled: this.model.enabled,
|
|
|
|
|
- pinned: this.model.pinned,
|
|
|
|
|
- jsonData: this.model.jsonData,
|
|
|
|
|
- secureJsonData: this.model.secureJsonData,
|
|
|
|
|
- }, {});
|
|
|
|
|
-
|
|
|
|
|
- return this.backendSrv.post(`/api/plugins/${this.pluginId}/settings`, updateCmd);
|
|
|
|
|
- })
|
|
|
|
|
- .then(this.postUpdateHook)
|
|
|
|
|
- .then((res) => {
|
|
|
|
|
- window.location.href = window.location.href;
|
|
|
|
|
|
|
+ var wizard = new WizardFlow("Application Setup");
|
|
|
|
|
+
|
|
|
|
|
+ wizard.addStep("Validating form", () => {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ setTimeout(resolve, 2000);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ wizard.addStep("Saving application config", () => {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ setTimeout(resolve, 2000);
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ wizard.addStep("Validing key", () => {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ setTimeout(resolve, 2000);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ wizard.addStep("Adding Raintank metric data source", () => {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ setTimeout(resolve, 2000);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ wizard.addStep("Adding Raintank event data source", () => {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ setTimeout(resolve, 2000);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ wizard.addStep("Importing worldPing dashboards", () => {
|
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
|
+ setTimeout(resolve, 2000);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ wizard.start();
|
|
|
|
|
+ // this.preUpdateHook().then(() => {
|
|
|
|
|
+ // var updateCmd = _.extend({
|
|
|
|
|
+ // enabled: this.model.enabled,
|
|
|
|
|
+ // pinned: this.model.pinned,
|
|
|
|
|
+ // jsonData: this.model.jsonData,
|
|
|
|
|
+ // secureJsonData: this.model.secureJsonData,
|
|
|
|
|
+ // }, {});
|
|
|
|
|
+ // return this.backendSrv.post(`/api/plugins/${this.pluginId}/settings`, updateCmd);
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .then(this.postUpdateHook)
|
|
|
|
|
+ // .then((res) => {
|
|
|
|
|
+ // window.location.href = window.location.href;
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
importDashboards() {
|
|
importDashboards() {
|