From f18bd7aeac6d676d321c86532522533c207a5a8a Mon Sep 17 00:00:00 2001 From: liyang Date: Tue, 30 Sep 2025 14:06:12 +0800 Subject: [PATCH] * [task#150385] fix bug for devops menu. --- module/execution/model.php | 5 +++++ module/pipeline/config.php | 1 + module/project/tao.php | 6 ++++++ module/repo/control.php | 3 ++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 95d18e41a0..e134eedf49 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -230,6 +230,11 @@ class executionModel extends model if(!$features['burn']) unset($this->lang->execution->menu->burn); if(!$features['other']) unset($this->lang->execution->menu->other); if(!$features['story'] && $this->config->edition == 'open') unset($this->lang->execution->menu->view); + if($this->config->inCompose) + { + $repoServers = $this->loadModel('pipeline')->getPairs($this->config->pipeline->checkRepoServers); + if(empty($repoServers)) unset($this->lang->execution->menu->devops); + } return true; } diff --git a/module/pipeline/config.php b/module/pipeline/config.php index 4c1cdeb9c4..27022200ef 100755 --- a/module/pipeline/config.php +++ b/module/pipeline/config.php @@ -5,3 +5,4 @@ $config->pipeline->create->requiredFields = 'name,url,type'; $config->pipeline->edit->requiredFields = 'name,url,type'; $config->pipeline->formatTypeService = array('gitlab'); +$config->pipeline->checkRepoServers = 'gitlab,gitea,gogs'; diff --git a/module/project/tao.php b/module/project/tao.php index b729cc5320..f3d25af4b7 100755 --- a/module/project/tao.php +++ b/module/project/tao.php @@ -1080,6 +1080,12 @@ class projectTao extends projectModel if($lang->{$model}->dividerMenu) $lang->{$model}->dividerMenu = ',' . trim($lang->{$model}->dividerMenu, ',') . ','; } + if($this->config->inCompose) + { + $repoServers = $this->loadModel('pipeline')->getPairs($this->config->pipeline->checkRepoServers); + if(empty($repoServers)) unset($lang->{$model}->menu->devops); + } + $lang->project->menu = $lang->{$model}->menu; $lang->project->menuOrder = $lang->{$model}->menuOrder; $lang->project->dividerMenu = $lang->{$model}->dividerMenu; diff --git a/module/repo/control.php b/module/repo/control.php index 4df3e0dd68..4e5cca6b75 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -81,6 +81,7 @@ class repo extends control if(empty($this->repos) && !in_array(strtolower($this->methodName), array('create', 'setrules', 'createrepo', 'import', 'maintain'))) { $method = $this->app->tab == 'devops' ? 'maintain' : 'create'; + if($this->config->inCompose && $method == 'create') $method = 'createRepo'; return $this->locate(inLink($method, "objectID=$objectID")); } $this->view->fromModal = $fromModal; @@ -134,7 +135,7 @@ class repo extends control $this->view->projects = $projects; $this->view->sonarRepoList = $sonarRepoList; $this->view->successJobs = $successJobs; - $this->view->repoServers = $this->pipeline->getPairs('gitlab,gitea,gogs'); + $this->view->repoServers = $this->pipeline->getPairs($this->config->pipeline->checkRepoServers); $this->display(); }