+ [task#145554] add branch on compile list.

This commit is contained in:
liyang
2025-06-19 15:44:43 +08:00
parent fbf4546ad7
commit c923fae9ca
3 changed files with 10 additions and 2 deletions
+8 -1
View File
@@ -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:'<span class="' + className + '">' + result[0] + '</span>'};
}
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:'<span class="label success-pale mr-1">' + branch + '</span>'};
}
return result;
+1 -1
View File
@@ -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')
+1
View File
@@ -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();