From 3fc82ccde2db83494e6648bbc529c6e4a3a48834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Mon, 22 Dec 2025 11:47:11 +0900 Subject: [PATCH] dbmsv4 init...3 --- app/Helpers/Customer/ServiceHelper.php | 2 +- app/Helpers/Equipment/CHASSISHelper.php | 22 ++++++++++++++++++++ app/Helpers/Part/PartHelper.php | 27 +++++++++++++++++++++++++ app/Views/cells/chassis/stock.php | 2 +- app/Views/cells/part/disk_stock.php | 2 +- app/Views/cells/part/ram_stock.php | 2 +- app/Views/cells/service/detail.php | 2 +- 7 files changed, 54 insertions(+), 5 deletions(-) diff --git a/app/Helpers/Customer/ServiceHelper.php b/app/Helpers/Customer/ServiceHelper.php index ae30b49..5801a13 100644 --- a/app/Helpers/Customer/ServiceHelper.php +++ b/app/Helpers/Customer/ServiceHelper.php @@ -80,7 +80,7 @@ class ServiceHelper extends CustomerHelper public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string { switch ($action) { - case 'modify': + case 'detail': $action = form_label( $label, 'modify_service', diff --git a/app/Helpers/Equipment/CHASSISHelper.php b/app/Helpers/Equipment/CHASSISHelper.php index 5dfa66a..072e8bb 100644 --- a/app/Helpers/Equipment/CHASSISHelper.php +++ b/app/Helpers/Equipment/CHASSISHelper.php @@ -25,4 +25,26 @@ class CHASSISHelper extends EquipmentHelper } return $value; } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'stock': + $action = form_label( + $label ? $label : ICONS["SERVER_ITEM_{$action}"], + $action, + [ + "data-src" => "/admin/equipment/chassis/modify/{$viewDatas['entity']->getPK()}?ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "btn btn-sm form-label-sm text-primary", + ...$extras, + ] + ); + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Helpers/Part/PartHelper.php b/app/Helpers/Part/PartHelper.php index 7b1f149..004b292 100644 --- a/app/Helpers/Part/PartHelper.php +++ b/app/Helpers/Part/PartHelper.php @@ -27,4 +27,31 @@ abstract class PartHelper extends CommonHelper } return $value; } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'ip': + case 'cs': + case 'cpu': + case 'ram': + case 'disk': + case 'software': + $action = form_label( + $label ? $label : ICONS["SERVER_ITEM_{$action}"], + $action, + [ + "data-src" => "/admin/part/{$action}/modify/{$viewDatas['entity']->getPK()}?ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "btn btn-sm form-label-sm text-primary", + ...$extras, + ] + ); + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Views/cells/chassis/stock.php b/app/Views/cells/chassis/stock.php index 4ee2bd3..124c6fe 100644 --- a/app/Views/cells/chassis/stock.php +++ b/app/Views/cells/chassis/stock.php @@ -8,7 +8,7 @@ - getListButton('modify', $entity->getTitle(), $partCellDatas) ?> + getListButton('stock', $entity->getTitle(), $partCellDatas) ?> getUsed() ?> getAvailable() ?> getStock() ?> diff --git a/app/Views/cells/part/disk_stock.php b/app/Views/cells/part/disk_stock.php index aba9f7c..58cedc9 100644 --- a/app/Views/cells/part/disk_stock.php +++ b/app/Views/cells/part/disk_stock.php @@ -9,7 +9,7 @@ - getListButton('modify', $entity->getTitle(), $partCellDatas) ?> + getListButton('disk', $entity->getTitle(), $partCellDatas) ?> getUsed() ?> getAvailable() ?> getFieldView('format', $entity->format, $partCellDatas) ?> diff --git a/app/Views/cells/part/ram_stock.php b/app/Views/cells/part/ram_stock.php index 4ee2bd3..a9eaef9 100644 --- a/app/Views/cells/part/ram_stock.php +++ b/app/Views/cells/part/ram_stock.php @@ -8,7 +8,7 @@ - getListButton('modify', $entity->getTitle(), $partCellDatas) ?> + getListButton('ram', $entity->getTitle(), $partCellDatas) ?> getUsed() ?> getAvailable() ?> getStock() ?> diff --git a/app/Views/cells/service/detail.php b/app/Views/cells/service/detail.php index 4b8494c..33dfe4b 100644 --- a/app/Views/cells/service/detail.php +++ b/app/Views/cells/service/detail.php @@ -13,7 +13,7 @@
getFieldView('site', $entity->getSite(), $serviceCellDatas) ?> / getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?>
-
getListButton('modify', $entity->getCode(), $serviceCellDatas) ?>
+
getListButton('detail', $entity->getCode(), $serviceCellDatas) ?>
getTitle() ?>
상면비 : getRack()) ?>
회선비 : getLine()) ?>