dbmsv3 init...1
This commit is contained in:
parent
c7168eac48
commit
915f8a0bc1
@ -417,8 +417,8 @@ define("SERVICE", [
|
||||
define("SERVERPART", [
|
||||
"CNT_RANGE" => array_combine(range(1, 10), range(1, 10)),
|
||||
"SERVER_PARTTYPES" => ['CPU', 'RAM', 'DISK'],
|
||||
"SERVICE_PARTTYPES" => ['OS', 'SOFTWARE', 'CS', 'IP'],
|
||||
"ALL_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'OS', 'SOFTWARE', 'IP', 'CS'],
|
||||
"SERVICE_PARTTYPES" => ['SOFTWARE', 'CS', 'IP'],
|
||||
"ALL_PARTTYPES" => ['CPU', 'RAM', 'DISK', 'SOFTWARE', 'IP', 'CS'],
|
||||
"CPU" => [
|
||||
"ATYPE" => [["UID" => 1, "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('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->get('/', 'SOFTWAREController::index');
|
||||
$routes->get('create', 'SOFTWAREController::create_form');
|
||||
|
||||
@ -5,16 +5,11 @@ namespace App\Controllers\Admin\Equipment;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
|
||||
use App\Services\Equipment\LineService;
|
||||
use App\Services\Equipment\IPService;
|
||||
use App\Helpers\Equipment\LineHelper;
|
||||
use App\Entities\Equipment\LineEntity;
|
||||
use App\Entities\Equipment\IPEntity;
|
||||
|
||||
class LineController extends EquipmentController
|
||||
{
|
||||
private ?IpService $_ipService = null;
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
@ -31,13 +26,6 @@ class LineController extends EquipmentController
|
||||
}
|
||||
return $this->_service;
|
||||
}
|
||||
final public function getIPService(): IpService
|
||||
{
|
||||
if (!$this->_ipService) {
|
||||
$this->_ipService = new IpService();
|
||||
}
|
||||
return $this->_ipService;
|
||||
}
|
||||
//Index,FieldForm관련
|
||||
|
||||
//생성
|
||||
@ -47,16 +35,6 @@ class LineController extends EquipmentController
|
||||
if (!$this->getService()->getHelper()->isValidCIDR($formDatas['bandwith'])) {
|
||||
throw new \Exception("{$formDatas['bandwith']}는 CIDR 형식에 부합되지 않습니다.");
|
||||
}
|
||||
//부모처리
|
||||
$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;
|
||||
return parent::create_process($formDatas);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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": {
|
||||
"width": 3000,
|
||||
"height": 3000,
|
||||
"scrollTop": -638.7873,
|
||||
"scrollLeft": -730,
|
||||
"scrollTop": -1890.7873,
|
||||
"scrollLeft": -626,
|
||||
"zoomLevel": 0.79,
|
||||
"show": 511,
|
||||
"database": 4,
|
||||
@ -48,8 +48,7 @@
|
||||
"PdXX5ghGi8ZK89G9OjtnQ",
|
||||
"VN2Issjy8MFts5mr8-_9S",
|
||||
"0SUAXsejoiaHZwmW8msS3",
|
||||
"6lQ2M_5glzZEDHxKHx83G",
|
||||
"FfKKPJaDUSq_L0PzVw0qB"
|
||||
"6lQ2M_5glzZEDHxKHx83G"
|
||||
],
|
||||
"relationshipIds": [
|
||||
"AH1dyESfueUlhcoiU6KsQ",
|
||||
@ -259,6 +258,7 @@
|
||||
"I8DumSwkLWz-Ve5_vc0uE",
|
||||
"4t01_53QawHcw0lfY4zDm",
|
||||
"jnDePNx6_yIPBt4qYZguP",
|
||||
"UYIPZF2zMJcIZoTNYWUTH",
|
||||
"9F6QpQqxeEggZ0FHM81O1",
|
||||
"tsDqk1dzwzUtvBzpjmarJ",
|
||||
"hmZlcR-Pw2C_ife1zzo5o",
|
||||
@ -295,6 +295,7 @@
|
||||
"m77kSp3scTgMhInPBjsc3",
|
||||
"4t01_53QawHcw0lfY4zDm",
|
||||
"jnDePNx6_yIPBt4qYZguP",
|
||||
"UYIPZF2zMJcIZoTNYWUTH",
|
||||
"9F6QpQqxeEggZ0FHM81O1",
|
||||
"EKrwHre6e66jqAMnAW_KR",
|
||||
"Z2CriPHsk4OV0AD1jAhM4",
|
||||
@ -342,7 +343,7 @@
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1760509478899,
|
||||
"updateAt": 1760573684145,
|
||||
"createAt": 1745819764137
|
||||
}
|
||||
},
|
||||
@ -1043,15 +1044,15 @@
|
||||
"LrJ1wi95G76oooLA-9Etg"
|
||||
],
|
||||
"ui": {
|
||||
"x": 630.3799,
|
||||
"y": 2273.1488,
|
||||
"x": 91.1394,
|
||||
"y": 2607.3257,
|
||||
"zIndex": 5380,
|
||||
"widthName": 60,
|
||||
"widthComment": 60,
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1758849634812,
|
||||
"updateAt": 1760573618223,
|
||||
"createAt": 1758759596462
|
||||
}
|
||||
},
|
||||
@ -1081,15 +1082,15 @@
|
||||
"GpF8nYONyRFaSexZvhzu5"
|
||||
],
|
||||
"ui": {
|
||||
"x": 102.5318,
|
||||
"y": 2583.2749,
|
||||
"x": 620.2533,
|
||||
"y": 2311.123,
|
||||
"zIndex": 5387,
|
||||
"widthName": 68,
|
||||
"widthComment": 86,
|
||||
"color": ""
|
||||
},
|
||||
"meta": {
|
||||
"updateAt": 1758762821105,
|
||||
"updateAt": 1760573623206,
|
||||
"createAt": 1758759637696
|
||||
}
|
||||
},
|
||||
@ -9633,6 +9634,26 @@
|
||||
"updateAt": 1760509585504,
|
||||
"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": {
|
||||
@ -10067,7 +10088,7 @@
|
||||
"RITMHZcQAJ7KvtxkTtMv-"
|
||||
],
|
||||
"x": 1746.7498,
|
||||
"y": 2092.4788,
|
||||
"y": 2107.4788,
|
||||
"direction": 2
|
||||
},
|
||||
"end": {
|
||||
@ -10104,7 +10125,7 @@
|
||||
"4iRyOhmW3b7kbiZT8lQyY"
|
||||
],
|
||||
"x": 1746.7498,
|
||||
"y": 1884.4788,
|
||||
"y": 1887.4788,
|
||||
"direction": 2
|
||||
},
|
||||
"meta": {
|
||||
@ -10179,7 +10200,7 @@
|
||||
"RITMHZcQAJ7KvtxkTtMv-"
|
||||
],
|
||||
"x": 1086.7498,
|
||||
"y": 2040.4788,
|
||||
"y": 2052.4788,
|
||||
"direction": 1
|
||||
},
|
||||
"end": {
|
||||
@ -10207,7 +10228,7 @@
|
||||
"RITMHZcQAJ7KvtxkTtMv-"
|
||||
],
|
||||
"x": 1746.7498,
|
||||
"y": 2196.4788,
|
||||
"y": 2217.4788,
|
||||
"direction": 2
|
||||
},
|
||||
"end": {
|
||||
@ -10515,7 +10536,7 @@
|
||||
"RITMHZcQAJ7KvtxkTtMv-"
|
||||
],
|
||||
"x": 1746.7498,
|
||||
"y": 1988.4788,
|
||||
"y": 1997.4788,
|
||||
"direction": 2
|
||||
},
|
||||
"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;
|
||||
}
|
||||
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 .= form_label(
|
||||
sprintf(
|
||||
"[%s] %s / %s / %s",
|
||||
"[%s] %s/%s/%s/%s",
|
||||
lang("Equipment/Server.TYPE")[$viewDatas['serverEntity']->getType()],
|
||||
$viewDatas['serverEntity']->getCode(),
|
||||
$viewDatas['serverEntity']->getIP(),
|
||||
$viewDatas['serverEntity']->getSwitch()
|
||||
$viewDatas['serverEntity']->getSwitch(),
|
||||
$viewDatas['serverEntity']->getOS()
|
||||
),
|
||||
$field,
|
||||
[
|
||||
@ -97,9 +98,7 @@ class ServerPartHelper extends EquipmentHelper
|
||||
case 'CPU':
|
||||
case 'RAM':
|
||||
case 'DISK':
|
||||
case 'OS':
|
||||
case 'SOFTWARE':
|
||||
case 'SWITCH':
|
||||
case 'IP':
|
||||
case 'CS':
|
||||
//파트 Entity
|
||||
@ -135,13 +134,11 @@ class ServerPartHelper extends EquipmentHelper
|
||||
public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||
{
|
||||
switch ($action) {
|
||||
case 'SWITCH':
|
||||
case 'IP':
|
||||
case 'CS':
|
||||
case 'CPU':
|
||||
case 'RAM':
|
||||
case 'DISK':
|
||||
case 'OS':
|
||||
case 'SOFTWARE':
|
||||
$extras = [
|
||||
"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' => "장비번호",
|
||||
'type' => "형식",
|
||||
'switch' => "스위치",
|
||||
'ip' => "메인IP",
|
||||
'ip' => "IP",
|
||||
'os' => "OS",
|
||||
'title' => "모델명",
|
||||
'price' => "기본가",
|
||||
'manufactur_at' => "입고일",
|
||||
@ -49,4 +50,26 @@ return [
|
||||
STATUS['TERMINATED'] => "서비스해지",
|
||||
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",
|
||||
"RAM" => "메모리",
|
||||
"DISK" => "저장장치",
|
||||
"OS" => "운영체제",
|
||||
"DB" => "데이터베이스",
|
||||
"SOFTWARE" => "소프트웨어",
|
||||
"SWITCH" => "스위치",
|
||||
"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",
|
||||
"switch",
|
||||
"ip",
|
||||
"os",
|
||||
"title",
|
||||
"price",
|
||||
"manufactur_at",
|
||||
@ -64,6 +65,9 @@ class ServerModel extends EquipmentModel
|
||||
$rule = "permit_empty|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
|
||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||
break;
|
||||
case "os":
|
||||
$rule = "permit_empty|trim|string";
|
||||
break;
|
||||
case "format_at":
|
||||
$rule = "permit_empty|valid_date";
|
||||
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 'RAM':
|
||||
case 'DISK':
|
||||
case 'OS':
|
||||
case 'SOFTWARE':
|
||||
case 'SWITCH':
|
||||
case 'IP':
|
||||
|
||||
@ -2,11 +2,14 @@
|
||||
|
||||
namespace App\Services\Equipment;
|
||||
|
||||
use App\Entities\Equipment\LineEntity;
|
||||
use App\Helpers\Equipment\LineHelper;
|
||||
use App\Models\Equipment\LineModel;
|
||||
use App\Services\Part\IPService;
|
||||
|
||||
class LineService extends EquipmentService
|
||||
{
|
||||
private ?IPService $_ipService = null;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(new LineModel(), new LineHelper());
|
||||
@ -34,5 +37,26 @@ class LineService extends EquipmentService
|
||||
{
|
||||
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\DISKService;
|
||||
use App\Services\Part\IPService;
|
||||
use App\Services\Part\OSService;
|
||||
use App\Services\Part\RAMService;
|
||||
use App\Services\Part\SOFTWAREService;
|
||||
use App\Services\Part\SWITCHService;
|
||||
@ -29,7 +28,6 @@ class ServerPartService extends EquipmentService implements ServerInterface
|
||||
private ?CPUService $_cpuService = null;
|
||||
private ?RAMService $_ramService = null;
|
||||
private ?DISKService $_diskService = null;
|
||||
private ?OSService $_osService = null;
|
||||
private ?SOFTWAREService $_softwareService = null;
|
||||
private ?SWITCHService $_switchService = null;
|
||||
private ?IPService $_ipService = null;
|
||||
@ -131,13 +129,6 @@ class ServerPartService extends EquipmentService implements ServerInterface
|
||||
}
|
||||
return $this->_diskService;
|
||||
}
|
||||
final public function getOSService(): OSService
|
||||
{
|
||||
if (!$this->_osService) {
|
||||
$this->_osService = new OSService();
|
||||
}
|
||||
return $this->_osService;
|
||||
}
|
||||
final public function getSOFTWAREService(): SOFTWAREService
|
||||
{
|
||||
if (!$this->_softwareService) {
|
||||
@ -180,9 +171,6 @@ class ServerPartService extends EquipmentService implements ServerInterface
|
||||
case 'DISK':
|
||||
$service = $this->getDISKService();
|
||||
break;
|
||||
case 'OS':
|
||||
$service = $this->getOSService();
|
||||
break;
|
||||
case 'SOFTWARE':
|
||||
$service = $this->getSOFTWAREService();
|
||||
break;
|
||||
@ -238,7 +226,8 @@ class ServerPartService extends EquipmentService implements ServerInterface
|
||||
$formDatas['cnt'] = $serverpart["CNT"];
|
||||
$formDatas['extra'] = $serverpart["EXTRA"];
|
||||
$formDatas = $this->setDefaultPartByServer($parttype, $formDatas);
|
||||
$this->create($formDatas);
|
||||
//서버연결정보 생성
|
||||
parent::create($formDatas);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ class ServerService extends EquipmentService implements ServiceInterface
|
||||
"type",
|
||||
"switch",
|
||||
"ip",
|
||||
"os",
|
||||
"title",
|
||||
"price",
|
||||
"manufactur_at",
|
||||
@ -40,6 +41,7 @@ class ServerService extends EquipmentService implements ServiceInterface
|
||||
{
|
||||
return [
|
||||
"type",
|
||||
"os",
|
||||
"title",
|
||||
"status"
|
||||
];
|
||||
@ -52,6 +54,7 @@ class ServerService extends EquipmentService implements ServiceInterface
|
||||
"type",
|
||||
"switch",
|
||||
"ip",
|
||||
"os",
|
||||
'title',
|
||||
'price',
|
||||
'manufactur_at',
|
||||
@ -65,6 +68,7 @@ class ServerService extends EquipmentService implements ServiceInterface
|
||||
'clientinfo_uid',
|
||||
'serviceinfo_uid',
|
||||
'type',
|
||||
"os",
|
||||
"title",
|
||||
'status'
|
||||
];
|
||||
|
||||
@ -131,13 +131,13 @@ class IPService extends PartService implements ServerInterface
|
||||
$formDatas['serverinfo_uid'] = $serverEntity->getPK();
|
||||
$formDatas['status'] = STATUS['OCCUPIED'];
|
||||
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()]);
|
||||
if ($entity instanceof IPEntity) {
|
||||
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);
|
||||
}
|
||||
@ -150,7 +150,7 @@ class IPService extends PartService implements ServerInterface
|
||||
$formDatas['old_clientinfo_uid'] = $serverEntity->getClientInfoUID() ?? null;
|
||||
$formDatas['status'] = STATUS['AVAILABLE'];
|
||||
if (!array_key_exists('status', $formDatas)) {
|
||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: IP상태가 설정되지 않았습니다.");
|
||||
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: IP상태가 설정되지 않았습니다.");
|
||||
}
|
||||
//IP정보가져와서 있으면 수정
|
||||
$entity = $this->getEntity(['ip' => $serverEntity->getIP()]);
|
||||
@ -159,7 +159,7 @@ class IPService extends PartService implements ServerInterface
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: 정의되지 않은 작업입니다.");
|
||||
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: 정의되지 않은 작업입니다.");
|
||||
// break;
|
||||
}
|
||||
return $serverEntity;
|
||||
@ -176,7 +176,7 @@ class IPService extends PartService implements ServerInterface
|
||||
$formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUID();
|
||||
$formDatas['status'] = STATUS['OCCUPIED'];
|
||||
if (!array_key_exists('status', $formDatas)) {
|
||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: IP상태가 설정되지 않았습니다.");
|
||||
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: IP상태가 설정되지 않았습니다.");
|
||||
}
|
||||
//IP정보가져오기
|
||||
$entity = $this->getEntity($serverPartEntity->getPartUID());
|
||||
@ -184,7 +184,7 @@ class IPService extends PartService implements ServerInterface
|
||||
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다.");
|
||||
}
|
||||
if ($entity->getStatus() !== STATUS['AVAILABLE']) {
|
||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: {$entity->getIP()}는 사용중인 IP입니다.");
|
||||
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: {$entity->getIP()}는 사용중인 IP입니다.");
|
||||
}
|
||||
//IP정보 수정
|
||||
$entity = parent::modify($entity, $formDatas);
|
||||
@ -197,7 +197,7 @@ class IPService extends PartService implements ServerInterface
|
||||
$formDatas['old_clientinfo_uid'] = $serverPartEntity->getClientInfoUID() ?? null;
|
||||
$formDatas['status'] = STATUS['AVAILABLE'];
|
||||
if (!array_key_exists('status', $formDatas)) {
|
||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: IP상태가 설정되지 않았습니다.");
|
||||
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: IP상태가 설정되지 않았습니다.");
|
||||
}
|
||||
//IP정보가져오기
|
||||
$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['status'] = STATUS['OCCUPIED'];
|
||||
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()]);
|
||||
if ($entity instanceof SWITCHEntity) {
|
||||
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);
|
||||
}
|
||||
@ -120,7 +120,7 @@ class SWITCHService extends PartService implements ServerInterface
|
||||
$formDatas['old_clientinfo_uid'] = $serverEntity->getClientInfoUID() ?? null;
|
||||
$formDatas['status'] = STATUS['AVAILABLE'];
|
||||
if (!array_key_exists('status', $formDatas)) {
|
||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: Switch상태가 설정되지 않았습니다.");
|
||||
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: Switch상태가 설정되지 않았습니다.");
|
||||
}
|
||||
//Switch정보가져와서 있으면 수정
|
||||
$entity = $this->getEntity(['code' => $serverEntity->getSwitch()]);
|
||||
@ -129,7 +129,7 @@ class SWITCHService extends PartService implements ServerInterface
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: 정의되지 않은 작업입니다.");
|
||||
throw new \Exception(__METHOD__ . ":에서 {$action}오류발생: 정의되지 않은 작업입니다.");
|
||||
// break;
|
||||
}
|
||||
return $serverEntity;
|
||||
|
||||
@ -143,9 +143,15 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
|
||||
$entity = parent::create($formDatas);
|
||||
break;
|
||||
case 'modify': //서비스 가격 수정용
|
||||
$entity = $serviceEntity->getPaymentEntity();
|
||||
if ($serviceEntity->getPaymentUID() === null) {
|
||||
throw new \Exception(__METHOD__ . "에서 {$action}오류발생:서비스정보에 결제정보가 정의되지 않았습니다.");
|
||||
}
|
||||
$entity = $this->getEntity($serviceEntity->getPaymentUID());
|
||||
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['clientinfo_uid'] = $serviceEntity->getClientInfoUID();
|
||||
@ -180,9 +186,15 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
|
||||
$entity = parent::create($formDatas);
|
||||
break;
|
||||
case 'modify': //일회성 서비스 수정용
|
||||
$entity = $serverPartEntity->getPaymentEntity();
|
||||
if ($serverPartEntity->getPaymentUID() === null) {
|
||||
throw new \Exception(__METHOD__ . "에서 {$action}오류발생:일회성서비스정보에 결제정보가 정의되지 않았습니다.");
|
||||
}
|
||||
$entity = $this->getEntity($serverPartEntity->getPaymentUID());
|
||||
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['clientinfo_uid'] = $serverPartEntity->getClientInfoUID();
|
||||
|
||||
@ -43,9 +43,10 @@
|
||||
</th>
|
||||
<th class="index_head_short_column">
|
||||
<?= $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 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 class="index_head_short_column" style="width:900px;">
|
||||
<span class="float-start rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">ALL 📋</span>부품정보
|
||||
@ -80,9 +81,10 @@
|
||||
</td>
|
||||
<td nowrap>
|
||||
<?= $viewDatas['service']->getHelper()->getFieldView('switch', $entity->switch, $viewDatas) ?>
|
||||
<BR><?= $viewDatas['service']->getHelper()->getFieldView('ip', $entity->ip, $viewDatas) ?>
|
||||
</td>
|
||||
<td nowrap>
|
||||
<?= $viewDatas['service']->getHelper()->getFieldView('ip', $entity->ip, $viewDatas) ?>
|
||||
<?= $viewDatas['service']->getHelper()->getFieldView('os', $entity->ip, $viewDatas) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
||||
|
||||
@ -23,9 +23,6 @@
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/part/disk"><?= ICONS['SERVER_ITEM_DISK'] ?>DISK정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/part/os"><?= ICONS['SERVER_ITEM_OS'] ?>OS정보</a>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<a href="/admin/part/software"><?= ICONS['SERVER_ITEM_SOFTWARE'] ?>Software정보</a>
|
||||
</div>
|
||||
|
||||
@ -37,9 +37,6 @@
|
||||
<li class="nav-item">
|
||||
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/cs">CS정보</a></span>
|
||||
</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">
|
||||
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/cpu">CPU정보</a></span>
|
||||
</li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user