fix menu issues
This commit is contained in:
@@ -83,7 +83,7 @@ class ci extends control
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->ci->create();
|
||||
$this->ci->createJob();
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
}
|
||||
@@ -111,10 +111,10 @@ class ci extends control
|
||||
*/
|
||||
public function editJob($id)
|
||||
{
|
||||
$job = $this->ci->getByID($id);
|
||||
$job = $this->ci->getJobByID($id);
|
||||
if($_POST)
|
||||
{
|
||||
$this->ci->update($id);
|
||||
$this->ci->updateJob($id);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
}
|
||||
|
||||
@@ -53,12 +53,12 @@
|
||||
|
||||
<td class='c-actions text-right'>
|
||||
<?php
|
||||
common::printIcon('job', 'browseBuild', "jobID=$id", '', 'list', 'file-text');
|
||||
common::printIcon('job', 'editJob', "jobID=$id", '', 'list', 'edit');
|
||||
common::printIcon('ci', 'browseBuild', "jobID=$id", '', 'list', 'file-text');
|
||||
common::printIcon('ci', 'editJob', "jobID=$id", '', 'list', 'edit');
|
||||
|
||||
if (common::hasPriv('job', 'delete')) {
|
||||
$deleteURL = $this->createLink('job', 'delete', "jobID=$id&confirm=yes");
|
||||
echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"taskList\", confirmDelete)", '<i class="icon-trash"></i>', '', "title='{$lang->job->delete}' class='btn'");
|
||||
if (common::hasPriv('ci', 'deleteJob')) {
|
||||
$deleteURL = $this->createLink('ci', 'deleteJob', "jobID=$id&confirm=yes");
|
||||
echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"jobList\", confirmDelete)", '<i class="icon-trash"></i>', '', "title='{$lang->job->delete}' class='btn'");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -335,7 +335,7 @@ $lang->caselib->menu->caselib = array('link' => '用例库|caselib|browse|libI
|
||||
$lang->repo = new stdclass();
|
||||
$lang->repo->menu = new stdclass();
|
||||
$lang->repo->menu->browse = array('link' =>'浏览|repo|browse|repoID=%s', 'alias' => 'diff,view,revision,showsynccomment');
|
||||
$lang->repo->menu->review = array('link' =>'评审|repo|review|repoID=%s', 'alias' => 'create,edit');
|
||||
$lang->repo->menu->review = array('link' =>'评审|repo|review|repoID=%s', 'alias' => '');
|
||||
$lang->repo->menu->maintain = array('link' =>'代码库|repo|maintain', 'alias' => 'create,edit');
|
||||
$lang->repo->menu->job = array('link' =>'构建|ci|browsejob', 'alias' => 'createjob,editjob,browsebuild,viewbuildlogs');
|
||||
$lang->repo->menu->jenkins = array('link' =>'Jenkins|jenkins|browse', 'alias' => 'create,edit');
|
||||
@@ -483,6 +483,7 @@ $lang->menugroup->message = 'admin';
|
||||
|
||||
$lang->menugroup->repo = 'devops';
|
||||
$lang->menugroup->ci = 'devops';
|
||||
$lang->menugroup->jenkins = 'devops';
|
||||
|
||||
/* 错误提示信息。*/
|
||||
$lang->error = new stdclass();
|
||||
|
||||
@@ -116,7 +116,7 @@ class jenkins extends control
|
||||
$this->view->jenkins = $jenkins;
|
||||
$this->view->credentialsList = $this->loadModel('cicredentials')->listForSelection("type='token' or type='account'");
|
||||
|
||||
$this->view->module = 'jenkins';
|
||||
// $this->view->module = 'jenkins';
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,13 @@ $lang->jenkins->id = 'ID';
|
||||
$lang->jenkins->name = '名称';
|
||||
$lang->jenkins->serviceUrl = '服务地址';
|
||||
$lang->jenkins->type = '认证方式';
|
||||
$lang->jenkins->credentials = '凭证';
|
||||
$lang->jenkins->username = '用户名';
|
||||
$lang->jenkins->password = '密码';
|
||||
$lang->jenkins->token = 'Token';
|
||||
$lang->jenkins->account = '用户名';
|
||||
$lang->jenkins->password = '密码';
|
||||
$lang->jenkins->encoding = '编码';
|
||||
$lang->repo->encryptList['plain'] = '不加密';
|
||||
$lang->repo->encryptList['base64'] = 'BASE64';
|
||||
|
||||
$lang->jenkins->desc = '描述';
|
||||
$lang->jenkins->tips = '选择用户名密码类型凭证时,请在Jenkins全局安全设置中禁用"防止跨站点请求伪造"选项。';
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
|
||||
<td class='c-actions text-right'>
|
||||
<?php
|
||||
common::printIcon('cijenkins', 'edit', "jenkinsID=$id", '', 'list', 'edit');
|
||||
if (common::hasPriv('cijenkins', 'delete')) {
|
||||
$deleteURL = $this->createLink('cijenkins', 'delete', "jenkinsID=$id&confirm=yes");
|
||||
common::printIcon('jenkins', 'edit', "jenkinsID=$id", '', 'list', 'edit');
|
||||
if (common::hasPriv('jenkins', 'delete')) {
|
||||
$deleteURL = $this->createLink('jenkins', 'delete', "jenkinsID=$id&confirm=yes");
|
||||
echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"jenkinsList\", confirmDelete)", '<i class="icon-trash"></i>', '', "title='{$lang->jenkins->delete}' class='btn'");
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -30,10 +30,19 @@
|
||||
<td class='required'><?php echo html::input('serviceUrl', '', "class='form-control'"); ?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="credentials-field">
|
||||
<th class='thWidth'><?php echo $lang->credentials->common; ?></th>
|
||||
<td style="width:550px"><?php echo html::select('credentials', $credentialsList, '', "class='form-control chosen'"); ?></td>
|
||||
<td><?php echo $lang->jenkins->tips; ?></td>
|
||||
<tr>
|
||||
<th><?php echo $lang->repo->account;?></th>
|
||||
<td><?php echo html::input('account', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->repo->password;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::password('password', '', "class='form-control'");?>
|
||||
<span class='input-group-addon fix-border fix-padding'></span>
|
||||
<?php echo html::select('encrypt', $lang->repo->encryptList, 'base64', "class='form-control'");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -30,10 +30,19 @@
|
||||
<td class='required'><?php echo html::input('serviceUrl', $jenkins->serviceUrl, "class='form-control'"); ?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="credentials-field">
|
||||
<th class='thWidth'><?php echo $lang->credentials->common; ?></th>
|
||||
<td style="width:550px"><?php echo html::select('credentials', $credentialsList, $jenkins->credentials, "class='form-control'"); ?></td>
|
||||
<td><?php echo $lang->jenkins->tips; ?></td>
|
||||
<tr>
|
||||
<th><?php echo $lang->jenkins->account;?></th>
|
||||
<td><?php echo html::input('account', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->jenkins->password;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::password('password', '', "class='form-control'");?>
|
||||
<span class='input-group-addon fix-border fix-padding'></span>
|
||||
<?php echo html::select('encrypt', $lang->jenkins->encryptList, 'base64', "class='form-control'");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -152,7 +152,7 @@ class repo extends control
|
||||
public function create()
|
||||
{
|
||||
$repoID = $this->session->repoID;
|
||||
$this->repo->setMenu($this->repos, '', false);
|
||||
$this->repo->setMenu($this->repos, $repoID, false);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user