dbmsv2_init...1

This commit is contained in:
choi.jh 2025-09-04 18:32:01 +09:00
parent 730e90a2aa
commit 5eed7114a9
16 changed files with 336 additions and 300 deletions

View File

@ -60,6 +60,24 @@ class ServerController extends EquipmentController
} }
return $result; return $result;
} }
protected function getFormData(string $field, array $requestDatas, array $formDatas): array
{
switch ($field) {
case 'CPU':
case 'RAM':
$formDatas[$field] = $requestDatas[$field] ?? null;
$formDatas["{$field}_cnt"] = $requestDatas["{$field}_cnt"] ?? null;
break;
case 'DISK':
$formDatas[$field] = $requestDatas[$field] ?? null;
$formDatas["{$field}_cnt"] = $requestDatas["{$field}_cnt"] ?? null;
$formDatas["{$field}_extra"] = $requestDatas["{$field}_extra"] ?? null;
break;
default:
$formDatas = parent::getFormData($field, $requestDatas, $formDatas);
}
return $formDatas;
}
//생성 //생성
protected function create_form_process(): void protected function create_form_process(): void
{ {
@ -74,8 +92,6 @@ class ServerController extends EquipmentController
(int)env("Server.Default.code", 0) (int)env("Server.Default.code", 0)
) )
]); ]);
//서버파트연결용
$this->serverPartHelper = new ServerPartHelper();
parent::create_form_process(); parent::create_form_process();
} }
//생성 //생성
@ -92,15 +108,8 @@ class ServerController extends EquipmentController
$this->getService()->codeCheck($formDatas); $this->getService()->codeCheck($formDatas);
return parent::modify_process($entity, $formDatas); return parent::modify_process($entity, $formDatas);
} }
protected function view_process(mixed $entity): mixed
{
//서버파트연결용
$this->serverPartHelper = new ServerPartHelper();
return parent::view_process($entity);
}
protected function index_process(array $entities = []): array protected function index_process(array $entities = []): array
{ {
//서버파트연결용
$this->serverPartHelper = new ServerPartHelper(); $this->serverPartHelper = new ServerPartHelper();
return parent::index_process($entities); return parent::index_process($entities);
} }

View File

@ -2,7 +2,6 @@
namespace App\Controllers\Admin\Equipment; namespace App\Controllers\Admin\Equipment;
use App\Entities\Equipment\ServerPartEntity;
use App\Helpers\Equipment\ServerPartHelper; use App\Helpers\Equipment\ServerPartHelper;
use App\Services\Equipment\ServerPartService; use App\Services\Equipment\ServerPartService;

View File

@ -4,7 +4,6 @@ namespace App\Controllers;
use App\Controllers\BaseController; use App\Controllers\BaseController;
use App\Entities\FormOptionEntity;
use App\Libraries\LogCollector; use App\Libraries\LogCollector;
use App\Services\MyLogService; use App\Services\MyLogService;
use CodeIgniter\HTTP\DownloadResponse; use CodeIgniter\HTTP\DownloadResponse;

View File

@ -4,9 +4,9 @@
"settings": { "settings": {
"width": 3000, "width": 3000,
"height": 3000, "height": 3000,
"scrollTop": -1805.1278, "scrollTop": -1503.4046,
"scrollLeft": -1141.7503, "scrollLeft": -1269.8532,
"zoomLevel": 1, "zoomLevel": 0.73,
"show": 511, "show": 511,
"database": 4, "database": 4,
"databaseName": "", "databaseName": "",
@ -112,15 +112,15 @@
"w_EuwbTwtLEPAgYjS1aYq" "w_EuwbTwtLEPAgYjS1aYq"
], ],
"ui": { "ui": {
"x": 1598.9121, "x": 1423.9121,
"y": 219.9426, "y": 72.4426,
"zIndex": 2, "zIndex": 2,
"widthName": 60, "widthName": 60,
"widthComment": 62, "widthComment": 62,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756951973898, "updateAt": 1756961389352,
"createAt": 1745819764136 "createAt": 1745819764136
} }
}, },
@ -174,15 +174,15 @@
"JEk5AASiK6MpT9QBRWjMX" "JEk5AASiK6MpT9QBRWjMX"
], ],
"ui": { "ui": {
"x": 689.465, "x": 864.465,
"y": 922.0675, "y": 1069.5675,
"zIndex": 2, "zIndex": 2,
"widthName": 60, "widthName": 60,
"widthComment": 60, "widthComment": 60,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756951977870, "updateAt": 1756961419032,
"createAt": 1745819764137 "createAt": 1745819764137
} }
}, },
@ -318,15 +318,15 @@
"aY2pn1J3VHF_qV5XFM_zf" "aY2pn1J3VHF_qV5XFM_zf"
], ],
"ui": { "ui": {
"x": 1216.2756, "x": 948.7756,
"y": 1620.1057, "y": 2042.6057,
"zIndex": 2, "zIndex": 2,
"widthName": 60, "widthName": 60,
"widthComment": 60, "widthComment": 60,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756951983406, "updateAt": 1756961447384,
"createAt": 1745819764137 "createAt": 1745819764137
} }
}, },
@ -367,15 +367,15 @@
"xvHi50lODgZs-Ke-lH95g" "xvHi50lODgZs-Ke-lH95g"
], ],
"ui": { "ui": {
"x": 889.129, "x": 111.629,
"y": 2138.0891, "y": 2093.0891,
"zIndex": 2, "zIndex": 2,
"widthName": 60, "widthName": 60,
"widthComment": 60, "widthComment": 60,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756951951547, "updateAt": 1756961442460,
"createAt": 1745819764138 "createAt": 1745819764138
} }
}, },
@ -420,15 +420,15 @@
"ZgRRNC6OFpn87uomKBHbH" "ZgRRNC6OFpn87uomKBHbH"
], ],
"ui": { "ui": {
"x": 55.2992, "x": 65.2992,
"y": 1309.3218, "y": 1149.3218,
"zIndex": 2, "zIndex": 2,
"widthName": 60, "widthName": 60,
"widthComment": 60, "widthComment": 60,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756951933749, "updateAt": 1756961428954,
"createAt": 1745819764138 "createAt": 1745819764138
} }
}, },
@ -486,15 +486,15 @@
"CX9ODlVw-gFnxgfMJ1JyV" "CX9ODlVw-gFnxgfMJ1JyV"
], ],
"ui": { "ui": {
"x": 201.8242, "x": 84.3242,
"y": 1753.7017, "y": 1608.7017,
"zIndex": 2, "zIndex": 2,
"widthName": 60, "widthName": 60,
"widthComment": 60, "widthComment": 60,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756951935884, "updateAt": 1756961435521,
"createAt": 1745819764138 "createAt": 1745819764138
} }
}, },
@ -730,15 +730,15 @@
"2fzVlWt1Skh-391N_z9Ci" "2fzVlWt1Skh-391N_z9Ci"
], ],
"ui": { "ui": {
"x": 1530.1399, "x": 2012.6399,
"y": 808.6469, "y": 1161.1469,
"zIndex": 2395, "zIndex": 2395,
"widthName": 60, "widthName": 60,
"widthComment": 62, "widthComment": 62,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756951967284, "updateAt": 1756961453341,
"createAt": 1748485662214 "createAt": 1748485662214
} }
}, },
@ -779,15 +779,15 @@
"qOLH2re1rmaG-63c08R8x" "qOLH2re1rmaG-63c08R8x"
], ],
"ui": { "ui": {
"x": 2465.5679, "x": 1433.0679,
"y": 1164.3837, "y": 494.3837,
"zIndex": 2509, "zIndex": 2509,
"widthName": 60, "widthName": 60,
"widthComment": 62, "widthComment": 62,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756952096387, "updateAt": 1756961382553,
"createAt": 1750898626895 "createAt": 1750898626895
} }
}, },
@ -834,15 +834,15 @@
"S-_BBM4Qv5LCTvGVKmQQw" "S-_BBM4Qv5LCTvGVKmQQw"
], ],
"ui": { "ui": {
"x": 2218.7142, "x": 1953.7142,
"y": 1669.2031, "y": 1801.7031,
"zIndex": 4045, "zIndex": 4045,
"widthName": 60, "widthName": 60,
"widthComment": 201, "widthComment": 201,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756952094110, "updateAt": 1756961412059,
"createAt": 1755244574868 "createAt": 1755244574868
} }
}, },
@ -855,6 +855,7 @@
"l2g7xess8DY86_ZOm7Ca1", "l2g7xess8DY86_ZOm7Ca1",
"IbWdZlEEF70bGqUDkU5ub", "IbWdZlEEF70bGqUDkU5ub",
"eu4eV0U7BRaP7Zk-oyBhV", "eu4eV0U7BRaP7Zk-oyBhV",
"cHqRVW_Ce77LXwoPpG3OP",
"mYEan5gjLS5bBthtFCc6w", "mYEan5gjLS5bBthtFCc6w",
"tmSvn-3Kqlf7oUbiedFDh", "tmSvn-3Kqlf7oUbiedFDh",
"SioEINPlR0iyL87vqa4N-", "SioEINPlR0iyL87vqa4N-",
@ -872,6 +873,7 @@
"IbWdZlEEF70bGqUDkU5ub", "IbWdZlEEF70bGqUDkU5ub",
"eu4eV0U7BRaP7Zk-oyBhV", "eu4eV0U7BRaP7Zk-oyBhV",
"czO0QNJkidvlfvj3hL6xs", "czO0QNJkidvlfvj3hL6xs",
"cHqRVW_Ce77LXwoPpG3OP",
"mYEan5gjLS5bBthtFCc6w", "mYEan5gjLS5bBthtFCc6w",
"tmSvn-3Kqlf7oUbiedFDh", "tmSvn-3Kqlf7oUbiedFDh",
"SioEINPlR0iyL87vqa4N-", "SioEINPlR0iyL87vqa4N-",
@ -884,15 +886,15 @@
"IMTeN4-Evbpr5MMraE__C" "IMTeN4-Evbpr5MMraE__C"
], ],
"ui": { "ui": {
"x": 1790.8624, "x": 2243.3624,
"y": 2142.2793, "y": 2299.7793,
"zIndex": 4514, "zIndex": 4514,
"widthName": 76, "widthName": 76,
"widthComment": 74, "widthComment": 74,
"color": "" "color": ""
}, },
"meta": { "meta": {
"updateAt": 1756953821847, "updateAt": 1756961728419,
"createAt": 1755476453282 "createAt": 1755476453282
} }
}, },
@ -8277,6 +8279,26 @@
"updateAt": 1756778069722, "updateAt": 1756778069722,
"createAt": 1756778058760 "createAt": 1756778058760
} }
},
"cHqRVW_Ce77LXwoPpG3OP": {
"id": "cHqRVW_Ce77LXwoPpG3OP",
"tableId": "8GYAVBvZGaMFeq3QuXk_B",
"name": "type",
"comment": "구분",
"dataType": "VARCHAR(20)",
"default": "",
"options": 8,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 75,
"widthDefault": 60
},
"meta": {
"updateAt": 1756961786936,
"createAt": 1756961726238
}
} }
}, },
"relationshipEntities": { "relationshipEntities": {
@ -8290,8 +8312,8 @@
"columnIds": [ "columnIds": [
"7B0zaLoZnOoMNW8OHZlrQ" "7B0zaLoZnOoMNW8OHZlrQ"
], ],
"x": 306.7992, "x": 316.7992,
"y": 1605.3218, "y": 1445.3218,
"direction": 8 "direction": 8
}, },
"end": { "end": {
@ -8299,8 +8321,8 @@
"columnIds": [ "columnIds": [
"f7_MGvRjkwL1xkCWrAgDR" "f7_MGvRjkwL1xkCWrAgDR"
], ],
"x": 467.8242, "x": 350.3242,
"y": 1753.7017, "y": 1608.7017,
"direction": 4 "direction": 4
}, },
"meta": { "meta": {
@ -8318,17 +8340,17 @@
"columnIds": [ "columnIds": [
"mfHtgzc_Aeocr6xkgwYWh" "mfHtgzc_Aeocr6xkgwYWh"
], ],
"x": 1851.4121, "x": 1928.9121,
"y": 515.9426, "y": 319.1092666666667,
"direction": 8 "direction": 2
}, },
"end": { "end": {
"tableId": "B8haiEbPc1lRBWTv1g25G", "tableId": "B8haiEbPc1lRBWTv1g25G",
"columnIds": [ "columnIds": [
"Vf3bNvvEPfu1zCs4rcHTU" "Vf3bNvvEPfu1zCs4rcHTU"
], ],
"x": 1856.6399, "x": 2121.473233333333,
"y": 808.6469, "y": 1161.1469,
"direction": 4 "direction": 4
}, },
"meta": { "meta": {
@ -8346,8 +8368,8 @@
"columnIds": [ "columnIds": [
"mfHtgzc_Aeocr6xkgwYWh" "mfHtgzc_Aeocr6xkgwYWh"
], ],
"x": 2103.9121, "x": 1928.9121,
"y": 441.94259999999997, "y": 220.44260000000003,
"direction": 2 "direction": 2
}, },
"end": { "end": {
@ -8356,7 +8378,7 @@
"s1Az-lXWK0NlVQqFEEK8o" "s1Az-lXWK0NlVQqFEEK8o"
], ],
"x": 2338.5336, "x": 2338.5336,
"y": 587.9663333333334, "y": 618.633,
"direction": 1 "direction": 1
}, },
"meta": { "meta": {
@ -8374,8 +8396,8 @@
"columnIds": [ "columnIds": [
"mfHtgzc_Aeocr6xkgwYWh" "mfHtgzc_Aeocr6xkgwYWh"
], ],
"x": 2103.9121, "x": 1928.9121,
"y": 293.94259999999997, "y": 121.77593333333334,
"direction": 2 "direction": 2
}, },
"end": { "end": {
@ -8402,17 +8424,17 @@
"columnIds": [ "columnIds": [
"mfHtgzc_Aeocr6xkgwYWh" "mfHtgzc_Aeocr6xkgwYWh"
], ],
"x": 1598.9121, "x": 1676.4121,
"y": 478.94259999999997, "y": 368.44259999999997,
"direction": 1 "direction": 8
}, },
"end": { "end": {
"tableId": "6ajvOCaGuXU9pzV0Y9jEi", "tableId": "6ajvOCaGuXU9pzV0Y9jEi",
"columnIds": [ "columnIds": [
"hrPg0uHAdEjamOj--BVzO" "hrPg0uHAdEjamOj--BVzO"
], ],
"x": 1133.6316666666667, "x": 1330.8400000000001,
"y": 922.0675, "y": 1069.5675,
"direction": 4 "direction": 4
}, },
"meta": { "meta": {
@ -8430,8 +8452,8 @@
"columnIds": [ "columnIds": [
"mfHtgzc_Aeocr6xkgwYWh" "mfHtgzc_Aeocr6xkgwYWh"
], ],
"x": 1598.9121, "x": 1423.9121,
"y": 256.94259999999997, "y": 121.77593333333334,
"direction": 1 "direction": 1
}, },
"end": { "end": {
@ -8458,8 +8480,8 @@
"columnIds": [ "columnIds": [
"mfHtgzc_Aeocr6xkgwYWh" "mfHtgzc_Aeocr6xkgwYWh"
], ],
"x": 1598.9121, "x": 1423.9121,
"y": 330.94259999999997, "y": 220.44260000000003,
"direction": 1 "direction": 1
}, },
"end": { "end": {
@ -8486,8 +8508,8 @@
"columnIds": [ "columnIds": [
"mfHtgzc_Aeocr6xkgwYWh" "mfHtgzc_Aeocr6xkgwYWh"
], ],
"x": 1598.9121, "x": 1423.9121,
"y": 404.94259999999997, "y": 319.1092666666667,
"direction": 1 "direction": 1
}, },
"end": { "end": {
@ -8514,8 +8536,8 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 689.465, "x": 864.465,
"y": 1142.0675, "y": 1142.9008333333334,
"direction": 1 "direction": 1
}, },
"end": { "end": {
@ -8542,8 +8564,8 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 955.9649999999999, "x": 1064.3400000000001,
"y": 922.0675, "y": 1069.5675,
"direction": 4 "direction": 4
}, },
"end": { "end": {
@ -8570,8 +8592,8 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 778.2983333333333, "x": 931.09,
"y": 922.0675, "y": 1069.5675,
"direction": 4 "direction": 4
}, },
"end": { "end": {
@ -8598,8 +8620,8 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 1222.4650000000001, "x": 1397.4650000000001,
"y": 977.0675, "y": 1142.9008333333334,
"direction": 2 "direction": 2
}, },
"end": { "end": {
@ -8608,7 +8630,7 @@
"8mPFhDdUY8QLPvc8rNw1B" "8mPFhDdUY8QLPvc8rNw1B"
], ],
"x": 2338.5336, "x": 2338.5336,
"y": 833.2996666666667, "y": 802.633,
"direction": 1 "direction": 1
}, },
"meta": { "meta": {
@ -8626,8 +8648,8 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 1222.4650000000001, "x": 1397.4650000000001,
"y": 1087.0675, "y": 1289.5675,
"direction": 2 "direction": 2
}, },
"end": { "end": {
@ -8635,8 +8657,8 @@
"columnIds": [ "columnIds": [
"N-2m8O_JzS6-sDEcL5zTv" "N-2m8O_JzS6-sDEcL5zTv"
], ],
"x": 1530.1399, "x": 2012.6399,
"y": 918.6469, "y": 1234.4802333333334,
"direction": 1 "direction": 1
}, },
"meta": { "meta": {
@ -8654,18 +8676,18 @@
"columnIds": [ "columnIds": [
"nNWsAWbHfKWqx8EwxvuM1" "nNWsAWbHfKWqx8EwxvuM1"
], ],
"x": 2183.1399, "x": 2556.806566666666,
"y": 881.9802333333332, "y": 1161.1469,
"direction": 2 "direction": 4
}, },
"end": { "end": {
"tableId": "QCNA57Pi6A9dJDgybxS5v", "tableId": "QCNA57Pi6A9dJDgybxS5v",
"columnIds": [ "columnIds": [
"vxhl-9RMNJ8zU9oqzEWo8" "vxhl-9RMNJ8zU9oqzEWo8"
], ],
"x": 2338.5336, "x": 2649.0336,
"y": 710.633, "y": 894.633,
"direction": 1 "direction": 8
}, },
"meta": { "meta": {
"updateAt": 1755653412891, "updateAt": 1755653412891,
@ -8682,18 +8704,18 @@
"columnIds": [ "columnIds": [
"RITMHZcQAJ7KvtxkTtMv-" "RITMHZcQAJ7KvtxkTtMv-"
], ],
"x": 1740.2756, "x": 1341.7756,
"y": 1718.1057, "y": 2042.6057,
"direction": 2 "direction": 4
}, },
"end": { "end": {
"tableId": "IsMoJXzvtuoOFFt93qS0w", "tableId": "IsMoJXzvtuoOFFt93qS0w",
"columnIds": [ "columnIds": [
"wi1XbZM3emknh42sOMkYq" "wi1XbZM3emknh42sOMkYq"
], ],
"x": 2465.5679, "x": 1691.5679,
"y": 1391.050366666667, "y": 766.3837,
"direction": 1 "direction": 8
}, },
"meta": { "meta": {
"updateAt": 1755653724845, "updateAt": 1755653724845,
@ -8710,8 +8732,8 @@
"columnIds": [ "columnIds": [
"RITMHZcQAJ7KvtxkTtMv-" "RITMHZcQAJ7KvtxkTtMv-"
], ],
"x": 1740.2756, "x": 1472.7756,
"y": 1914.1057, "y": 2238.6057,
"direction": 2 "direction": 2
}, },
"end": { "end": {
@ -8719,8 +8741,8 @@
"columnIds": [ "columnIds": [
"GtBqjKsmtYWvsd0fckBc0" "GtBqjKsmtYWvsd0fckBc0"
], ],
"x": 2218.7142, "x": 1953.7142,
"y": 1963.2031, "y": 2095.7030999999997,
"direction": 1 "direction": 1
}, },
"meta": { "meta": {
@ -8738,18 +8760,18 @@
"columnIds": [ "columnIds": [
"nNWsAWbHfKWqx8EwxvuM1" "nNWsAWbHfKWqx8EwxvuM1"
], ],
"x": 1693.3899, "x": 2012.6399,
"y": 1248.6469, "y": 1527.813566666667,
"direction": 8 "direction": 1
}, },
"end": { "end": {
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ", "tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
"columnIds": [ "columnIds": [
"4iRyOhmW3b7kbiZT8lQyY" "4iRyOhmW3b7kbiZT8lQyY"
], ],
"x": 1478.2756, "x": 1472.7756,
"y": 1620.1057, "y": 2107.9390333333336,
"direction": 4 "direction": 2
}, },
"meta": { "meta": {
"updateAt": 1755653818593, "updateAt": 1755653818593,
@ -8766,8 +8788,8 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 1133.6316666666667, "x": 1130.9650000000001,
"y": 1362.0675, "y": 1509.5675,
"direction": 8 "direction": 8
}, },
"end": { "end": {
@ -8775,9 +8797,9 @@
"columnIds": [ "columnIds": [
"JRdeV7n53lb1iSmmYnhHX" "JRdeV7n53lb1iSmmYnhHX"
], ],
"x": 1216.2756, "x": 1079.7756,
"y": 1718.1057, "y": 2042.6057,
"direction": 1 "direction": 4
}, },
"meta": { "meta": {
"updateAt": 1755653851900, "updateAt": 1755653851900,
@ -8794,17 +8816,17 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 778.2983333333333, "x": 864.465,
"y": 1362.0675, "y": 1289.5675,
"direction": 8 "direction": 1
}, },
"end": { "end": {
"tableId": "ZLEpY5EjuZV21718zf-Y1", "tableId": "ZLEpY5EjuZV21718zf-Y1",
"columnIds": [ "columnIds": [
"60w6M5QqxGAvJa3EEMDbR" "60w6M5QqxGAvJa3EEMDbR"
], ],
"x": 733.8242, "x": 616.3242,
"y": 1891.7017, "y": 1654.7017,
"direction": 2 "direction": 2
}, },
"meta": { "meta": {
@ -8822,8 +8844,8 @@
"columnIds": [ "columnIds": [
"RITMHZcQAJ7KvtxkTtMv-" "RITMHZcQAJ7KvtxkTtMv-"
], ],
"x": 1216.2756, "x": 948.7756,
"y": 1914.1057, "y": 2238.6057,
"direction": 1 "direction": 1
}, },
"end": { "end": {
@ -8831,8 +8853,8 @@
"columnIds": [ "columnIds": [
"QznZ6PY_T3OGj3YD4GdOX" "QznZ6PY_T3OGj3YD4GdOX"
], ],
"x": 733.8242, "x": 616.3242,
"y": 2075.7017, "y": 1930.7017,
"direction": 2 "direction": 2
}, },
"meta": { "meta": {
@ -8850,17 +8872,17 @@
"columnIds": [ "columnIds": [
"RITMHZcQAJ7KvtxkTtMv-" "RITMHZcQAJ7KvtxkTtMv-"
], ],
"x": 1478.2756, "x": 1472.7756,
"y": 2012.1057, "y": 2369.2723666666666,
"direction": 8 "direction": 2
}, },
"end": { "end": {
"tableId": "8GYAVBvZGaMFeq3QuXk_B", "tableId": "8GYAVBvZGaMFeq3QuXk_B",
"columnIds": [ "columnIds": [
"IbWdZlEEF70bGqUDkU5ub" "IbWdZlEEF70bGqUDkU5ub"
], ],
"x": 1790.8624, "x": 2243.3624,
"y": 2290.2793, "y": 2459.7793,
"direction": 1 "direction": 1
}, },
"meta": { "meta": {
@ -8878,8 +8900,8 @@
"columnIds": [ "columnIds": [
"nNWsAWbHfKWqx8EwxvuM1" "nNWsAWbHfKWqx8EwxvuM1"
], ],
"x": 1530.1399, "x": 2012.6399,
"y": 1138.6469, "y": 1381.1469000000002,
"direction": 1 "direction": 1
}, },
"end": { "end": {
@ -8887,8 +8909,8 @@
"columnIds": [ "columnIds": [
"sJfMcwfDgXnsZ89DVVDA2" "sJfMcwfDgXnsZ89DVVDA2"
], ],
"x": 733.8242, "x": 616.3242,
"y": 1799.7017, "y": 1838.7017,
"direction": 2 "direction": 2
}, },
"meta": { "meta": {
@ -8906,18 +8928,18 @@
"columnIds": [ "columnIds": [
"nNWsAWbHfKWqx8EwxvuM1" "nNWsAWbHfKWqx8EwxvuM1"
], ],
"x": 2183.1399, "x": 2339.1398999999997,
"y": 1028.6469, "y": 1161.1469,
"direction": 2 "direction": 4
}, },
"end": { "end": {
"tableId": "IsMoJXzvtuoOFFt93qS0w", "tableId": "IsMoJXzvtuoOFFt93qS0w",
"columnIds": [ "columnIds": [
"E30sHnqJytLlBmfL7ueOG" "E30sHnqJytLlBmfL7ueOG"
], ],
"x": 2465.5679, "x": 1950.0679,
"y": 1209.7170333333336, "y": 630.3837,
"direction": 1 "direction": 2
}, },
"meta": { "meta": {
"updateAt": 1755664567491, "updateAt": 1755664567491,
@ -8934,17 +8956,17 @@
"columnIds": [ "columnIds": [
"nNWsAWbHfKWqx8EwxvuM1" "nNWsAWbHfKWqx8EwxvuM1"
], ],
"x": 2183.1399, "x": 2175.8899,
"y": 1175.3135666666667, "y": 1601.1469,
"direction": 2 "direction": 8
}, },
"end": { "end": {
"tableId": "SEgsi7mbM-56Rsx5-qj8K", "tableId": "SEgsi7mbM-56Rsx5-qj8K",
"columnIds": [ "columnIds": [
"7Tqt0jVOln16nire8AE2K" "7Tqt0jVOln16nire8AE2K"
], ],
"x": 2487.7142, "x": 2222.7142,
"y": 1669.2031, "y": 1801.7031,
"direction": 4 "direction": 4
}, },
"meta": { "meta": {
@ -8962,8 +8984,8 @@
"columnIds": [ "columnIds": [
"nNWsAWbHfKWqx8EwxvuM1" "nNWsAWbHfKWqx8EwxvuM1"
], ],
"x": 2019.8899, "x": 2502.3899,
"y": 1248.6469, "y": 1601.1469,
"direction": 8 "direction": 8
}, },
"end": { "end": {
@ -8971,8 +8993,8 @@
"columnIds": [ "columnIds": [
"eu4eV0U7BRaP7Zk-oyBhV" "eu4eV0U7BRaP7Zk-oyBhV"
], ],
"x": 2087.8624, "x": 2540.3624,
"y": 2142.2793, "y": 2299.7793,
"direction": 4 "direction": 4
}, },
"meta": { "meta": {
@ -8990,17 +9012,17 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 1222.4650000000001, "x": 1197.5900000000001,
"y": 1197.0675, "y": 1069.5675,
"direction": 2 "direction": 4
}, },
"end": { "end": {
"tableId": "IsMoJXzvtuoOFFt93qS0w", "tableId": "IsMoJXzvtuoOFFt93qS0w",
"columnIds": [ "columnIds": [
"9FYinSR3C6jDrEsRsCMpl" "9FYinSR3C6jDrEsRsCMpl"
], ],
"x": 2465.5679, "x": 1433.0679,
"y": 1300.3837000000003, "y": 630.3837,
"direction": 1 "direction": 1
}, },
"meta": { "meta": {
@ -9018,8 +9040,8 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 1222.4650000000001, "x": 1397.4650000000001,
"y": 1307.0675, "y": 1436.2341666666669,
"direction": 2 "direction": 2
}, },
"end": { "end": {
@ -9027,8 +9049,8 @@
"columnIds": [ "columnIds": [
"q_IaRBb367b9mgGozh6jB" "q_IaRBb367b9mgGozh6jB"
], ],
"x": 2218.7142, "x": 1953.7142,
"y": 1767.2031, "y": 1899.7031,
"direction": 1 "direction": 1
}, },
"meta": { "meta": {
@ -9046,17 +9068,17 @@
"columnIds": [ "columnIds": [
"V6BuLrtFrGgCWaHSUkSLb" "V6BuLrtFrGgCWaHSUkSLb"
], ],
"x": 955.9649999999999, "x": 864.465,
"y": 1362.0675, "y": 1436.2341666666669,
"direction": 8 "direction": 1
}, },
"end": { "end": {
"tableId": "ZLEpY5EjuZV21718zf-Y1", "tableId": "ZLEpY5EjuZV21718zf-Y1",
"columnIds": [ "columnIds": [
"4sj8hIYAiLSSF89eeNXdQ" "4sj8hIYAiLSSF89eeNXdQ"
], ],
"x": 733.8242, "x": 616.3242,
"y": 1983.7017, "y": 1746.7017,
"direction": 2 "direction": 2
}, },
"meta": { "meta": {

File diff suppressed because one or more lines are too long

View File

@ -10,11 +10,11 @@ class ServerPartEntity extends EquipmentEntity
const TITLE = ServerPartModel::TITLE; const TITLE = ServerPartModel::TITLE;
const DEFAULT_STATUS = null; const DEFAULT_STATUS = null;
public function setPartEntity(PartEntity $entity): void public function setPartEntity(mixed $entity): void
{ {
$this->attributes['partEntity'] = $entity; $this->attributes['partEntity'] = $entity;
} }
public function getPartEntity(): PartEntity|null public function getPartEntity(): mixed
{ {
return $this->attributes['partEntity'] ?? null; return $this->attributes['partEntity'] ?? null;
} }

View File

@ -394,7 +394,6 @@ class CommonHelper
{ {
switch ($action) { switch ($action) {
case 'create': case 'create':
// echo current_url() . '/' . $action . '?' . $viewDatas['uri']->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(
$label ? $label : '입력', $label ? $label : '입력',

View File

@ -6,10 +6,16 @@ use App\Models\Equipment\ServerModel;
class ServerHelper extends EquipmentHelper class ServerHelper extends EquipmentHelper
{ {
private ?ServerPartHelper $_serverPartHelper = null;
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->setTitleField(field: ServerModel::TITLE); $this->setTitleField(field: ServerModel::TITLE);
$this->_serverPartHelper = new ServerPartHelper();
}
private function getServerPartHelper(): ServerPartHelper
{
return $this->_serverPartHelper;
} }
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
{ {
@ -18,38 +24,20 @@ class ServerHelper extends EquipmentHelper
// $extras['readonly'] = in_array($viewDatas['control']['action'], ['modify_form']) ? ' readonly' : ''; // $extras['readonly'] = in_array($viewDatas['control']['action'], ['modify_form']) ? ' readonly' : '';
$form = parent::getFieldForm($field, $value, $viewDatas, $extras); $form = parent::getFieldForm($field, $value, $viewDatas, $extras);
break; break;
case 'switchinfo_uid':
if (array_key_exists('entity', $viewDatas)) {
$value = $viewDatas['entity']->getSwitchEntity() !== null ? $viewDatas['entity']->getSwitchEntity()->getPK() : $value;
}
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
break;
case 'ipinfo_uid':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = "";
if (array_key_exists('entity', $viewDatas)) {
foreach ($viewDatas['entity']->getIPEntities() as $ipEntity) {
$form .= "<div>" . $this->form_dropdown_custom($field, $ipEntity->getPK(), $viewDatas, $extras) . "</div>";
}
}
$form .= $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
break;
case 'csinfo_uid':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = "";
if (array_key_exists('entity', $viewDatas)) {
foreach ($viewDatas['entity']->getCSEntities() as $csEntity) {
$form .= "<div>" . $this->form_dropdown_custom($field, $csEntity->getPK(), $viewDatas, $extras) . "</div>";
}
}
$form .= $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
break;
case 'manufactur_at': case 'manufactur_at':
case 'format_at': case 'format_at':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' calender' : 'calender'; $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' calender' : 'calender';
$form = form_input($field, $value ?? "", $extras); $form = form_input($field, $value ?? "", $extras);
break; break;
case 'CPU':
case 'CPU_cnt':
case 'RAM':
case 'RAM_cnt':
case 'DISK':
case 'DISK_cnt':
case 'DISK_extra':
$form = $this->getServerPartHelper()->getFieldForm($field, $value, $viewDatas, $extras);
break;
default: default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras); $form = parent::getFieldForm($field, $value, $viewDatas, $extras);
break; break;

View File

@ -2,6 +2,7 @@
namespace App\Helpers\Equipment; namespace App\Helpers\Equipment;
use App\Entities\FormOptionEntity;
use App\Models\Equipment\ServerPartModel; use App\Models\Equipment\ServerPartModel;
class ServerPartHelper extends EquipmentHelper class ServerPartHelper extends EquipmentHelper
@ -30,44 +31,54 @@ class ServerPartHelper extends EquipmentHelper
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
{ {
switch ($field) { switch ($field) {
case 'CPU': case 'SWITCH':
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'CPU'); if (array_key_exists('entity', $viewDatas)) {
break; $value = $viewDatas['entity']->getSwitchEntity() !== null ? $viewDatas['entity']->getSwitchEntity()->getPK() : $value;
case 'CPU_cnt': }
$form = form_dropdown($field, SERVERPART['CNT_RANGE'], $value, $extras) . ""; $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
break;
case 'RAM':
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'RAM',);
break;
case 'RAM_cnt':
$form = form_dropdown($field, SERVERPART['CNT_RANGE'], $value, $extras) . "";
break;
case 'DISK':
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'DISK');
break;
case 'DISK_cnt':
$form = form_dropdown($field, SERVERPART['CNT_RANGE'], $value, $extras) . "";
break;
case 'DISK_extra':
$form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras); $form = $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
break; break;
case 'OS': case 'IP':
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'OS'); $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = "";
if (array_key_exists('entity', $viewDatas)) {
foreach ($viewDatas['entity']->getIPEntities() as $ipEntity) {
$form .= "<div>" . $this->form_dropdown_custom($field, $ipEntity->getPK(), $viewDatas, $extras) . "</div>";
}
}
$form .= $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
break; break;
case 'OS_cnt': case 'CS':
$form = form_dropdown($field, SERVERPART['CNT_RANGE'], $value, $extras) . ""; $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = "";
if (array_key_exists('entity', $viewDatas)) {
foreach ($viewDatas['entity']->getCSEntities() as $csEntity) {
$form .= "<div>" . $this->form_dropdown_custom($field, $csEntity->getPK(), $viewDatas, $extras) . "</div>";
}
}
$form .= $this->form_dropdown_custom($field, $value, $viewDatas, $extras);
break; break;
case 'CPU':
case 'RAM':
case 'DISK':
case 'DB': case 'DB':
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'DB'); case 'OS':
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, $field);
break; break;
case 'CPU_cnt':
case 'RAM_cnt':
case 'DISK_cnt':
case 'DB_cnt': case 'DB_cnt':
$form = form_dropdown($field, SERVERPART['CNT_RANGE'], $value, $extras) . ""; case 'OS_cnt':
$form = "*" . form_dropdown($field, SERVERPART['CNT_RANGE'], $value, $extras) . "";
break; break;
case 'SOFTWARE': case 'DISK_extra':
$form = $this->getServerPartForm($field, $value, $viewDatas, $extras, 'SOFTWARE'); $formOptionDatas = lang("Equipment/ServerPart.EXTRA");
break; if (!is_array($formOptionDatas)) {
case 'SOFTWARE_cnt': throw new \Exception(__FUNCTION__ . "에서 {$field}}의 formOptionDatas 값이 array가 아닙니다.\n" . var_export($formOptionDatas, true));
$form = form_dropdown($field, SERVERPART['CNT_RANGE'], $value, $extras) . ""; }
$options = ["" => lang("Equipment/ServerPart.label.extra") . " 선택", ...$formOptionDatas];
$form = form_dropdown($field, $options, $value, $extras);
break; break;
default: default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras); $form = parent::getFieldForm($field, $value, $viewDatas, $extras);
@ -79,6 +90,9 @@ class ServerPartHelper extends EquipmentHelper
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
{ {
switch ($field) { switch ($field) {
case 'SWITCH':
case 'IP':
case 'CS':
case 'CPU': case 'CPU':
case 'RAM': case 'RAM':
case 'DISK': case 'DISK':
@ -86,12 +100,12 @@ class ServerPartHelper extends EquipmentHelper
case 'DB': case 'DB':
case 'SOFTWARE': case 'SOFTWARE':
$temps = []; $temps = [];
foreach ($viewDatas['entity']->getServerPartEntities($field) as $serverPartEntity) { foreach ($viewDatas['entity']->getServerPartEntities($field) as $partEntity) {
$modal = form_label( $modal = form_label(
ICONS['SETUP'], ICONS['SETUP'],
$field, $field,
[ [
"data-src" => "/admin/equipment/serverpart/modify/{$serverPartEntity->getPK()}?ActionTemplate=popup", "data-src" => "/admin/equipment/serverpart/modify/{$partEntity->getPK()}?ActionTemplate=popup",
"data-bs-toggle" => "modal", "data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form", "data-bs-target" => "#index_action_form",
"class" => "btn btn-sm btn-outline btn-circle", "class" => "btn btn-sm btn-outline btn-circle",
@ -101,9 +115,9 @@ class ServerPartHelper extends EquipmentHelper
$temps[] = sprintf( $temps[] = sprintf(
"%s%s%s %s", "%s%s%s %s",
$modal, $modal,
$serverPartEntity->getTitle(), $partEntity->getTitle(),
$serverPartEntity->getCnt() >= 1 ? "*" . $serverPartEntity->getCnt() . "" : "", $partEntity->getCnt() >= 1 ? "*" . $partEntity->getCnt() . "" : "",
$serverPartEntity->getExtra() ?? "" $partEntity->getExtra() ?? ""
); );
} }
$value .= implode("<BR>", $temps); $value .= implode("<BR>", $temps);
@ -121,6 +135,9 @@ class ServerPartHelper extends EquipmentHelper
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
{ {
switch ($action) { switch ($action) {
case 'SWITCH':
case 'IP':
case 'CS':
case 'CPU': case 'CPU':
case 'RAM': case 'RAM':
case 'DISK': case 'DISK':

View File

@ -23,14 +23,10 @@ return [
'RAM' => "RAM", 'RAM' => "RAM",
'RAM_cnt' => "RAM갯수", 'RAM_cnt' => "RAM갯수",
'DISK' => "DISK", 'DISK' => "DISK",
'DISK_cnt' => "DISK갯수",
'DISK_extra' => "RAID설정", 'DISK_extra' => "RAID설정",
'OS' => "OS", 'OS' => "OS",
'OS_cnt' => "OS갯수",
'DB' => "DB", 'DB' => "DB",
'DB_cnt' => "DB갯수",
'SOFTWARE' => "기타SW", 'SOFTWARE' => "기타SW",
'SOFTWARE_cnt' => "SOFTWARE갯수",
], ],
"TITLE" => [ "TITLE" => [
'HP DL360 Gen6' => "HP DL360 Gen6", 'HP DL360 Gen6' => "HP DL360 Gen6",
@ -50,11 +46,4 @@ return [
STATUS['OCCUPIED'] => "서비스중", STATUS['OCCUPIED'] => "서비스중",
STATUS['FORBIDDEN'] => "사용불가", STATUS['FORBIDDEN'] => "사용불가",
], ],
"DISK_EXTRA" => [
'RAID0' => "RAID0",
'RAID1' => "RAID1",
'RAID5' => "RAID5",
'RAID6' => "RAID6",
'RAID10' => "RAID10",
],
]; ];

View File

@ -152,7 +152,7 @@ abstract class CommonModel extends Model
$field, $field,
$formDatas $formDatas
); );
if ($value !== null) { if ($value !== '' && $value !== null) {
$convertedFormDatas[$field] = $value; $convertedFormDatas[$field] = $value;
} }
} }

View File

@ -2,12 +2,8 @@
namespace App\Services\Equipment; namespace App\Services\Equipment;
use App\Entities\Customer\ServiceEntity;
use App\Entities\Equipment\CSEntity;
use App\Entities\Equipment\IPEntity;
use App\Entities\Equipment\ServerEntity; use App\Entities\Equipment\ServerEntity;
use App\Entities\Equipment\ServerPartEntity; use App\Entities\Equipment\ServerPartEntity;
use App\Entities\Equipment\SwitchEntity;
use App\Helpers\Equipment\ServerPartHelper; use App\Helpers\Equipment\ServerPartHelper;
use App\Models\Equipment\ServerPartModel; use App\Models\Equipment\ServerPartModel;
use App\Services\Equipment\EquipmentService; use App\Services\Equipment\EquipmentService;
@ -46,7 +42,7 @@ class ServerPartService extends EquipmentService
} }
public function getBatchjobFields(): array public function getBatchjobFields(): array
{ {
return ['billing', 'type', 'partinfo_uid']; return ['billing', 'type'];
} }
final public function getSwitchService(): SwitchService final public function getSwitchService(): SwitchService
{ {
@ -79,8 +75,7 @@ class ServerPartService extends EquipmentService
//partEntity 정보 추가 //partEntity 정보 추가
protected function getEntity_process(mixed $entity): ServerPartEntity protected function getEntity_process(mixed $entity): ServerPartEntity
{ {
//부품정보 정의 $partEntity = $this->getPartService()->getEntity($entity->getPartUID());
$partEntity = $this->getPartService()->getEntity($entity->getPartInfoUID());
if ($entity) { if ($entity) {
$entity->setPartEntity($partEntity); $entity->setPartEntity($partEntity);
} }
@ -91,6 +86,9 @@ class ServerPartService extends EquipmentService
public function getFormOption(string $field, array $options = []): array public function getFormOption(string $field, array $options = []): array
{ {
switch ($field) { switch ($field) {
case 'part_uid':
$options = $this->getPartService()->getEntities();
break;
case 'SWITCH': case 'SWITCH':
$options = $this->getSwitchService()->getEntities(); $options = $this->getSwitchService()->getEntities();
break; break;
@ -118,6 +116,12 @@ class ServerPartService extends EquipmentService
case 'CS': case 'CS':
$options = $this->getCSService()->getEntities(); $options = $this->getCSService()->getEntities();
break; break;
default:
$options = parent::getFormOption($field, $options);
break;
}
if (!is_array($options)) {
throw new \Exception(__FUNCTION__ . "에서 {$field}의 options 값이 array가 아닙니다.\n" . var_export($options, true));
} }
return $options; return $options;
} }
@ -155,7 +159,12 @@ class ServerPartService extends EquipmentService
if (!$partEntity) { if (!$partEntity) {
throw new \Exception(__METHOD__ . "에서 오류:{$partType}{$entity->getPartUID()}에 해닫하는 정보가 없습니다."); throw new \Exception(__METHOD__ . "에서 오류:{$partType}{$entity->getPartUID()}에 해닫하는 정보가 없습니다.");
} }
$serverEntity->addServerPartEntity($partType, $partEntity); $partService->modify($partEntity, [
'serverinfo_uid' => $serverEntity->getPK(),
'serviceinfo_uid' => $serverEntity->getServiceInfoUID(),
]);
$entity->setPartEntity($partEntity);
$serverEntity->addServerPartEntity($partType, $entity);
} }
} }
return $serverEntity; return $serverEntity;
@ -233,7 +242,7 @@ class ServerPartService extends EquipmentService
$entity->setPartEntity($partEntity); $entity->setPartEntity($partEntity);
return $entity; return $entity;
} }
public function show(int $serverinfo_uid): string public function show(mixed $serverinfo_uid): string
{ {
//서버파트연결용 //서버파트연결용
$viewDatas = [ $viewDatas = [
@ -250,6 +259,6 @@ class ServerPartService extends EquipmentService
$viewDatas['action'] = __FUNCTION__; $viewDatas['action'] = __FUNCTION__;
//기존 Entity 가져오기 //기존 Entity 가져오기
$viewDatas['entities'] = $this->getEntities(['serverinfo_uid' => $serverinfo_uid]); $viewDatas['entities'] = $this->getEntities(['serverinfo_uid' => $serverinfo_uid]);
return view('serverpart/' . __FUNCTION__, ['viewDatas' => $viewDatas]); return view('admin/serverpart/' . __FUNCTION__, ['viewDatas' => $viewDatas]);
} }
} }

View File

@ -27,12 +27,8 @@ class ServerService extends EquipmentService
"format_at", "format_at",
"status", "status",
"CPU", "CPU",
"CPU_cnt",
"RAM", "RAM",
"RAM_cnt",
"DISK", "DISK",
"DISK_cnt",
"DISK_extra",
]; ];
} }
public function getFormFilters(): array public function getFormFilters(): array
@ -45,7 +41,6 @@ class ServerService extends EquipmentService
"CPU", "CPU",
"RAM", "RAM",
"DISK", "DISK",
"DISK_extra",
"status" "status"
]; ];
} }
@ -96,6 +91,29 @@ class ServerService extends EquipmentService
} }
//기본 기능부분 //기본 기능부분
//FieldForm관련용 //FieldForm관련용
public function getFormOption(string $field, array $options = []): array
{
switch ($field) {
case 'SWITCH':
case 'IP':
case 'CS':
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
$options = $this->getServerPartService()->getFormOption($field, $options);
break;
default:
$options = parent::getFormOption($field, $options);
break;
}
if (!is_array($options)) {
throw new \Exception(__FUNCTION__ . "에서 {$field}의 options 값이 array가 아닙니다.\n" . var_export($options, true));
}
return $options;
}
//create용 장비코드 마지막번호 가져오기 //create용 장비코드 마지막번호 가져오기
final public function getLastestCode(string $format, int $default): string final public function getLastestCode(string $format, int $default): string
{ {

View File

@ -17,7 +17,7 @@
<?php foreach (["code", "type", "title", "price", "amount", "manufactur_at", "format_at", "status",] as $field): ?> <?php foreach (["code", "type", "title", "price", "amount", "manufactur_at", "format_at", "status",] as $field): ?>
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"> <td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['form_datas'][$field] ?? null), $viewDatas) ?> <?= $viewDatas['helper']->getFieldForm($field, old($field, $viewDatas['control']['form_datas'][$field] ?? null), $viewDatas) ?>
<span><?= validation_show_error($field); ?></span> <span><?= validation_show_error($field); ?></span>
</td> </td>
</tr> </tr>
@ -26,15 +26,16 @@
</td> </td>
<td> <td>
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach (SERVERPART['PARTTYPES'] as $partType): ?> <?php foreach (['CPU', 'RAM', 'DISK'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel("{$partType}", lang("{$viewDatas['class_path']}.label.{$partType}"), $viewDatas) ?></th> <th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"> <td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm("{$partType}", old("{$partType}") ?? ($viewDatas['control']['form_datas']["{$partType}"] ?? null), $viewDatas) ?> <?= $viewDatas['helper']->getFieldForm($field, old($field, $viewDatas['control']['form_datas'][$field] ?? null), $viewDatas) ?>
<?= $viewDatas['helper']->getFieldForm("{$partType}_cnt", old("{$partType}_cnt") ?? ($viewDatas['control']['form_datas']["{$partType}_cnt"] ?? null), $viewDatas) ?> <?= $viewDatas['helper']->getFieldForm("{$field}_cnt", old("{$field}_cnt", $viewDatas['control']['form_datas']["{$field}_cnt"] ?? 1), $viewDatas) ?>
<?php if ($partType == 'DISK'): ?> <?php if ($field === 'DISK'): ?>
<?= $viewDatas['helper']->getFieldForm("{$partType}_extra", old("{$partType}_extra") ?? ($viewDatas['control']['form_datas']["{$partType}_extra"] ?? null), $viewDatas) ?> <?= $viewDatas['helper']->getFieldForm("{$field}_extra", old("{$field}_extra", $viewDatas['control']['form_datas']["{$field}_extra"] ?? null), $viewDatas) ?>
<?php endif ?> <?php endif ?>
<span><?= validation_show_error($field); ?></span>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -69,16 +69,13 @@
</td> </td>
<td><?= $viewDatas['helper']->getFieldView('status', $entity->status, $viewDatas) ?></td> <td><?= $viewDatas['helper']->getFieldView('status', $entity->status, $viewDatas) ?></td>
<td nowrap> <td nowrap>
<?= view_cell('\App\Services\ServerPartService::show', ['serverinfo_uid' => $entity->getPK()]) ?>
<table class="table table-bordered table-striped m-0 p-0"> <table class="table table-bordered table-striped m-0 p-0">
<tr class="m-0 p-0"> <?php foreach (SERVERPART['PARTTYPES'] as $partType): ?>
<th class="m-0 p-0">IP</th> <tr class="m-0 p-0">
<td class="m-0 p-0"><?= $viewDatas['helper']->getFieldView("ipinfo_uid", "", $viewDatas) ?></td> <th class="text-end m-0 p-0"><?= $viewDatas['serverPartHelper']->getListButton($partType, $partType, $viewDatas) ?></th>
</tr> <td class="text-start m-0 p-0"><?= $viewDatas['serverPartHelper']->getFieldView($partType, "", $viewDatas) ?></td>
<tr class="m-0 p-0"> </tr>
<th class="m-0 p-0">CS</th> <?php endforeach ?>
<td class="m-0 p-0"><?= $viewDatas['helper']->getFieldView("csinfo_uid", "", $viewDatas) ?></td>
</tr>
</table> </table>
</td> </td>
<td nowrap> <td nowrap>

View File

@ -1,8 +0,0 @@
<table class="table table-bordered table-striped m-0 p-0">
<?php foreach (SERVERPART['PARTTYPES'] as $partType): ?>
<tr class="m-0 p-0">
<th class="text-end m-0 p-0"><?= $viewDatas['helper']->getListButton($partType, $partType, $viewDatas) ?></th>
<td class="text-start m-0 p-0"><?= $viewDatas['helper']->getFieldView($partType, "", $viewDatas) ?></td>
</tr>
<?php endforeach ?>
</table>