|
|
@@ -40,23 +40,6 @@ class GeneralSection extends HalfPageSection
|
|
|
$this->initIds('generalSection');
|
|
|
$this->resourceManager = new ResourceManager();
|
|
|
$this->initFields();
|
|
|
- $rangeField = $this->getField('disk');
|
|
|
- $rangeField->setMinValue($this->configuration()->serverDiskSize->min);
|
|
|
- $rangeField->setDefaultValue($this->configuration()->serverDiskSize->min);
|
|
|
- if ($this->configuration()->serverDiskSize->max > ($this->resourceManager->disk()->free())) {
|
|
|
- $rangeField->setMaxValue(125);
|
|
|
- } else {
|
|
|
- $rangeField->setMaxValue(215);
|
|
|
- }
|
|
|
-
|
|
|
- logModuleCall(
|
|
|
- 'proxmoxCloud',
|
|
|
- __FUNCTION__,
|
|
|
- $this->resourceManager->disk(),
|
|
|
- 'Debug',
|
|
|
- $this->resourceManager->disk()->free()
|
|
|
- );
|
|
|
-
|
|
|
}
|
|
|
|
|
|
public function initFields() {
|
|
|
@@ -147,7 +130,12 @@ class GeneralSection extends HalfPageSection
|
|
|
$field->setDescription('description');
|
|
|
$this->addField($field);
|
|
|
//disk
|
|
|
- $field = new Range('disk', 0,0);
|
|
|
+ if ($this->configuration()->serverDiskSize->max > ($this->resourceManager->disk()->free())) {
|
|
|
+ $maxRange = $this->resourceManager->disk()->free();
|
|
|
+ } else {
|
|
|
+ $maxRange = $this->configuration()->serverDiskSize->max;
|
|
|
+ }
|
|
|
+ $field = new Range('disk', $this->configuration()->serverDiskSize->min, $maxRange);
|
|
|
$field->addValidator(new DiskSizeValidator('disk',true));
|
|
|
$field->setDescription('description');
|
|
|
$this->addField($field);
|