From ae6464c40fdef974b4b9ecbf13289e885419bd1d Mon Sep 17 00:00:00 2001 From: "choi.jh" Date: Tue, 11 Nov 2025 15:11:07 +0900 Subject: [PATCH] trafficmonitor init...2 --- app/Controllers/Admin/AdminController.php | 9 ++++++++- app/Controllers/Admin/CollectorController.php | 11 ++++++----- app/Controllers/Admin/MylogController.php | 11 ++++++----- app/Controllers/Admin/TrafficController.php | 14 ++++++-------- app/Controllers/Admin/UserController.php | 12 ++---------- app/Controllers/Auth/GoogleController.php | 2 +- app/Controllers/Auth/LocalController.php | 2 +- app/Forms/CollectorForm.php | 1 - app/Forms/CommonForm.php | 4 +--- 9 files changed, 31 insertions(+), 35 deletions(-) diff --git a/app/Controllers/Admin/AdminController.php b/app/Controllers/Admin/AdminController.php index ca54d69..0e1b926 100644 --- a/app/Controllers/Admin/AdminController.php +++ b/app/Controllers/Admin/AdminController.php @@ -29,8 +29,15 @@ abstract class AdminController extends CommonController } protected function action_init_process(string $action): void { - parent::action_init_process($action); $this->addViewDatas('layout', $this->getLayout()); + $this->addViewDatas('helper', $this->service->getHelper()); + $this->addViewDatas('formFields', $this->service->getFormService()->getFormFields()); + $this->addViewDatas('formRules', $this->service->getFormService()->getFormRules()); + $this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters()); + $this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions()); + $this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFilters()); + $this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons()); + parent::action_init_process($action); } abstract protected function create_form_process(): void; final public function create_form(): string diff --git a/app/Controllers/Admin/CollectorController.php b/app/Controllers/Admin/CollectorController.php index 6d9a1a3..cc8d5ca 100644 --- a/app/Controllers/Admin/CollectorController.php +++ b/app/Controllers/Admin/CollectorController.php @@ -42,11 +42,12 @@ class CollectorController extends AdminController throw new \Exception("지원하지 않는 action입니다.({$action})"); // break; } - $this->addViewDatas('helper', $this->service->getHelper()); - $this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields)); - $this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters)); - $this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields)); - $this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters)); + $this->service->getFormService()->setFormFields($fields); + $this->service->getFormService()->setFormRules($action, $fields); + $this->service->getFormService()->setFormFilters($filters); + $this->service->getFormService()->setFormOptions($filters); + $this->service->getFormService()->setBatchjobFilters($filters); + parent::action_init_process($action); } //Action작업관련 protected function create_form_process(): void diff --git a/app/Controllers/Admin/MylogController.php b/app/Controllers/Admin/MylogController.php index 113eab4..0d71a0c 100644 --- a/app/Controllers/Admin/MylogController.php +++ b/app/Controllers/Admin/MylogController.php @@ -42,11 +42,12 @@ class MylogController extends AdminController throw new \Exception("지원하지 않는 action입니다.({$action})"); // break; } - $this->addViewDatas('helper', $this->service->getHelper()); - $this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields)); - $this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters)); - $this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields)); - $this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters)); + $this->service->getFormService()->setFormFields($fields); + $this->service->getFormService()->setFormRules($action, $fields); + $this->service->getFormService()->setFormFilters($filters); + $this->service->getFormService()->setFormOptions($filters); + $this->service->getFormService()->setBatchjobFilters($filters); + parent::action_init_process($action); } //Action작업관련 protected function create_form_process(): void diff --git a/app/Controllers/Admin/TrafficController.php b/app/Controllers/Admin/TrafficController.php index b812537..3ed215c 100644 --- a/app/Controllers/Admin/TrafficController.php +++ b/app/Controllers/Admin/TrafficController.php @@ -23,7 +23,6 @@ class TrafficController extends AdminController { $fields = ['client', 'switch', 'ip', 'interface', 'status']; $filters = ['status']; - parent::action_init_process($action); switch ($action) { case 'create': case 'create_form': @@ -35,18 +34,17 @@ class TrafficController extends AdminController break; case 'index': $fields = [...$fields, 'created_at']; - $this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields($filters)); - $this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons()); break; default: throw new \Exception("지원하지 않는 action입니다.({$action})"); // break; } - $this->addViewDatas('helper', $this->service->getHelper()); - $this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields)); - $this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters)); - $this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields)); - $this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters)); + $this->service->getFormService()->setFormFields($fields); + $this->service->getFormService()->setFormRules($action, $fields); + $this->service->getFormService()->setFormFilters($filters); + $this->service->getFormService()->setFormOptions($filters); + $this->service->getFormService()->setBatchjobFilters($filters); + parent::action_init_process($action); } //Action작업관련 protected function create_form_process(): void diff --git a/app/Controllers/Admin/UserController.php b/app/Controllers/Admin/UserController.php index 964acb5..e0e66a5 100644 --- a/app/Controllers/Admin/UserController.php +++ b/app/Controllers/Admin/UserController.php @@ -22,7 +22,6 @@ class UserController extends AdminController //Action작업관련 protected function action_init_process(string $action): void { - parent::action_init_process($action); $fields = ['id', 'passwd', 'confirmpassword', 'name', 'email', 'mobile', 'role']; $filters = ['role', 'status']; switch ($action) { @@ -44,16 +43,9 @@ class UserController extends AdminController $this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormRules($action, $fields); $this->service->getFormService()->setFormFilters($filters); - $this->service->getFormService()->getFormOptions($filters); + $this->service->getFormService()->setFormOptions($filters); $this->service->getFormService()->setBatchjobFilters($filters); - - $this->addViewDatas('helper', $this->service->getHelper()); - $this->addViewDatas('formFields', $this->service->getFormService()->getFormFields()); - $this->addViewDatas('formRules', $this->service->getFormService()->getFormRules()); - $this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters()); - $this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions()); - $this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields()); - $this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons()); + parent::action_init_process($action); } protected function create_form_process(): void { diff --git a/app/Controllers/Auth/GoogleController.php b/app/Controllers/Auth/GoogleController.php index 691e120..e37c038 100644 --- a/app/Controllers/Auth/GoogleController.php +++ b/app/Controllers/Auth/GoogleController.php @@ -35,7 +35,7 @@ class GoogleController extends AuthController $this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormRules($action, $fields); $this->service->getFormService()->setFormFilters($filters); - $this->service->getFormService()->getFormOptions($filters); + $this->service->getFormService()->setFormOptions($filters); $this->service->getFormService()->setBatchjobFilters($filters); $this->addViewDatas('helper', $this->service->getHelper()); diff --git a/app/Controllers/Auth/LocalController.php b/app/Controllers/Auth/LocalController.php index ed90203..54a0f48 100644 --- a/app/Controllers/Auth/LocalController.php +++ b/app/Controllers/Auth/LocalController.php @@ -40,7 +40,7 @@ class LocalController extends AuthController $this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormRules($action, $fields); $this->service->getFormService()->setFormFilters($filters); - $this->service->getFormService()->getFormOptions($filters); + $this->service->getFormService()->setFormOptions($filters); $this->service->getFormService()->setBatchjobFilters($filters); $this->addViewDatas('helper', $this->service->getHelper()); diff --git a/app/Forms/CollectorForm.php b/app/Forms/CollectorForm.php index 248b663..08f4b0f 100644 --- a/app/Forms/CollectorForm.php +++ b/app/Forms/CollectorForm.php @@ -36,7 +36,6 @@ class CollectorForm extends CommonForm $tempOptions[$entity->getPK()] = $entity->getTitle(); } $options[$field]['options'] = $tempOptions; - $options[$field]['extras'] = ['class' => 'form-control select-field']; break; default: $options = parent::getFormOption($field, $options); diff --git a/app/Forms/CommonForm.php b/app/Forms/CommonForm.php index 5bf6fb1..287aefa 100644 --- a/app/Forms/CommonForm.php +++ b/app/Forms/CommonForm.php @@ -67,6 +67,7 @@ abstract class CommonForm foreach ($fields as $field) { $this->_formOptions[$field] = $this->getFormOption($field); } + // dd($this->_formOptions[$field]); } //$fields 매치된것만 반환, []->전체 final public function getFormOptions(array $fields = []): array @@ -172,7 +173,6 @@ abstract class CommonForm // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } $options['options'] = $tempOptions; - $options['extras'] = ['class' => 'form-control select-field']; break; case 'clientinfo_uid': foreach (service('clientervice')->getEntities() as $entity) { @@ -180,14 +180,12 @@ abstract class CommonForm // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } $options['options'] = $tempOptions; - $options['extras'] = ['class' => 'form-control select-field']; break; default: foreach (lang($this->getAttribute('class_path') . "." . strtoupper($field)) as $key => $label) { $tempOptions[$key] = $label; } $options['options'] = $tempOptions; - $options['extras'] = ['class' => 'form-control']; break; } return $options;