From 450098778f5a698f1d877c44b260eb8b86bb6bb7 Mon Sep 17 00:00:00 2001 From: liujun Date: Mon, 8 Apr 2024 17:00:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=8A=82=E7=82=B9=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E8=B0=83=E7=94=A8=E5=AE=89=E8=A3=85=E9=80=9A?= =?UTF-8?q?=E9=81=93=E6=97=B6=E6=8F=90=E4=BE=9B=E9=BB=98=E8=AE=A4=E9=80=9A?= =?UTF-8?q?=E9=81=93=20#7379?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sites/open/nodeman/create_task/v4_0.py | 2 +- .../components/atoms/nodeman/create_task/v6_0.js | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py b/pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py index 3354932c53..19558a9554 100644 --- a/pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py +++ b/pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py @@ -136,7 +136,7 @@ def execute(self, data, parent_data): "os_type": host["os_type"], "is_manual": False, } - if install_channel_id: + if install_channel_id and install_channel_id != -1: base_params["install_channel_id"] = install_channel_id # 支持表格中一行多ip操作, 拼装表格内的inner_ip参数 for index, inner_ip in enumerate(inner_ip_list): diff --git a/pipeline_plugins/components/static/components/atoms/nodeman/create_task/v6_0.js b/pipeline_plugins/components/static/components/atoms/nodeman/create_task/v6_0.js index 590979bcc8..83a4e4ca34 100644 --- a/pipeline_plugins/components/static/components/atoms/nodeman/create_task/v6_0.js +++ b/pipeline_plugins/components/static/components/atoms/nodeman/create_task/v6_0.js @@ -54,15 +54,15 @@ type: "select", attrs: { name: gettext("安装通道"), - hookable: false, + width: "180px", remote: true, remote_url: "", remote_data_init: function (resp) { if (resp.result === false) { show_msg(resp.message, 'error'); - }else if (resp.data.length != 0){ - this._set_value(resp.data[0]["value"]); } + resp.data.unshift({"text": gettext("默认通道"), "value": -1}); + this._set_value(resp.data[0]["value"]); return resp.data; }, validation: [ @@ -72,6 +72,16 @@ ] }, events: [ + { + source: "nodeman_bk_cloud_id", + type: "init", + action: function (cloud_id) { + if (cloud_id !== '') { + this.remote_url = $.context.get('site_url') + 'pipeline/nodeman_get_install_channel/' + cloud_id + '/'; + this.remoteMethod(); + } + } + }, { source: "nodeman_bk_cloud_id", type: "change",