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登录用户名。
+