dbmsv3 init...1
This commit is contained in:
parent
c7168eac48
commit
915f8a0bc1
@ -417,8 +417,8 @@ define("SERVICE", [
|
|||||||
define("SERVERPART", [
|
define("SERVERPART", [
|
||||||
"CNT_RANGE" => array_combine(range(1, 10), range(1, 10)),
|
"CNT_RANGE" => array_combine(range(1, 10), range(1, 10)),
|
||||||
"SERVER_PARTTYPES" => ['CPU', 'RAM', 'DISK'],
|
"SERVER_PARTTYPES" => ['CPU', 'RAM', 'DISK'],
|
||||||
"SERVICE_PARTTYPES" => ['OS', 'SOFTWARE', 'CS', 'IP'],
|
"SERVICE_PARTTYPES" => ['SOFTWARE', 'CS', 'IP'],
|
||||||
"ALL_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'OS', 'SOFTWARE', 'IP', 'CS'],
|
"ALL_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'SOFTWARE', 'IP', 'CS'],
|
||||||
"CPU" => [
|
"CPU" => [
|
||||||
"ATYPE" => [["UID" => 1, "CNT" => 1, "EXTRA" => ""]],
|
"ATYPE" => [["UID" => 1, "CNT" => 1, "EXTRA" => ""]],
|
||||||
"BTYPE" => [["UID" => 2, "CNT" => 1, "EXTRA" => ""]],
|
"BTYPE" => [["UID" => 2, "CNT" => 1, "EXTRA" => ""]],
|
||||||
|
|||||||
@ -273,19 +273,6 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
|
|||||||
$routes->get('download/(:alpha)', 'DISKController::download/$1');
|
$routes->get('download/(:alpha)', 'DISKController::download/$1');
|
||||||
$routes->get('complete/(:num)', 'DISKController::complete/$1');
|
$routes->get('complete/(:num)', 'DISKController::complete/$1');
|
||||||
});
|
});
|
||||||
$routes->group('os', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
|
||||||
$routes->get('/', 'OSController::index');
|
|
||||||
$routes->get('create', 'OSController::create_form');
|
|
||||||
$routes->post('create', 'OSController::create');
|
|
||||||
$routes->get('modify/(:num)', 'OSController::modify_form/$1');
|
|
||||||
$routes->post('modify/(:num)', 'OSController::modify/$1');
|
|
||||||
$routes->get('view/(:num)', 'OSController::view/$1');
|
|
||||||
$routes->get('delete/(:num)', 'OSController::delete/$1');
|
|
||||||
$routes->get('toggle/(:num)/(:any)', 'OSController::toggle/$1/$2');
|
|
||||||
$routes->post('batchjob', 'OSController::batchjob');
|
|
||||||
$routes->post('batchjob_delete', 'OSController::batchjob_delete');
|
|
||||||
$routes->get('download/(:alpha)', 'OSController::download/$1');
|
|
||||||
});
|
|
||||||
$routes->group('software', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
$routes->group('software', ['namespace' => 'App\Controllers\Admin\Part'], function ($routes) {
|
||||||
$routes->get('/', 'SOFTWAREController::index');
|
$routes->get('/', 'SOFTWAREController::index');
|
||||||
$routes->get('create', 'SOFTWAREController::create_form');
|
$routes->get('create', 'SOFTWAREController::create_form');
|
||||||
|
|||||||
@ -5,16 +5,11 @@ namespace App\Controllers\Admin\Equipment;
|
|||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
|
||||||
use App\Services\Equipment\LineService;
|
use App\Services\Equipment\LineService;
|
||||||
use App\Services\Equipment\IPService;
|
|
||||||
use App\Helpers\Equipment\LineHelper;
|
|
||||||
use App\Entities\Equipment\LineEntity;
|
use App\Entities\Equipment\LineEntity;
|
||||||
use App\Entities\Equipment\IPEntity;
|
|
||||||
|
|
||||||
class LineController extends EquipmentController
|
class LineController extends EquipmentController
|
||||||
{
|
{
|
||||||
private ?IpService $_ipService = null;
|
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
@ -31,13 +26,6 @@ class LineController extends EquipmentController
|
|||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
final public function getIPService(): IpService
|
|
||||||
{
|
|
||||||
if (!$this->_ipService) {
|
|
||||||
$this->_ipService = new IpService();
|
|
||||||
}
|
|
||||||
return $this->_ipService;
|
|
||||||
}
|
|
||||||
//Index,FieldForm관련
|
//Index,FieldForm관련
|
||||||
|
|
||||||
//생성
|
//생성
|
||||||
@ -47,16 +35,6 @@ class LineController extends EquipmentController
|
|||||||
if (!$this->getService()->getHelper()->isValidCIDR($formDatas['bandwith'])) {
|
if (!$this->getService()->getHelper()->isValidCIDR($formDatas['bandwith'])) {
|
||||||
throw new \Exception("{$formDatas['bandwith']}는 CIDR 형식에 부합되지 않습니다.");
|
throw new \Exception("{$formDatas['bandwith']}는 CIDR 형식에 부합되지 않습니다.");
|
||||||
}
|
}
|
||||||
//부모처리
|
return parent::create_process($formDatas);
|
||||||
$entity = parent::create_process($formDatas);
|
|
||||||
//Prefixed IP to array 자동 등록
|
|
||||||
foreach ($this->getService()->getHelper()->cidrToIpRange($formDatas['bandwith']) as $ip) {
|
|
||||||
$this->getIPService()->create([
|
|
||||||
'lineinfo_uid' => $entity->getPK(),
|
|
||||||
'ip' => $ip,
|
|
||||||
'status' => IPEntity::DEFAULT_STATUS,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
return $entity;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Admin\Part;
|
|
||||||
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
|
|
||||||
use App\Services\Part\OSService;
|
|
||||||
|
|
||||||
class OSController extends PartController
|
|
||||||
{
|
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
||||||
{
|
|
||||||
parent::initController($request, $response, $logger);
|
|
||||||
$this->content_title = lang("{$this->getService()->getClassName()}.title");
|
|
||||||
$this->class_path .= $this->getService()->getClassName();
|
|
||||||
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
|
|
||||||
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
|
|
||||||
|
|
||||||
}
|
|
||||||
public function getService(): OSService
|
|
||||||
{
|
|
||||||
if (!$this->_service) {
|
|
||||||
$this->_service = new OSService();
|
|
||||||
}
|
|
||||||
return $this->_service;
|
|
||||||
}
|
|
||||||
//Index,FieldForm관
|
|
||||||
}
|
|
||||||
@ -4,8 +4,8 @@
|
|||||||
"settings": {
|
"settings": {
|
||||||
"width": 3000,
|
"width": 3000,
|
||||||
"height": 3000,
|
"height": 3000,
|
||||||
"scrollTop": -638.7873,
|
"scrollTop": -1890.7873,
|
||||||
"scrollLeft": -730,
|
"scrollLeft": -626,
|
||||||
"zoomLevel": 0.79,
|
"zoomLevel": 0.79,
|
||||||
"show": 511,
|
"show": 511,
|
||||||
"database": 4,
|
"database": 4,
|
||||||
@ -48,8 +48,7 @@
|
|||||||
"PdXX5ghGi8ZK89G9OjtnQ",
|
"PdXX5ghGi8ZK89G9OjtnQ",
|
||||||
"VN2Issjy8MFts5mr8-_9S",
|
"VN2Issjy8MFts5mr8-_9S",
|
||||||
"0SUAXsejoiaHZwmW8msS3",
|
"0SUAXsejoiaHZwmW8msS3",
|
||||||
"6lQ2M_5glzZEDHxKHx83G",
|
"6lQ2M_5glzZEDHxKHx83G"
|
||||||
"FfKKPJaDUSq_L0PzVw0qB"
|
|
||||||
],
|
],
|
||||||
"relationshipIds": [
|
"relationshipIds": [
|
||||||
"AH1dyESfueUlhcoiU6KsQ",
|
"AH1dyESfueUlhcoiU6KsQ",
|
||||||
@ -259,6 +258,7 @@
|
|||||||
"I8DumSwkLWz-Ve5_vc0uE",
|
"I8DumSwkLWz-Ve5_vc0uE",
|
||||||
"4t01_53QawHcw0lfY4zDm",
|
"4t01_53QawHcw0lfY4zDm",
|
||||||
"jnDePNx6_yIPBt4qYZguP",
|
"jnDePNx6_yIPBt4qYZguP",
|
||||||
|
"UYIPZF2zMJcIZoTNYWUTH",
|
||||||
"9F6QpQqxeEggZ0FHM81O1",
|
"9F6QpQqxeEggZ0FHM81O1",
|
||||||
"tsDqk1dzwzUtvBzpjmarJ",
|
"tsDqk1dzwzUtvBzpjmarJ",
|
||||||
"hmZlcR-Pw2C_ife1zzo5o",
|
"hmZlcR-Pw2C_ife1zzo5o",
|
||||||
@ -295,6 +295,7 @@
|
|||||||
"m77kSp3scTgMhInPBjsc3",
|
"m77kSp3scTgMhInPBjsc3",
|
||||||
"4t01_53QawHcw0lfY4zDm",
|
"4t01_53QawHcw0lfY4zDm",
|
||||||
"jnDePNx6_yIPBt4qYZguP",
|
"jnDePNx6_yIPBt4qYZguP",
|
||||||
|
"UYIPZF2zMJcIZoTNYWUTH",
|
||||||
"9F6QpQqxeEggZ0FHM81O1",
|
"9F6QpQqxeEggZ0FHM81O1",
|
||||||
"EKrwHre6e66jqAMnAW_KR",
|
"EKrwHre6e66jqAMnAW_KR",
|
||||||
"Z2CriPHsk4OV0AD1jAhM4",
|
"Z2CriPHsk4OV0AD1jAhM4",
|
||||||
@ -342,7 +343,7 @@
|
|||||||
"color": ""
|
"color": ""
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"updateAt": 1760509478899,
|
"updateAt": 1760573684145,
|
||||||
"createAt": 1745819764137
|
"createAt": 1745819764137
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1043,15 +1044,15 @@
|
|||||||
"LrJ1wi95G76oooLA-9Etg"
|
"LrJ1wi95G76oooLA-9Etg"
|
||||||
],
|
],
|
||||||
"ui": {
|
"ui": {
|
||||||
"x": 630.3799,
|
"x": 91.1394,
|
||||||
"y": 2273.1488,
|
"y": 2607.3257,
|
||||||
"zIndex": 5380,
|
"zIndex": 5380,
|
||||||
"widthName": 60,
|
"widthName": 60,
|
||||||
"widthComment": 60,
|
"widthComment": 60,
|
||||||
"color": ""
|
"color": ""
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"updateAt": 1758849634812,
|
"updateAt": 1760573618223,
|
||||||
"createAt": 1758759596462
|
"createAt": 1758759596462
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1081,15 +1082,15 @@
|
|||||||
"GpF8nYONyRFaSexZvhzu5"
|
"GpF8nYONyRFaSexZvhzu5"
|
||||||
],
|
],
|
||||||
"ui": {
|
"ui": {
|
||||||
"x": 102.5318,
|
"x": 620.2533,
|
||||||
"y": 2583.2749,
|
"y": 2311.123,
|
||||||
"zIndex": 5387,
|
"zIndex": 5387,
|
||||||
"widthName": 68,
|
"widthName": 68,
|
||||||
"widthComment": 86,
|
"widthComment": 86,
|
||||||
"color": ""
|
"color": ""
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"updateAt": 1758762821105,
|
"updateAt": 1760573623206,
|
||||||
"createAt": 1758759637696
|
"createAt": 1758759637696
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -9633,6 +9634,26 @@
|
|||||||
"updateAt": 1760509585504,
|
"updateAt": 1760509585504,
|
||||||
"createAt": 1760509585503
|
"createAt": 1760509585503
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"UYIPZF2zMJcIZoTNYWUTH": {
|
||||||
|
"id": "UYIPZF2zMJcIZoTNYWUTH",
|
||||||
|
"tableId": "B4qGh3KZsXHQ3_4EOgwJZ",
|
||||||
|
"name": "os",
|
||||||
|
"comment": "",
|
||||||
|
"dataType": "VARCHAR(30)",
|
||||||
|
"default": "",
|
||||||
|
"options": 0,
|
||||||
|
"ui": {
|
||||||
|
"keys": 0,
|
||||||
|
"widthName": 60,
|
||||||
|
"widthComment": 60,
|
||||||
|
"widthDataType": 75,
|
||||||
|
"widthDefault": 60
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"updateAt": 1760573707223,
|
||||||
|
"createAt": 1760573680816
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relationshipEntities": {
|
"relationshipEntities": {
|
||||||
@ -10067,7 +10088,7 @@
|
|||||||
"RITMHZcQAJ7KvtxkTtMv-"
|
"RITMHZcQAJ7KvtxkTtMv-"
|
||||||
],
|
],
|
||||||
"x": 1746.7498,
|
"x": 1746.7498,
|
||||||
"y": 2092.4788,
|
"y": 2107.4788,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
@ -10104,7 +10125,7 @@
|
|||||||
"4iRyOhmW3b7kbiZT8lQyY"
|
"4iRyOhmW3b7kbiZT8lQyY"
|
||||||
],
|
],
|
||||||
"x": 1746.7498,
|
"x": 1746.7498,
|
||||||
"y": 1884.4788,
|
"y": 1887.4788,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
@ -10179,7 +10200,7 @@
|
|||||||
"RITMHZcQAJ7KvtxkTtMv-"
|
"RITMHZcQAJ7KvtxkTtMv-"
|
||||||
],
|
],
|
||||||
"x": 1086.7498,
|
"x": 1086.7498,
|
||||||
"y": 2040.4788,
|
"y": 2052.4788,
|
||||||
"direction": 1
|
"direction": 1
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
@ -10207,7 +10228,7 @@
|
|||||||
"RITMHZcQAJ7KvtxkTtMv-"
|
"RITMHZcQAJ7KvtxkTtMv-"
|
||||||
],
|
],
|
||||||
"x": 1746.7498,
|
"x": 1746.7498,
|
||||||
"y": 2196.4788,
|
"y": 2217.4788,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
@ -10515,7 +10536,7 @@
|
|||||||
"RITMHZcQAJ7KvtxkTtMv-"
|
"RITMHZcQAJ7KvtxkTtMv-"
|
||||||
],
|
],
|
||||||
"x": 1746.7498,
|
"x": 1746.7498,
|
||||||
"y": 1988.4788,
|
"y": 1997.4788,
|
||||||
"direction": 2
|
"direction": 2
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -42,4 +42,8 @@ class ServerEntity extends EquipmentEntity
|
|||||||
{
|
{
|
||||||
return $this->attributes['ip'] ?? null;
|
return $this->attributes['ip'] ?? null;
|
||||||
}
|
}
|
||||||
|
public function getOS(): string|null
|
||||||
|
{
|
||||||
|
return $this->attributes['os'] ?? null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Entities\Part;
|
|
||||||
|
|
||||||
use App\Models\Part\OSModel;
|
|
||||||
|
|
||||||
class OSEntity extends PartEntity
|
|
||||||
{
|
|
||||||
const PK = OSModel::PK;
|
|
||||||
const TITLE = OSModel::TITLE;
|
|
||||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
|
||||||
//기본기능
|
|
||||||
final public function getStock(): int
|
|
||||||
{
|
|
||||||
return $this->attributes['stock'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -78,11 +78,12 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
$value = $viewDatas['serviceinfo_serverinfo_uid'] == $viewDatas['serverEntity']->getPK() ? "📌" : "<a href=\"/admin/customer/service/changeServer/{$viewDatas['serverEntity']->getServiceInfoUID()}?serverinfo_uid={$viewDatas['serverEntity']->getPK()}\">✔️</a>";
|
$value = $viewDatas['serviceinfo_serverinfo_uid'] == $viewDatas['serverEntity']->getPK() ? "📌" : "<a href=\"/admin/customer/service/changeServer/{$viewDatas['serverEntity']->getServiceInfoUID()}?serverinfo_uid={$viewDatas['serverEntity']->getPK()}\">✔️</a>";
|
||||||
$value .= form_label(
|
$value .= form_label(
|
||||||
sprintf(
|
sprintf(
|
||||||
"[%s] %s / %s / %s",
|
"[%s] %s/%s/%s/%s",
|
||||||
lang("Equipment/Server.TYPE")[$viewDatas['serverEntity']->getType()],
|
lang("Equipment/Server.TYPE")[$viewDatas['serverEntity']->getType()],
|
||||||
$viewDatas['serverEntity']->getCode(),
|
$viewDatas['serverEntity']->getCode(),
|
||||||
$viewDatas['serverEntity']->getIP(),
|
$viewDatas['serverEntity']->getIP(),
|
||||||
$viewDatas['serverEntity']->getSwitch()
|
$viewDatas['serverEntity']->getSwitch(),
|
||||||
|
$viewDatas['serverEntity']->getOS()
|
||||||
),
|
),
|
||||||
$field,
|
$field,
|
||||||
[
|
[
|
||||||
@ -97,9 +98,7 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
case 'CPU':
|
case 'CPU':
|
||||||
case 'RAM':
|
case 'RAM':
|
||||||
case 'DISK':
|
case 'DISK':
|
||||||
case 'OS':
|
|
||||||
case 'SOFTWARE':
|
case 'SOFTWARE':
|
||||||
case 'SWITCH':
|
|
||||||
case 'IP':
|
case 'IP':
|
||||||
case 'CS':
|
case 'CS':
|
||||||
//파트 Entity
|
//파트 Entity
|
||||||
@ -135,13 +134,11 @@ 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 'IP':
|
||||||
case 'CS':
|
case 'CS':
|
||||||
case 'CPU':
|
case 'CPU':
|
||||||
case 'RAM':
|
case 'RAM':
|
||||||
case 'DISK':
|
case 'DISK':
|
||||||
case 'OS':
|
|
||||||
case 'SOFTWARE':
|
case 'SOFTWARE':
|
||||||
$extras = [
|
$extras = [
|
||||||
"class" => "btn btn-sm btn-outline btn-circle btn-link form-label-sm",
|
"class" => "btn btn-sm btn-outline btn-circle btn-link form-label-sm",
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Helpers\Part;
|
|
||||||
|
|
||||||
use App\Models\Part\OSModel;
|
|
||||||
|
|
||||||
class OSHelper extends PartHelper
|
|
||||||
{
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
$this->setTitleField(field: OSModel::TITLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -7,7 +7,8 @@ return [
|
|||||||
'code' => "장비번호",
|
'code' => "장비번호",
|
||||||
'type' => "형식",
|
'type' => "형식",
|
||||||
'switch' => "스위치",
|
'switch' => "스위치",
|
||||||
'ip' => "메인IP",
|
'ip' => "IP",
|
||||||
|
'os' => "OS",
|
||||||
'title' => "모델명",
|
'title' => "모델명",
|
||||||
'price' => "기본가",
|
'price' => "기본가",
|
||||||
'manufactur_at' => "입고일",
|
'manufactur_at' => "입고일",
|
||||||
@ -49,4 +50,26 @@ return [
|
|||||||
STATUS['TERMINATED'] => "서비스해지",
|
STATUS['TERMINATED'] => "서비스해지",
|
||||||
STATUS['FORBIDDEN'] => "사용불가",
|
STATUS['FORBIDDEN'] => "사용불가",
|
||||||
],
|
],
|
||||||
|
"OS" => [
|
||||||
|
"CENTOS7" => "CentOS7",
|
||||||
|
"CENTOS8" => "CentOS8",
|
||||||
|
"CENTOS9" => "CentOS9",
|
||||||
|
"CENTOS10" => "CentOS10",
|
||||||
|
"UBUNTU20.04" => "Ubuntu20.04",
|
||||||
|
"UBUNTU22.04" => "Ubuntu22.04",
|
||||||
|
"UBUNTU23.04" => "Ubuntu23.04",
|
||||||
|
"UBUNTU24.04" => "Ubuntu24.04",
|
||||||
|
"UBUNTU25.04" => "Ubuntu25.04",
|
||||||
|
"DEBIAN10" => "Debian10",
|
||||||
|
"DEBIAN11" => "Debian11",
|
||||||
|
"DEBIAN12" => "Debian12",
|
||||||
|
"WINDOWS10" => "Windows10",
|
||||||
|
"WINDOWS11" => "Windows11",
|
||||||
|
"WINDOWS2008R2" => "Windows2008R2",
|
||||||
|
"WINDOWS2012R2" => "Windows2012R2",
|
||||||
|
"WINDOWS2016R2" => "Windows2016R2",
|
||||||
|
"WINDOWS2019R2" => "Windows2019R2",
|
||||||
|
"WINDOWS2022R2" => "Windows2022R2",
|
||||||
|
"WINDOWS2024R2" => "Windows2024R2",
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -25,8 +25,6 @@ return [
|
|||||||
"CPU" => "CPU",
|
"CPU" => "CPU",
|
||||||
"RAM" => "메모리",
|
"RAM" => "메모리",
|
||||||
"DISK" => "저장장치",
|
"DISK" => "저장장치",
|
||||||
"OS" => "운영체제",
|
|
||||||
"DB" => "데이터베이스",
|
|
||||||
"SOFTWARE" => "소프트웨어",
|
"SOFTWARE" => "소프트웨어",
|
||||||
"SWITCH" => "스위치",
|
"SWITCH" => "스위치",
|
||||||
"IP" => "IP",
|
"IP" => "IP",
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
return [
|
|
||||||
'title' => "OS정보",
|
|
||||||
'label' => [
|
|
||||||
'title' => "모델명",
|
|
||||||
'price' => "기본가",
|
|
||||||
'stock' => "재고",
|
|
||||||
'status' => "상태",
|
|
||||||
'updated_at' => "수정일",
|
|
||||||
'created_at' => "작성일",
|
|
||||||
'deleted_at' => "삭제일",
|
|
||||||
],
|
|
||||||
"STATUS" => [
|
|
||||||
STATUS['AVAILABLE'] => "사용가능",
|
|
||||||
STATUS['FORBIDDEN'] => "사용불가",
|
|
||||||
],
|
|
||||||
];
|
|
||||||
@ -21,6 +21,7 @@ class ServerModel extends EquipmentModel
|
|||||||
"type",
|
"type",
|
||||||
"switch",
|
"switch",
|
||||||
"ip",
|
"ip",
|
||||||
|
"os",
|
||||||
"title",
|
"title",
|
||||||
"price",
|
"price",
|
||||||
"manufactur_at",
|
"manufactur_at",
|
||||||
@ -64,6 +65,9 @@ class ServerModel extends EquipmentModel
|
|||||||
$rule = "permit_empty|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
|
$rule = "permit_empty|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
|
||||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||||
break;
|
break;
|
||||||
|
case "os":
|
||||||
|
$rule = "permit_empty|trim|string";
|
||||||
|
break;
|
||||||
case "format_at":
|
case "format_at":
|
||||||
$rule = "permit_empty|valid_date";
|
$rule = "permit_empty|valid_date";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models\Part;
|
|
||||||
|
|
||||||
use App\Entities\Part\OSEntity;
|
|
||||||
|
|
||||||
class OSModel extends PartModel
|
|
||||||
{
|
|
||||||
const TABLE = "osinfo";
|
|
||||||
const PK = "uid";
|
|
||||||
const TITLE = "title";
|
|
||||||
protected $table = self::TABLE;
|
|
||||||
protected $primaryKey = self::PK;
|
|
||||||
// protected $useAutoIncrement = false;
|
|
||||||
protected $returnType = OSEntity::class;
|
|
||||||
protected $allowedFields = [
|
|
||||||
"uid",
|
|
||||||
"title",
|
|
||||||
"price",
|
|
||||||
"stock",
|
|
||||||
"status",
|
|
||||||
"updated_at"
|
|
||||||
];
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -224,7 +224,6 @@ class ServiceService extends CustomerService
|
|||||||
case 'CPU':
|
case 'CPU':
|
||||||
case 'RAM':
|
case 'RAM':
|
||||||
case 'DISK':
|
case 'DISK':
|
||||||
case 'OS':
|
|
||||||
case 'SOFTWARE':
|
case 'SOFTWARE':
|
||||||
case 'SWITCH':
|
case 'SWITCH':
|
||||||
case 'IP':
|
case 'IP':
|
||||||
|
|||||||
@ -2,11 +2,14 @@
|
|||||||
|
|
||||||
namespace App\Services\Equipment;
|
namespace App\Services\Equipment;
|
||||||
|
|
||||||
|
use App\Entities\Equipment\LineEntity;
|
||||||
use App\Helpers\Equipment\LineHelper;
|
use App\Helpers\Equipment\LineHelper;
|
||||||
use App\Models\Equipment\LineModel;
|
use App\Models\Equipment\LineModel;
|
||||||
|
use App\Services\Part\IPService;
|
||||||
|
|
||||||
class LineService extends EquipmentService
|
class LineService extends EquipmentService
|
||||||
{
|
{
|
||||||
|
private ?IPService $_ipService = null;
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct(new LineModel(), new LineHelper());
|
parent::__construct(new LineModel(), new LineHelper());
|
||||||
@ -34,5 +37,26 @@ class LineService extends EquipmentService
|
|||||||
{
|
{
|
||||||
return ['status'];
|
return ['status'];
|
||||||
}
|
}
|
||||||
//기본 기능부분}
|
final public function getIPService(): IPService
|
||||||
|
{
|
||||||
|
if (!$this->_ipService) {
|
||||||
|
$this->_ipService = new IPService();
|
||||||
|
}
|
||||||
|
return $this->_ipService;
|
||||||
|
}
|
||||||
|
//기본 기능부분
|
||||||
|
public function create(array $formDatas): LineEntity
|
||||||
|
{
|
||||||
|
//서버정보 생성
|
||||||
|
$entity = parent::create($formDatas);
|
||||||
|
//Prefixed IP to array 자동 등록
|
||||||
|
foreach ($this->getHelper()->cidrToIpRange($formDatas['bandwith']) as $ip) {
|
||||||
|
$this->getIPService()->create([
|
||||||
|
'lineinfo_uid' => $entity->getPK(),
|
||||||
|
'ip' => $ip,
|
||||||
|
'status' => STATUS['AVAILABLE'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,6 @@ use App\Services\Part\CPUService;
|
|||||||
use App\Services\Part\CSService;
|
use App\Services\Part\CSService;
|
||||||
use App\Services\Part\DISKService;
|
use App\Services\Part\DISKService;
|
||||||
use App\Services\Part\IPService;
|
use App\Services\Part\IPService;
|
||||||
use App\Services\Part\OSService;
|
|
||||||
use App\Services\Part\RAMService;
|
use App\Services\Part\RAMService;
|
||||||
use App\Services\Part\SOFTWAREService;
|
use App\Services\Part\SOFTWAREService;
|
||||||
use App\Services\Part\SWITCHService;
|
use App\Services\Part\SWITCHService;
|
||||||
@ -29,7 +28,6 @@ class ServerPartService extends EquipmentService implements ServerInterface
|
|||||||
private ?CPUService $_cpuService = null;
|
private ?CPUService $_cpuService = null;
|
||||||
private ?RAMService $_ramService = null;
|
private ?RAMService $_ramService = null;
|
||||||
private ?DISKService $_diskService = null;
|
private ?DISKService $_diskService = null;
|
||||||
private ?OSService $_osService = null;
|
|
||||||
private ?SOFTWAREService $_softwareService = null;
|
private ?SOFTWAREService $_softwareService = null;
|
||||||
private ?SWITCHService $_switchService = null;
|
private ?SWITCHService $_switchService = null;
|
||||||
private ?IPService $_ipService = null;
|
private ?IPService $_ipService = null;
|
||||||
@ -131,13 +129,6 @@ class ServerPartService extends EquipmentService implements ServerInterface
|
|||||||
}
|
}
|
||||||
return $this->_diskService;
|
return $this->_diskService;
|
||||||
}
|
}
|
||||||
final public function getOSService(): OSService
|
|
||||||
{
|
|
||||||
if (!$this->_osService) {
|
|
||||||
$this->_osService = new OSService();
|
|
||||||
}
|
|
||||||
return $this->_osService;
|
|
||||||
}
|
|
||||||
final public function getSOFTWAREService(): SOFTWAREService
|
final public function getSOFTWAREService(): SOFTWAREService
|
||||||
{
|
{
|
||||||
if (!$this->_softwareService) {
|
if (!$this->_softwareService) {
|
||||||
@ -180,9 +171,6 @@ class ServerPartService extends EquipmentService implements ServerInterface
|
|||||||
case 'DISK':
|
case 'DISK':
|
||||||
$service = $this->getDISKService();
|
$service = $this->getDISKService();
|
||||||
break;
|
break;
|
||||||
case 'OS':
|
|
||||||
$service = $this->getOSService();
|
|
||||||
break;
|
|
||||||
case 'SOFTWARE':
|
case 'SOFTWARE':
|
||||||
$service = $this->getSOFTWAREService();
|
$service = $this->getSOFTWAREService();
|
||||||
break;
|
break;
|
||||||
@ -238,7 +226,8 @@ class ServerPartService extends EquipmentService implements ServerInterface
|
|||||||
$formDatas['cnt'] = $serverpart["CNT"];
|
$formDatas['cnt'] = $serverpart["CNT"];
|
||||||
$formDatas['extra'] = $serverpart["EXTRA"];
|
$formDatas['extra'] = $serverpart["EXTRA"];
|
||||||
$formDatas = $this->setDefaultPartByServer($parttype, $formDatas);
|
$formDatas = $this->setDefaultPartByServer($parttype, $formDatas);
|
||||||
$this->create($formDatas);
|
//서버연결정보 생성
|
||||||
|
parent::create($formDatas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@ class ServerService extends EquipmentService implements ServiceInterface
|
|||||||
"type",
|
"type",
|
||||||
"switch",
|
"switch",
|
||||||
"ip",
|
"ip",
|
||||||
|
"os",
|
||||||
"title",
|
"title",
|
||||||
"price",
|
"price",
|
||||||
"manufactur_at",
|
"manufactur_at",
|
||||||
@ -40,6 +41,7 @@ class ServerService extends EquipmentService implements ServiceInterface
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
"type",
|
"type",
|
||||||
|
"os",
|
||||||
"title",
|
"title",
|
||||||
"status"
|
"status"
|
||||||
];
|
];
|
||||||
@ -52,6 +54,7 @@ class ServerService extends EquipmentService implements ServiceInterface
|
|||||||
"type",
|
"type",
|
||||||
"switch",
|
"switch",
|
||||||
"ip",
|
"ip",
|
||||||
|
"os",
|
||||||
'title',
|
'title',
|
||||||
'price',
|
'price',
|
||||||
'manufactur_at',
|
'manufactur_at',
|
||||||
@ -65,6 +68,7 @@ class ServerService extends EquipmentService implements ServiceInterface
|
|||||||
'clientinfo_uid',
|
'clientinfo_uid',
|
||||||
'serviceinfo_uid',
|
'serviceinfo_uid',
|
||||||
'type',
|
'type',
|
||||||
|
"os",
|
||||||
"title",
|
"title",
|
||||||
'status'
|
'status'
|
||||||
];
|
];
|
||||||
|
|||||||
@ -131,13 +131,13 @@ class IPService extends PartService implements ServerInterface
|
|||||||
$formDatas['serverinfo_uid'] = $serverEntity->getPK();
|
$formDatas['serverinfo_uid'] = $serverEntity->getPK();
|
||||||
$formDatas['status'] = STATUS['OCCUPIED'];
|
$formDatas['status'] = STATUS['OCCUPIED'];
|
||||||
if (!array_key_exists('status', $formDatas)) {
|
if (!array_key_exists('status', $formDatas)) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: IP상태가 설정되지 않았습니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: IP상태가 설정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
//IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정
|
//IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정
|
||||||
$entity = $this->getEntity(['ip' => $serverEntity->getIP()]);
|
$entity = $this->getEntity(['ip' => $serverEntity->getIP()]);
|
||||||
if ($entity instanceof IPEntity) {
|
if ($entity instanceof IPEntity) {
|
||||||
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
|
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: {$serverEntity->getIP()}는 사용중인 IP입니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: {$serverEntity->getIP()}는 사용중인 IP입니다.");
|
||||||
}
|
}
|
||||||
$entity = parent::modify($entity, $formDatas);
|
$entity = parent::modify($entity, $formDatas);
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ class IPService extends PartService implements ServerInterface
|
|||||||
$formDatas['old_clientinfo_uid'] = $serverEntity->getClientInfoUID() ?? null;
|
$formDatas['old_clientinfo_uid'] = $serverEntity->getClientInfoUID() ?? null;
|
||||||
$formDatas['status'] = STATUS['AVAILABLE'];
|
$formDatas['status'] = STATUS['AVAILABLE'];
|
||||||
if (!array_key_exists('status', $formDatas)) {
|
if (!array_key_exists('status', $formDatas)) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: IP상태가 설정되지 않았습니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: IP상태가 설정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
//IP정보가져와서 있으면 수정
|
//IP정보가져와서 있으면 수정
|
||||||
$entity = $this->getEntity(['ip' => $serverEntity->getIP()]);
|
$entity = $this->getEntity(['ip' => $serverEntity->getIP()]);
|
||||||
@ -159,7 +159,7 @@ class IPService extends PartService implements ServerInterface
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: 정의되지 않은 작업입니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: 정의되지 않은 작업입니다.");
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
return $serverEntity;
|
return $serverEntity;
|
||||||
@ -176,7 +176,7 @@ class IPService extends PartService implements ServerInterface
|
|||||||
$formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUID();
|
$formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUID();
|
||||||
$formDatas['status'] = STATUS['OCCUPIED'];
|
$formDatas['status'] = STATUS['OCCUPIED'];
|
||||||
if (!array_key_exists('status', $formDatas)) {
|
if (!array_key_exists('status', $formDatas)) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: IP상태가 설정되지 않았습니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: IP상태가 설정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
//IP정보가져오기
|
//IP정보가져오기
|
||||||
$entity = $this->getEntity($serverPartEntity->getPartUID());
|
$entity = $this->getEntity($serverPartEntity->getPartUID());
|
||||||
@ -184,7 +184,7 @@ class IPService extends PartService implements ServerInterface
|
|||||||
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다.");
|
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다.");
|
||||||
}
|
}
|
||||||
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
|
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: {$entity->getIP()}는 사용중인 IP입니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: {$entity->getIP()}는 사용중인 IP입니다.");
|
||||||
}
|
}
|
||||||
//IP정보 수정
|
//IP정보 수정
|
||||||
$entity = parent::modify($entity, $formDatas);
|
$entity = parent::modify($entity, $formDatas);
|
||||||
@ -197,7 +197,7 @@ class IPService extends PartService implements ServerInterface
|
|||||||
$formDatas['old_clientinfo_uid'] = $serverPartEntity->getClientInfoUID() ?? null;
|
$formDatas['old_clientinfo_uid'] = $serverPartEntity->getClientInfoUID() ?? null;
|
||||||
$formDatas['status'] = STATUS['AVAILABLE'];
|
$formDatas['status'] = STATUS['AVAILABLE'];
|
||||||
if (!array_key_exists('status', $formDatas)) {
|
if (!array_key_exists('status', $formDatas)) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: IP상태가 설정되지 않았습니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: IP상태가 설정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
//IP정보가져오기
|
//IP정보가져오기
|
||||||
$entity = $this->getEntity($serverPartEntity->getPartUID());
|
$entity = $this->getEntity($serverPartEntity->getPartUID());
|
||||||
|
|||||||
@ -1,52 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Services\Part;
|
|
||||||
|
|
||||||
use App\Helpers\Part\OSHelper;
|
|
||||||
use App\Models\Part\OSModel;
|
|
||||||
|
|
||||||
|
|
||||||
class OSService extends PartService
|
|
||||||
{
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct(new OSModel(), new OSHelper());
|
|
||||||
$this->addClassName('OS');
|
|
||||||
}
|
|
||||||
public function getFormFields(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
"title",
|
|
||||||
"price",
|
|
||||||
"stock",
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
}
|
|
||||||
public function getFormFilters(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'status',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
public function getIndexFields(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
"title",
|
|
||||||
"price",
|
|
||||||
"stock",
|
|
||||||
"status",
|
|
||||||
];
|
|
||||||
}
|
|
||||||
public function getBatchjobFields(): array
|
|
||||||
{
|
|
||||||
return ['status'];
|
|
||||||
}
|
|
||||||
//기본 기능부분
|
|
||||||
//FieldForm관련용
|
|
||||||
//OrderBy 처리
|
|
||||||
public function setOrderBy(mixed $field = null, mixed $value = null): void
|
|
||||||
{
|
|
||||||
$this->getModel()->orderBy('title ASC');
|
|
||||||
parent::setOrderBy($field, $value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -101,13 +101,13 @@ class SWITCHService extends PartService implements ServerInterface
|
|||||||
$formDatas['serverinfo_uid'] = $serverEntity->getPK();
|
$formDatas['serverinfo_uid'] = $serverEntity->getPK();
|
||||||
$formDatas['status'] = STATUS['OCCUPIED'];
|
$formDatas['status'] = STATUS['OCCUPIED'];
|
||||||
if (!array_key_exists('status', $formDatas)) {
|
if (!array_key_exists('status', $formDatas)) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: Switch상태가 설정되지 않았습니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: Switch상태가 설정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
//Switch정보에서 해당하는 Switch가 있으면 가져와서 사용중인지 체크 후 수정
|
//Switch정보에서 해당하는 Switch가 있으면 가져와서 사용중인지 체크 후 수정
|
||||||
$entity = $this->getEntity(['code' => $serverEntity->getSwitch()]);
|
$entity = $this->getEntity(['code' => $serverEntity->getSwitch()]);
|
||||||
if ($entity instanceof SWITCHEntity) {
|
if ($entity instanceof SWITCHEntity) {
|
||||||
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
|
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: {$serverEntity->getSwitch()}는 사용중인 Switch입니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: {$serverEntity->getSwitch()}는 사용중인 Switch입니다.");
|
||||||
}
|
}
|
||||||
$entity = parent::modify($entity, $formDatas);
|
$entity = parent::modify($entity, $formDatas);
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ class SWITCHService extends PartService implements ServerInterface
|
|||||||
$formDatas['old_clientinfo_uid'] = $serverEntity->getClientInfoUID() ?? null;
|
$formDatas['old_clientinfo_uid'] = $serverEntity->getClientInfoUID() ?? null;
|
||||||
$formDatas['status'] = STATUS['AVAILABLE'];
|
$formDatas['status'] = STATUS['AVAILABLE'];
|
||||||
if (!array_key_exists('status', $formDatas)) {
|
if (!array_key_exists('status', $formDatas)) {
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: Switch상태가 설정되지 않았습니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: Switch상태가 설정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
//Switch정보가져와서 있으면 수정
|
//Switch정보가져와서 있으면 수정
|
||||||
$entity = $this->getEntity(['code' => $serverEntity->getSwitch()]);
|
$entity = $this->getEntity(['code' => $serverEntity->getSwitch()]);
|
||||||
@ -129,7 +129,7 @@ class SWITCHService extends PartService implements ServerInterface
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: 정의되지 않은 작업입니다.");
|
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: 정의되지 않은 작업입니다.");
|
||||||
// break;
|
// break;
|
||||||
}
|
}
|
||||||
return $serverEntity;
|
return $serverEntity;
|
||||||
|
|||||||
@ -143,19 +143,25 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
|
|||||||
$entity = parent::create($formDatas);
|
$entity = parent::create($formDatas);
|
||||||
break;
|
break;
|
||||||
case 'modify': //서비스 가격 수정용
|
case 'modify': //서비스 가격 수정용
|
||||||
$entity = $serviceEntity->getPaymentEntity();
|
if ($serviceEntity->getPaymentUID() === null) {
|
||||||
if (!$entity instanceof PaymentEntity) {
|
throw new \Exception(__METHOD__ . "에서 {$action}오류발생:서비스정보에 결제정보가 정의되지 않았습니다.");
|
||||||
throw new \Exception(__METHOD__ . "에서 오류발생:결제정보를 찾을수 없습니다.");
|
|
||||||
}
|
}
|
||||||
$formDatas = [];
|
$entity = $this->getEntity($serviceEntity->getPaymentUID());
|
||||||
$formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUID();
|
if (!$entity instanceof PaymentEntity) {
|
||||||
|
throw new \Exception(__METHOD__ . "에서 {$action}오류발생:결제정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
if ($entity->getStatus() === STATUS['PAID']) {
|
||||||
|
throw new \Exception(__METHOD__ . "에서 {$action}오류발생:결제완료된 서비스는 수정할수 없습니다.");
|
||||||
|
}
|
||||||
|
$formDatas = [];
|
||||||
|
$formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUID();
|
||||||
$formDatas['serviceinfo_uid'] = $serviceEntity->getPK();
|
$formDatas['serviceinfo_uid'] = $serviceEntity->getPK();
|
||||||
$formDatas['serverinfo_uid'] = $serviceEntity->getServerInfoUID();
|
$formDatas['serverinfo_uid'] = $serviceEntity->getServerInfoUID();
|
||||||
$formDatas['title'] = $serviceEntity->getTitle();
|
$formDatas['title'] = $serviceEntity->getTitle();
|
||||||
$formDatas['amount'] = $serviceEntity->getAmount();
|
$formDatas['amount'] = $serviceEntity->getAmount();
|
||||||
$formDatas['billing'] = PAYMENT['BILLING']['MONTH'];
|
$formDatas['billing'] = PAYMENT['BILLING']['MONTH'];
|
||||||
$formDatas['billing_at'] = $serviceEntity->getBillingAt();
|
$formDatas['billing_at'] = $serviceEntity->getBillingAt();
|
||||||
$entity = parent::modify($entity, $formDatas);
|
$entity = parent::modify($entity, $formDatas);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \Exception(__METHOD__ . "에서 오류발생:{$action}은 정의되지 않은 작업입니다.");
|
throw new \Exception(__METHOD__ . "에서 오류발생:{$action}은 정의되지 않은 작업입니다.");
|
||||||
@ -180,9 +186,15 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
|
|||||||
$entity = parent::create($formDatas);
|
$entity = parent::create($formDatas);
|
||||||
break;
|
break;
|
||||||
case 'modify': //일회성 서비스 수정용
|
case 'modify': //일회성 서비스 수정용
|
||||||
$entity = $serverPartEntity->getPaymentEntity();
|
if ($serverPartEntity->getPaymentUID() === null) {
|
||||||
|
throw new \Exception(__METHOD__ . "에서 {$action}오류발생:일회성서비스정보에 결제정보가 정의되지 않았습니다.");
|
||||||
|
}
|
||||||
|
$entity = $this->getEntity($serverPartEntity->getPaymentUID());
|
||||||
if (!$entity instanceof PaymentEntity) {
|
if (!$entity instanceof PaymentEntity) {
|
||||||
throw new \Exception(__METHOD__ . "에서 오류발생:결제정보를 찾을수 없습니다.");
|
throw new \Exception(__METHOD__ . "에서 {$action}오류발생:결제정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
if ($entity->getStatus() === STATUS['PAID']) {
|
||||||
|
throw new \Exception(__METHOD__ . "에서 {$action}오류발생:결제완료된 서비스는 수정할수 없습니다.");
|
||||||
}
|
}
|
||||||
$formDatas = [];
|
$formDatas = [];
|
||||||
$formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID();
|
$formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID();
|
||||||
|
|||||||
@ -43,9 +43,10 @@
|
|||||||
</th>
|
</th>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column">
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('switch', lang("{$viewDatas['class_path']}.label.switch"), $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListLabel('switch', lang("{$viewDatas['class_path']}.label.switch"), $viewDatas) ?>
|
||||||
|
/ <?= $viewDatas['service']->getHelper()->getListLabel('ip', lang("{$viewDatas['class_path']}.label.ip"), $viewDatas) ?>
|
||||||
</th>
|
</th>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column">
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('ip', lang("{$viewDatas['class_path']}.label.ip"), $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListLabel('switch', lang("{$viewDatas['class_path']}.label.os"), $viewDatas) ?>
|
||||||
</th>
|
</th>
|
||||||
<th class="index_head_short_column" style="width:900px;">
|
<th class="index_head_short_column" style="width:900px;">
|
||||||
<span class="float-start rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">ALL 📋</span>부품정보
|
<span class="float-start rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">ALL 📋</span>부품정보
|
||||||
@ -80,9 +81,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getFieldView('switch', $entity->switch, $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getFieldView('switch', $entity->switch, $viewDatas) ?>
|
||||||
|
<BR><?= $viewDatas['service']->getHelper()->getFieldView('ip', $entity->ip, $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getFieldView('ip', $entity->ip, $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getFieldView('os', $entity->ip, $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
||||||
|
|||||||
@ -23,9 +23,6 @@
|
|||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<a href="/admin/part/disk"><?= ICONS['SERVER_ITEM_DISK'] ?>DISK정보</a>
|
<a href="/admin/part/disk"><?= ICONS['SERVER_ITEM_DISK'] ?>DISK정보</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="accordion-item">
|
|
||||||
<a href="/admin/part/os"><?= ICONS['SERVER_ITEM_OS'] ?>OS정보</a>
|
|
||||||
</div>
|
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<a href="/admin/part/software"><?= ICONS['SERVER_ITEM_SOFTWARE'] ?>Software정보</a>
|
<a href="/admin/part/software"><?= ICONS['SERVER_ITEM_SOFTWARE'] ?>Software정보</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -37,9 +37,6 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/cs">CS정보</a></span>
|
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/cs">CS정보</a></span>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
|
||||||
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/os">OS정보</a></span>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/cpu">CPU정보</a></span>
|
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/cpu">CPU정보</a></span>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user