* Adjust gogs,gitea binduser

This commit is contained in:
zenggang
2023-08-11 02:10:38 +00:00
parent 3a4d815b40
commit dc386ef720
7 changed files with 7 additions and 20 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class gitea extends control
/* This is essential when changing tab(menu) from gitea to repo. */
/* Optional: common::setMenuVars('devops', $this->session->repoID); */
$this->loadModel('ci')->setMenu();
if($this->app->rawMethod != 'binduser') $this->loadModel('ci')->setMenu();
}
/**
+1 -1
View File
@@ -400,7 +400,7 @@ class giteaModel extends model
for($page = 1; true; $page++)
{
$results = json_decode(commonModel::http($url . "&page={$page}&limit=50"));
if(!is_array($results->data)) break;
if(empty($results) || !is_array($results->data)) break;
if(!empty($results->data)) $allResults = array_merge($allResults, $results->data);
if(count($results->data) < 50) break;
}
+1 -1
View File
@@ -74,7 +74,7 @@
<tr>
<td colspan="5" class="text-center form-actions">
<?php echo html::submitButton();?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"');?>
<?php if(!isonlybody()) echo html::a($this->createLink('space', 'browse'), $lang->goback, '', 'class="btn btn-wide"');?>
</td>
</tr>
</tfoot>
+1 -1
View File
@@ -22,7 +22,7 @@ class gogs extends control
/* This is essential when changing tab(menu) from gogs to repo. */
/* Optional: common::setMenuVars('devops', $this->session->repoID); */
$this->loadModel('ci')->setMenu();
if($this->app->rawMethod != 'binduser') $this->loadModel('ci')->setMenu();
}
/**
+1 -1
View File
@@ -74,7 +74,7 @@
<tr>
<td colspan="5" class="text-center form-actions">
<?php echo html::submitButton();?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"');?>
<?php if(!isonlybody()) echo html::a($this->createLink('space', 'browse'), $lang->goback, '', 'class="btn btn-wide"');?>
</td>
</tr>
</tfoot>
+2
View File
@@ -42,3 +42,5 @@ $config->index->oldPages[] = 'webhook-create';
$config->index->oldPages[] = 'dept-browse';
$config->index->oldPages[] = 'repo-setrules';
$config->index->oldPages[] = 'host-treemap';
$config->index->oldPages[] = 'gogs-binduser';
$config->index->oldPages[] = 'gitea-binduser';
-15
View File
@@ -1754,10 +1754,6 @@ class repo extends control
public function ajaxGetGiteaProjects($giteaID)
{
$projects = $this->loadModel('gitea')->apiGetProjects($giteaID);
if(!$projects) $this->send(array('message' => array()));
$options = "<option value=''></option>";
foreach($projects as $project) $options .= "<option value='{$project->full_name}' data-name='{$project->name}'>{$project->full_name}</option>";
$options = array();
$options[] = array('text' => '', 'value' => '');;
@@ -1779,11 +1775,6 @@ class repo extends control
public function ajaxGetGogsProjects($gogsID)
{
$projects = $this->loadModel('gogs')->apiGetProjects($gogsID);
$options = "<option value=''></option>";
if(!empty($projects))
{
foreach($projects as $project) $options .= "<option value='{$project->full_name}' data-name='{$project->name}'>{$project->full_name}</option>";
}
$options = array();
$options[] = array('text' => '', 'value' => '');;
@@ -1808,12 +1799,6 @@ class repo extends control
if(!$projects) return print('[]');
$projectIdList = $projectIdList ? explode(',', $projectIdList) : null;
$options = "<option value=''></option>";
foreach($projects as $project)
{
if(!empty($projectIdList) and $project and !in_array($project->id, $projectIdList)) continue;
$options .= "<option value='{$project->id}' data-name='{$project->name}'>{$project->name_with_namespace}</option>";
}
$options = array();
$options[] = array('text' => '', 'value' => '');;