Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaopms_289

This commit is contained in:
caoyanyi
2023-02-28 13:53:09 +08:00
49 changed files with 226 additions and 94 deletions
+13
View File
@@ -84,6 +84,19 @@ class hostHeartbeatEntry extends baseEntry
if($heartbeat > 0) $vmData['heartbeat'] = date("Y-m-d H:i:s", $heartbeat);
$this->dao->update(TABLE_ZAHOST)->data($vmData)->where('mac')->eq($vm->macAddress)->exec();
if($vm->status == 'running')
{
$node = $this->loadModel('zanode')->getNodeByMac($vm->macAddress);
if(!empty($node))
{
$snaps = $this->loadModel('zanode')->getSnapshotList($node->id);
if(empty($snaps))
{
if($vm->status == 'running') $this->loadModel('zanode')->createDefaultSnapshot($node->id);
}
}
}
}
}
+10 -2
View File
@@ -40,13 +40,21 @@ class hostSubmitEntry extends baseEntry
if(!$id) return $this->sendError(400, 'Secret error.');
$imageInfo = $this->dao->select('`status`,`from`')->from(TABLE_IMAGE)
$imageInfo = $this->dao->select('`status`,`from`', 'name')->from(TABLE_IMAGE)
->where('id')->eq($task)
->fetch();
if(empty($imageInfo)) return $this->sendSuccess(200, 'success');
if($imageInfo->from == 'snapshot' && $imageInfo->status == 'restoring')
{
$image->status = $image->status == 'completed' ? 'restore_completed' : 'restore_failed';
if(in_array($image->status, array('failed', 'completed'))) $image->status = $image->status == 'completed' ? 'restore_completed' : 'restore_failed';
}
else if($imageInfo->from == 'snapshot' && $imageInfo->status == 'creating')
{
if($image->status == 'failed')
{
$this->dao->delete()->from(TABLE_IMAGE)->where("id")->eq($task)->exec();
return $this->sendSuccess(200, 'success');
}
}
$this->dao->update(TABLE_IMAGE)->data($image)->where("id")->eq($task)->exec();
+1
View File
@@ -406,6 +406,7 @@ $config->objectTables['apistruct'] = TABLE_APISTRUCT;
$config->objectTables['repo'] = TABLE_REPO;
$config->objectTables['dataview'] = TABLE_DATAVIEW;
$config->objectTables['zahost'] = TABLE_ZAHOST;
$config->objectTables['zanode'] = TABLE_ZAHOST;
$config->objectTables['automation'] = TABLE_AUTOMATION;
$config->objectTables['stepResult'] = TABLE_TESTRUN;
+1 -8
View File
@@ -6385,14 +6385,7 @@ REPLACE INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`) V
('zh-cn', 'custom', 'URSRList', '3', '{\"SRName\":\"\\u8f6f\\u9700\",\"URName\":\"\\u7528\\u9700\"}', '1'),('zh-cn', 'custom', 'URSRList', '4', '{\"SRName\":\"\\u6545\\u4e8b\",\"URName\":\"\\u53f2\\u8bd7\"}', '1'),
('zh-cn', 'custom', 'URSRList', '5', '{\"SRName\":\"\\u9700\\u6c42\",\"URName\":\"\\u7528\\u6237\\u9700\\u6c42\"}', '1'),
('en', 'custom', 'URSRList', '1', '{\"SRName\":\"Story\",\"URName\":\"Epic\"}', '0'),
('en', 'custom', 'URSRList', '2', '{\"SRName\":\"Software Requirement\",\"URName\":\"User Requirement\"}', '0'),
('all','stage','typeList','request','需求', '1'),
('all','stage','typeList','design','设计', '1'),
('all','stage','typeList','dev','开发', '1'),
('all','stage','typeList','qa','测试', '1'),
('all','stage','typeList','release','发布', '1'),
('all','stage','typeList','review','总结评审','1'),
('all','stage','typeList','other','其他','1');
('en', 'custom', 'URSRList', '2', '{\"SRName\":\"Software Requirement\",\"URName\":\"User Requirement\"}', '0');
REPLACE INTO `zt_stage` (`name`,`percent`,`type`,`projectType`,`createdBy`,`createdDate`,`editedBy`,`editedDate`,`deleted`) VALUES
('需求','10','request','waterfall','admin','2020-02-08 21:08:30','admin','2020-02-12 13:50:27','0'),
+2
View File
@@ -938,6 +938,8 @@ class actionModel extends model
}
else
{
if($actionType == 'restoredsnapshot' && in_array($action->objectType, array('vm', 'zanode')) && $value == 'defaultSnap') $value = $this->lang->$objectType->snapshot->defaultSnapName;
$desc = str_replace('$' . $key, $value, $desc);
}
}
+3 -3
View File
@@ -8,7 +8,7 @@ if(!isset($config->safe)) $config->safe = new stdclass();
if(!isset($config->safe->weak)) $config->safe->weak = '123456,password,12345,12345678,qwerty,123456789,1234,1234567,abc123,111111,123123';
$config->admin->menuGroup['system'] = array('custom|mode', 'backup', 'cron', 'action|trash', 'admin|xuanxuan', 'setting|xuanxuan', 'admin|license', 'admin|checkweak', 'admin|resetpwdsetting', 'admin|safe', 'custom|timezone', 'search|buildindex', 'admin|tableengine', 'ldap', 'custom|libreoffice', 'conference', 'client');
$config->admin->menuGroup['user'] = array('dept', 'company', 'user', 'group');
$config->admin->menuGroup['company'] = array('dept', 'company', 'user', 'group', 'tutorial');
$config->admin->menuGroup['switch'] = array('admin|setmodule');
$config->admin->menuGroup['model'] = array('auditcl', 'stage', 'design', 'cmcl', 'reviewcl', 'custom|required', 'custom|set', 'custom|flow', 'custom|code', 'custom|estimate', 'custom|hours', 'subject', 'process', 'activity', 'zoutput', 'classify', 'holiday', 'reviewsetting');
$config->admin->menuGroup['feature'] = array('custom|set', 'custom|product', 'custom|execution', 'custom|required', 'custom|kanban', 'approvalflow', 'measurement', 'meetingroom', 'custom|browsestoryconcept', 'custom|kanban', 'sqlbuilder', 'report');
@@ -72,10 +72,10 @@ $config->admin->extAPIURL = $config->admin->apiSite . 'extension-apiGetExte
$config->admin->patchAPIURL = $config->admin->apiSite . 'extension-apiGetExtensions-bymodule-MTIxOA==-0-100-1.json';
$config->admin->downloadAPIURL = $config->admin->apiSite . 'download.json';
$config->admin->videoAPIURL = $config->admin->apiSite . 'publicclass.json';
$config->admin->liteMenuList = array('system', 'user', 'feature', 'message', 'extension', 'dev');
$config->admin->liteMenuList = array('system', 'company', 'feature', 'message', 'extension', 'dev');
$config->admin->helpURL['system'] = 'https://www.zentao.net/book/zentaopms/538.html';
$config->admin->helpURL['user'] = 'https://www.zentao.net/book/zentaopms/38.html';
$config->admin->helpURL['company'] = 'https://www.zentao.net/book/zentaopms/38.html';
$config->admin->helpURL['switch'] = 'https://www.zentao.net/book/zentaopms/38.html';
$config->admin->helpURL['model'] = 'https://www.zentao.net/book/zentaopms/533.html';
$config->admin->helpURL['feature'] = 'https://www.zentao.net/book/zentaopms/38.html';
+3 -1
View File
@@ -41,7 +41,9 @@
.settings-list > .setting-box > button.btn {padding: 5px 10px; height: 100%; width: 100%; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; white-space: unset; text-align: unset; border: 1px solid rgba(227, 228, 233, 0.6)}
.settings-list > .setting-box > .btn:hover {background: unset;}
.settings-list > .setting-box > .btn[disabled] {cursor: not-allowed; pointer-events: unset;}
.settings-list > .setting-box > .btn[disabled] > a {pointer-events: none;}
.settings-list > .setting-box > .btn[disabled] > a,
.settings-list > .setting-box > .btn[disabled] a.setting-help,
.settings-list > .setting-box > .btn[disabled] p.setting-desc {pointer-events: none;}
.settings-list > .setting-box > .btn > h4 {padding-right: 5px;}
.settings-list > .setting-box > .btn > h4 > div {gap: 3px;}
.settings-list > .setting-box > .btn > h4 > img {padding-right: 8px; padding-bottom: 3px; width: 32px; height: 27px;}
+1
View File
@@ -186,6 +186,7 @@ $lang->admin->updateDynamics = 'Dynamics';
$lang->admin->updatePatch = 'Patch';
$lang->admin->upgradeRecommend = 'Recommend Upgrade';
$lang->admin->zentaoUsed = 'You have used ZenTao';
$lang->admin->noPriv = 'You have no permission to visit this block.';
$lang->admin->openTag = 'ZenTao Opensource ';
$lang->admin->bizTag = 'ZenTao Biz ';
+1
View File
@@ -186,6 +186,7 @@ $lang->admin->updateDynamics = 'Dynamics';
$lang->admin->updatePatch = 'Patch';
$lang->admin->upgradeRecommend = 'Recommend Upgrade';
$lang->admin->zentaoUsed = 'You have used ZenTao';
$lang->admin->noPriv = 'You have no permission to visit this block.';
$lang->admin->openTag = 'ZenTao Opensource ';
$lang->admin->bizTag = 'ZenTao Biz ';
+1
View File
@@ -186,6 +186,7 @@ $lang->admin->updateDynamics = 'Dynamics';
$lang->admin->updatePatch = 'Patch';
$lang->admin->upgradeRecommend = 'Recommend Upgrade';
$lang->admin->zentaoUsed = 'You have used ZenTao';
$lang->admin->noPriv = 'You have no permission to visit this block.';
$lang->admin->openTag = 'ZenTao Opensource ';
$lang->admin->bizTag = 'ZenTao Biz ';
+16 -15
View File
@@ -10,9 +10,9 @@ $lang->admin->menuList->switch['desc'] = $lang->admin->menuSetting['switch']['d
$lang->admin->menuList->switch['link'] = 'admin|setmodule';
$lang->admin->menuList->switch['order'] = 10;
$lang->admin->menuList->user['name'] = $lang->admin->menuSetting['user']['name'];
$lang->admin->menuList->user['desc'] = $lang->admin->menuSetting['user']['desc'];
$lang->admin->menuList->user['order'] = 15;
$lang->admin->menuList->company['name'] = $lang->admin->menuSetting['user']['name'];
$lang->admin->menuList->company['desc'] = $lang->admin->menuSetting['user']['desc'];
$lang->admin->menuList->company['order'] = 15;
$lang->admin->menuList->model['name'] = $lang->admin->menuSetting['model']['name'];
$lang->admin->menuList->model['desc'] = $lang->admin->menuSetting['model']['desc'];
@@ -64,13 +64,13 @@ $lang->admin->menuList->system['menuOrder']['50'] = 'tableengine';
$lang->admin->menuList->system['dividerMenu'] = ',safe,';
$lang->admin->menuList->user['subMenu']['dept'] = array('link' => "{$lang->dept->common}|dept|browse|", 'subModule' => 'dept');
$lang->admin->menuList->user['subMenu']['user'] = array('link' => "{$lang->user->common}|company|browse|", 'subModule' => 'user');
$lang->admin->menuList->user['subMenu']['group'] = array('link' => "{$lang->priv}|group|browse|", 'subModule' => 'group');
$lang->admin->menuList->company['subMenu']['dept'] = array('link' => "{$lang->dept->common}|dept|browse|", 'subModule' => 'dept');
$lang->admin->menuList->company['subMenu']['browseUser'] = array('link' => "{$lang->user->common}|company|browse|", 'subModule' => 'user,tutorial');
$lang->admin->menuList->company['subMenu']['group'] = array('link' => "{$lang->priv}|group|browse|", 'subModule' => 'group');
$lang->admin->menuList->user['menuOrder']['5'] = 'dept';
$lang->admin->menuList->user['menuOrder']['10'] = 'user';
$lang->admin->menuList->user['menuOrder']['15'] = 'group';
$lang->admin->menuList->company['menuOrder']['5'] = 'dept';
$lang->admin->menuList->company['menuOrder']['10'] = 'browseUser';
$lang->admin->menuList->company['menuOrder']['15'] = 'group';
$lang->admin->menuList->model['subMenu']['common'] = array('link' => "{$lang->globalSetting}|custom|required|module=project", 'subModule' => 'custom,subject,holiday,stage', 'exclude' => 'stage-browse,stage-plusbrowse,stage-create,stage-edit,stage-batchcreate');
$lang->admin->menuList->model['subMenu']['scrum'] = array('link' => "{$lang->scrumModel}|auditcl|scrumbrowse|", 'subModule' => 'auditcl');
@@ -85,21 +85,22 @@ $lang->admin->menuList->model['menuOrder']['20'] = 'agileplus';
$lang->admin->menuList->model['menuOrder']['25'] = 'waterfallplus';
$lang->admin->menuList->model['tabMenu']['common']['project'] = array('link' => "{$lang->project->common}|custom|required|module=project", 'alias' => 'set', 'exclude' => 'custom', 'links' => array('custom|set|module=project&field=unitList'));
$lang->admin->menuList->model['tabMenu']['common']['stage'] = array('link' => "{$lang->stage->type}|stage|settype|", 'subModule' => 'stage', 'links' => array('stage|browse|'));
if(helper::hasFeature('waterfall') or helper::hasFeature('waterfallplus')) $lang->admin->menuList->model['tabMenu']['common']['stage'] = array('link' => "{$lang->stage->type}|stage|settype|", 'subModule' => 'stage', 'links' => array('stage|browse|'));
$lang->admin->menuList->model['tabMenu']['common']['build'] = array('link' => "{$lang->build->common}|custom|required|module=build", 'alias' => 'set', 'exclude' => 'custom');
$lang->admin->menuList->model['tabMenu']['common']['flow'] = array('link' => "{$lang->custom->flow}|custom|flow|", 'divider' => true);
$lang->admin->menuList->model['tabMenu']['common']['code'] = array('link' => "{$lang->code}|custom|code|");
$lang->admin->menuList->model['tabMenu']['common']['hours'] = array('link' => "{$lang->workingHour}|custom|hours|", 'subModule' => 'holiday', 'links' => array('holiday|browse|', 'custom|hours'));
$lang->admin->menuList->model['tabMenu']['waterfall']['stage'] = array('link' => "{$lang->stage->list}|stage|browse|", 'subModule' => 'stage', 'exclude' => 'stage-plusbrowse');
$lang->admin->menuList->model['tabMenu']['waterfallplus']['stage'] = array('link' => "{$lang->stage->list}|stage|plusbrowse|", 'subModule' => 'stage', 'exclude' => 'stage-browse');
if(helper::hasFeature('waterfall')) $lang->admin->menuList->model['tabMenu']['waterfall']['stage'] = array('link' => "{$lang->stage->list}|stage|browse|", 'subModule' => 'stage', 'exclude' => 'stage-plusbrowse');
if(helper::hasFeature('waterfallplus')) $lang->admin->menuList->model['tabMenu']['waterfallplus']['stage'] = array('link' => "{$lang->stage->list}|stage|plusbrowse|", 'subModule' => 'stage', 'exclude' => 'stage-browse');
$lang->admin->menuList->model['tabMenu']['menuOrder']['common']['5'] = 'project';
$lang->admin->menuList->model['tabMenu']['menuOrder']['common']['7'] = 'stage';
if(helper::hasFeature('waterfall') or helper::hasFeature('waterfallplus')) $lang->admin->menuList->model['tabMenu']['menuOrder']['common']['7'] = 'stage';
$lang->admin->menuList->model['tabMenu']['menuOrder']['common']['10'] = 'build';
$lang->admin->menuList->model['tabMenu']['menuOrder']['common']['35'] = 'flow';
$lang->admin->menuList->model['tabMenu']['menuOrder']['common']['40'] = 'code';
$lang->admin->menuList->model['tabMenu']['menuOrder']['common']['45'] = 'hours';
$lang->admin->menuList->model['tabMenu']['menuOrder']['waterfall']['5'] = 'stage';
$lang->admin->menuList->model['tabMenu']['menuOrder']['waterfallplus']['5'] = 'stage';
if(helper::hasFeature('waterfall')) $lang->admin->menuList->model['tabMenu']['menuOrder']['waterfall']['5'] = 'stage';
if(helper::hasFeature('waterfallplus')) $lang->admin->menuList->model['tabMenu']['menuOrder']['waterfallplus']['5'] = 'stage';
$lang->admin->menuList->feature['subMenu']['my'] = array('link' => "{$lang->my->common}|custom|set|module=todo&field=priList", 'exclude' => 'set,required');
$lang->admin->menuList->feature['subMenu']['product'] = array('link' => "{$lang->productCommon}|custom|required|module=product", 'exclude' => 'set,required', 'alias' => 'browsestoryconcept,product');
+1
View File
@@ -186,6 +186,7 @@ $lang->admin->updateDynamics = '更新动态';
$lang->admin->updatePatch = '补丁更新';
$lang->admin->upgradeRecommend = '推荐升级';
$lang->admin->zentaoUsed = '您已使用禅道';
$lang->admin->noPriv = '您没有访问该区块的权限。';
$lang->admin->openTag = '禅道';
$lang->admin->bizTag = '禅道企业版';
+1 -1
View File
@@ -19,7 +19,7 @@
<div class="settings-list <?php if($config->vision == 'lite') echo 'lite-setting';?>">
<?php foreach($lang->admin->menuList as $menuKey => $menu):?>
<?php if($config->vision == 'lite' and !in_array($menuKey, $config->admin->liteMenuList)) continue;?>
<div class="setting-box">
<div class="setting-box" <?php if($menu['disabled']) echo "title={$lang->admin->noPriv}";?> data-id="<?php echo $menuKey;?>">
<button class="btn shadow-primary-hover" <?php if($menu['disabled']) echo 'disabled';?> data-link='<?php echo $menu['link'];?>'>
<h4 class="flex align-center w-full">
<div class="flex align-center">
+9 -2
View File
@@ -995,14 +995,21 @@ class customModel extends model
foreach($this->config->custom->dataFeatures as $feature)
{
$function = 'has' . ucfirst($feature) . 'Data';
if(!$this->$function()) $disabledFeatures .= "$feature,";
if(!$this->$function())
{
$disabledFeatures .= "$feature,";
if(strpos($feature, 'scrum') === 0) $disabledFeatures .= 'agileplus' . substr($feature, 5) . ',';
}
}
$disabledFeatures .= 'scrumMeasrecord,productTrack,productRoadmap';
$disabledFeatures .= 'scrumMeasrecord,agileplusMeasrecord,productTrack,productRoadmap';
}
$disabledFeatures = rtrim($disabledFeatures, ',');
$this->loadModel('setting')->setItem('system.common.disabledFeatures', $disabledFeatures);
$URAndSR = strpos(",$disabledFeatures,", ',productUR,') === false ? 1 : 0;
$this->setting->setItem('system.custom.URAndSR', $URAndSR);
$this->processMeasrecordCron();
}
+4
View File
@@ -472,6 +472,7 @@ class execution extends control
$this->view->users = $users;
$this->view->moduleID = 0;
$this->view->moduleName = $this->lang->tree->all;
$this->view->features = $this->execution->getExecutionFeatures($execution);
$this->view->filter = $filter;
$this->view->allCount = $allCount;
$this->display();
@@ -1548,6 +1549,7 @@ class execution extends control
$this->view->executionName = $execution->name;
$this->view->executionID = $executionID;
$this->view->chartData = $chartData;
$this->view->features = $this->execution->getExecutionFeatures($execution);
$this->view->begin = $begin;
$this->view->end = $end;
$this->view->minDate = $minDate;
@@ -2590,6 +2592,7 @@ class execution extends control
$this->view->chartData = $chartData;
$this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable.
$this->view->type = $type;
$this->view->features = $this->execution->getExecutionFeatures($execution);
$this->view->project = $this->loadModel('project')->getByID($execution->project);
$this->display();
@@ -2951,6 +2954,7 @@ class execution extends control
$this->view->executionID = $executionID;
$this->view->level = $type;
$this->view->tree = $this->execution->printTree($tree, $project->hasProduct);
$this->view->features = $this->execution->getExecutionFeatures($execution);
$this->display();
}
+2 -2
View File
@@ -33,11 +33,11 @@
$weekend = $withWeekend == 'true' ? 'noweekend' : 'withweekend';
echo html::a('#', $lang->execution->$weekend, '', "class='btn btn-link' id='weekend'");
?>
<?php if($execution->lifetime != 'ops' and !in_array($execution->attribute, array('request', 'review'))):?>
<?php if(!$features['story']) unset($lang->execution->cfdTypeList['story']);?>
<?php if(!$features['qa']) unset($lang->execution->cfdTypeList['bug']);?>
<div class='input-control w-140px'>
<?php echo html::select('type', $lang->execution->cfdTypeList, $type, "class='form-control chosen'");?>
</div>
<?php endif;?>
<div id="cfdDateSelect">
<form method='post' class='form-ajax not-watch'>
<div class='input-group'>
+1 -1
View File
@@ -63,7 +63,7 @@
$link = common::hasPriv('execution', 'importTask') ? $this->createLink('execution', 'importTask', "execution=$execution->id") : '#';
echo "<li $class>" . html::a($link, $lang->execution->importTask, '', $misc) . "</li>";
if(isset($this->lang->execution->menu->qa))
if($features['qa'])
{
$class = common::hasPriv('execution', 'importBug') ? '' : "class=disabled";
$misc = common::hasPriv('execution', 'importBug') ? "class='import'" : "class=disabled";
+6 -3
View File
@@ -41,9 +41,12 @@
$link = common::hasPriv('execution', 'importTask') ? $this->createLink('execution', 'importTask', "execution=$execution->id") : '#';
echo "<li $misc>" . html::a($link, $lang->execution->importTask, '', $misc) . "</li>";
$misc = common::hasPriv('execution', 'importBug') ? '' : "class=disabled";
$link = common::hasPriv('execution', 'importBug') ? $this->createLink('execution', 'importBug', "execution=$execution->id") : '#';
echo "<li $misc>" . html::a($link, $lang->execution->importBug, '', $misc) . "</li>";
if($features['qa'])
{
$misc = common::hasPriv('execution', 'importBug') ? '' : "class=disabled";
$link = common::hasPriv('execution', 'importBug') ? $this->createLink('execution', 'importBug', "execution=$execution->id") : '#';
echo "<li $misc>" . html::a($link, $lang->execution->importBug, '', $misc) . "</li>";
}
?>
</ul>
</div>
+3 -4
View File
@@ -420,14 +420,13 @@
<table class="table table-data data-basic">
<tbody>
<tr>
<?php if($execution->lifetime == 'ops' or in_array($execution->attribute, array('request', 'review'))):?>
<th><?php echo $lang->task->common;?></th>
<td><?php echo $statData->taskCount;?></td>
<?php else:?>
<?php if($features['story']):?>
<th><?php echo $lang->story->common;?></th>
<td><?php echo $statData->storyCount;?></td>
<?php endif;?>
<th><?php echo $lang->task->common;?></th>
<td><?php echo $statData->taskCount;?></td>
<?php if($features['qa']):?>
<th><?php echo $lang->bug->common;?></th>
<td><?php echo $statData->bugCount;?></td>
<?php endif;?>
+1 -1
View File
@@ -236,7 +236,7 @@ class group extends control
}
$this->lang->custom->common = $this->lang->group->config;
if($this->config->edition == 'max' and $this->config->vision == 'rnd' and (!$menu or $menu == 'admin')) $this->lang->baseline->common = $this->lang->group->docTemplate;
if($this->config->edition == 'max' and $this->config->vision == 'rnd' and isset($this->lang->baseline)) $this->lang->baseline->common = $this->lang->group->docTemplate;
$this->view->group = $group;
$this->view->changelogs = ',' . join(',', $changelog) . ',';
+2
View File
@@ -7,3 +7,5 @@
.table-import {padding: 6px 5px 5px 5px; }
.shadow-sm {box-shadow: 0 1px 1px rgb(0 0 0 / 5%), 0 2px 6px 0 rgb(0 0 0 / 25%)}
.flex-center {display: flex; align-items: center; justify-content: center;}
.c-desc {width: 280px;}
p.c-desc {white-space: nowrap; margin-bottom: 0; text-overflow: clip; overflow: hidden;}
View File
View File
+3 -3
View File
@@ -36,12 +36,12 @@
</div>
</div>
<table class='table has-sort-head'>
<thead class="shadow-sm">
<thead <?php if(empty($holidays)) echo 'class="shadow-sm"';?>>
<tr>
<th class='c-name'><?php echo $lang->holiday->name;?></th>
<th class='c-time-limit'><?php echo $lang->holiday->holiday;?></th>
<th class='c-status'><?php echo $lang->holiday->type;?></th>
<th class='c-object'><?php echo $lang->holiday->desc;?></th>
<th class='c-desc'><?php echo $lang->holiday->desc;?></th>
<th class='c-actions-2'><?php echo $lang->actions;?></th>
</tr>
</thead>
@@ -51,7 +51,7 @@
<td><?php echo $holiday->name;?></td>
<td><?php echo formatTime($holiday->begin, DT_DATE1) . ' ~ ' . formatTime($holiday->end, DT_DATE1);?></td>
<td><?php echo zget($lang->holiday->typeList, $holiday->type);?></td>
<td><?php echo $holiday->desc;?></td>
<td><p class='c-desc'><?php echo $holiday->desc;?></p></td>
<td class=" c-actions">
<?php common::printIcon('holiday', 'edit', "id=$holiday->id", $holiday, 'list', '', '', 'iframe', 'yes');?>
<?php common::printIcon('holiday', 'delete', "id=$holiday->id", $holiday, 'list', '', 'hiddenwin');?>
View File
+1 -1
View File
@@ -123,7 +123,7 @@ class programplanModel extends model
*/
public function getPairs($executionID, $productID = 0, $type = 'all')
{
$plans = $this->getStage($executionID, $productID, 'all', $orderBy);
$plans = $this->getStage($executionID, $productID, $type);
$pairs = array(0 => '');
+8 -1
View File
@@ -360,7 +360,13 @@ $(function()
else
{
var menuModule = task.nav.menuModule || task.nav['module'];
var $navbar = $$('#navbar');
var $navbar = $$('#navbar');
var adminMenu = false;
if(!$navbar.find('li').length)
{
adminMenu = true;
$navbar = $$('.settings-list');
}
var $navbarItem = $navbar.find('[data-id="' + menuModule + '"]');
var targetPageTip = lang.targetPageTip.replace('%s', task.nav.targetPageName || lang.target);
if($navbarItem.length && !$navbarItem.hasClass('active'))
@@ -408,6 +414,7 @@ $(function()
else
{
var $modulemenu = $$('#subNavbar');
if(adminMenu) $modulemenu = $$('#navbar');
var $modulemenuItem = $modulemenu.find('[data-id="' + task.nav.menu + '"]');
if($modulemenuItem.length && !$modulemenuItem.hasClass('active'))
{
+1 -1
View File
@@ -37,7 +37,7 @@ $lang->tutorial->tasks = array();
$lang->tutorial->tasks['createAccount'] = array('title' => '创建帐号');
$lang->tutorial->tasks['createAccount']['nav'] = array('app' => 'admin', 'module' => 'user', 'method' => 'create', 'menuModule' => 'company', 'menu' => 'browseUser', 'form' => '#createForm', 'requiredFields' => 'account,realname,verifyPassword,password1,password2', 'submit' => '#submit', 'target' => '.create-user-btn', 'targetPageName' => '添加用户');
$lang->tutorial->tasks['createAccount']['desc'] = "<p>在系统创建一个新的用户帐号:</p><ul><li data-target='nav'>打开 <span class='task-nav'>后台 <i class='icon icon-angle-right'></i> 人员 <i class='icon icon-angle-right'></i> 用户 <i class='icon icon-angle-right'></i> 添加用户</span> 页面;</li><li data-target='form'>在添加用户表单中填写新用户信息;</li><li data-target='submit'>保存用户信息。</li></ul>";
$lang->tutorial->tasks['createAccount']['desc'] = "<p>在系统创建一个新的用户帐号:</p><ul><li data-target='nav'>打开 <span class='task-nav'>后台 <i class='icon icon-angle-right'></i> 人员管理 <i class='icon icon-angle-right'></i> 用户 <i class='icon icon-angle-right'></i> 添加用户</span> 页面;</li><li data-target='form'>在添加用户表单中填写新用户信息;</li><li data-target='submit'>保存用户信息。</li></ul>";
$lang->tutorial->tasks['createProgram'] = array('title' => '创建项目集');
$lang->tutorial->tasks['createProgram']['nav'] = array('app' => 'program', 'module' => 'program', 'method' => 'create', 'menuModule' => 'program', 'menu' => '#heading>.header-btn:first,#navbar>.nav>li[data-id="browse"],.create-program-btn', 'form' => '#dataform', 'submit' => '#submit', 'target' => '.create-program-btn', 'targetPageName' => '添加项目集');
+3 -3
View File
@@ -94,8 +94,8 @@ $lang->upgrade->productCount = "%s个{$lang->productCommon}";
$lang->upgrade->projectCount = "%s个{$lang->projectCommon}";
$lang->upgrade->mergeByProject = "当前提供如下2种数据迁移方式,如果历史的{$lang->projectCommon}都是长周期的,那么我们建议把历史的{$lang->projectCommon}作为项目升级。</br>如果历史的{$lang->projectCommon}都是短周期的,那么我们建议把历史的{$lang->projectCommon}作为{$lang->executionCommon}升级。";
$lang->upgrade->mergeRepoTips = "将选中的版本库归并到所选产品下。";
$lang->upgrade->needBuild4Add = '本次升级需要创建索引。请到 [后台->系统->重建索引] 页面,重新创建索引。';
$lang->upgrade->needChangeEngine = '本次升级需要更换表引擎, [后台->系统->表引擎] 页面更换引擎。';
$lang->upgrade->needBuild4Add = '本次升级需要创建索引。请到 [后台->系统设置->重建索引] 页面,重新创建索引。';
$lang->upgrade->needChangeEngine = '本次升级需要更换表引擎, [后台->系统设置->表引擎] 页面更换引擎。';
$lang->upgrade->errorEngineInnodb = '您当前的数据库不支持使用InnoDB数据表引擎,请修改为MyISAM后重试。';
$lang->upgrade->duplicateProject = "同一个项目集内项目名称不能重复,请调整重名的项目名称";
$lang->upgrade->upgradeTips = "历史删除数据不参与升级,升级后将不支持还原,请知悉";
@@ -138,4 +138,4 @@ $lang->upgrade->recoveryActions->cancel = '取消';
$lang->upgrade->recoveryActions->review = '评审';
$lang->upgrade->remark = '备注';
$lang->upgrade->remarkDesc = '后续您还可以在禅道的后台-系统-模式中进行切换。';
$lang->upgrade->remarkDesc = '后续您还可以在禅道的后台-系统设置-模式中进行切换。';
+1
View File
@@ -21,3 +21,4 @@
.icon-refresh {font-size: 15px;}
.load-indicator:after {top: 33%;}
.btn.disabled i {color: #fff;}
#statusContainer{min-height: 120px;}
+1
View File
@@ -35,6 +35,7 @@ function ajaxGetServiceStatus()
setTimeout(function() {
$('#serviceContent').removeClass('loading');
$(".service-status, .status-notice").show()
}, 500);
});
return
+1 -1
View File
@@ -92,7 +92,7 @@ $lang->zahost->image->statusList['created'] = 'Inprogress';
$lang->zahost->image->statusList['canceled'] = 'Not Downloaded';
$lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['pending'] = 'Waiting for download';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['completed'] = 'Usable';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';
+1 -1
View File
@@ -92,7 +92,7 @@ $lang->zahost->image->statusList['created'] = 'Inprogress';
$lang->zahost->image->statusList['canceled'] = 'Not Downloaded';
$lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['pending'] = 'Waiting for download';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['completed'] = 'Usable';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';
+1 -1
View File
@@ -92,7 +92,7 @@ $lang->zahost->image->statusList['created'] = 'Inprogress';
$lang->zahost->image->statusList['canceled'] = 'Not Downloaded';
$lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['pending'] = 'Waiting for download';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['completed'] = 'Usable';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';
+1 -1
View File
@@ -91,7 +91,7 @@ $lang->zahost->image->statusList['created'] = 'Inprogress';
$lang->zahost->image->statusList['canceled'] = 'Not Downloaded';
$lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['pending'] = 'Waiting for download';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['completed'] = 'Usable';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->image->imageEmpty = 'No Image';
+1
View File
@@ -590,6 +590,7 @@ class zahostModel extends model
*/
public function getServiceStatus($host)
{
if(in_array($host->status, array('wait', 'offline'))) return $this->lang->zahost->init->serviceStatus;
$result = json_decode(commonModel::http("http://{$host->extranet}:{$host->zap}/api/v1/service/check", json_encode(array("services" => "all")), array(), array("Authorization:$host->tokenSN")));
if(empty($result) || $result->code != 'success')
{
+1 -4
View File
@@ -105,10 +105,7 @@
<div class="detail-content article-content load-indicator" id='serviceContent'>
<div class="main-row">
<div id="statusContainer">
<div class="text-kvm"><span class="dot-symbol fail"> </span><span>KVM</span></div>
<div class="text-kvm"><span class="dot-symbol fail"> </span><span>Nginx</span></div>
<div class="text-kvm"><span class="dot-symbol fail"> </span><span>noVNC</span></div>
<div class="text-kvm"><span class="dot-symbol fail"> </span><span>Websockify</span></div>
</div>
<div class='result'>
<?php $imageLink = html::a($this->createLink('zahost', 'browseImage', "hostID=$zahost->id", '', true), $lang->zahost->image->downloadImage, '', "class='iframe'");?>
+2 -4
View File
@@ -243,9 +243,7 @@ class zanode extends control
if($error)
{
$response['result'] = 'fail';
$response['message'] = $error;
return $this->send($response);
return print(js::alert($error) . js::reload('parent'));
}
else
{
@@ -558,7 +556,7 @@ class zanode extends control
{
$node = $this->zanode->getNodeById($hostID);
$serviceStatus = $this->zanode->getServiceStatus($node);
if ($node->status != 'running' && $node->status != 'wait')
if ($node->status != 'running')
{
$serviceStatus['ZenAgent'] = "unknown";
$serviceStatus['ZTF'] = "unknown";
+1
View File
@@ -17,3 +17,4 @@
.node-not-wrap{white-space: nowrap;}
.btn-info {background-color: unset;}
.btn.disabled i {color: #fff;}
#serviceContent{min-height: 120px;}
+2 -1
View File
@@ -99,6 +99,7 @@ function checkServiceStatus(){
}
setTimeout(function() {
$('#serviceContent').removeClass('loading');
$(".service-status, .status-notice").show()
}, 500);
});
return
@@ -186,7 +187,7 @@ $('#jumpManual').click(function()
$(function(){
checkServiceStatus();
$('#checkServiceStatus').trigger("click")
checkInterval = setInterval(() => {
intervalTimes++;
if(intervalTimes > 300)
+7 -3
View File
@@ -86,18 +86,22 @@ $lang->zanode->snapshotName = 'Snapshot Name';
$lang->zanode->browseSnapshot = 'Snapshot List';
$lang->zanode->createSnapshot = 'Create Snapshot';
$lang->zanode->editSnapshot = 'Edit Snapshot';
$lang->zanode->restoreSnapshot = 'Revert Snapshot';
$lang->zanode->restoreSnapshot = 'Revert From This Snapshot';
$lang->zanode->deleteSnapshot = 'Delete Snapshot';
$lang->zanode->snapshotEmpty = 'No snapshots';
$lang->zanode->confirmDeleteSnapshot = "The snapshot cannot be restored from the recycle bin after being deleted. Are you sure to continue?";
$lang->zanode->snapshot = new stdClass();
$lang->zanode->snapshot->statusList['creating'] = 'Creating';
$lang->zanode->snapshot->statusList['completed'] = 'Create Completed';
$lang->zanode->snapshot->statusList['inprogress'] = 'Creating';
$lang->zanode->snapshot->statusList['completed'] = 'Usable';
$lang->zanode->snapshot->statusList['failed'] = 'Create Failed';
$lang->zanode->snapshot->statusList['restoring'] = 'Restoring';
$lang->zanode->snapshot->statusList['restore_failed'] = 'Restore Failed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Restore Completed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Usable';
$lang->zanode->snapshot->defaultSnapName = 'DefaultSnapshot';
$lang->zanode->snapshot->defaultSnapUser = 'System';
$lang->zanode->imageNameEmpty = 'Name can not be empty.';
$lang->zanode->snapStatusError = 'Snapshot is not ready.';
+7 -3
View File
@@ -86,18 +86,22 @@ $lang->zanode->snapshotName = 'Snapshot Name';
$lang->zanode->browseSnapshot = 'Snapshot List';
$lang->zanode->createSnapshot = 'Create Snapshot';
$lang->zanode->editSnapshot = 'Edit Snapshot';
$lang->zanode->restoreSnapshot = 'Revert Snapshot';
$lang->zanode->restoreSnapshot = 'Revert From This Snapshot';
$lang->zanode->deleteSnapshot = 'Delete Snapshot';
$lang->zanode->snapshotEmpty = 'No snapshots';
$lang->zanode->confirmDeleteSnapshot = "The snapshot cannot be restored from the recycle bin after being deleted. Are you sure to continue?";
$lang->zanode->snapshot = new stdClass();
$lang->zanode->snapshot->statusList['creating'] = 'Creating';
$lang->zanode->snapshot->statusList['completed'] = 'Create Completed';
$lang->zanode->snapshot->statusList['inprogress'] = 'Creating';
$lang->zanode->snapshot->statusList['completed'] = 'Usable';
$lang->zanode->snapshot->statusList['failed'] = 'Create Failed';
$lang->zanode->snapshot->statusList['restoring'] = 'Restoring';
$lang->zanode->snapshot->statusList['restore_failed'] = 'Restore Failed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Restore Completed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Usable';
$lang->zanode->snapshot->defaultSnapName = 'DefaultSnapshot';
$lang->zanode->snapshot->defaultSnapUser = 'System';
$lang->zanode->imageNameEmpty = 'Name can not be empty.';
$lang->zanode->snapStatusError = 'Snapshot is not ready.';
+7 -3
View File
@@ -86,18 +86,22 @@ $lang->zanode->snapshotName = 'Snapshot Name';
$lang->zanode->browseSnapshot = 'Snapshot List';
$lang->zanode->createSnapshot = 'Create Snapshot';
$lang->zanode->editSnapshot = 'Edit Snapshot';
$lang->zanode->restoreSnapshot = 'Revert Snapshot';
$lang->zanode->restoreSnapshot = 'Revert From This Snapshot';
$lang->zanode->deleteSnapshot = 'Delete Snapshot';
$lang->zanode->snapshotEmpty = 'No snapshots';
$lang->zanode->confirmDeleteSnapshot = "The snapshot cannot be restored from the recycle bin after being deleted. Are you sure to continue?";
$lang->zanode->snapshot = new stdClass();
$lang->zanode->snapshot->statusList['creating'] = 'Creating';
$lang->zanode->snapshot->statusList['completed'] = 'Create Completed';
$lang->zanode->snapshot->statusList['inprogress'] = 'Creating';
$lang->zanode->snapshot->statusList['completed'] = 'Usable';
$lang->zanode->snapshot->statusList['failed'] = 'Create Failed';
$lang->zanode->snapshot->statusList['restoring'] = 'Restoring';
$lang->zanode->snapshot->statusList['restore_failed'] = 'Restore Failed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Restore Completed';
$lang->zanode->snapshot->statusList['restore_completed'] = 'Usable';
$lang->zanode->snapshot->defaultSnapName = 'DefaultSnapshot';
$lang->zanode->snapshot->defaultSnapUser = 'System';
$lang->zanode->imageNameEmpty = 'Name can not be empty.';
$lang->zanode->snapStatusError = 'Snapshot is not ready.';
+7 -3
View File
@@ -86,18 +86,22 @@ $lang->zanode->snapshotName = '快照名称';
$lang->zanode->browseSnapshot = '快照列表';
$lang->zanode->createSnapshot = '创建快照';
$lang->zanode->editSnapshot = '编辑快照';
$lang->zanode->restoreSnapshot = '还原快照';
$lang->zanode->restoreSnapshot = '还原到此快照';
$lang->zanode->deleteSnapshot = '删除快照';
$lang->zanode->snapshotEmpty = '无快照';
$lang->zanode->confirmDeleteSnapshot = "快照被删除后无法从回收站中还原,您确定继续么?";
$lang->zanode->snapshot = new stdClass();
$lang->zanode->snapshot->statusList['creating'] = '创建中';
$lang->zanode->snapshot->statusList['completed'] = '创建完成';
$lang->zanode->snapshot->statusList['inprogress'] = '创建';
$lang->zanode->snapshot->statusList['completed'] = '可使用';
$lang->zanode->snapshot->statusList['failed'] = '创建失败';
$lang->zanode->snapshot->statusList['restoring'] = '还原中';
$lang->zanode->snapshot->statusList['restore_failed'] = '还原失败';
$lang->zanode->snapshot->statusList['restore_completed'] = '还原成功';
$lang->zanode->snapshot->statusList['restore_completed'] = '可使用';
$lang->zanode->snapshot->defaultSnapName = '初始快照';
$lang->zanode->snapshot->defaultSnapUser = '系统';
$lang->zanode->imageNameEmpty = '名称不能为空';
$lang->zanode->snapStatusError = '快照不可用';
+48 -1
View File
@@ -231,6 +231,53 @@ class zanodemodel extends model
return false;
}
public function createDefaultSnapshot($zanodeID = 0)
{
$node = $this->getNodeByID($zanodeID);
if($node->status != 'running') dao::$errors['name'] = $this->lang->zanode->apiError['notRunning'];
if(dao::isError()) return false;
$newSnapshot = new stdClass();
$newSnapshot->host = $node->id;
$newSnapshot->name = "defaultSnap";
$newSnapshot->desc = "";
$newSnapshot->status = 'creating';
$newSnapshot->osName = $node->osName;
$newSnapshot->from = 'snapshot';
$newSnapshot->createdBy = 'system';
$newSnapshot->createdDate = helper::now();
$this->dao->insert(TABLE_IMAGE)
->data($newSnapshot)
->autoCheck()
->exec();
if(dao::isError()) return false;
$newID = $this->dao->lastInsertID();
/* Prepare create params. */
$agnetUrl = 'http://' . $node->ip . ':' . $node->hzap;
$param = array(array(
'name' => $newSnapshot->name,
'task' => $newID,
'type' => 'createSnap',
'vm' => $node->name
));
$result = json_decode(commonModel::http($agnetUrl . static::SNAPSHOT_CREATE_PATH, json_encode($param,JSON_NUMERIC_CHECK), null, array("Authorization:$node->tokenSN")));
if(!empty($result) and $result->code == 'success')
{
return $newID;
}
$this->dao->delete()->from(TABLE_IMAGE)->where('id')->eq($newID)->exec();
dao::$errors[] = (!empty($result) and !empty($result->msg)) ? $result->msg : $this->app->lang->fail;
return false;
}
/**
* Edit Snapshot.
*
@@ -512,6 +559,7 @@ class zanodemodel extends model
->leftJoin(TABLE_IMAGE)->alias('t3')->on('t3.id = t1.image')
->where('t1.deleted')->eq(0)
->andWhere("t1.type")->eq("node")
->andWhere("t2.type")->eq("zahost")
->beginIF($query)->andWhere($query)->fi()
->orderBy($orderBy)
->page($pager)
@@ -756,7 +804,6 @@ class zanodemodel extends model
{
$node = $this->dao->select('*')->from(TABLE_ZAHOST)
->where('mac')->eq($mac)
->andWhere("type")->eq('node')
->fetch();
$host = $this->loadModel("zahost")->getByID($node->parent);
+13 -5
View File
@@ -78,17 +78,25 @@
<td class='c-actions'>
<?php
$suspendAttr = "title='{$lang->zanode->suspend}' target='hiddenwin'";
$suspendAttr .= $node->status != 'running' && $node->status != 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
$suspendAttr .= $node->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
$resumeAttr = "title='{$lang->zanode->resume}' target='hiddenwin'";
$resumeAttr .= $node->status == 'running' || $node->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'";
$rebootAttr = "title='{$lang->zanode->reboot}' target='hiddenwin'";
$rebootAttr .= $node->status == 'shutoff' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
$rebootAttr .= $node->status == 'shutoff' || $node->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
$closeAttr = "title='{$lang->zanode->shutdown}'";
$closeAttr .= $node->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"';
$startAttr = "title='{$lang->zanode->boot}'";
$startAttr .= $node->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"';
$snapshotAttr = "title='{$lang->zanode->createSnapshot}'";
$snapshotAttr .= $node->status != 'running' ? ' class="btn disabled"' : ' class="btn iframe"';
$imageAttr = $node->status != 'running' ? ' class="btn btn-action iframe createImage disabled"' : ' class="btn btn-action iframe createImage"';
common::printLink('zanode', 'getVNC', "id={$node->id}", "<i class='icon icon-remote'></i> ", (in_array($node->status ,array('running', 'launch', 'wait')) ? '_blank' : ''), "title='{$lang->zanode->getVNC}' class='btn desktop " . (in_array($node->status ,array('running', 'launch', 'wait')) ? '':'disabled') . "'", '');
if($node->status == "suspend")
{
@@ -101,11 +109,11 @@
if($node->status == "shutoff")
{
common::printLink('zanode', 'start', "zanodeID={$node->id}", "<i class='icon icon-play'></i> ", '', "class='btn ' title='{$lang->zanode->boot}'");
common::printLink('zanode', 'start', "zanodeID={$node->id}", "<i class='icon icon-play'></i> ", '', $startAttr);
}
else
{
common::printLink('zanode', 'close', "zanodeID={$node->id}", "<i class='icon icon-off'></i> ", '', "class='btn ' title='{$lang->zanode->shutdown}'");
common::printLink('zanode', 'close', "zanodeID={$node->id}", "<i class='icon icon-off'></i> ", '', $closeAttr);
}
common::printLink('zanode', 'reboot', "zanodeID={$node->id}", "<i class='icon icon-restart'></i> ", '', $rebootAttr);
@@ -117,7 +125,7 @@
echo "<button type='button' class='btn dropdown-toggle' data-toggle='context-dropdown' title='{$this->lang->more}'><i class='icon-ellipsis-v'></i></button>";
echo "<ul class='dropdown-menu pull-right text-center' role='menu'>";
common::printIcon('zanode', 'edit', "id={$node->id}", $node, 'list', '', '', 'btn-action');
common::printLink('zanode', 'createImage', "zanodeID={$node->id}", "<i class='icon icon-export'></i> ", '', "class='btn btn-action iframe createImage' title='{$lang->zanode->createImage}' data-width='55%'", '', true);
common::printLink('zanode', 'createImage', "zanodeID={$node->id}", "<i class='icon icon-export'></i> ", '', $imageAttr . " title='{$lang->zanode->createImage}' data-width='55%'", '', true);
common::printLink('zanode', 'destroy', "zanodeID={$node->id}", "<i class='icon icon-trash'></i> ", '', "title='{$lang->zanode->destroy}' class='btn btn-action' target='hiddenwin'");
echo "</ul>";
echo "</div>";
+12 -3
View File
@@ -44,10 +44,20 @@
$deleteAttr = "title='{$lang->zanode->deleteSnapshot}' target='hiddenwin'";
$deleteAttr .= ($snapshot->status == 'restoring' or $snapshot->status == 'creating') ? ' class="btn disabled"' : 'class="btn"';
$isDefalut = $snapshot->name == 'defaultSnap' && $snapshot->createdBy == 'system';
if($isDefalut) $editAttr = $deleteAttr = 'class="btn disabled"';
$name = $snapshot->localName ? $snapshot->localName : $snapshot->name;
$title = $snapshot->name;
if($snapshot->name == 'defaultSnap' && $snapshot->createdBy == 'system')
{
$name = $lang->zanode->snapshot->defaultSnapName;
$title = $name;
}
?>
<td title="<?php echo $snapshot->name;?>"><?php echo $snapshot->localName ? $snapshot->localName : $snapshot->name;?></td>
<td title="<?php echo $title;?>"><?php echo $name;?></td>
<td class='<?php echo $snapshot->status;?>'><?php echo zget($lang->zanode->snapshot->statusList, $snapshot->status, '');?></td>
<td class="c-createdBy"><?php echo zget($users, $snapshot->createdBy, '')?></td>
<td class="c-createdBy"><?php echo $snapshot->name == 'defaultSnap' && $snapshot->createdBy == 'system' ? $lang->zanode->snapshot->defaultSnapUser : zget($users, $snapshot->createdBy, '')?></td>
<td class='c-datetime'><?php echo $snapshot->createdDate;?></td>
<td class='c-actions'>
<?php if(common::hasPriv('zanode', 'editSnapshot')) echo html::a('###', '<i class="icon-edit"></i>', 'hiddenwin', $editAttr);?>
@@ -63,4 +73,3 @@
</div>
<?php endif;?>
</div>
<?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>
+14 -8
View File
@@ -129,20 +129,20 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
<button type='button' id='checkServiceStatus' class='btn btn-info'><i class="icon icon-refresh"></i> <span class='checkStatus'><?php echo $lang->zanode->init->checkStatus;?></span></button>
</div>
<div class="detail-content statusContainer load-indicator" id='serviceContent'>
<div class="service-status">
<div class="service-status hide">
<span class='dot-symbol dot-zenagent text-danger'></span>
<span>&nbsp;&nbsp;ZenAgent &nbsp;
<span class="zenagent-status"><?php echo $lang->zanode->initializing; ?></span>
</span>
</div>
<div class="service-status">
<div class="service-status hide">
<span class='dot-symbol dot-ztf text-danger'></span>
<span>&nbsp;&nbsp;ZTF &nbsp;
<span class="ztf-status"><?php echo $lang->zanode->initializing; ?></span>&nbsp;
<a class='node-init-install hide' target='hiddenwin' href='javascript:;' data-href='<?php echo $this->createLink('zanode', 'ajaxInstallService', 'nodeID=' . $zanode->id . '&service=ztf');?>'><i class="icon icon-download icon-sm ztf-install-icon"></i><span class="ztf-install"><?php echo $lang->zanode->install ?></span></a>
</span>
</div>
<div class="status-notice">
<div class="status-notice hide">
<span class='init-success hide'><?php echo sprintf($lang->zanode->init->initSuccessNoticeTitle, "<a id='jumpManual' href='javascript:;'>{$lang->zanode->manual}</a>", html::a(helper::createLink('testcase', 'automation', "", '', true), $lang->zanode->automation, '', "class='iframe' title='{$lang->zanode->automation}' data-width='50%'", '')); ?></span>
<span class='init-fail hide'><?php echo $lang->zanode->init->initFailNoticeTitle . '<br/>' . $lang->zanode->init->initFailNoticeDesc;?></span>
</div>
@@ -177,13 +177,19 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
<?php
if (empty($zanode->deleted)) {
$suspendAttr = "title='{$lang->zanode->suspend}' target='hiddenwin'";
$suspendAttr .= $zanode->status != 'running' && $zanode->status != 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
$suspendAttr .= $zanode->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
$resumeAttr = "title='{$lang->zanode->resume}' target='hiddenwin'";
$resumeAttr .= $zanode->status == 'running' || $zanode->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'";
$resumeAttr .= $zanode->status == 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'";
$rebootAttr = "title='{$lang->zanode->reboot}' target='hiddenwin'";
$rebootAttr .= $zanode->status == 'shutoff' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
$rebootAttr .= $zanode->status == 'shutoff' || $zanode->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
$closeAttr = "title='{$lang->zanode->shutdown}'";
$closeAttr .= $zanode->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"';
$startAttr = "title='{$lang->zanode->boot}'";
$startAttr .= $zanode->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"';
$snapshotAttr = "title='{$lang->zanode->createSnapshot}'";
$snapshotAttr .= $zanode->status != 'running' ? ' class="btn disabled"' : ' class="btn iframe"';
@@ -200,11 +206,11 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
if($zanode->status == "shutoff")
{
common::printLink('zanode', 'start', "zanodeID={$zanode->id}", "<i class='icon icon-play'></i> " . $lang->zanode->bootNode, '', "title='{$lang->zanode->boot}' class='btn '");
common::printLink('zanode', 'start', "zanodeID={$zanode->id}", "<i class='icon icon-play'></i> " . $lang->zanode->bootNode, '', $startAttr);
}
else
{
common::printLink('zanode', 'close', "zanodeID={$zanode->id}", "<i class='icon icon-off'></i> " . $lang->zanode->shutdownNode, '', "title='{$lang->zanode->shutdown}' class='btn '");
common::printLink('zanode', 'close', "zanodeID={$zanode->id}", "<i class='icon icon-off'></i> " . $lang->zanode->shutdownNode, '', $closeAttr);
}
common::printLink('zanode', 'reboot', "zanodeID={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->rebootNode, '', $rebootAttr);