From f758a2a487b063a2710e9330b9e62596b9de36b2 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 3 Aug 2021 06:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E8=BF=87=E7=A8=8B=E4=B8=AD=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=A1=AB=E5=86=99SSH=E8=AE=A4=E8=AF=81=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=90=8D=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/actions/default/clusters/grants/createPopup.go | 3 +++ .../web/actions/default/clusters/grants/updatePopup.go | 3 +++ web/views/@default/clusters/cluster/updateNodeSSH.js | 5 +++++ web/views/@default/clusters/grants/createPopup.html | 7 +++++++ web/views/@default/clusters/grants/updatePopup.html | 7 +++++++ 5 files changed, 25 insertions(+) create mode 100644 web/views/@default/clusters/cluster/updateNodeSSH.js diff --git a/internal/web/actions/default/clusters/grants/createPopup.go b/internal/web/actions/default/clusters/grants/createPopup.go index 66d5e95b..2d855d8e 100644 --- a/internal/web/actions/default/clusters/grants/createPopup.go +++ b/internal/web/actions/default/clusters/grants/createPopup.go @@ -43,6 +43,9 @@ func (this *CreatePopupAction) RunPost(params struct { this.FailField("username", "请输入SSH登录用户名") } case "privateKey": + if len(params.Username) == 0 { + this.FailField("username", "请输入SSH登录用户名") + } if len(params.PrivateKey) == 0 { this.FailField("privateKey", "请输入RSA私钥") } diff --git a/internal/web/actions/default/clusters/grants/updatePopup.go b/internal/web/actions/default/clusters/grants/updatePopup.go index 241a53d5..3b063179 100644 --- a/internal/web/actions/default/clusters/grants/updatePopup.go +++ b/internal/web/actions/default/clusters/grants/updatePopup.go @@ -73,6 +73,9 @@ func (this *UpdatePopupAction) RunPost(params struct { this.FailField("username", "请输入SSH登录用户名") } case "privateKey": + if len(params.Username) == 0 { + this.FailField("username", "请输入SSH登录用户名") + } if len(params.PrivateKey) == 0 { this.FailField("privateKey", "请输入RSA私钥") } diff --git a/web/views/@default/clusters/cluster/updateNodeSSH.js b/web/views/@default/clusters/cluster/updateNodeSSH.js new file mode 100644 index 00000000..53c03942 --- /dev/null +++ b/web/views/@default/clusters/cluster/updateNodeSSH.js @@ -0,0 +1,5 @@ +Tea.context(function () { + if (this.params.port <= 0) { + this.params.port = 22 + } +}) \ No newline at end of file diff --git a/web/views/@default/clusters/grants/createPopup.html b/web/views/@default/clusters/grants/createPopup.html index bc62b5ea..3b72b293 100644 --- a/web/views/@default/clusters/grants/createPopup.html +++ b/web/views/@default/clusters/grants/createPopup.html @@ -37,6 +37,13 @@ + + SSH用户名 * + + +

SSH登录用户名。

+ + RSA私钥 * diff --git a/web/views/@default/clusters/grants/updatePopup.html b/web/views/@default/clusters/grants/updatePopup.html index c010ae53..126c8015 100644 --- a/web/views/@default/clusters/grants/updatePopup.html +++ b/web/views/@default/clusters/grants/updatePopup.html @@ -39,6 +39,13 @@ + + SSH用户名 * + + +

SSH登录用户名。

+ + RSA私钥 *