Correct link to branches in github
这个提交包含在:
父节点
b9b0d0e483
当前提交
f897ec2db3
共有 1 个文件被更改,包括 20 次插入 和 4 次删除
|
|
@ -15,11 +15,11 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Language</td>
|
||||
<td><?php echo ucfirst($this->config->item('language'))."\n"; ?></td>
|
||||
<td><?php echo $this->config->item('language')."\n"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Base URL</td>
|
||||
<td><span id="baseUrl"><a href="<?php echo $this->config->item('base_url')?>" target="_blank"><?php echo $this->config->item('base_url'); ?></a></span> <span data-toggle="tooltip" data-original-title="<?php echo $this->lang->line('copy_to_clipboard'); ?>" onclick='copyURL("<?php echo $this->config->item('base_url'); ?>")'><i class="copy-icon fas fa-copy"></span></td>
|
||||
<td><?php echo $this->config->item('base_url')."\n"; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -163,7 +163,17 @@
|
|||
<?php
|
||||
$commitHash = trim(exec('git log --pretty="%H" -n1 HEAD'));
|
||||
$commitDate = trim(exec('git log --pretty="%ci" -n1 HEAD'));
|
||||
$branch = trim(exec('git branch --show-current'));
|
||||
$line = trim(exec('git log -n 1 --pretty=%D HEAD'));
|
||||
$pieces = explode(', ', $line);
|
||||
$remote = substr($pieces[1], 0, strpos($pieces[1], '/'));
|
||||
$branch = substr($pieces[1], strpos($pieces[1], '/')+1);
|
||||
$url = trim(exec('git remote get-url '.$remote));
|
||||
$owner = '';
|
||||
if (strpos($url, 'https://github.com') !== false) {
|
||||
$owner = preg_replace('/https:\/\/github\.com\/(\w+)\/Cloudlog\.git/', '$1', $url);
|
||||
} else if (strpos($url, 'git@github.com') !== false) {
|
||||
$owner = preg_replace('/git@github\.com:(\w+)\/Cloudlog\.git/', '$1', $url);
|
||||
}
|
||||
$tag = trim(exec('git describe --tags '.$commitHash));
|
||||
?>
|
||||
<div class="card-header">Git Information</div>
|
||||
|
|
@ -173,7 +183,13 @@
|
|||
<td>Branch</td>
|
||||
<td>
|
||||
<?php if($branch != "") { ?>
|
||||
<a target="_blank" href="https://github.com/magicbug/Cloudlog/tree/<?php echo $branch?>"><span class="badge badge-success"><?php echo $branch; ?></span></a>
|
||||
<?php if($owner != "") { ?>
|
||||
<a target="_blank" href="https://github.com/<?php echo $owner; ?>/Cloudlog/tree/<?php echo $branch?>">
|
||||
<?php } ?>
|
||||
<span class="badge badge-success"><?php echo $branch; ?></span>
|
||||
<?php if($owner != "") { ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
<?php } else { ?>
|
||||
<span class="badge badge-danger">n/a</span>
|
||||
<?php } ?>
|
||||
|
|
|
|||
正在加载…
在新工单中引用