diff --git a/module/host/config.php b/module/host/config.php index 3ba8d69bc0..c223cdbba6 100644 --- a/module/host/config.php +++ b/module/host/config.php @@ -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'); \ No newline at end of file diff --git a/module/host/config/dtable.php b/module/host/config/dtable.php index bea1e70fdb..e30d53538d 100644 --- a/module/host/config/dtable.php +++ b/module/host/config/dtable.php @@ -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; diff --git a/module/host/control.php b/module/host/control.php index 40bd9fc27f..9dfc311636 100644 --- a/module/host/control.php +++ b/module/host/control.php @@ -1,4 +1,9 @@ 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); } diff --git a/module/host/ui/edit.html.php b/module/host/ui/edit.html.php index 48063815e2..fe96fb5525 100644 --- a/module/host/ui/edit.html.php +++ b/module/host/ui/edit.html.php @@ -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),