From 01cd2cf69929e6547e9eb3ef23e0591674d1735a Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 27 Dec 2023 14:34:00 +0800 Subject: [PATCH] + Add devops application options process. --- module/install/control.php | 2 +- module/install/ui/app.html.php | 5 +---- module/install/zen.php | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/module/install/control.php b/module/install/control.php index 5d74380e33..f20495a772 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -464,7 +464,7 @@ class install extends control $this->view->title = $this->lang->solution->install; $this->view->cloudSolution = $cloudSolution; - $this->view->components = $components; + $this->view->components = $this->installZen->processComponents($components, $cloudSolution); $this->view->category = $category; $this->display(); diff --git a/module/install/ui/app.html.php b/module/install/ui/app.html.php index f36d82b758..a6991f4172 100644 --- a/module/install/ui/app.html.php +++ b/module/install/ui/app.html.php @@ -18,15 +18,12 @@ h::importJs($app->getWebRoot() . 'js/xterm/xterm.js'); $formRows = array(); foreach($components->category as $item) { - if(in_array($item->name, array('analysis', 'artifact'))) array_unshift($item->choices, (object)array('name' => $lang->install->solution->skipInstall, 'version' => '')); - if($item->name === 'pms') continue; - $formRows[] = formGroup ( set::label($item->alias), set::name($item->name), set::required(true), - set::items($this->solution->createSelectOptions($item->choices, $cloudSolution)), + set::items($item->schemaChoices), on::change('checkMemory(this)') ); } diff --git a/module/install/zen.php b/module/install/zen.php index ad31334715..c4b779e5f9 100644 --- a/module/install/zen.php +++ b/module/install/zen.php @@ -414,4 +414,36 @@ class installZen extends install return $customSession; } + + /** + * 处理安装应用下拉选择的数据。 + * Process application options. + * + * @param object $components + * @param object $cloudSolution + * @access protected + * @return object + */ + protected function processComponents(object $components, object $cloudSolution): object + { + foreach($components->category as $key => &$item) + { + if($item->name === 'pms') + { + unset($components->category[$key]); + continue; + } + + if(in_array($item->name, array('analysis', 'artifact'))) array_unshift($item->choices, (object)array('name' => $this->lang->install->solution->skipInstall, 'version' => '')); + + $item->schemaChoices = array(); + foreach($item->choices as $cloudApp) + { + $appInfo = zget($cloudSolution->apps, $cloudApp->name, array()); + $item->schemaChoices[$cloudApp->name] = zget($appInfo, 'alias', $cloudApp->name); + } + } + + return $components; + } }