Преглед изворни кода

Make DeploymentDetails header icon replica-scenario-appropriate.

Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
Nashwan Azhari пре 2 година
родитељ
комит
4a86ee49bd

+ 13 - 3
src/components/smart/DeploymentDetailsPage/DeploymentDetailsPage.tsx

@@ -37,7 +37,8 @@ import providerStore from "@src/stores/ProviderStore";
 import userStore from "@src/stores/UserStore";
 import configLoader from "@src/utils/Config";
 
-import deploymentImage from "./images/deployment.svg";
+import replicaDeploymentImage from "./images/replica-deployment.svg";
+import liveMigrationDeploymentImage from "./images/live-migration-deployment.svg"
 
 import type { Field } from "@src/@types/Field";
 import type { InstanceScript } from "@src/@types/Instance";
@@ -101,7 +102,7 @@ class DeploymentDetailsPage extends React.Component<Props, State> {
     return deploymentStore.deploymentDetails?.last_execution_status;
   }
 
-  getDeploymentReplicaScenarioItemType() {
+  getDeploymentReplicaScenarioItemType(): string {
     let item_type = "replica";
     let scenario = this.deployment?.replica_scenario_type;
     if (scenario && scenario === "live_migration") {
@@ -119,6 +120,15 @@ class DeploymentDetailsPage extends React.Component<Props, State> {
     return should_red;
   }
 
+  getDeploymentScenarioTypeImage(): string {
+    let image = replicaDeploymentImage;
+    let scenario = this.deployment?.replica_scenario_type;
+    if (scenario && scenario === "live_migration") {
+      image = liveMigrationDeploymentImage;
+    }
+    return image;
+  }
+
   async loadDeploymentAndPollData() {
     const loadDeployment = async () => {
       await endpointStore.getEndpoints({ showLoading: true });
@@ -500,7 +510,7 @@ class DeploymentDetailsPage extends React.Component<Props, State> {
               itemType={this.getDeploymentReplicaScenarioItemType()}
               itemDescription={deploymentStore.deploymentDetails?.description}
               backLink="/deployments"
-              typeImage={deploymentImage}
+              typeImage={this.getDeploymentScenarioTypeImage()}
               dropdownActions={dropdownActions}
               alertInfoPill={this.getReplicaTypePillShouldRed()}
               primaryInfoPill={!this.getReplicaTypePillShouldRed()}

Разлика између датотеке није приказан због своје велике величине
+ 2 - 2
src/components/smart/DeploymentDetailsPage/images/live-migration-deployment.svg


Разлика између датотеке није приказан због своје велике величине
+ 10 - 0
src/components/smart/DeploymentDetailsPage/images/replica-deployment.svg


Неке датотеке нису приказане због велике количине промена