@@ -129,9 +129,6 @@ export default class OneClickAppConfigPage extends Component<
DomUtils.scrollToTopBar();
}}
/>
-
-
- {JSON.stringify(this.state.apiData, null, 2)}>
diff --git a/app-frontend/src/containers/apps/oneclick/OneClickAppDeployManager.ts b/app-frontend/src/containers/apps/oneclick/OneClickAppDeployManager.ts
index 80a0c40..c5ece1a 100644
--- a/app-frontend/src/containers/apps/oneclick/OneClickAppDeployManager.ts
+++ b/app-frontend/src/containers/apps/oneclick/OneClickAppDeployManager.ts
@@ -1,17 +1,11 @@
-import ApiManager from "../../../api/ApiManager";
import { IHashMapGeneric } from "../../../models/IHashMapGeneric";
import {
IOneClickTemplate,
IDockerComposeService
} from "./OneClickAppConfigPage";
import Utils from "../../../utils/Utils";
-import { IAppDef } from "../AppDefinition";
import OneClickAppDeploymentHelper from "./OneClickAppDeploymentHelper";
-const REGISTERING = "REGISTERING";
-const CONFIGURING = "CONFIGURING";
-const DEPLOYING = "DEPLOYING";
-
interface IDeploymentStep {
stepName: string;
stepPromise: () => Promise
;
@@ -20,6 +14,7 @@ interface IDeploymentStep {
export interface IDeploymentState {
steps: string[];
error: string;
+ successMessage?: string;
currentStep: number;
}
@@ -88,38 +83,37 @@ export default class OneClickAppDeployManager {
);
}
- let currentStep = 0;
const stepsTexts: string[] = ["Parsing the template"];
for (let index = 0; index < steps.length; index++) {
stepsTexts.push(steps[index].stepName);
}
- let promise = new Promise(function(resolve) {
- self.onDeploymentStateChanged(
- Utils.copyObject({
- steps: stepsTexts,
- error: "",
- currentStep: 0
- })
- );
- resolve();
- });
+ let currentStep = 0;
+ const onNextStepPromiseCreator = function() {
+ return new Promise(function(resolve) {
+ currentStep++;
+ self.onDeploymentStateChanged(
+ Utils.copyObject({
+ steps: stepsTexts,
+ error: "",
+ currentStep,
+ successMessage:
+ currentStep >= stepsTexts.length
+ ? self.template!.instructions.end
+ : undefined
+ })
+ );
+ resolve();
+ });
+ };
+
+ let promise = onNextStepPromiseCreator();
for (let index = 0; index < steps.length; index++) {
const element = steps[index];
- promise = promise.then(element.stepPromise).then(function() {
- return new Promise(function(resolve) {
- currentStep++;
- self.onDeploymentStateChanged(
- Utils.copyObject({
- steps: stepsTexts,
- error: "",
- currentStep
- })
- );
- resolve();
- });
- });
+ promise = promise
+ .then(element.stepPromise)
+ .then(onNextStepPromiseCreator);
}
promise.catch(function(error) {
diff --git a/app-frontend/src/containers/apps/oneclick/OneClickAppDeployProgress.tsx b/app-frontend/src/containers/apps/oneclick/OneClickAppDeployProgress.tsx
index fb37797..8d40fca 100644
--- a/app-frontend/src/containers/apps/oneclick/OneClickAppDeployProgress.tsx
+++ b/app-frontend/src/containers/apps/oneclick/OneClickAppDeployProgress.tsx
@@ -1,6 +1,6 @@
import React, { Component } from "react";
import { IDeploymentState } from "./OneClickAppDeployManager";
-import { Row, Col, Card, Steps, Icon } from "antd";
+import { Row, Col, Card, Steps, Icon, Button, Alert } from "antd";
const Step = Steps.Step;
@@ -8,12 +8,44 @@ export default class OneClickAppDeployProgress extends Component<{
appName: string;
deploymentState: IDeploymentState;
onRestartClicked: () => void;
+ onFinishClicked: () => void;
}> {
+ createSteps() {
+ const steps = this.props.deploymentState.steps;
+ const stepsInfo = [];
+
+ for (let index = 0; index < steps.length; index++) {
+ stepsInfo.push({
+ text: (
+
+
+ {index === this.props.deploymentState.currentStep &&
+ !this.props.deploymentState.error ? (
+
+ ) : (
+
+ )}
+
+ {steps[index]}
+
+ ),
+ icon: undefined
+ });
+ }
+
+ return stepsInfo.map(s => {
+ return ;
+ });
+ }
+
render() {
+ const self = this;
+
return (
-
{JSON.stringify(this.props.deploymentState, null, 2)}
-
@@ -25,33 +57,69 @@ export default class OneClickAppDeployProgress extends Component<{
Progress:
-
-
- }
- title="Configuring App Name"
- description="This is a description."
- />
-
-
-
-
+
+ {self.createSteps()}
+
+
+
+
+ {self.props.deploymentState.successMessage}
+
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+