dbmsv2 init...1
This commit is contained in:
parent
6889d58063
commit
08f19e95ae
@ -16,8 +16,20 @@ class ServerPartHelper extends EquipmentHelper
|
||||
{
|
||||
$html = "";
|
||||
switch ($field) {
|
||||
case 'SWITCH':
|
||||
case 'IP':
|
||||
case 'CS':
|
||||
case 'CPU':
|
||||
case 'RAM':
|
||||
case 'DISK':
|
||||
case 'DB':
|
||||
case 'OS':
|
||||
case 'SOFTWARE':
|
||||
case 'part_uid':
|
||||
foreach ($viewDatas['control']['field_optons'][$field] as $option_key => $option_value) {
|
||||
// dd($viewDatas['control']);
|
||||
$type = array_key_exists('type', $viewDatas['control']['form_datas']) ? $viewDatas['control']['form_datas']['type'] : 'CPU';
|
||||
// dd($viewDatas['control']['field_optons'][$field]);
|
||||
foreach ($viewDatas['control']['field_optons'][$field][$type] as $option_key => $option_value) {
|
||||
$isSelected = $option_key == $value ? ' selected' : '';
|
||||
$isDisabled = "";
|
||||
$attribute = "";
|
||||
@ -54,9 +66,9 @@ class ServerPartHelper extends EquipmentHelper
|
||||
case 'OS':
|
||||
case 'SOFTWARE':
|
||||
case 'part_uid':
|
||||
if ($value === null && array_key_exists('entity', $viewDatas)) {
|
||||
$value = $viewDatas['entity']->getServerEntity()->getPK();
|
||||
}
|
||||
// if ($value === null && array_key_exists('entity', $viewDatas)) {
|
||||
// $value = $viewDatas['entity']->getServerEntity()->getPK();
|
||||
// }
|
||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
||||
$extras['onChange'] = "document.querySelector('input[name=\'amount\']').value = this.options[this.selectedIndex].getAttribute('data-price')";
|
||||
$attributes = ['data-type' => 'getType', 'data-price' => 'getPrice'];
|
||||
@ -66,7 +78,6 @@ class ServerPartHelper extends EquipmentHelper
|
||||
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||
break;
|
||||
}
|
||||
echo "Field:{$field}";
|
||||
return $form;
|
||||
}
|
||||
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
||||
|
||||
@ -57,8 +57,8 @@ class ServerPartService extends EquipmentService
|
||||
{
|
||||
return [
|
||||
"serverinfo_uid",
|
||||
"part_uid",
|
||||
"type",
|
||||
"part_uid",
|
||||
"billing",
|
||||
];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user