dbms_init...1

This commit is contained in:
최준흠 2025-05-26 18:52:09 +09:00
parent 5034d870cd
commit d6da8f2ee1
4 changed files with 104 additions and 13 deletions

View File

@ -2,16 +2,17 @@
namespace App\Controllers\Admin\Equipment;
use App\Helpers\Equipment\ServerHelper;
use App\Services\Equipment\Link\CpuService;
use App\Services\Equipment\Link\DiskService;
use App\Services\Equipment\Link\RamService;
use App\Services\Equipment\ServerService;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Helpers\Equipment\ServerHelper;
use App\Services\Equipment\ServerService;
use App\Services\Equipment\Link\CpuService;
use App\Services\Equipment\Link\RamService;
use App\Services\Equipment\Link\DiskService;
class ServerController extends EquipmentController
{
private ?CpuService $_cpuService = null;
@ -61,11 +62,24 @@ class ServerController extends EquipmentController
}
return $this->_diskService;
}
protected function getResultPageByActon(string $action, string $message = MESSAGES["SUCCESS"]): RedirectResponse|string
{
switch ($action) {
case 'index':
$this->getHelper()->setViewDatas($this->getViewDatas());
$result = view($this->view_path . 'server' . DIRECTORY_SEPARATOR . $action, ['viewDatas' => $this->getViewDatas()]);
break;
default:
$result = parent::getResultPageByActon($action, $message);
break;
}
return $result;
}
//Index,FieldForm관련
protected function index_process(): array
{
$fields = [
'fields' => ['code', 'type', 'model', 'price', 'CPU', 'RAM', 'DISK', "raid", 'status'],
'fields' => ['code', 'type', 'model', 'price', "raid", 'status'],
];
$this->init('index', $fields);
// $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임

View File

@ -31,14 +31,14 @@
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<?php $viewDatas['entity'] = $entity; ?>
<th><?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?></th>
<td><?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?></td>
<?php foreach ($viewDatas['fields'] as $field): ?>
<td><?= $viewDatas['helper']->getFieldView($field, $viewDatas) ?></td>
<?php endforeach ?>
<th><?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?></th>
<td><?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?></td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>

View File

@ -20,14 +20,14 @@
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<?php $viewDatas['entity'] = $entity; ?>
<th><?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?></th>
<td><?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?></td>
<?php foreach ($viewDatas['fields'] as $field): ?>
<td><?= $viewDatas['helper']->getFieldView($field, $viewDatas) ?></td>
<?php endforeach ?>
<th><?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?></th>
<td><?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?></td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>

View File

@ -0,0 +1,77 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): ?><div style="border:1px solid red;"><?= $error ?></div><?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 -->
<?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?>
<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['fields'] as $field): ?>
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['helper']->getListLabel($field, $viewDatas) ?></th>
<?php endforeach ?>
<th class="index_head_short_column">작업</th>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<td><?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?></td>
<?php foreach ($viewDatas['fields'] as $field): ?>
<td><?= $viewDatas['helper']->getFieldView($field, $viewDatas) ?></td>
<?php endforeach ?>
<td><?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?></td>
</tr>
<tr>
<td colspan="8">
<table class="table table-bordered table-hover table-striped">
<tr>
<td><?= $viewDatas['helper']->getListButton('LINE', $viewDatas) ?></td>
<td><?= $viewDatas['helper']->getListButton('IP', $viewDatas) ?></td>
<td><?= $viewDatas['helper']->getListButton('CPU', $viewDatas) ?></td>
<td><?= $viewDatas['helper']->getListButton('RAM', $viewDatas) ?></td>
<td><?= $viewDatas['helper']->getListButton('DISK', $viewDatas) ?></td>
<td><?= $viewDatas['helper']->getListButton('DEFENCE', $viewDatas) ?></td>
<td><?= $viewDatas['helper']->getListButton('SOFTWARE', $viewDatas) ?></td>
<td><?= $viewDatas['helper']->getListButton('DOMAIN', $viewDatas) ?></td>
</tr>
</table>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_batchjob"); ?>
<?= form_close() ?>
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
</div>
<div class="index_bottom"><?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?></div>
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/index.js"></script>
</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() ?>