* Fix job object name in browse page.

This commit is contained in:
Guan Xiying
2021-09-06 17:45:08 +08:00
parent a5ceffb6cf
commit cd1a40b066
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -86,4 +86,4 @@ $lang->job->pipelineVariables = "变量";
$lang->job->pipelineVariablesKeyPlaceHolder = "输入变量的名称";
$lang->job->pipelineVariablesValuePlaceHolder = "输入变量的值";
$lang->job->pipelineVariablesTips = "指定要在此次运行中使用的变量值。CI/CD设置中指定的值将用作默认值。";
$lang->job->setReferenceTips = "在执行构建前,请先设置构建的 Reference.";
$lang->job->setReferenceTips = "在执行构建前,请先设置代码库的分支信息。";
+8 -1
View File
@@ -50,13 +50,20 @@
</thead>
<tbody>
<?php foreach($jobList as $id => $job):?>
I <?php
if(strtolower($job->engine) == 'gitlab')
{
$pipeline = json_decode($job->pipeline);
if(is_numeric($job->pipeline)) $job->pipeline = $this->loadModel('gitlab')->getProjectName($job->server, $job->pipeline);
if(isset($pipeline->reference)) $job->pipeline = $this->loadModel('gitlab')->getProjectName($job->server, $pipeline->project);
}
?>
<tr class='text-left'>
<td class='text-center'><?php echo $id;?></td>
<td class='text-left c-name' title='<?php echo $job->name;?>'><?php echo common::hasPriv('job', 'view') ? html::a($this->createLink('job', 'view', "jobID={$job->id}", 'html', true), $job->name, '', "class='iframe' data-width='90%'") : $job->name;?></td>
<td title='<?php echo $job->repoName;?>'><?php echo $job->repoName;?></td>
<td><?php echo zget($lang->job->engineList, $job->engine);?></td>
<td><?php echo zget($lang->job->frameList, $job->frame);?></td>
<?php if(strtolower($job->engine) == 'gitlab') $job->pipeline = $this->loadModel('gitlab')->getProjectName($job->server, $job->pipeline);?>
<?php $jenkins = urldecode($job->pipeline) . '@' . $job->jenkinsName;?>
<td class='c-name' title='<?php echo $jenkins;?>'><?php echo $jenkins;?></td>
<?php $triggerConfig = $this->job->getTriggerConfig($job);?>