dbmsv4 init...2

This commit is contained in:
최준흠 2025-12-04 14:06:36 +09:00
parent 7bb89cfcb6
commit e9fafc084f
5 changed files with 54 additions and 27 deletions

View File

@ -57,16 +57,6 @@ class ServerCell extends EquipmentCell
] ]
]); ]);
} }
public function stock(array $params): string
{
$template = array_key_exists('template', $params) ? $params['template'] : 'stock';
return view('cells/server/' . $template, [
'partCellDatas' => [
'rows' => $this->getService()->getStockCount(),
],
]);
}
public function detail(array $params): string public function detail(array $params): string
{ {
$this->getService()->action_init_process(__FUNCTION__); $this->getService()->action_init_process(__FUNCTION__);

View File

@ -0,0 +1,23 @@
<?php
namespace App\Cells\Part;
use App\Services\Part\RAMService;
class CHASSISCell extends PartCell
{
public function __construct()
{
parent::__construct(service('part_chassisservice'));
}
public function stock(array $params): string
{
$template = array_key_exists('template', $params) ? $params['template'] : 'chassis_stock';
return view('cells/part/' . $template, [
'partCellDatas' => [
'entities' => $this->getService()->getEntities(),
],
]);
}
}

View File

@ -15,7 +15,7 @@
<th class="text-center">저장장치 재고</th> <th class="text-center">저장장치 재고</th>
</tr> </tr>
<tr> <tr>
<td><?= view_cell("\App\Cells\Equipment\ServerCell::stock") ?></td> <td><?= view_cell("\App\Cells\Part\CHASSISCell::stock") ?></td>
<td><?= view_cell("\App\Cells\Part\RAMCell::stock") ?></td> <td><?= view_cell("\App\Cells\Part\RAMCell::stock") ?></td>
<td><?= view_cell("\App\Cells\Part\DISKCell::stock") ?></td> <td><?= view_cell("\App\Cells\Part\DISKCell::stock") ?></td>
</tr> </tr>

View File

@ -0,0 +1,30 @@
<table class="table table-bordered table-hover table-striped">
<tr>
<th class="text-center">항목</th>
<th class="text-center text-nowrap" width="13%">사용</th>
<th class="text-center text-nowrap" width="13%">가능</th>
<th class="text-center text-nowrap" width="17%">총재고</th>
</tr>
<?php foreach ($partCellDatas['entities'] as $entity): ?>
<?php $partCellDatas['entity'] = $entity; ?>
<tr>
<td class="text-end text-nowrap">
<?=
form_label(
$entity->getTitle(),
'disk_modify',
[
"data-src" => "admin/part/chassis/modify/{$entity->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#modal_action_form",
"class" => "text-primary form-label-sm",
]
);
?>
</td>
<td class="text-center text-nowrap"><?= $entity->getUsed() ?></td>
<td class="text-center text-nowrap"><?= $entity->getAvailable() ?></td>
<td class="text-center text-nowrap"><?= $entity->getStock() ?></td>
</tr>
<?php endforeach ?>
</table>

View File

@ -1,16 +0,0 @@
<table class="table table-bordered table-hover table-striped">
<tr>
<th class="text-center">항목</th>
<th class="text-center text-nowrap" width="18%">사용</th>
<th class="text-center text-nowrap" width="18%">가능</th>
<th class="text-center text-nowrap" width="18%">총재고</th>
</tr>
<?php foreach (SERVER['CHASSISES'] as $key => $label): ?>
<tr>
<td class="text-end text-nowrap"><?= $label ?></td>
<td class="text-center text-nowrap"><?= array_key_exists($key, $partCellDatas['rows']) ? $partCellDatas['rows'][$key] : 0 ?></td>
<td class="text-center text-nowrap"><?= array_key_exists($key, $partCellDatas['rows']) ? SERVER['STOCKS'][$key] - $partCellDatas['rows'][$key] : SERVER['STOCKS'][$key] ?></td>
<td class="text-center text-nowrap"><?= SERVER['STOCKS'][$key] ?></td>
</tr>
<?php endforeach ?>
</table>