diff --git a/module/compile/js/browse.ui.js b/module/compile/js/browse.ui.js index 024004f149..7c7caae93c 100644 --- a/module/compile/js/browse.ui.js +++ b/module/compile/js/browse.ui.js @@ -6,8 +6,15 @@ window.renderCell = function(result, {col, row}) if(row.data.status == 'failure' || row.data.status == 'create_fail') className = 'status-doing'; if(row.data.status == 'success') className = 'status-done'; result[0] = {html:'' + result[0] + ''}; + } - return result; + if(col.name == 'name') + { + const pipeline = row.data.pipeline; + if(!pipeline) return result; + const branch = JSON.parse(pipeline).reference; + + if(branch) result[1] = {html:'' + branch + ''}; } return result; diff --git a/module/compile/model.php b/module/compile/model.php index b92a750536..80c1c72a6f 100644 --- a/module/compile/model.php +++ b/module/compile/model.php @@ -79,7 +79,7 @@ class compileModel extends model } if(strpos($orderBy, 'id') === false) $orderBy .= ', id_desc'; - return $this->dao->select('t1.id, t1.name, t1.job, t1.status, t1.createdDate, t1.testtask, t2.pipeline, t2.triggerType, t2.svnDir, t2.comment, t2.atDay, t2.atTime, t2.engine, t2.triggerActions, t3.name as repoName, t4.name as jenkinsName')->from(TABLE_COMPILE)->alias('t1') + return $this->dao->select('t1.id, t1.branch, t1.name, t1.job, t1.status, t1.createdDate, t1.testtask, t2.pipeline, t2.triggerType, t2.svnDir, t2.comment, t2.atDay, t2.atTime, t2.engine, t2.triggerActions, t3.name as repoName, t4.name as jenkinsName')->from(TABLE_COMPILE)->alias('t1') ->leftJoin(TABLE_JOB)->alias('t2')->on('t1.job=t2.id') ->leftJoin(TABLE_REPO)->alias('t3')->on('t2.repo=t3.id') ->leftJoin(TABLE_PIPELINE)->alias('t4')->on('t2.server=t4.id') diff --git a/module/compile/tao.php b/module/compile/tao.php index b5b1010406..5b7a095b5f 100644 --- a/module/compile/tao.php +++ b/module/compile/tao.php @@ -96,6 +96,7 @@ class compileTao extends compileModel $updatedDate = $build->updated; } $data->updateDate = date('Y-m-d H:i:s', $updatedDate); + $data->branch = !empty($build->branch) ? $build->branch : ''; } $this->dao->insert(TABLE_COMPILE)->data($data)->exec();