|
|
@@ -40,6 +40,14 @@ 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($this->resourceManager->disk()->free());
|
|
|
+ } else {
|
|
|
+ $rangeField->setMaxValue($this->configuration()->serverDiskSize->max);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function initFields() {
|
|
|
@@ -130,9 +138,8 @@ class GeneralSection extends HalfPageSection
|
|
|
$field->setDescription('description');
|
|
|
$this->addField($field);
|
|
|
//disk
|
|
|
- $field = new Range('disk', $this->configuration()->serverDiskSize->min, $this->resourceManager->disk()->free());
|
|
|
+ $field = new Range('disk', 0,0);
|
|
|
$field->addValidator(new DiskSizeValidator('disk',true));
|
|
|
- $field->setDefaultValue($this->configuration()->serverDiskSize->min);
|
|
|
$field->setDescription('description');
|
|
|
$this->addField($field);
|
|
|
//username
|