* Add actions of host view.

This commit is contained in:
zhaoke
2023-07-21 14:29:57 +08:00
parent 20edf79ecf
commit 60f2808735
4 changed files with 43 additions and 31 deletions
+4
View File
@@ -28,3 +28,7 @@ $config->host->featureBar = array(
'url' => helper::createLink('host', 'treemap', 'type=group'),
),
);
$config->host->actions = new stdclass();
$config->host->actions->view = array();
$config->host->actions->view['suffixActions'] = array('edit', 'delete');
+7 -5
View File
@@ -76,13 +76,15 @@ $config->host->actionList['offline']['url'] = helper::createLink('host',
$config->host->actionList['edit']['icon'] = 'edit';
$config->host->actionList['edit']['text'] = $lang->edit;
$config->host->actionList['edit']['hint'] = $lang->edit;
$config->host->actionList['edit']['showText'] = true;
$config->host->actionList['edit']['url'] = array('module' => 'host', 'method' => 'edit', 'params' => 'id={id}');
$config->host->actionList['delete']['icon'] = 'trash';
$config->host->actionList['delete']['text'] = $lang->delete;
$config->host->actionList['delete']['hint'] = $lang->delete;
$config->host->actionList['delete']['ajaxSubmit'] = true;
$config->host->actionList['delete']['url'] = array('module' => 'host', 'method' => 'delete', 'params' => 'id={id}');
$config->host->actionList['delete']['icon'] = 'trash';
$config->host->actionList['delete']['text'] = $lang->delete;
$config->host->actionList['delete']['hint'] = $lang->delete;
$config->host->actionList['delete']['showText'] = true;
$config->host->actionList['delete']['data-confirm'] = $lang->host->confirmDelete;
$config->host->actionList['delete']['url'] = array('module' => 'host', 'method' => 'delete', 'params' => 'id={id}');
$config->host->dtable->fieldList['actions']['name'] = 'actions';
$config->host->dtable->fieldList['actions']['title'] = $lang->actions;
+12 -6
View File
@@ -1,4 +1,9 @@
<?php
use Symfony\Component\Yaml\Inline;
use function zin\isAjaxRequest;
/**
* The control file of host of ZenTaoPMS.
*
@@ -113,9 +118,7 @@ class host extends control
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
}
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => inlink('browse'), 'closeModal' => true));
}
$this->view->accounts = $this->loadModel('account')->getPairs();
@@ -158,9 +161,12 @@ class host extends control
}
else
{
$response['result'] = 'success';
$response['message'] = '';
$response['load'] = true;
$response['result'] = 'success';
$response['message'] = '';
$response['load'] = true;
$response['closeModal'] = true;
if(helper::isAjaxRequest('modal')) return print(js::execute("loadCurrentPage();$('.modal').removeClass('show')"));
}
$this->send($response);
}
+20 -20
View File
@@ -22,14 +22,14 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('name'),
set::label($lang->host->name),
set::value($host->name),
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->admin),
set::control('picker'),
set::name('admin'),
@@ -41,7 +41,7 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->cpuBrand),
set::control('picker'),
set::name('cpuBrand'),
@@ -50,7 +50,7 @@ formPanel
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('cpuModel'),
set::label($lang->host->cpuModel),
set::value($host->cpuModel),
@@ -60,14 +60,14 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('cpuNumber'),
set::label($lang->host->cpuNumber),
set::value($host->cpuNumber),
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('cpuCores'),
set::label($lang->host->cpuCores),
set::value($host->cpuCores),
@@ -77,7 +77,7 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('memory'),
set::label($lang->host->memory),
set::value($host->memory),
@@ -90,7 +90,7 @@ formPanel
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('diskSize'),
set::label($lang->host->diskSize),
set::value($host->diskSize),
@@ -106,7 +106,7 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->group),
set::control('picker'),
set::name('group'),
@@ -115,7 +115,7 @@ formPanel
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->serverRoom),
set::control('picker'),
set::name('serverRoom'),
@@ -127,14 +127,14 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('serverModel'),
set::label($lang->host->serverModel),
set::value($host->serverModel),
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->hostType),
set::control('picker'),
set::name('hostType'),
@@ -146,7 +146,7 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->osName),
set::control('picker'),
set::name('osName'),
@@ -156,7 +156,7 @@ formPanel
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->osVersion),
set::control('picker'),
set::name('osVersion'),
@@ -168,14 +168,14 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('zap'),
set::label($lang->host->zap),
set::value($host->zap ? $host->zap : 8086),
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->tags),
set::control('picker'),
set::name('vsoft'),
@@ -187,14 +187,14 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('intranet'),
set::label($lang->host->intranet),
set::value($host->intranet),
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('extranet'),
set::label($lang->host->extranet),
set::value($host->extranet),
@@ -204,7 +204,7 @@ formPanel
(
formGroup
(
set::width('1/3'),
set::width('400px'),
set::label($lang->host->provider),
set::control('picker'),
set::name('provider'),
@@ -213,7 +213,7 @@ formPanel
),
formGroup
(
set::width('1/3'),
set::width('400px'),
set::name('status'),
set::control('radioList'),
set::label($lang->host->status),