فهرست منبع

Merge pull request #714 from smiclea/fix-edit-windows

Fix Windows image not required in edit replica
Daniel Vincze 3 سال پیش
والد
کامیت
67ab252d1a
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx

+ 7 - 0
src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx

@@ -140,6 +140,10 @@ class TransferItemModal extends React.Component<Props, State> {
     this.loadData(true)
   }
 
+  get requiresWindowsImage() {
+    return this.props.instancesDetails.some(i => i.os_type === 'windows')
+  }
+
   getStorageMap(storageBackends: StorageBackend[]): StorageMap[] {
     const storageMap: StorageMap[] = []
     const currentStorage = this.props.replica.storage_mappings
@@ -356,6 +360,7 @@ class TransferItemModal extends React.Component<Props, State> {
     try {
       await providerStore.loadOptionsSchema({
         providerName: endpoint.type,
+        requiresWindowsImage: this.requiresWindowsImage,
         optionsType,
         useCache,
       })
@@ -373,6 +378,7 @@ class TransferItemModal extends React.Component<Props, State> {
       endpointId: endpoint.id,
       providerName: endpoint.type,
       useCache,
+      requiresWindowsImage: this.requiresWindowsImage,
     })
   }
 
@@ -410,6 +416,7 @@ class TransferItemModal extends React.Component<Props, State> {
       providerName: endpoint.type,
       useCache,
       envData,
+      requiresWindowsImage: this.requiresWindowsImage,
     })
     if (type === 'destination') {
       networkStore.loadNetworks(endpoint.id, envData, { cache: true })