Browse Source

additional slider

andre 4 years ago
parent
commit
013683bbec
1 changed files with 9 additions and 14 deletions
  1. 9 14
      app/UI/VmUpdate/Sections/Qemu/GeneralSection.php

+ 9 - 14
app/UI/VmUpdate/Sections/Qemu/GeneralSection.php

@@ -125,20 +125,15 @@ class GeneralSection extends BaseSection
         $this->addField($field);
         if($this->configuration()->isDetailsCombinedView()){
             //disk
-            $field = new Range('disk', $this->resourceManager->disk()->getUsed(), $this->resourceManager->disk()->free());
-            $field->addValidator(new DiskSizeValidator('disk',true));
-            $field->setDefaultValue($this->resourceManager->disk()->getUsed());
-            $field->setDescription('description');
-            $this->addField($field);
-
-            logModuleCall(
-                'proxmoxCloud',
-                __FUNCTION__,
-                $this->resourceManager->disk()->getUsed(),
-                'Debug',
-                $vm->getHardDiskRepostiory()->fetch()
-            );
-
+            foreach ($vm->getHardDiskRepostiory()->fetch() as $disk){
+                if($disk->getName() == 'disk-0'){
+                    $field = new Range('disk', $disk->getSize(), $this->resourceManager->disk()->free());
+                    $field->addValidator(new DiskSizeValidator('disk',true));
+                    $field->setDefaultValue($disk->getSize());
+                    $field->setDescription('description');
+                    $this->addField($field);
+                }
+            }
         }
         /**
          * @deprecated