dbmsv2 init...1
This commit is contained in:
parent
bc60c1c08a
commit
289b814fcd
@ -50,6 +50,10 @@ class ServiceHelper extends CustomerHelper
|
||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
||||
$form = $this->form_dropdown_custom($field, array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getServerEntity()->getPK() : $value, $viewDatas, $extras);
|
||||
break;
|
||||
case 'switchinfo_uid':
|
||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
||||
$form = $this->form_dropdown_custom($field, array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getSwitchEntity()->getPK() : $value, $viewDatas, $extras);
|
||||
break;
|
||||
default:
|
||||
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||
break;
|
||||
|
||||
@ -19,9 +19,9 @@ class ServerHelper extends EquipmentHelper
|
||||
$serverpartEntity = $viewDatas['entity']->getServerPartEntity($partType);
|
||||
}
|
||||
$form = "";
|
||||
//수정시 Type별 사용할 hidden serverinfopartinfo_uid
|
||||
//수정시 Type별 사용할 hidden partinfo_uid
|
||||
if ($serverpartEntity !== null) {
|
||||
$form .= form_hidden("serverinfopartinfo_uid_{$partType}", $serverpartEntity->getPK());
|
||||
$form .= form_hidden("partinfo_uid_{$partType}", $serverpartEntity->getPK());
|
||||
}
|
||||
//기존 입력화면에서 return 된것인지?
|
||||
if ($value === null && $serverpartEntity !== null) {
|
||||
@ -45,40 +45,40 @@ class ServerHelper extends EquipmentHelper
|
||||
case 'partinfo_uid_CPU':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'CPU');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_CPU_cnt':
|
||||
case 'partinfo_uid_CPU_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'partinfo_uid_RAM':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'RAM',);
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_RAM_cnt':
|
||||
case 'partinfo_uid_RAM_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'partinfo_uid_DISK':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'DISK');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_DISK_cnt':
|
||||
case 'partinfo_uid_DISK_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_DISK_extra':
|
||||
case 'partinfo_uid_DISK_extra':
|
||||
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
|
||||
break;
|
||||
case 'partinfo_uid_OS':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'OS');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_OS_cnt':
|
||||
case 'partinfo_uid_OS_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'partinfo_uid_DB':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'DB');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_DB_cnt':
|
||||
case 'partinfo_uid_DB_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'partinfo_uid_SOFTWARE':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'SOFTWARE');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_SOFTWARE_cnt':
|
||||
case 'partinfo_uid_SOFTWARE_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'ipinfo_uid':
|
||||
|
||||
@ -19,9 +19,9 @@ class ServerPartHelper extends EquipmentHelper
|
||||
$serverpartEntity = $viewDatas['entity']->getServerPartEntity($partType);
|
||||
}
|
||||
$form = "";
|
||||
//수정시 Type별 사용할 hidden serverinfopartinfo_uid
|
||||
//수정시 Type별 사용할 hidden partinfo_uid
|
||||
if ($serverpartEntity !== null) {
|
||||
$form .= form_hidden("serverinfopartinfo_uid_{$partType}", $serverpartEntity->getPK());
|
||||
$form .= form_hidden("partinfo_uid_{$partType}", $serverpartEntity->getPK());
|
||||
}
|
||||
//기존 입력화면에서 return 된것인지?
|
||||
if ($value === null && $serverpartEntity !== null) {
|
||||
@ -45,40 +45,40 @@ class ServerPartHelper extends EquipmentHelper
|
||||
case 'partinfo_uid_CPU':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'CPU');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_CPU_cnt':
|
||||
case 'partinfo_uid_CPU_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'partinfo_uid_RAM':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'RAM',);
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_RAM_cnt':
|
||||
case 'partinfo_uid_RAM_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'partinfo_uid_DISK':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'DISK');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_DISK_cnt':
|
||||
case 'partinfo_uid_DISK_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_DISK_extra':
|
||||
case 'partinfo_uid_DISK_extra':
|
||||
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
|
||||
break;
|
||||
case 'partinfo_uid_OS':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'OS');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_OS_cnt':
|
||||
case 'partinfo_uid_OS_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'partinfo_uid_DB':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'DB');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_DB_cnt':
|
||||
case 'partinfo_uid_DB_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'partinfo_uid_SOFTWARE':
|
||||
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'SOFTWARE');
|
||||
break;
|
||||
case 'serverinfopartinfo_uid_SOFTWARE_cnt':
|
||||
case 'partinfo_uid_SOFTWARE_cnt':
|
||||
$form = form_dropdown($field, $viewDatas['serverinfopartinfo_cnt_options'], $value, $extras) . "개";
|
||||
break;
|
||||
case 'ipinfo_uid':
|
||||
|
||||
@ -19,18 +19,18 @@ return [
|
||||
"ipinfo_uid" => "IP정보",
|
||||
"csinfo_uid" => "CS정보",
|
||||
'partinfo_uid_CPU' => "CPU",
|
||||
'serverinfopartinfo_uid_CPU_cnt' => "CPU갯수",
|
||||
'partinfo_uid_CPU_cnt' => "CPU갯수",
|
||||
'partinfo_uid_RAM' => "RAM",
|
||||
'serverinfopartinfo_uid_RAM_cnt' => "RAM갯수",
|
||||
'partinfo_uid_RAM_cnt' => "RAM갯수",
|
||||
'partinfo_uid_DISK' => "DISK",
|
||||
'serverinfopartinfo_uid_DISK_cnt' => "DISK갯수",
|
||||
'serverinfopartinfo_uid_DISK_extra' => "RAID설정",
|
||||
'partinfo_uid_DISK_cnt' => "DISK갯수",
|
||||
'partinfo_uid_DISK_extra' => "RAID설정",
|
||||
'partinfo_uid_OS' => "OS",
|
||||
'serverinfopartinfo_uid_OS_cnt' => "OS갯수",
|
||||
'partinfo_uid_OS_cnt' => "OS갯수",
|
||||
'partinfo_uid_DB' => "DB",
|
||||
'serverinfopartinfo_uid_DB_cnt' => "DB갯수",
|
||||
'partinfo_uid_DB_cnt' => "DB갯수",
|
||||
'partinfo_uid_SOFTWARE' => "기타SW",
|
||||
'serverinfopartinfo_uid_SOFTWARE_cnt' => "SOFTWARE갯수",
|
||||
'partinfo_uid_SOFTWARE_cnt' => "SOFTWARE갯수",
|
||||
],
|
||||
"TITLE" => [
|
||||
'HP DL360 Gen6' => "HP DL360 Gen6",
|
||||
@ -50,7 +50,7 @@ return [
|
||||
'occupied' => "서비스중",
|
||||
'forbidden' => "사용불가",
|
||||
],
|
||||
"SERVERINFOPARTINFO_UID_DISK_EXTRA" => [
|
||||
"PARTINFO_UID_DISK_EXTRA" => [
|
||||
'RAID0' => "RAID0",
|
||||
'RAID1' => "RAID1",
|
||||
'RAID5' => "RAID5",
|
||||
|
||||
@ -98,9 +98,13 @@ class ServiceService extends CustomerService
|
||||
{
|
||||
//서버정보 정의
|
||||
$serverEntityy = $this->getServerService()->getEntity(['serviceinfo_uid' => $entity->getPK()]);
|
||||
if ($serverEntityy) {
|
||||
if ($serverEntityy !== null) {
|
||||
$entity->setServerEntity($serverEntityy);
|
||||
}
|
||||
$switchEntityy = $this->getSwitchService()->getEntity(['serviceinfo_uid' => $entity->getPK()]);
|
||||
if ($switchEntityy !== null) {
|
||||
$entity->setSwitchEntity($switchEntityy);
|
||||
}
|
||||
// //IP정보 정의
|
||||
// foreach ($this->getIPService()->getEntities(['serverinfo_uid' => $entity->getPK()]) as $ipEntity) {
|
||||
// $entity->addIPEntity($ipEntity);
|
||||
@ -160,46 +164,38 @@ class ServiceService extends CustomerService
|
||||
}
|
||||
|
||||
//다른장치 설정용
|
||||
private function disableSetServiceToEquipments(ServiceEntity $entity): ServiceEntity
|
||||
private function disableService(ServiceEntity $entity): ServiceEntity
|
||||
{
|
||||
//기존 Server정보와 다른경우 사용가능상태로 변경
|
||||
$serverEntity = $entity->getServerEntity();
|
||||
if ($serverEntity !== null) {
|
||||
$serverEntity = $this->getServerService()->setService(
|
||||
$entity,
|
||||
$serverEntity->getPK(),
|
||||
ServerEntity::STATUS_AVAILABLE
|
||||
);
|
||||
$serverEntity = $this->getServerService()->disableService($serverEntity);
|
||||
$entity->setServerEntity(null);
|
||||
}
|
||||
//기존 Switch정보와 다른경우 사용가능상태로 변경
|
||||
$switchEntity = $entity->getSwitchEntity();
|
||||
if ($switchEntity !== null) {
|
||||
$switchEntity = $this->getSwitchService()->setService(
|
||||
$entity,
|
||||
$switchEntity->getPK(),
|
||||
SwitchEntity::STATUS_AVAILABLE
|
||||
);
|
||||
$switchEntity = $this->getSwitchService()->disableService($switchEntity);
|
||||
$entity->setSwitchEntity(null);
|
||||
}
|
||||
return $entity;
|
||||
}
|
||||
private function enableServiceToEquipments(ServiceEntity $entity, array $formDatas): ServiceEntity
|
||||
private function enableService(ServiceEntity $entity, array $formDatas): ServiceEntity
|
||||
{
|
||||
//서버경우 서비스중으로 설정
|
||||
$serverEntity = $this->getServerService()->setService(
|
||||
$entity,
|
||||
$formDatas['serverinfo_uid'],
|
||||
ServerEntity::STATUS_OCCUPIED
|
||||
);
|
||||
$serverEntity = $this->getServerService()->getEntity($formDatas['serverinfo_uid']);
|
||||
if (!$serverEntity) {
|
||||
throw new \Exception("{$formDatas['serverinfo_uid']}에 대한 서버정보를 찾을수 없습니다.");
|
||||
}
|
||||
$serverEntity = $this->getServerService()->enableService($entity, $serverEntity);
|
||||
$entity->setServerEntity($serverEntity);
|
||||
//Switch경우 서비스중으로 설정
|
||||
$serverEntity = $this->getSwitchService()->setService(
|
||||
$entity,
|
||||
$formDatas['switchinfo_uid'],
|
||||
SwitchEntity::STATUS_OCCUPIED
|
||||
);
|
||||
$entity->setSwitchEntity($serverEntity);
|
||||
$switchEntity = $this->getServerService()->getEntity($formDatas['switchinfo_uid']);
|
||||
if (!$switchEntity) {
|
||||
throw new \Exception("{$formDatas['switchinfo_uid']}에 대한 스위치정보를 찾을수 없습니다.");
|
||||
}
|
||||
$switchEntity = $this->getSwitchService()->enableService($entity, $switchEntity);
|
||||
$entity->setSwitchEntity($switchEntity);
|
||||
return $entity;
|
||||
}
|
||||
//생성
|
||||
@ -213,7 +209,7 @@ class ServiceService extends CustomerService
|
||||
throw new \Exception("스위치정보가 지정되지 않았습니다.");
|
||||
}
|
||||
//신규정보 Enable
|
||||
return $this->enableServiceToEquipments($entity, $formDatas);
|
||||
return $this->enableService($entity, $formDatas);
|
||||
}
|
||||
//수정
|
||||
public function modify(mixed $entity, array $formDatas): ServiceEntity
|
||||
@ -226,15 +222,15 @@ class ServiceService extends CustomerService
|
||||
throw new \Exception("스위치정보가 지정되지 않았습니다.");
|
||||
}
|
||||
//기존정보 Disable
|
||||
$entity = $this->disableSetServiceToEquipments($entity);
|
||||
$entity = $this->disableService($entity);
|
||||
//신규정보 Enable
|
||||
return $this->enableServiceToEquipments($entity, $formDatas);
|
||||
return $this->enableService($entity, $formDatas);
|
||||
}
|
||||
//삭제
|
||||
public function delete(mixed $entity): ServiceEntity
|
||||
{
|
||||
//기존정보 Disable
|
||||
$entity = $this->disableSetServiceToEquipments($entity);
|
||||
$entity = $this->disableService($entity);
|
||||
return parent::delete($entity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,10 +100,10 @@ class ServerPartService extends EquipmentService
|
||||
$serverPartFormDatas["serverinfo_uid"] = $serverEntity->getPK();
|
||||
$serverPartFormDatas["serviceinfo_uid"] = $serverEntity->getServiceInfoUID();
|
||||
$serverPartFormDatas["type"] = $partType;
|
||||
$serverPartFormDatas["billing"] = array_key_exists("serverinfopartinfo_uid_{$partType}_billing", $formDatas) ? $formDatas["serverinfopartinfo_uid_{$partType}_billing"] : null;
|
||||
$serverPartFormDatas["amount"] = array_key_exists("serverinfopartinfo_uid_{$partType}_amount", $formDatas) ? $formDatas["serverinfopartinfo_uid_{$partType}_amount"] : 0;
|
||||
$serverPartFormDatas["cnt"] = array_key_exists("serverinfopartinfo_uid_{$partType}_cnt", $formDatas) ? $formDatas["serverinfopartinfo_uid_{$partType}_cnt"] : null;
|
||||
$serverPartFormDatas["extra"] = array_key_exists("serverinfopartinfo_uid_{$partType}_extra", $formDatas) ? $formDatas["serverinfopartinfo_uid_{$partType}_extra"] : null;
|
||||
$serverPartFormDatas["billing"] = array_key_exists("partinfo_uid_{$partType}_billing", $formDatas) ? $formDatas["partinfo_uid_{$partType}_billing"] : null;
|
||||
$serverPartFormDatas["amount"] = array_key_exists("partinfo_uid_{$partType}_amount", $formDatas) ? $formDatas["partinfo_uid_{$partType}_amount"] : 0;
|
||||
$serverPartFormDatas["cnt"] = array_key_exists("partinfo_uid_{$partType}_cnt", $formDatas) ? $formDatas["partinfo_uid_{$partType}_cnt"] : null;
|
||||
$serverPartFormDatas["extra"] = array_key_exists("partinfo_uid_{$partType}_extra", $formDatas) ? $formDatas["partinfo_uid_{$partType}_extra"] : null;
|
||||
$entity = parent::create($serverPartFormDatas);
|
||||
//부품정보 정의
|
||||
$partEntity = $this->getPartService()->getEntity($entity->getPartInfoUID());
|
||||
|
||||
@ -29,16 +29,16 @@ class ServerService extends EquipmentService
|
||||
"format_at",
|
||||
"status",
|
||||
"partinfo_uid_CPU",
|
||||
"serverinfopartinfo_uid_CPU_cnt",
|
||||
"partinfo_uid_CPU_cnt",
|
||||
"partinfo_uid_RAM",
|
||||
"serverinfopartinfo_uid_RAM_cnt",
|
||||
"partinfo_uid_RAM_cnt",
|
||||
"partinfo_uid_DISK",
|
||||
"serverinfopartinfo_uid_DISK_cnt",
|
||||
"serverinfopartinfo_uid_DISK_extra",
|
||||
"partinfo_uid_DISK_cnt",
|
||||
"partinfo_uid_DISK_extra",
|
||||
"partinfo_uid_OS",
|
||||
"serverinfopartinfo_uid_OS_cnt",
|
||||
"partinfo_uid_OS_cnt",
|
||||
"partinfo_uid_SOFTWARE",
|
||||
"serverinfopartinfo_uid_SOFTWARE_cnt",
|
||||
"partinfo_uid_SOFTWARE_cnt",
|
||||
"ipinfo_uid",
|
||||
"csinfo_uid",
|
||||
];
|
||||
@ -53,7 +53,7 @@ class ServerService extends EquipmentService
|
||||
"partinfo_uid_CPU",
|
||||
"partinfo_uid_RAM",
|
||||
"partinfo_uid_DISK",
|
||||
"serverinfopartinfo_uid_DISK_extra",
|
||||
"partinfo_uid_DISK_extra",
|
||||
"partinfo_uid_OS",
|
||||
"partinfo_uid_SOFTWARE",
|
||||
"ipinfo_uid",
|
||||
@ -223,22 +223,20 @@ class ServerService extends EquipmentService
|
||||
parent::setOrderBy($field, $value);
|
||||
}
|
||||
|
||||
public function setService(ServiceEntity $serviceEntity, mixed $uid, string $status): ServerEntity
|
||||
public function enableService(ServiceEntity $serviceEntity, ServerEntity $entity): ServerEntity
|
||||
{
|
||||
$entity = $this->getEntity($uid);
|
||||
if (!$entity) {
|
||||
throw new \Exception("{$uid}에 대한 서버정보를 찾을수 없습니다.");
|
||||
}
|
||||
$formDatas = ['status' => $status];
|
||||
if ($status === ServerEntity::STATUS_OCCUPIED) {
|
||||
$formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUID();
|
||||
$formDatas["serviceinfo_uid"] = $serviceEntity->getPK();
|
||||
} elseif ($status === ServerEntity::STATUS_AVAILABLE) {
|
||||
$formDatas["clientinfo_uid"] = null;
|
||||
$formDatas["serviceinfo_uid"] = null;
|
||||
} else {
|
||||
throw new \Exception(__METHOD__ . "에서 오류발생: {$status}는 지정되지 않은 상태값입니다.");
|
||||
}
|
||||
$formDatas = [];
|
||||
$formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUID();
|
||||
$formDatas["serviceinfo_uid"] = $serviceEntity->getPK();
|
||||
$formDatas['status'] = ServerEntity::STATUS_OCCUPIED;
|
||||
return parent::modify($entity, $formDatas);
|
||||
}
|
||||
public function disableService(ServerEntity $entity): ServerEntity
|
||||
{
|
||||
$formDatas = [];
|
||||
$formDatas["clientinfo_uid"] = null;
|
||||
$formDatas["serviceinfo_uid"] = null;
|
||||
$formDatas['status'] = ServerEntity::STATUS_AVAILABLE;
|
||||
return parent::modify($entity, $formDatas);
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,24 +64,22 @@ class SwitchService extends EquipmentService
|
||||
parent::setOrderBy($field, $value);
|
||||
}
|
||||
|
||||
public function setService(ServiceEntity $serviceEntity, mixed $uid, string $status): SwitchEntity
|
||||
public function enableService(ServiceEntity $serviceEntity, SwitchEntity $entity): SwitchEntity
|
||||
{
|
||||
$entity = $this->getEntity($uid);
|
||||
if (!$entity) {
|
||||
throw new \Exception("{$uid}에 대한 서버정보를 찾을수 없습니다.");
|
||||
}
|
||||
$formDatas = ['status' => $status];
|
||||
if ($status === SwitchEntity::STATUS_OCCUPIED) {
|
||||
$formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUID();
|
||||
$formDatas["serviceinfo_uid"] = $serviceEntity->getPK();
|
||||
$formDatas["serverinfo_uid"] = $serviceEntity->getServerEntity()->getPK();
|
||||
} elseif ($status === SwitchEntity::STATUS_AVAILABLE) {
|
||||
$formDatas["clientinfo_uid"] = null;
|
||||
$formDatas["serviceinfo_uid"] = null;
|
||||
$formDatas["serverinfo_uid"] = null;
|
||||
} else {
|
||||
throw new \Exception(__METHOD__ . "에서 오류발생: {$status}는 지정되지 않은 상태값입니다.");
|
||||
}
|
||||
$formDatas = [];
|
||||
$formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUID();
|
||||
$formDatas["serviceinfo_uid"] = $serviceEntity->getPK();
|
||||
$formDatas["serverinfo_uid"] = $serviceEntity->getServerEntity()->getPK();
|
||||
$formDatas['status'] = SwitchEntity::STATUS_OCCUPIED;
|
||||
return parent::modify($entity, $formDatas);
|
||||
}
|
||||
public function disableService(SwitchEntity $entity): SwitchEntity
|
||||
{
|
||||
$formDatas = [];
|
||||
$formDatas["clientinfo_uid"] = null;
|
||||
$formDatas["serviceinfo_uid"] = null;
|
||||
$formDatas["serverinfo_uid"] = null;
|
||||
$formDatas['status'] = SwitchEntity::STATUS_AVAILABLE;
|
||||
return parent::modify($entity, $formDatas);
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,9 +31,9 @@
|
||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("partinfo_uid_{$partType}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$partType}"), $viewDatas) ?></th>
|
||||
<td nowrap class="text-start">
|
||||
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}", old("partinfo_uid_{$partType}") ?? ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}"] ?? null), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_cnt", old("serverinfopartinfo_uid_{$partType}_cnt") ?? ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_cnt"] ?? null), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}_cnt", old("partinfo_uid_{$partType}_cnt") ?? ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}_cnt"] ?? null), $viewDatas) ?>
|
||||
<?php if ($partType === "DISK"): ?>
|
||||
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_extra", old("serverinfopartinfo_uid_{$partType}_extra") ?? ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_extra"] ?? null), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}_extra", old("partinfo_uid_{$partType}_extra") ?? ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}_extra"] ?? null), $viewDatas) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
69
app/Views/admin/server/indexv2.php
Normal file
69
app/Views/admin/server/indexv2.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||
<?= $this->section('content') ?>
|
||||
<?php if ($error = session('error')): echo $viewDatas['helper']->alert($error) ?><?php endif ?>
|
||||
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
|
||||
<!-- Layout Middle Start -->
|
||||
<table class="layout_middle">
|
||||
<tr>
|
||||
<td class="layout_left">
|
||||
<!-- Layout Left Start -->
|
||||
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
|
||||
<!-- Layout Left End -->
|
||||
</td>
|
||||
<td class="layout_right">
|
||||
<!-- Layout Right Start -->
|
||||
<div class="layout_header"><?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?></div>
|
||||
<div id="container" class="layout_content">
|
||||
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div class="index_body">
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
|
||||
<?= form_open(current_url(), ['id' => 'batchjob_form', 'method' => "post"]) ?>
|
||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="index_head_short_column">번호</th>
|
||||
<?php foreach ($viewDatas['control']['actionFields'] as $field): ?>
|
||||
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['helper']->getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
||||
<?php endforeach ?>
|
||||
<th class="index_head_short_column">추가정보</th>
|
||||
<th class="index_head_short_column">작업</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $cnt = 0 ?>
|
||||
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||
<?php $viewDatas['entity'] = $entity; ?>
|
||||
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||
<td nowrap><?= $viewDatas['helper']->getListButton('modify', '', $viewDatas) ?></td>
|
||||
<?php foreach ($viewDatas['control']['actionFields'] as $field): ?>
|
||||
<td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td>
|
||||
<?php endforeach ?>
|
||||
<td nowrap>
|
||||
<?php foreach (SERVER['PARTTYPES'] as $partType): ?>
|
||||
<div><?= $viewDatas['helper']->getFieldView($partType, "", $viewDatas) ?></div>
|
||||
<?php endforeach; ?>
|
||||
<div><?= $viewDatas['helper']->getFieldView("ipinfo_uid", "", $viewDatas) ?></div>
|
||||
<div><?= $viewDatas['helper']->getFieldView("csinfo_uid", "", $viewDatas) ?></div>
|
||||
</td>
|
||||
<td nowrap>
|
||||
<?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getListButton('history', '', $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $cnt++ ?>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom"); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
|
||||
<!-- Layout Right End -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- Layout Middle End -->
|
||||
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -31,9 +31,9 @@
|
||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("partinfo_uid_{$partType}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$partType}"), $viewDatas) ?></th>
|
||||
<td nowrap class="text-start">
|
||||
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}", old("partinfo_uid_{$partType}") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getPartInfoUID() : ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}"] ?? null)), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_cnt", old("serverinfopartinfo_uid_{$partType}_cnt") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getCnt() : ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_cnt"] ?? null)), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}_cnt", old("partinfo_uid_{$partType}_cnt") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getCnt() : ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}_cnt"] ?? null)), $viewDatas) ?>
|
||||
<?php if ($partType === "DISK"): ?>
|
||||
<?= $viewDatas['helper']->getFieldForm("serverinfopartinfo_uid_{$partType}_extra", old("serverinfopartinfo_uid_{$partType}_extra") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getExtra() : ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_extra"] ?? null)), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldForm("partinfo_uid_{$partType}_extra", old("partinfo_uid_{$partType}_extra") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getExtra() : ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}_extra"] ?? null)), $viewDatas) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -31,9 +31,9 @@
|
||||
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("partinfo_uid_{$partType}", lang("{$viewDatas['class_path']}.label.partinfo_uid_{$partType}"), $viewDatas) ?></th>
|
||||
<td nowrap class="text-start">
|
||||
<?= $viewDatas['helper']->getFieldView("partinfo_uid_{$partType}", old("partinfo_uid_{$partType}") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getPartInfoUID() : ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}"] ?? null)), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldView("serverinfopartinfo_uid_{$partType}_cnt", old("serverinfopartinfo_uid_{$partType}_cnt") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getCnt() : ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_cnt"] ?? null)), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldView("partinfo_uid_{$partType}_cnt", old("partinfo_uid_{$partType}_cnt") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getCnt() : ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}_cnt"] ?? null)), $viewDatas) ?>
|
||||
<?php if ($partType === "DISK"): ?>
|
||||
<?= $viewDatas['helper']->getFieldView("serverinfopartinfo_uid_{$partType}_extra", old("serverinfopartinfo_uid_{$partType}_extra") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getExtra() : ($viewDatas['control']['form_datas']["serverinfopartinfo_uid_{$partType}_extra"] ?? null)), $viewDatas) ?>
|
||||
<?= $viewDatas['helper']->getFieldView("partinfo_uid_{$partType}_extra", old("partinfo_uid_{$partType}_extra") ?? ($viewDatas['entity']->getServerPartEntity($partType) ? $viewDatas['entity']->getServerPartEntity($partType)->getExtra() : ($viewDatas['control']['form_datas']["partinfo_uid_{$partType}_extra"] ?? null)), $viewDatas) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user