dbms_init...1

This commit is contained in:
최준흠 2025-05-26 16:04:13 +09:00
parent a2c02983cf
commit a3495e708c
27 changed files with 8843 additions and 326 deletions

View File

@ -46,7 +46,7 @@ class DefenceController extends EquipmentController
protected function index_process(): array protected function index_process(): array
{ {
$fields = [ $fields = [
'fields' => ['type', 'ip', 'accountid', 'domain', 'status'], 'fields' => ['type', 'ip', 'price', 'accountid', 'domain', 'status'],
]; ];
$this->init('index', $fields); $this->init('index', $fields);
return parent::index_process(); return parent::index_process();

View File

@ -45,7 +45,7 @@ class IpController extends EquipmentController
protected function index_process(): array protected function index_process(): array
{ {
$fields = [ $fields = [
'fields' => ['lineinfo_uid', 'ip', 'status', 'updated_at'], 'fields' => ['lineinfo_uid', 'ip', 'price', 'status', 'updated_at', 'created_at'],
]; ];
$this->init('index', $fields); $this->init('index', $fields);
return parent::index_process(); return parent::index_process();

View File

@ -20,7 +20,7 @@ abstract class LinkController extends EquipmentController
protected function setOrderByForList() protected function setOrderByForList()
{ {
//OrderBy 처리 //OrderBy 처리
$this->getService()->getModel()->orderBy('serviceinfo_uid', 'ASC', false); $this->getService()->getModel()->orderBy('serverinfo_uid', 'ASC', false);
parent::setOrderByForList(); parent::setOrderByForList();
} }

View File

@ -24,7 +24,7 @@ abstract class PartController extends EquipmentController
protected function index_process(): array protected function index_process(): array
{ {
$fields = [ $fields = [
'fields' => ['model', 'status'], 'fields' => ['model', 'price', 'status'],
]; ];
$this->init('index', $fields); $this->init('index', $fields);
return parent::index_process(); return parent::index_process();

View File

@ -65,7 +65,7 @@ class ServerController extends EquipmentController
protected function index_process(): array protected function index_process(): array
{ {
$fields = [ $fields = [
'fields' => ['code', 'type', 'model', 'CPU', 'RAM', 'DISK', "raid", 'status'], 'fields' => ['code', 'type', 'model', 'price', 'CPU', 'RAM', 'DISK', "raid", 'status'],
]; ];
$this->init('index', $fields); $this->init('index', $fields);
// $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임 // $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임

View File

@ -39,7 +39,7 @@ class SoftwareController extends EquipmentController
protected function index_process(): array protected function index_process(): array
{ {
$fields = [ $fields = [
'fields' => ['type', 'model', 'status', 'description'], 'fields' => ['type', 'model', 'price', 'status', 'description'],
]; ];
$this->init('index', $fields); $this->init('index', $fields);
return parent::index_process(); return parent::index_process();

View File

@ -161,25 +161,6 @@ abstract class CommonController extends BaseController
protected function getResultPageByActon(string $action, string $message = MESSAGES["SUCCESS"]): RedirectResponse|string protected function getResultPageByActon(string $action, string $message = MESSAGES["SUCCESS"]): RedirectResponse|string
{ {
switch ($action) { switch ($action) {
// case 'create':
// $segments = $this->request->getUri()->getSegments();
// if (!empty($segments)) {
// // 마지막 세그먼트 무조건 view로 교체
// $segments[count($segments) - 1] = 'view';
// }
// $redirectPath = '/' . implode('/', $segments);
// $result = redirect()->to($redirectPath . '/' . $this->entity->getPK());
// // $result = view($this->view_path . 'view', ['viewDatas' => $this->getViewDatas()]);;
// break;
// case 'modify':
// $segments = $this->request->getUri()->getSegments();
// if (!empty($segments)) {
// // 마지막 세그먼트 무조건 view로 교체
// $segments[count($segments) - 2] = 'view';
// }
// $result = redirect()->to('/' . implode('/', $segments));
// // $result = view($this->view_path . 'view', ['viewDatas' => $this->getViewDatas()]);;
// break;
case 'create': case 'create':
case 'modify': case 'modify':
$result = $this->view($this->entity->getPK()); $result = $this->view($this->entity->getPK());
@ -189,7 +170,7 @@ abstract class CommonController extends BaseController
case 'login_form': case 'login_form':
case 'index': case 'index':
case 'view': case 'view':
$this->getHelper()->setViewDatas($this->getViewDatas()); // $this->getHelper()->setViewDatas($this->getViewDatas());
$result = view($this->view_path . $action, ['viewDatas' => $this->getViewDatas()]); $result = view($this->view_path . $action, ['viewDatas' => $this->getViewDatas()]);
break; break;
default: default:
@ -228,6 +209,7 @@ abstract class CommonController extends BaseController
//데이터 검증 //데이터 검증
$this->formDatas = $this->doValidate($this->action, $this->fields); $this->formDatas = $this->doValidate($this->action, $this->fields);
$this->entity = $this->create_process(); $this->entity = $this->create_process();
// dd($this->entity);
$this->getService()->getModel()->transCommit(); $this->getService()->getModel()->transCommit();
$this->getMyLogService()->save($this->getService(), __FUNCTION__, $this->getMyAuth(), MESSAGES["SUCCESS"]); $this->getMyLogService()->save($this->getService(), __FUNCTION__, $this->getMyAuth(), MESSAGES["SUCCESS"]);
return $this->getResultPageByActon($this->action); return $this->getResultPageByActon($this->action);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -260,6 +260,8 @@ class CommonHelper
if (!is_array($viewDatas['field_options'][$field])) { if (!is_array($viewDatas['field_options'][$field])) {
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다."); throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
} }
//request값이 있을경우
$value = $this->request->getVar($field) ?? $value;
$extra_class = isset($extras['class']) ? $extras['class'] . ' select-field' : 'select-field'; $extra_class = isset($extras['class']) ? $extras['class'] . ' select-field' : 'select-field';
// $extra_class = isset($extras['class']) ? $extras['class'] : ""; // $extra_class = isset($extras['class']) ? $extras['class'] : "";
$formOptions = ["" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택']; $formOptions = ["" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택'];
@ -307,6 +309,10 @@ class CommonHelper
case 'created_at': case 'created_at':
$value = $value ? date("Y-m-d", strtotime($value)) : ""; $value = $value ? date("Y-m-d", strtotime($value)) : "";
break; break;
case 'price':
case 'amount':
$value = $value ? number_format($value) : "";
break;
default: default:
if (in_array($field, $viewDatas['filter_fields'])) { if (in_array($field, $viewDatas['filter_fields'])) {
$extras["onChange"] = sprintf( $extras["onChange"] = sprintf(
@ -349,6 +355,7 @@ class CommonHelper
{ {
switch ($action) { switch ($action) {
case 'create': case 'create':
// echo current_url() . '/' . $action . '?' . $this->request->getUri()->getQuery();
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
$action = form_label( $action = form_label(
'입력', '입력',

View File

@ -3,6 +3,7 @@ return [
'title' => "CPU정보", 'title' => "CPU정보",
'label' => [ 'label' => [
'model' => "모델", 'model' => "모델",
'price' => "가격",
'description' => "설명", 'description' => "설명",
'status' => "상태", 'status' => "상태",
'updated_at' => "수정일", 'updated_at' => "수정일",

View File

@ -3,6 +3,7 @@ return [
'title' => "DISK정보", 'title' => "DISK정보",
'label' => [ 'label' => [
'model' => "모델", 'model' => "모델",
'price' => "가격",
'description' => "설명", 'description' => "설명",
'status' => "상태", 'status' => "상태",
'updated_at' => "수정일", 'updated_at' => "수정일",

View File

@ -3,6 +3,7 @@ return [
'title' => "RAM정보", 'title' => "RAM정보",
'label' => [ 'label' => [
'model' => "모델", 'model' => "모델",
'price' => "가격",
'description' => "설명", 'description' => "설명",
'status' => "상태", 'status' => "상태",
'updated_at' => "수정일", 'updated_at' => "수정일",

View File

@ -15,6 +15,7 @@ class DefenceModel extends EquipmentModel
protected $allowedFields = [ protected $allowedFields = [
"type", "type",
"ip", "ip",
"price",
"accountid", "accountid",
"domain", "domain",
"description", "description",
@ -38,6 +39,9 @@ class DefenceModel extends EquipmentModel
case "ip": case "ip":
$rule = "required|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6) $rule = "required|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
break; break;
case "price":
$rule = "required|numeric";
break;
default: default:
$rule = parent::getFieldRule($action, $field); $rule = parent::getFieldRule($action, $field);
break; break;

View File

@ -15,6 +15,7 @@ class IpModel extends EquipmentModel
protected $allowedFields = [ protected $allowedFields = [
"lineinfo_uid", "lineinfo_uid",
"ip", "ip",
"price",
"status", "status",
"updated_at" "updated_at"
]; ];
@ -29,6 +30,7 @@ class IpModel extends EquipmentModel
} }
switch ($field) { switch ($field) {
case "lineinfo_uid": case "lineinfo_uid":
case "price":
$rule = "required|numeric"; $rule = "required|numeric";
break; break;
case "ip": case "ip":

View File

@ -6,7 +6,7 @@ use App\Entities\Equipment\Link\CpuEntity;
class CpuModel extends LinkModel class CpuModel extends LinkModel
{ {
const TABLE = "cpuinfo_link"; const TABLE = "serverinfos_cpuinfos";
const PK = "uid"; const PK = "uid";
const TITLE = "uid"; const TITLE = "uid";
protected $table = self::TABLE; protected $table = self::TABLE;

View File

@ -6,7 +6,7 @@ use App\Entities\Equipment\Link\DiskEntity;
class DiskModel extends LinkModel class DiskModel extends LinkModel
{ {
const TABLE = "diskinfo_link"; const TABLE = "serverinfos_diskinfos";
const PK = "uid"; const PK = "uid";
const TITLE = "uid"; const TITLE = "uid";
protected $table = self::TABLE; protected $table = self::TABLE;

View File

@ -6,7 +6,7 @@ use App\Entities\Equipment\Link\RamEntity;
class RamModel extends LinkModel class RamModel extends LinkModel
{ {
const TABLE = "raminfo_link"; const TABLE = "serverinfos_raminfos";
const PK = "uid"; const PK = "uid";
const TITLE = "uid"; const TITLE = "uid";
protected $table = self::TABLE; protected $table = self::TABLE;

View File

@ -8,6 +8,7 @@ abstract class PartModel extends EquipmentModel
{ {
protected $allowedFields = [ protected $allowedFields = [
"model", "model",
"price",
"status", "status",
"updated_at" "updated_at"
]; ];
@ -24,6 +25,9 @@ abstract class PartModel extends EquipmentModel
case "model": case "model":
$rule = "required|trim|string"; $rule = "required|trim|string";
break; break;
case "price":
$rule = "required|numeric";
break;
default: default:
$rule = parent::getFieldRule($action, $field); $rule = parent::getFieldRule($action, $field);
break; break;

View File

@ -16,6 +16,7 @@ class ServerModel extends EquipmentModel
"code", "code",
"type", "type",
"model", "model",
"price",
"raid", "raid",
"description", "description",
"status", "status",
@ -37,6 +38,9 @@ class ServerModel extends EquipmentModel
case "raid": case "raid":
$rule = "required|trim|string"; $rule = "required|trim|string";
break; break;
case "price":
$rule = "required|numeric";
break;
default: default:
$rule = parent::getFieldRule($action, $field); $rule = parent::getFieldRule($action, $field);
break; break;

View File

@ -15,6 +15,7 @@ class SoftwareModel extends EquipmentModel
protected $allowedFields = [ protected $allowedFields = [
"type", "type",
"model", "model",
"price",
"status", "status",
"description", "description",
"updated_at" "updated_at"
@ -33,6 +34,9 @@ class SoftwareModel extends EquipmentModel
case "type": case "type":
$rule = "required|trim|string"; $rule = "required|trim|string";
break; break;
case "price":
$rule = "required|numeric";
break;
default: default:
$rule = parent::getFieldRule($action, $field); $rule = parent::getFieldRule($action, $field);
break; break;

View File

@ -28,6 +28,7 @@ class DefenceService extends EquipmentService
return [ return [
"type", "type",
"ip", "ip",
"price",
"accountid", "accountid",
"domain", "domain",
"status", "status",

View File

@ -27,6 +27,7 @@ class IpService extends EquipmentService
return [ return [
"lineinfo_uid", "lineinfo_uid",
"ip", "ip",
"price",
"status", "status",
]; ];
} }

View File

@ -16,6 +16,7 @@ abstract class PartService extends EquipmentService
{ {
return [ return [
"model", "model",
"price",
"status", "status",
]; ];
} }

View File

@ -29,6 +29,7 @@ class ServerService extends EquipmentService
"code", "code",
"type", "type",
"model", "model",
"price",
"raid", "raid",
"status", "status",
"description", "description",

View File

@ -27,6 +27,7 @@ class SoftwareService extends EquipmentService
return [ return [
"type", "type",
"model", "model",
"price",
"status", "status",
"description", "description",
]; ];

View File

@ -19,7 +19,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"
onClick="window.location.reload()">Close</button> onClick="closeBootstrapModal()">Close</button>
</div> </div>
</div> </div>
</div> </div>
@ -35,9 +35,9 @@
function closeBootstrapModal() { function closeBootstrapModal() {
var modalElement = document.getElementById('index_action_form'); // 모달의 실제 DOM 요소 가져오기 var modalElement = document.getElementById('index_action_form'); // 모달의 실제 DOM 요소 가져오기
var modalInstance = bootstrap.Modal.getInstance(modalElement); // 모달 인스턴스 가져오기 var modalInstance = bootstrap.Modal.getInstance(modalElement); // 모달 인스턴스 가져오기
// 먼저 모달을 호출한 페이지를 리로드
// window.location.reload();
if (modalInstance) { if (modalInstance) {
// 먼저 모달을 호출한 페이지를 리로드
window.location.reload();
modalInstance.hide(); // 모달 닫기 (hide() 메서드 사용) modalInstance.hide(); // 모달 닫기 (hide() 메서드 사용)
} else { } else {
console.error("Modal instance not found."); console.error("Modal instance not found.");