update codes for original repo and ci models combination

This commit is contained in:
aaronchen2k
2020-01-31 10:34:29 +08:00
parent de8106ab82
commit a82cb65366
10 changed files with 68 additions and 34 deletions
+4 -2
View File
@@ -187,6 +187,7 @@ class ci extends control
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->buildList = $this->ci->listBuild($taskID, $orderBy, $pager);
$this->view->job = $this->ci->getJobByID($taskID);
$this->view->title = $this->lang->ci->task . $this->lang->colon . $this->lang->job->browseBuild;
$this->view->position[] = $this->lang->ci->common;
@@ -208,8 +209,9 @@ class ci extends control
*/
public function viewBuildLogs($buildID)
{
$build = $this->ci->getBuild($buildID);
$this->view->logs = str_replace("\r\n","<br />", $build->logs);
$build = $this->ci->getBuildByID($buildID);
$this->view->logs = str_replace("\r\n","<br />", $build->logs);
$this->view->build = $build;
$this->view->title = $this->lang->ci->task . $this->lang->colon . $this->lang->job->viewLogs;
$this->view->position[] = $this->lang->ci->common;
+17 -16
View File
@@ -1,25 +1,26 @@
<?php
$lang->ci->common = '持续集成';
$lang->ci->common = '持续集成';
$lang->ci->de = '的';
$lang->ci->jenkins = 'Jenkins';
$lang->ci->repo = '代码库';
$lang->ci->job = '构建';
$lang->ci->browse = '浏览';
$lang->ci->create = '新建';
$lang->ci->edit = '编辑';
$lang->ci->jenkins = 'Jenkins';
$lang->ci->repo = '代码库';
$lang->ci->job = '构建';
$lang->ci->browse = '浏览';
$lang->ci->create = '新建';
$lang->ci->edit = '编辑';
$lang->ci->list = '列表';
$lang->ci->create = '新增构建';
$lang->ci->list = '列表';
$lang->ci->create = '新增构建';
$lang->job->browseBuild = '构建历史';
$lang->job->viewLogs = '构建日志';
$lang->job->browseBuild = '构建历史';
$lang->job->viewLogs = '构建日志';
$lang->job->exeNow = '立即执行';
$lang->job->delete = '删除构建任务';
$lang->job->exeNow = '立即执行';
$lang->job->delete = '删除构建任务';
$lang->job->confirmDelete = '确认删除该构建任务吗?';
$lang->job->buildStatus = '构建状态';
$lang->job->buildTime = '构建时间';
$lang->job->buildStatus = '构建状态';
$lang->job->buildTime = '构建时间';
$lang->job->id = 'ID';
$lang->job->name = '名称';
@@ -50,7 +51,7 @@ $lang->job->tagEx = 'build_#15,其中15为Jenkins任务编号';
$lang->job->commitEx = 'start build #15,其中15为Jenkins任务编号';
$lang->job->cronSample = '如 0 0 2 * * 2-6/1 表示每个工作日凌晨2点';
$lang->job->buildStatus = array('success' => '成功', 'fail' => '失败', 'created' => '新建', 'building' => '构建中');
$lang->job->buildStatusList = array('success' => '成功', 'fail' => '失败', 'created' => '新建', 'building' => '构建中');
$lang->job->dayTypeList = array('workDay' => '工作日', 'everyDay' => '每天');
$lang->job->buildTypeList = array('build' => '仅构建', 'buildAndDeploy' => '构建部署', 'buildAndTest' => '构建测试');
$lang->job->triggerTypeList = array('tag' => '打标签', 'commit' => '代码提交注释', 'schedule' => '定时计划');
+22 -7
View File
@@ -12,6 +12,19 @@
?>
<?php include '../../common/view/header.html.php'; ?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<div class="page-title">
<strong>
<?php echo $lang->job->browseBuild; ?>
</strong>
</div>
</div>
<div class="btn-toolbar pull-right">
<?php echo html::a(helper::createLink('ci', "browseJob", ""), "<i class='icon icon-back icon-sm'></i> ". $lang->goback, '', "class='btn btn-secondary'");?>
</div>
</div>
<div id='mainContent' class='main-row'>
<div class='main-col main-content'>
<form class='main-table' id='ajaxForm' method='post'>
@@ -19,10 +32,10 @@
<thead>
<tr>
<?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->citask->id); ?></th>
<th class='w-200px text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->citask->name); ?></th>
<th class='w-100px text-left'><?php echo $lang->citask->buildStatus; ?></th>
<th class='w-100px text-left'><?php echo $lang->citask->buildTime; ?></th>
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->job->id); ?></th>
<th class='w-200px text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->job->name); ?></th>
<th class='w-100px text-left'><?php echo $lang->job->buildStatus; ?></th>
<th class='w-100px text-left'><?php echo $lang->job->buildTime; ?></th>
<th class='c-actions-4'><?php echo $lang->actions; ?></th>
</tr>
@@ -32,13 +45,15 @@
<tr>
<td class='text-center'><?php echo $id; ?></td>
<td class='text' title='<?php echo $build->name; ?>'><?php echo $build->name; ?></td>
<td class='text' title='<?php echo $build->status; ?>'><?php echo $build->status; ?></td>
<td class='text' title='<?php echo $lang->job->buildStatusList[$build->status]; ?>'>
<?php echo $lang->job->buildStatusList[$build->status]; ?>
</td>
<td class='text' title='<?php echo $build->createDate; ?>'><?php echo $build->createdDate; ?></td>
<td class='c-actions text-right'>
<?php
common::printIcon('citask', 'viewBuildLogs', "buildID=$id", '', 'list', 'file-text',
'', '', '', '', $lang->citask->viewLogs);
common::printIcon('ci', 'viewBuildLogs', "buildID=$id", '', 'list', 'file-text',
'', '', '', '', $lang->job->viewLogs);
?>
</td>
</tr>
+2 -1
View File
@@ -20,6 +20,7 @@
<thead>
<tr>
<?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
<th class='w-60px'><?php common::printOrderLink('id', $orderBy, $vars, $lang->job->id); ?></th>
<th class='w-150px text-left'>
<?php common::printOrderLink('name', $orderBy, $vars, $lang->job->name); ?></th>
@@ -48,7 +49,7 @@
<td class='text' title='<?php echo $lang->job->triggerTypeList[$job->triggerType]; ?>'>
<?php echo $lang->job->triggerTypeList[$job->triggerType]; ?></td>
<td class='text' title='<?php echo $lang->job->lastBuild; ?>'>
<?php echo $lang->job->buildStatus[$job->lastStatus] . ' ' . $job->lastExec; ?>
<?php echo $lang->job->buildStatusList[$job->lastStatus] . ' ' . $job->lastExec; ?>
</td>
<td class='c-actions text-right'>
+13
View File
@@ -12,6 +12,19 @@
?>
<?php include '../../common/view/header.html.php'; ?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<div class="page-title">
<strong>
<?php echo $lang->job->viewLogs; ?>
</strong>
</div>
</div>
<div class="btn-toolbar pull-right">
<?php echo html::a(helper::createLink('ci', "browseBuild", "taskId=$build->citask"), "<i class='icon icon-back icon-sm'></i> ". $lang->goback, '', "class='btn btn-secondary'");?>
</div>
</div>
<div id='mainContent' class='main-row'>
<div class='main-col main-content'>
<?php echo $logs; ?>
+3 -3
View File
@@ -174,7 +174,7 @@ class repo extends control
$this->view->title = $this->lang->ci->repo . $this->lang->colon . $this->lang->ci->create;
$this->view->position[] = $this->lang->ci->common;
$this->view->position[] = html::a(inlink('browse'), $this->lang->ci->repo);
$this->view->position[] = html::a(inlink('maintain'), $this->lang->ci->repo);
$this->view->position[] = $this->lang->ci->create;
$this->display();
@@ -202,7 +202,7 @@ class repo extends control
$link = $this->repo->createLink('showSyncComment', "repoID=$repoID");
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('maintain')));
}
$this->app->loadLang('action');
@@ -215,7 +215,7 @@ class repo extends control
$this->view->title = $this->lang->ci->repo . $this->lang->colon . $this->lang->ci->edit;
$this->view->position[] = $this->lang->ci->common;
$this->view->position[] = html::a(inlink('browse'), $this->lang->ci->repo);
$this->view->position[] = html::a(inlink('maintain'), $this->lang->ci->repo);
$this->view->position[] = $this->lang->ci->edit;
$this->view->repoID = $repoID;
+3 -2
View File
@@ -1,9 +1,10 @@
<?php
$lang->repo->common = '代码';
$lang->repo->create = '创建代码库';
$lang->repo->edit = '编辑代码库';
$lang->repo->create = '创建版本库';
$lang->repo->edit = '编辑版本库';
$lang->repo->browse = '浏览';
$lang->repo->delete = '删除版本库';
$lang->repo->confirmDelete = '确认删除该版本库吗?';
$lang->repo->showSyncComment = '显示同步进度';
$lang->repo->ajaxSyncComment = '接口:AJAX同步注释';
$lang->repo->download = '下载';
+2 -2
View File
@@ -185,7 +185,7 @@ class repoModel extends model
}
}
$this->checkRepoConnection();
$this->checkConnection();
$data = fixer::input('post')->skipSpecial('path,client,account,password')->get();
$data->acl = empty($data->acl) ? '' : json_encode($data->acl);
@@ -217,7 +217,7 @@ class repoModel extends model
*/
public function update($id)
{
$this->checkRepoConnection();
$this->checkConnection();
$data = fixer::input('post')->skipSpecial('path,client,account,password')->get();
$data->acl = empty($data->acl) ? '' : json_encode($data->acl);
+1
View File
@@ -34,6 +34,7 @@
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID&path=&revision=$revision&refresh=1", "path=" . $this->repo->encodePath($path)), "<i class='icon icon-refresh'></i> ". $lang->refresh, '', "class='btn btn-primary'");?>
</div>
</div>
<div id="mainContent" class="main-row fade">
<div class="main-col main-table">
<table class='table table-fixed'>
+1 -1
View File
@@ -33,7 +33,7 @@ $(function(){
if(data == 'finish')
{
$('#caption').text('<?php echo $lang->repo->notice->syncComplete?>');
return self.location = createLink('repo', 'browse', "repoID=<?php echo $repoID?>");
return self.location = createLink('repo', 'maintain');
}
$('#commits').html(parseInt($('#commits').html()) + parseInt(data));
setTimeout(syncComments, 10);