cfmgrv4 init...3

This commit is contained in:
최준흠 2024-10-18 10:37:16 +09:00
parent f7890539d3
commit 5965a9f2d6
7 changed files with 29 additions and 19 deletions

View File

@ -82,11 +82,11 @@ class ZoneController extends CloudflareController
private function init(string $action, array $fields = []): void
{
$this->action = $action;
$this->fields = count($fields) ? $fields : [$this->getModel()::PARENT, $this->getModel()::TITLE, 'name_servers', 'original_name_servers', 'plan', 'development_mode', 'ipv6', 'security_level', 'ssl_mode', 'status', 'updated_at', 'created_at'];
$this->fields = count($fields) ? $fields : [$this->getModel()::PARENT, $this->getModel()::TITLE, 'name_servers', 'original_name_servers', 'plan', 'development_mode', 'ipv6', 'security_level', 'ssl_mode', 'always_use_https', 'status', 'updated_at', 'created_at'];
$this->field_rules = $this->getModel()->getFieldRules($this->action, $this->fields);
$this->filter_fields = [$this->getModel()::PARENT, 'plan', 'development_mode', 'ipv6', 'security_level', 'ssl_mode'];
$this->filter_fields = [$this->getModel()::PARENT, 'plan', 'development_mode', 'ipv6', 'security_level', 'ssl_mode', 'always_use_https'];
$this->field_options = $this->getFormFieldOptions($this->filter_fields);
$this->batchjob_fields = ['development_mode', 'ipv6', 'security_level', 'ssl_mode'];
$this->batchjob_fields = ['development_mode', 'ipv6', 'security_level', 'ssl_mode', 'always_use_https'];
}
//생성
public function create_form(): RedirectResponse|string

View File

@ -48,6 +48,7 @@ class ZoneHelper extends MVCHelper
case "ipv6":
case "security_level":
case "ssl_mode":
case "always_use_https":
case 'status':
$form = form_dropdown($field, [
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',

View File

@ -12,6 +12,7 @@ return [
'ipv6' => "ipv6",
'security_level' => "공격방어",
'ssl_mode' => "SSL모드",
'always_use_https' => "https사용",
'status' => "서비스",
'updated_at' => "수정일",
'created_at' => "작성일",
@ -27,9 +28,9 @@ return [
"off" => "사용않함",
],
"PLAN" => [
"Free Website" => "Free Website",
"Pro Website" => "Pro Website",
"Business Website" => "Business Website",
"Free Website" => "Free",
"Pro Website" => "Pro",
"Business Website" => "Business",
],
"IPV6" => [
"on" => "사용",
@ -41,6 +42,10 @@ return [
"low" => "low",
"essentially_off" => "essentially_off",
],
"ALWAYS_USE_HTTPS" => [
"on" => "사용",
"off" => "사용않함",
],
"SSL_MODE" => [
"off" => "off",
"flexible" => "flexible",

View File

@ -11,7 +11,13 @@ class Zone extends Cloudflare
{
private $_model = null;
private $_account_entity = null;
private $_setting_fields = ['development_mode' => 'off', 'ipv6' => 'off', 'security_level' => 'medium', 'ssl' => 'off'];
private $_setting_fields = [
'development_mode' => 'off',
'ipv6' => 'off',
'security_level' => 'medium',
'ssl' => 'off',
'always_use_https' => 'off'
];
public function __construct(AccountEntity $account_entity)
{
$this->_account_entity = $account_entity;

View File

@ -16,7 +16,7 @@ class ZoneModel extends CommonModel
protected $primaryKey = self::PK;
protected $useAutoIncrement = false;
protected $returnType = ZoneEntity::class; //object,array,entity명::class
protected $allowedFields = [self::PK, self::PARENT, self::TITLE, 'name_servers', 'original_name_servers', 'plan', 'development_mode', 'ipv6', 'security_level', 'ssl_mode', 'status', 'updated_at', 'crated_at '];
protected $allowedFields = [self::PK, self::PARENT, self::TITLE, 'name_servers', 'original_name_servers', 'plan', 'development_mode', 'ipv6', 'security_level', 'ssl_mode', 'always_use_https', 'status', 'updated_at', 'crated_at '];
protected $useTimestamps = true;
public function __construct()
{
@ -47,6 +47,7 @@ class ZoneModel extends CommonModel
break;
case "development_mode":
case "ipv6":
case "always_use_https":
$rule = "if_exist|in_list[on,off]";
break;
case "status":

View File

@ -1,8 +1,8 @@
<?= form_open(current_url(), array("method" => "get")) ?>
<?= form_open(current_url(), ["method" => "get"], ['class' => 'd-flex']) ?>
<nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="condition nav">
조건검색:
조건:
<?php foreach ($viewDatas['filter_fields'] as $field): ?>
<?= $viewDatas['helper']->getFieldForm($field, $viewDatas[$field] ?: old($field), $viewDatas) ?>
<?php endforeach ?>
@ -10,12 +10,12 @@
<nav class="search nav justify-content-center">
검색어:<?= form_input('word', $viewDatas['word']) ?>
검색일:<?= form_input('start', $viewDatas['start'], ["class" => "calender"]) ?><?= form_input('end', $viewDatas['end'], ["class" => "calender"]) ?>
<?= form_submit('', '검색하기') ?>
<button class="btn btn-outline-primary" type="submit">검색</button>
<?= anchor(current_url() . '/download/excel', ICONS['EXCEL'], ["target" => "_self", "class" => "excel"]) ?>
</nav>
<nav class="pageinfo nav justify-content-end">
페이지 : <?= $viewDatas['page'] ?>/<?= $viewDatas['total_page'] ?>
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], array('onChange' => 'this.form.submit()')) ?>
Page:<?= $viewDatas['page'] ?>/<?= $viewDatas['total_page'] ?>
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], ['onChange' => 'this.form.submit()']) ?>
/ :<?= $viewDatas['total_count'] ?>
</nav>
</div>

View File

@ -34,20 +34,17 @@ nav.index_top nav.condition {
/*검색*/
nav.index_top nav.search {
position: relative;
height: 30px;
border-color: 1px solid red;
}
nav.index_top nav.search input[type="text"] {
width: 200px;
height: 30px;
width: 150px;
}
/*검색submit*/
nav.index_top nav.search input[type="submit"] {
font-weight: bold;
width: 80px;
height: 30px;
width: 70px;
color: white;
background-color: #555555;
}
@ -55,7 +52,7 @@ nav.index_top nav.search input[type="submit"] {
/*검색submit*/
nav.index_top nav.search a.excel {
position: absolute;
top: -9px;
top: -5px;
right: -45px;
/* border-color: 1px solid red; */
}