dbms_init...1
This commit is contained in:
parent
a2c02983cf
commit
a3495e708c
@ -46,7 +46,7 @@ class DefenceController extends EquipmentController
|
||||
protected function index_process(): array
|
||||
{
|
||||
$fields = [
|
||||
'fields' => ['type', 'ip', 'accountid', 'domain', 'status'],
|
||||
'fields' => ['type', 'ip', 'price', 'accountid', 'domain', 'status'],
|
||||
];
|
||||
$this->init('index', $fields);
|
||||
return parent::index_process();
|
||||
|
||||
@ -45,7 +45,7 @@ class IpController extends EquipmentController
|
||||
protected function index_process(): array
|
||||
{
|
||||
$fields = [
|
||||
'fields' => ['lineinfo_uid', 'ip', 'status', 'updated_at'],
|
||||
'fields' => ['lineinfo_uid', 'ip', 'price', 'status', 'updated_at', 'created_at'],
|
||||
];
|
||||
$this->init('index', $fields);
|
||||
return parent::index_process();
|
||||
|
||||
@ -20,7 +20,7 @@ abstract class LinkController extends EquipmentController
|
||||
protected function setOrderByForList()
|
||||
{
|
||||
//OrderBy 처리
|
||||
$this->getService()->getModel()->orderBy('serviceinfo_uid', 'ASC', false);
|
||||
$this->getService()->getModel()->orderBy('serverinfo_uid', 'ASC', false);
|
||||
parent::setOrderByForList();
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ abstract class PartController extends EquipmentController
|
||||
protected function index_process(): array
|
||||
{
|
||||
$fields = [
|
||||
'fields' => ['model', 'status'],
|
||||
'fields' => ['model', 'price', 'status'],
|
||||
];
|
||||
$this->init('index', $fields);
|
||||
return parent::index_process();
|
||||
|
||||
@ -65,7 +65,7 @@ class ServerController extends EquipmentController
|
||||
protected function index_process(): array
|
||||
{
|
||||
$fields = [
|
||||
'fields' => ['code', 'type', 'model', 'CPU', 'RAM', 'DISK', "raid", 'status'],
|
||||
'fields' => ['code', 'type', 'model', 'price', 'CPU', 'RAM', 'DISK', "raid", 'status'],
|
||||
];
|
||||
$this->init('index', $fields);
|
||||
// $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임
|
||||
|
||||
@ -39,7 +39,7 @@ class SoftwareController extends EquipmentController
|
||||
protected function index_process(): array
|
||||
{
|
||||
$fields = [
|
||||
'fields' => ['type', 'model', 'status', 'description'],
|
||||
'fields' => ['type', 'model', 'price', 'status', 'description'],
|
||||
];
|
||||
$this->init('index', $fields);
|
||||
return parent::index_process();
|
||||
|
||||
@ -161,25 +161,6 @@ abstract class CommonController extends BaseController
|
||||
protected function getResultPageByActon(string $action, string $message = MESSAGES["SUCCESS"]): RedirectResponse|string
|
||||
{
|
||||
switch ($action) {
|
||||
// case 'create':
|
||||
// $segments = $this->request->getUri()->getSegments();
|
||||
// if (!empty($segments)) {
|
||||
// // 마지막 세그먼트 무조건 view로 교체
|
||||
// $segments[count($segments) - 1] = 'view';
|
||||
// }
|
||||
// $redirectPath = '/' . implode('/', $segments);
|
||||
// $result = redirect()->to($redirectPath . '/' . $this->entity->getPK());
|
||||
// // $result = view($this->view_path . 'view', ['viewDatas' => $this->getViewDatas()]);;
|
||||
// break;
|
||||
// case 'modify':
|
||||
// $segments = $this->request->getUri()->getSegments();
|
||||
// if (!empty($segments)) {
|
||||
// // 마지막 세그먼트 무조건 view로 교체
|
||||
// $segments[count($segments) - 2] = 'view';
|
||||
// }
|
||||
// $result = redirect()->to('/' . implode('/', $segments));
|
||||
// // $result = view($this->view_path . 'view', ['viewDatas' => $this->getViewDatas()]);;
|
||||
// break;
|
||||
case 'create':
|
||||
case 'modify':
|
||||
$result = $this->view($this->entity->getPK());
|
||||
@ -189,7 +170,7 @@ abstract class CommonController extends BaseController
|
||||
case 'login_form':
|
||||
case 'index':
|
||||
case 'view':
|
||||
$this->getHelper()->setViewDatas($this->getViewDatas());
|
||||
// $this->getHelper()->setViewDatas($this->getViewDatas());
|
||||
$result = view($this->view_path . $action, ['viewDatas' => $this->getViewDatas()]);
|
||||
break;
|
||||
default:
|
||||
@ -228,6 +209,7 @@ abstract class CommonController extends BaseController
|
||||
//데이터 검증
|
||||
$this->formDatas = $this->doValidate($this->action, $this->fields);
|
||||
$this->entity = $this->create_process();
|
||||
// dd($this->entity);
|
||||
$this->getService()->getModel()->transCommit();
|
||||
$this->getMyLogService()->save($this->getService(), __FUNCTION__, $this->getMyAuth(), MESSAGES["SUCCESS"]);
|
||||
return $this->getResultPageByActon($this->action);
|
||||
|
||||
File diff suppressed because one or more lines are too long
8455
app/Database/erp2_1.vuerd.json
Normal file
8455
app/Database/erp2_1.vuerd.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -260,6 +260,8 @@ class CommonHelper
|
||||
if (!is_array($viewDatas['field_options'][$field])) {
|
||||
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
|
||||
}
|
||||
//request값이 있을경우
|
||||
$value = $this->request->getVar($field) ?? $value;
|
||||
$extra_class = isset($extras['class']) ? $extras['class'] . ' select-field' : 'select-field';
|
||||
// $extra_class = isset($extras['class']) ? $extras['class'] : "";
|
||||
$formOptions = ["" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택'];
|
||||
@ -307,6 +309,10 @@ class CommonHelper
|
||||
case 'created_at':
|
||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
||||
break;
|
||||
case 'price':
|
||||
case 'amount':
|
||||
$value = $value ? number_format($value) : "";
|
||||
break;
|
||||
default:
|
||||
if (in_array($field, $viewDatas['filter_fields'])) {
|
||||
$extras["onChange"] = sprintf(
|
||||
@ -349,6 +355,7 @@ class CommonHelper
|
||||
{
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
// echo current_url() . '/' . $action . '?' . $this->request->getUri()->getQuery();
|
||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||
$action = form_label(
|
||||
'입력',
|
||||
|
||||
@ -3,6 +3,7 @@ return [
|
||||
'title' => "CPU정보",
|
||||
'label' => [
|
||||
'model' => "모델",
|
||||
'price' => "가격",
|
||||
'description' => "설명",
|
||||
'status' => "상태",
|
||||
'updated_at' => "수정일",
|
||||
|
||||
@ -3,6 +3,7 @@ return [
|
||||
'title' => "DISK정보",
|
||||
'label' => [
|
||||
'model' => "모델",
|
||||
'price' => "가격",
|
||||
'description' => "설명",
|
||||
'status' => "상태",
|
||||
'updated_at' => "수정일",
|
||||
|
||||
@ -3,6 +3,7 @@ return [
|
||||
'title' => "RAM정보",
|
||||
'label' => [
|
||||
'model' => "모델",
|
||||
'price' => "가격",
|
||||
'description' => "설명",
|
||||
'status' => "상태",
|
||||
'updated_at' => "수정일",
|
||||
|
||||
@ -15,6 +15,7 @@ class DefenceModel extends EquipmentModel
|
||||
protected $allowedFields = [
|
||||
"type",
|
||||
"ip",
|
||||
"price",
|
||||
"accountid",
|
||||
"domain",
|
||||
"description",
|
||||
@ -38,6 +39,9 @@ class DefenceModel extends EquipmentModel
|
||||
case "ip":
|
||||
$rule = "required|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
|
||||
break;
|
||||
case "price":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFieldRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -15,6 +15,7 @@ class IpModel extends EquipmentModel
|
||||
protected $allowedFields = [
|
||||
"lineinfo_uid",
|
||||
"ip",
|
||||
"price",
|
||||
"status",
|
||||
"updated_at"
|
||||
];
|
||||
@ -29,6 +30,7 @@ class IpModel extends EquipmentModel
|
||||
}
|
||||
switch ($field) {
|
||||
case "lineinfo_uid":
|
||||
case "price":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
case "ip":
|
||||
|
||||
@ -6,7 +6,7 @@ use App\Entities\Equipment\Link\CpuEntity;
|
||||
|
||||
class CpuModel extends LinkModel
|
||||
{
|
||||
const TABLE = "cpuinfo_link";
|
||||
const TABLE = "serverinfos_cpuinfos";
|
||||
const PK = "uid";
|
||||
const TITLE = "uid";
|
||||
protected $table = self::TABLE;
|
||||
|
||||
@ -6,7 +6,7 @@ use App\Entities\Equipment\Link\DiskEntity;
|
||||
|
||||
class DiskModel extends LinkModel
|
||||
{
|
||||
const TABLE = "diskinfo_link";
|
||||
const TABLE = "serverinfos_diskinfos";
|
||||
const PK = "uid";
|
||||
const TITLE = "uid";
|
||||
protected $table = self::TABLE;
|
||||
|
||||
@ -6,7 +6,7 @@ use App\Entities\Equipment\Link\RamEntity;
|
||||
|
||||
class RamModel extends LinkModel
|
||||
{
|
||||
const TABLE = "raminfo_link";
|
||||
const TABLE = "serverinfos_raminfos";
|
||||
const PK = "uid";
|
||||
const TITLE = "uid";
|
||||
protected $table = self::TABLE;
|
||||
|
||||
@ -8,6 +8,7 @@ abstract class PartModel extends EquipmentModel
|
||||
{
|
||||
protected $allowedFields = [
|
||||
"model",
|
||||
"price",
|
||||
"status",
|
||||
"updated_at"
|
||||
];
|
||||
@ -24,6 +25,9 @@ abstract class PartModel extends EquipmentModel
|
||||
case "model":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "price":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFieldRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -16,6 +16,7 @@ class ServerModel extends EquipmentModel
|
||||
"code",
|
||||
"type",
|
||||
"model",
|
||||
"price",
|
||||
"raid",
|
||||
"description",
|
||||
"status",
|
||||
@ -37,6 +38,9 @@ class ServerModel extends EquipmentModel
|
||||
case "raid":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "price":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFieldRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -15,6 +15,7 @@ class SoftwareModel extends EquipmentModel
|
||||
protected $allowedFields = [
|
||||
"type",
|
||||
"model",
|
||||
"price",
|
||||
"status",
|
||||
"description",
|
||||
"updated_at"
|
||||
@ -33,6 +34,9 @@ class SoftwareModel extends EquipmentModel
|
||||
case "type":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "price":
|
||||
$rule = "required|numeric";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFieldRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -28,6 +28,7 @@ class DefenceService extends EquipmentService
|
||||
return [
|
||||
"type",
|
||||
"ip",
|
||||
"price",
|
||||
"accountid",
|
||||
"domain",
|
||||
"status",
|
||||
|
||||
@ -27,6 +27,7 @@ class IpService extends EquipmentService
|
||||
return [
|
||||
"lineinfo_uid",
|
||||
"ip",
|
||||
"price",
|
||||
"status",
|
||||
];
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ abstract class PartService extends EquipmentService
|
||||
{
|
||||
return [
|
||||
"model",
|
||||
"price",
|
||||
"status",
|
||||
];
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ class ServerService extends EquipmentService
|
||||
"code",
|
||||
"type",
|
||||
"model",
|
||||
"price",
|
||||
"raid",
|
||||
"status",
|
||||
"description",
|
||||
|
||||
@ -27,6 +27,7 @@ class SoftwareService extends EquipmentService
|
||||
return [
|
||||
"type",
|
||||
"model",
|
||||
"price",
|
||||
"status",
|
||||
"description",
|
||||
];
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"
|
||||
onClick="window.location.reload()">Close</button>
|
||||
onClick="closeBootstrapModal()">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -35,9 +35,9 @@
|
||||
function closeBootstrapModal() {
|
||||
var modalElement = document.getElementById('index_action_form'); // 모달의 실제 DOM 요소 가져오기
|
||||
var modalInstance = bootstrap.Modal.getInstance(modalElement); // 모달 인스턴스 가져오기
|
||||
// 먼저 모달을 호출한 페이지를 리로드
|
||||
// window.location.reload();
|
||||
if (modalInstance) {
|
||||
// 먼저 모달을 호출한 페이지를 리로드
|
||||
window.location.reload();
|
||||
modalInstance.hide(); // 모달 닫기 (hide() 메서드 사용)
|
||||
} else {
|
||||
console.error("Modal instance not found.");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user