From 4ff09220baf159aadcbabb5ffba08cfcf357f72a Mon Sep 17 00:00:00 2001 From: zhaoke Date: Fri, 3 Feb 2023 05:35:22 +0000 Subject: [PATCH] * Fix bug #31896. --- module/action/config.php | 1 + module/zahost/control.php | 3 ++- module/zahost/js/view.js | 1 - module/zahost/view/view.html.php | 2 ++ module/zanode/control.php | 4 ++-- module/zanode/lang/en.php | 1 + module/zanode/lang/zh-cn.php | 2 +- module/zanode/view/browsesnapshot.html.php | 4 +++- module/zanode/view/list.html.php | 1 + 9 files changed, 13 insertions(+), 6 deletions(-) diff --git a/module/action/config.php b/module/action/config.php index aae2118c64..77eaec4b92 100755 --- a/module/action/config.php +++ b/module/action/config.php @@ -49,6 +49,7 @@ $config->action->objectNameFields['stage'] = 'name'; $config->action->objectNameFields['apistruct'] = 'name'; $config->action->objectNameFields['repo'] = 'name'; $config->action->objectNameFields['dataview'] = 'name'; +$config->action->objectNameFields['zahost'] = 'name'; $config->action->objectNameFields['zanode'] = 'name'; $config->action->commonImgSize = 870; diff --git a/module/zahost/control.php b/module/zahost/control.php index a6f09f613c..a49ab2902a 100644 --- a/module/zahost/control.php +++ b/module/zahost/control.php @@ -168,8 +168,9 @@ class zahost extends control return print(js::confirm($this->lang->zahost->confirmDelete, inlink('delete', "hostID=$hostID&confirm=yes"))); } - $this->zahost->delete(TABLE_ZAHOST, $hostID); + $this->dao->update(TABLE_ZAHOST)->set('deleted')->eq(1)->where('id')->eq($hostID)->exec(); $this->loadModel('action')->create('zahost', $hostID, 'deleted'); + $this->loadModel('action')->create('zahost', $hostID, 'deleted', '', $extra = ACTIONMODEL::CAN_UNDELETED); /* if ajax request, send result. */ if($this->server->ajax) diff --git a/module/zahost/js/view.js b/module/zahost/js/view.js index 4df1246224..2b07966f7c 100644 --- a/module/zahost/js/view.js +++ b/module/zahost/js/view.js @@ -76,7 +76,6 @@ function setIframeHeight(iframe) { var height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight iframe.height = height+10; - console.log(1111, iframe.height) } } } \ No newline at end of file diff --git a/module/zahost/view/view.html.php b/module/zahost/view/view.html.php index 61d09e08fe..012ba10e13 100644 --- a/module/zahost/view/view.html.php +++ b/module/zahost/view/view.html.php @@ -132,6 +132,7 @@
desc) ? htmlspecialchars_decode($zahost->desc) : $lang->noData;?>
+
zahost->browseNode;?>
@@ -148,6 +149,7 @@ if($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=zahost&objectID=$zahost->hostID"); ?>
+ printExtendFields($zahost, 'div', "position=left&inForm=0&inCell=1");?>
diff --git a/module/zanode/control.php b/module/zanode/control.php index 76cd0eb876..595e650db2 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -78,9 +78,9 @@ class zanode extends control */ public function list($hostID, $orderBy = 'id_desc') { - if(!commonModel::hasPriv('zahost', 'view')) + if(!commonModel::hasPriv('zanode', 'browse')) { - $this->loadModel('common')->deny('zahost', 'view'); + $this->loadModel('common')->deny('zanode', 'browse'); } $this->view->title = $this->lang->zanode->common; $this->view->nodeList = $this->loadModel("zanode")->getListByHost($hostID, $orderBy); diff --git a/module/zanode/lang/en.php b/module/zanode/lang/en.php index 78417a405f..dcada9c8bd 100644 --- a/module/zanode/lang/en.php +++ b/module/zanode/lang/en.php @@ -49,6 +49,7 @@ $lang->zanode->confirmShutdown = "Are you sure to shutdown the ZenAgent Node?"; $lang->zanode->confirmSuspend = "Are you sure to suspend the ZenAgent Node?"; $lang->zanode->confirmResume = "Are you sure to resume the ZenAgent Node?"; $lang->zanode->confirmRestore = "Are you sure to restore the ZenAgent Node?"; +$lang->zanode->confirmRestore = "The ZenAgent Node will be restored to this snapshot state, are you sure you want to continue?"; $lang->zanode->actionSuccess = 'Success'; $lang->zanode->deleted = "Deleted"; $lang->zanode->scriptPath = "Script path"; diff --git a/module/zanode/lang/zh-cn.php b/module/zanode/lang/zh-cn.php index f499d510d7..4ea8485bf4 100644 --- a/module/zanode/lang/zh-cn.php +++ b/module/zanode/lang/zh-cn.php @@ -48,7 +48,7 @@ $lang->zanode->confirmReboot = "您确定重启执行节点吗?"; $lang->zanode->confirmShutdown = "您确定关闭执行节点吗?"; $lang->zanode->confirmSuspend = "您确定休眠执行节点吗?"; $lang->zanode->confirmResume = "您确定恢复执行节点吗?"; -$lang->zanode->confirmRestore = "您确定还原执行节点吗?"; +$lang->zanode->confirmRestore = "执行节点将会还原至此快照状态,您确定要继续么?"; $lang->zanode->actionSuccess = '操作成功'; $lang->zanode->deleted = "已删除"; $lang->zanode->scriptPath = "脚本目录"; diff --git a/module/zanode/view/browsesnapshot.html.php b/module/zanode/view/browsesnapshot.html.php index 3686889565..1f5ebda9a4 100644 --- a/module/zanode/view/browsesnapshot.html.php +++ b/module/zanode/view/browsesnapshot.html.php @@ -38,6 +38,8 @@ $snapshot->status = ($snapshot->status == 'restoring' && time() - strtotime($snapshot->restoreDate) > 600) ? 'restore_failed' : $snapshot->status; $restoreAttr = "title='{$lang->zanode->restoreSnapshot}' target='hiddenwin'"; $restoreAttr .= $snapshot->status == 'restoring' ? ' class="btn disabled"' : 'class="btn"'; + $deleteAttr = "title='{$lang->zanode->deleteSnapshot}' target='hiddenwin'"; + $deleteAttr .= $snapshot->status == 'restoring' ? ' class="btn disabled"' : 'class="btn"'; ?> localName ? $snapshot->localName : $snapshot->name;?> '>zanode->snapshot->statusList, $snapshot->status, '');?> @@ -46,7 +48,7 @@ ', 'hiddenwin', "title={$lang->zanode->editSnapshot} onclick='window.parent.editSnapshot(\"" . $this->createLink('zanode', 'editSnapshot', "snapshotID={$snapshot->id}") . "\")' class='btn'");?> createLink('zanode', 'restoreSnapshot', "nodeID={$nodeID}&snapshotID={$snapshot->id}"), '', 'hiddenwin', $restoreAttr);?> - createLink('zanode', 'deleteSnapshot', "snapshotID={$snapshot->id}"), '', 'hiddenwin', "title={$lang->zanode->deleteSnapshot} class='btn'");?> + createLink('zanode', 'deleteSnapshot', "snapshotID={$snapshot->id}"), '', 'hiddenwin', $deleteAttr);?> diff --git a/module/zanode/view/list.html.php b/module/zanode/view/list.html.php index 084e62a41a..37e595a1e5 100644 --- a/module/zanode/view/list.html.php +++ b/module/zanode/view/list.html.php @@ -11,6 +11,7 @@ * @link http://www.zentao.net */ ?> + getModuleRoot() . 'common/view/header.html.php'; ?>