* Modify clone url.
This commit is contained in:
+15
-32
@@ -497,7 +497,7 @@ class repo extends control
|
||||
$this->view->pager = $pager;
|
||||
$this->view->path = urldecode($path);
|
||||
$this->view->logType = $logType;
|
||||
$this->view->downloadUrl = $this->repo->getDownloadUrl($repoID);
|
||||
$this->view->cloneUrl = $this->repo->getCloneUrl($repo);
|
||||
$this->view->cacheTime = date('m-d H:i', filemtime($cacheFile));
|
||||
$this->view->branchOrTag = $branchOrTag;
|
||||
|
||||
@@ -1295,37 +1295,20 @@ class repo extends control
|
||||
echo html::select('execution', array('' => '') + $executions, '', 'class="form-control chosen"');
|
||||
}
|
||||
|
||||
public function ajaxGetCodeUrl($repoID = 0, $branch = '')
|
||||
/**
|
||||
* Download zip code.
|
||||
*
|
||||
* @param int $repoID
|
||||
* @param string $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function downloadCode($repoID = 0, $branch = '')
|
||||
{
|
||||
return <<<EOF
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>下载代码</h2>
|
||||
</div>
|
||||
<form id='gitlabForm' method='post' class='form-ajax'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th>使用SSH克隆</th>
|
||||
<td class='required'><?php echo html::input('name', '', "class='form-control' readonly");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>使用HTTPS克隆</th>
|
||||
<td class='required'><?php echo html::input('url', '', "class='form-control' readonly");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
EOF;
|
||||
|
||||
$repo = $this->repo->getRepoByID($repoID);
|
||||
if($repo->SCM == 'Gitlab')
|
||||
{
|
||||
return $this->loadModel('gitlab')->downloadCode($repo->gitlab, $repo->project);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user