This commit is contained in:
zhaoke
2023-02-03 05:35:22 +00:00
parent ffcc487808
commit 4ff09220ba
9 changed files with 13 additions and 6 deletions
+1
View File
@@ -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;
+2 -1
View File
@@ -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)
-1
View File
@@ -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)
}
}
}
+2
View File
@@ -132,6 +132,7 @@
<div class="detail-content article-content"><?php echo !empty($zahost->desc) ? htmlspecialchars_decode($zahost->desc) : $lang->noData;?></div>
</div>
</div>
<?php if(commonModel::hasPriv('zanode', 'browse')):?>
<div class="cell">
<div class="detail">
<div class="detail-title"><?php echo $lang->zahost->browseNode;?></div>
@@ -148,6 +149,7 @@
if($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=zahost&objectID=$zahost->hostID");
?>
</div>
<?php endif; ?>
<?php $this->printExtendFields($zahost, 'div', "position=left&inForm=0&inCell=1");?>
<div class='main-actions'>
<div class="btn-toolbar">
+2 -2
View File
@@ -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);
+1
View File
@@ -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";
+1 -1
View File
@@ -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 = "脚本目录";
+3 -1
View File
@@ -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"';
?>
<td title="<?php echo $snapshot->name;?>"><?php echo $snapshot->localName ? $snapshot->localName : $snapshot->name;?></td>
<td class='snapshot-status-<?php echo zget($snapshot, 'id', 0);?>'><?php echo zget($lang->zanode->snapshot->statusList, $snapshot->status, '');?></td>
@@ -46,7 +48,7 @@
<td class='c-actions'>
<?php if(common::hasPriv('zanode', 'editSnapshot')) echo html::a('###', '<i class="icon-edit"></i>', 'hiddenwin', "title={$lang->zanode->editSnapshot} onclick='window.parent.editSnapshot(\"" . $this->createLink('zanode', 'editSnapshot', "snapshotID={$snapshot->id}") . "\")' class='btn'");?>
<?php if(common::hasPriv('zanode', 'restoreSnapshot')) echo html::a($this->createLink('zanode', 'restoreSnapshot', "nodeID={$nodeID}&snapshotID={$snapshot->id}"), '<i class="icon-restart"></i>', 'hiddenwin', $restoreAttr);?>
<?php if(common::hasPriv('zanode', 'deleteSnapshot')) echo html::a($this->createLink('zanode', 'deleteSnapshot', "snapshotID={$snapshot->id}"), '<i class="icon-trash"></i>', 'hiddenwin', "title={$lang->zanode->deleteSnapshot} class='btn'");?>
<?php if(common::hasPriv('zanode', 'deleteSnapshot')) echo html::a($this->createLink('zanode', 'deleteSnapshot', "snapshotID={$snapshot->id}"), '<i class="icon-trash"></i>', 'hiddenwin', $deleteAttr);?>
</td>
</tr>
<?php endforeach;?>
+1
View File
@@ -11,6 +11,7 @@
* @link http://www.zentao.net
*/
?>
<?php js::set('showFeature', false);?>
<?php include $app->getModuleRoot() . 'common/view/header.html.php'; ?>
<div id='mainContent' class='main-table'>
<?php $vars = "id={$hostID}&orderBy=%s"; ?>