cfmgrv4 init...1

This commit is contained in:
최준흠 2024-09-30 20:34:48 +09:00
parent 241c4ea82c
commit 310130906c
9 changed files with 23 additions and 22 deletions

View File

@ -41,11 +41,11 @@ class AccountController extends CloudflareController
{
switch ($field) {
case $this->getModel()::PARENT:
$this->getAuthModel()->where('status', DEFAULTS['STATUS']);
$options[$field] = [
$temps = [
DEFAULTS['EMPTY'] => lang($this->class_path . '.label.' . $field) . ' 선택',
...$this->getAuthModel()->getFormFieldOption($field, $options),
];
// $this->getAuthModel()->where('status', DEFAULTS['STATUS']);
$options[$field] = $this->getAuthModel()->getFormFieldOption($field, $temps);
// echo $this->getAuthModel()->getLastQuery();
// dd($options);
break;

View File

@ -38,12 +38,12 @@ class RecordController extends CloudflareController
{
switch ($field) {
case $this->getModel()::PARENT:
$this->getZoneModel()->where('status', 'active');
$options[$field] = [
$temps = [
DEFAULTS['EMPTY'] => lang($this->class_path . '.label.' . $field) . ' 선택',
...$this->getZoneModel()->getFormFieldOption($field, $options),
];
// echo $this->getZoneModel()->getLastQuery();
// $this->getZoneModel()->where('status', 'active');
$options[$field] = $this->getZoneModel()->getFormFieldOption($field, $temps);
// echo $this->getAccountModel()->getLastQuery();
// dd($options);
break;
default:

View File

@ -42,11 +42,11 @@ class ZoneController extends CloudflareController
{
switch ($field) {
case $this->getModel()::PARENT:
$this->getAccountModel()->where('status', DEFAULTS['STATUS']);
$options[$field] = [
$temps = [
DEFAULTS['EMPTY'] => lang($this->class_path . '.label.' . $field) . ' 선택',
...$this->getAccountModel()->getFormFieldOption($field, $options),
];
// $this->getAccountModel()->where('status', DEFAULTS['STATUS']);
$options[$field] = $this->getAccountModel()->getFormFieldOption($field, $temps);
// echo $this->getAccountModel()->getLastQuery();
// dd($options);
break;

View File

@ -37,6 +37,7 @@ abstract class MVController extends CommonController
}
$options = $this->getFormFieldOption($field, $options);
}
// dd($options);
return $options;
}
//전송된 데이터

View File

@ -34,8 +34,10 @@ function getFieldForm_ZoneHelper(string $field, mixed $value, array $viewDatas,
$form = form_input($field, $value, ["placeholder" => "예)exmaple.com", "style" => "width:60%; ::placeholder{color:silver; opacity: 1;}"]);
break;
case 'domains':
$form = form_textarea($field, $value, ['class' => 'editor', 'rows' => '5']);
break;
case 'hosts':
$form = form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '5']);
$form = form_textarea($field, $value == DEFAULTS['EMPTY'] ? "@\n*\nm\nwww" : $value, ['class' => 'editor', 'rows' => '5']);
break;
case 'content':
$form = form_input($field, $value, ["placeholder" => "예)123.123.123.123", "style" => "width:200px; ::placeholder{color:silver; opacity: 1;}"]);

View File

@ -48,7 +48,7 @@ class AuthModel extends CommonModel
{
switch ($field) {
default:
$this->orderBy(self::TITLE, 'asc');
$this->orderBy(self::PK, 'asc');
$options = parent::getFormFieldOption($field, $options);
break;
}
@ -61,7 +61,7 @@ class AuthModel extends CommonModel
}
public function getEntityByID(string $id): null|AuthEntity
{
$this->where('id', $id);
$this->where(self::TITLE, $id);
return $this->getEntity();
}
//create용

View File

@ -75,7 +75,11 @@ class RecordModel extends CommonModel
$this->where(self::TITLE, $id);
return $this->getEntity();
}
public function getEntitysByParent(ZoneEntity $zone_entity)
{
$this->where(self::PARENT, $zone_entity->getPK());
return $this->getEntitys();
}
//create용
public function create(array $formDatas = []): RecordEntity
{
@ -86,11 +90,6 @@ class RecordModel extends CommonModel
{
return $this->modify_process($entity, $formDatas);
}
public function getEntitysByParent(ZoneEntity $zone_entity)
{
$this->where(self::PARENT, $zone_entity->getPK());
return $this->getEntitys();
}
//도메인이 이미 존재하는지 체크
public function isUniqueHost($zone_uid, string $host, string $content): bool
{

View File

@ -125,6 +125,8 @@ abstract class CommonModel extends Model
}
break;
}
// dd($options);
// exit;
return $options;
}
final public function getEntity(): array|object|null

View File

@ -46,9 +46,6 @@
</td>
<?php foreach ($viewDatas['fields'] as $field): ?>
<td><?= getFieldView_AccountHelper($field, $entity, $viewDatas, ['old_auth' => $old_auth]) ?></td>
<?php if ($cnt == 2) {
dd($viewDatas['fields']);
} ?>
<?php endforeach ?>
</tr>
<?php $cnt++ ?>