dbms_init...1
This commit is contained in:
parent
fabf52cd86
commit
4fc7d9407e
@ -101,9 +101,17 @@ class ServiceController extends CustomerController
|
|||||||
protected function index_process(): array
|
protected function index_process(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'fields' => ['type', 'clientinfo_uid', 'rack', 'lineinfo_uid', 'serverinfo_uid', 'IP', 'CPU', 'RAM', 'DISK', 'SOFTWARE', 'DEFENCE', 'billing_at', 'start_at', 'status'],
|
'fields' => ['clientinfo_uid', 'type', 'billing_at', 'rack', 'LINE', 'SERVER', 'IP', 'CPU', 'RAM', 'DISK', 'SOFTWARE', 'DEFENCE', 'start_at', 'status'],
|
||||||
];
|
];
|
||||||
$this->init('index', $fields);
|
$this->init('index', $fields);
|
||||||
return parent::index_process();
|
// $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임
|
||||||
|
$entities = [];
|
||||||
|
// foreach (parent::index_process() as $entity) {
|
||||||
|
// $entity->setPartEntities("CPU", $this->getCpuService()->getPartEntities($entity));
|
||||||
|
// $entity->setPartEntities("RAM", $this->getRamService()->getPartEntities($entity));
|
||||||
|
// $entity->setPartEntities("DISK", $this->getDiskService()->getPartEntities($entity));
|
||||||
|
// $entities[] = $entity;
|
||||||
|
// }
|
||||||
|
return $entities;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,6 @@ abstract class LinkController extends EquipmentController
|
|||||||
{
|
{
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'index':
|
case 'index':
|
||||||
case 'view':
|
|
||||||
$this->getHelper()->setViewDatas($this->getViewDatas());
|
$this->getHelper()->setViewDatas($this->getViewDatas());
|
||||||
$result = view($this->view_path . 'popup' . DIRECTORY_SEPARATOR . $action, ['viewDatas' => $this->getViewDatas()]);
|
$result = view($this->view_path . 'popup' . DIRECTORY_SEPARATOR . $action, ['viewDatas' => $this->getViewDatas()]);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -55,21 +55,6 @@ class UserController extends AdminController
|
|||||||
}
|
}
|
||||||
//Index,FieldForm관련.
|
//Index,FieldForm관련.
|
||||||
|
|
||||||
protected function getResultPageByActon(string $action, string $message = MESSAGES["SUCCESS"]): RedirectResponse|string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
case 'modify':
|
|
||||||
$this->getHelper()->setViewDatas($this->getViewDatas());
|
|
||||||
$result = view($this->view_path . 'view', ['viewDatas' => $this->getViewDatas()]);;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$result = parent::getResultPageByActon($action, $message);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//View관련
|
//View관련
|
||||||
protected function view_process($uid): mixed
|
protected function view_process($uid): mixed
|
||||||
{
|
{
|
||||||
|
|||||||
@ -36,19 +36,6 @@ abstract class AuthController extends CommonController
|
|||||||
return $this->_helper;
|
return $this->_helper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getResultPageByActon(string $action, string $message = MESSAGES["SUCCESS"]): RedirectResponse|string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'login_form':
|
|
||||||
$this->getHelper()->setViewDatas($this->getViewDatas());
|
|
||||||
$result = view($this->view_path . $action, ['viewDatas' => $this->getViewDatas()]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$result = parent::getResultPageByActon($action, $message);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
final public function getFields(): array
|
final public function getFields(): array
|
||||||
{
|
{
|
||||||
return ['id', 'passwd'];
|
return ['id', 'passwd'];
|
||||||
|
|||||||
@ -162,12 +162,27 @@ abstract class CommonController extends BaseController
|
|||||||
{
|
{
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
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':
|
case 'modify':
|
||||||
$this->getHelper()->setViewDatas($this->getViewDatas());
|
$segments = $this->request->getUri()->getSegments();
|
||||||
$result = view($this->view_path . 'view', ['viewDatas' => $this->getViewDatas()]);;
|
if (!empty($segments)) {
|
||||||
|
// 마지막 세그먼트 무조건 view로 교체
|
||||||
|
$segments[count($segments) - 2] = 'view';
|
||||||
|
}
|
||||||
|
$result = redirect()->to('/' . implode('/', $segments));
|
||||||
|
// $result = view($this->view_path . 'view', ['viewDatas' => $this->getViewDatas()]);;
|
||||||
break;
|
break;
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
case 'modify_form':
|
case 'modify_form':
|
||||||
|
case 'login_form':
|
||||||
case 'index':
|
case 'index':
|
||||||
case 'view':
|
case 'view':
|
||||||
$this->getHelper()->setViewDatas($this->getViewDatas());
|
$this->getHelper()->setViewDatas($this->getViewDatas());
|
||||||
@ -186,8 +201,10 @@ abstract class CommonController extends BaseController
|
|||||||
final public function create_form(): RedirectResponse|string
|
final public function create_form(): RedirectResponse|string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->init(__FUNCTION__);
|
// 현재 URL을 스택에 저장
|
||||||
|
// $this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
|
$this->init(__FUNCTION__);
|
||||||
$this->create_form_process();
|
$this->create_form_process();
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
return $this->getResultPageByActon($this->action);
|
return $this->getResultPageByActon($this->action);
|
||||||
@ -204,7 +221,6 @@ abstract class CommonController extends BaseController
|
|||||||
$this->getService()->getModel()->transStart();
|
$this->getService()->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->init(__FUNCTION__);
|
$this->init(__FUNCTION__);
|
||||||
helper(['form']);
|
|
||||||
//데이터 검증
|
//데이터 검증
|
||||||
$this->formDatas = $this->doValidate($this->action, $this->fields);
|
$this->formDatas = $this->doValidate($this->action, $this->fields);
|
||||||
$this->entity = $this->create_process();
|
$this->entity = $this->create_process();
|
||||||
@ -227,8 +243,10 @@ abstract class CommonController extends BaseController
|
|||||||
final public function modify_form(mixed $uid): RedirectResponse|string
|
final public function modify_form(mixed $uid): RedirectResponse|string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->init(__FUNCTION__);
|
// 현재 URL을 스택에 저장
|
||||||
|
// $this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
|
$this->init(__FUNCTION__);
|
||||||
$this->entity = $this->modify_form_process($uid);
|
$this->entity = $this->modify_form_process($uid);
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
return $this->getResultPageByActon($this->action);
|
return $this->getResultPageByActon($this->action);
|
||||||
@ -248,7 +266,6 @@ abstract class CommonController extends BaseController
|
|||||||
$this->getService()->getModel()->transStart();
|
$this->getService()->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->init(__FUNCTION__);
|
$this->init(__FUNCTION__);
|
||||||
helper(['form']);
|
|
||||||
//데이터 검증
|
//데이터 검증
|
||||||
$this->formDatas = $this->doValidate($this->action, $this->fields);
|
$this->formDatas = $this->doValidate($this->action, $this->fields);
|
||||||
$this->entity = $this->modify_process($uid);
|
$this->entity = $this->modify_process($uid);
|
||||||
@ -425,9 +442,9 @@ abstract class CommonController extends BaseController
|
|||||||
final public function view(string $uid): RedirectResponse|string
|
final public function view(string $uid): RedirectResponse|string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
helper(['form']);
|
||||||
$this->init(__FUNCTION__);
|
$this->init(__FUNCTION__);
|
||||||
$this->entity = $this->view_process($uid);
|
$this->entity = $this->view_process($uid);
|
||||||
helper(['form']);
|
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
return $this->getResultPageByActon($this->action);
|
return $this->getResultPageByActon($this->action);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -523,14 +540,32 @@ abstract class CommonController extends BaseController
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->init(__FUNCTION__);
|
|
||||||
$this->entities = $this->index_process();
|
|
||||||
// 현재 URL을 스택에 저장
|
// 현재 URL을 스택에 저장
|
||||||
$this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
$this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
|
$this->init(__FUNCTION__);
|
||||||
|
// if (env('app.debug.index')) {
|
||||||
|
// echo "ClassName: " . $this->getService()->getClassName() . "<BR>";
|
||||||
|
// echo "Title: " . $this->title . "<BR>";
|
||||||
|
// echo "uri_path: " . $this->uri_path . " <BR>";
|
||||||
|
// echo "view_path: " . $this->view_path . "<BR>";
|
||||||
|
// echo "action: " . $this->action . "<BR>";
|
||||||
|
// echo "fields: " . implode(",", $this->fields) . "<BR>";
|
||||||
|
// // exit;
|
||||||
|
// }
|
||||||
|
$this->entities = $this->index_process();
|
||||||
return $this->getResultPageByActon($this->action);
|
return $this->getResultPageByActon($this->action);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return redirect()->back()->withInput()->with('error', $e->getMessage());
|
// if (env('app.debug.index')) {
|
||||||
|
// echo "Error ClassName: " . $this->getService()->getClassName() . "<BR>";
|
||||||
|
// echo "Error Title: " . $this->title . "<BR>";
|
||||||
|
// echo "Error uri_path: " . $this->uri_path . " <BR>";
|
||||||
|
// echo "Error view_path: " . $this->view_path . "<BR>";
|
||||||
|
// echo "Error action: " . $this->action . "<BR>";
|
||||||
|
// echo "Error fields: " . implode(",", $this->fields) . "<BR>";
|
||||||
|
// // exit;
|
||||||
|
// }
|
||||||
|
return redirect()->with('error', $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,10 @@ abstract class CommonEntity extends Entity
|
|||||||
}
|
}
|
||||||
final public function isMatched(string $field, string $value): bool
|
final public function isMatched(string $field, string $value): bool
|
||||||
{
|
{
|
||||||
|
//Helper의 getListRowColor 함수에서 사용
|
||||||
|
if (!array_key_exists($field, $this->attributes)) {
|
||||||
|
return true;
|
||||||
|
};
|
||||||
return $this->attributes[$field] == $value;
|
return $this->attributes[$field] == $value;
|
||||||
}
|
}
|
||||||
final public function getUpdatedAt(): string|null
|
final public function getUpdatedAt(): string|null
|
||||||
|
|||||||
@ -11,6 +11,7 @@ use CodeIgniter\Session\Session;
|
|||||||
abstract class AuthService extends CommonService
|
abstract class AuthService extends CommonService
|
||||||
{
|
{
|
||||||
private ?Session $_session = null;
|
private ?Session $_session = null;
|
||||||
|
private $url_stack_name = "url_stack";
|
||||||
protected function __construct(?IncomingRequest $request = null)
|
protected function __construct(?IncomingRequest $request = null)
|
||||||
{
|
{
|
||||||
parent::__construct($request);
|
parent::__construct($request);
|
||||||
@ -72,12 +73,12 @@ abstract class AuthService extends CommonService
|
|||||||
|
|
||||||
final public function pushCurrentUrl(string $url): void
|
final public function pushCurrentUrl(string $url): void
|
||||||
{
|
{
|
||||||
$this->getSession()->set('url_stack', $url);
|
$this->getSession()->set($this->url_stack_name, $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function popPreviousUrl(): string
|
final public function popPreviousUrl(): string
|
||||||
{
|
{
|
||||||
$url = $this->getSession()->get('url_stack') ?? "";
|
$url = $this->getSession()->get($this->url_stack_name) ?? "";
|
||||||
if (!empty($url)) {
|
if (!empty($url)) {
|
||||||
$this->pushCurrentUrl("");
|
$this->pushCurrentUrl("");
|
||||||
return $url;
|
return $url;
|
||||||
|
|||||||
@ -35,7 +35,7 @@ abstract class CommonService
|
|||||||
{
|
{
|
||||||
return $this->request;
|
return $this->request;
|
||||||
}
|
}
|
||||||
final public function addClassName(string $className): void
|
final protected function addClassName(string $className): void
|
||||||
{
|
{
|
||||||
$this->_classNames[] = $className;
|
$this->_classNames[] = $className;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,8 +28,6 @@ class ServiceService extends CustomerService
|
|||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
"type",
|
"type",
|
||||||
"rack",
|
"rack",
|
||||||
"lineinfo_uid",
|
|
||||||
"serverinfo_uid",
|
|
||||||
"billing_at",
|
"billing_at",
|
||||||
"start_at",
|
"start_at",
|
||||||
"end_at",
|
"end_at",
|
||||||
@ -38,7 +36,7 @@ class ServiceService extends CustomerService
|
|||||||
}
|
}
|
||||||
public function getFilterFields(): array
|
public function getFilterFields(): array
|
||||||
{
|
{
|
||||||
return ["clientinfo_uid", "lineinfo_uid", "serverinfo_uid", 'type', 'status'];
|
return ["clientinfo_uid", 'type', 'status'];
|
||||||
}
|
}
|
||||||
public function getBatchJobFields(): array
|
public function getBatchJobFields(): array
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user