trafficmonitor init...2
This commit is contained in:
parent
e29f36f5a5
commit
ae6464c40f
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user