From ea358ad348f3e97c6408892cff94833b855cfc3d Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 30 Jun 2021 14:55:21 +0800 Subject: [PATCH] =?UTF-8?q?SSH=E8=AE=A4=E8=AF=81--=E7=A7=81=E9=92=A5?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=96=B9=E5=BC=8F=E5=A2=9E=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/web/actions/default/clusters/grants/create.go | 3 +++ internal/web/actions/default/clusters/grants/update.go | 3 +++ web/views/@default/clusters/grants/create.html | 7 +++++++ web/views/@default/clusters/grants/grant.html | 9 ++++++++- web/views/@default/clusters/grants/test.html | 6 +++++- web/views/@default/clusters/grants/update.html | 7 +++++++ 6 files changed, 33 insertions(+), 2 deletions(-) diff --git a/internal/web/actions/default/clusters/grants/create.go b/internal/web/actions/default/clusters/grants/create.go index f40af196..9cf57929 100644 --- a/internal/web/actions/default/clusters/grants/create.go +++ b/internal/web/actions/default/clusters/grants/create.go @@ -42,6 +42,9 @@ func (this *CreateAction) 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/update.go b/internal/web/actions/default/clusters/grants/update.go index 10380aa7..a3f2f9cb 100644 --- a/internal/web/actions/default/clusters/grants/update.go +++ b/internal/web/actions/default/clusters/grants/update.go @@ -74,6 +74,9 @@ func (this *UpdateAction) 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/grants/create.html b/web/views/@default/clusters/grants/create.html index baed6f48..82976d7e 100644 --- a/web/views/@default/clusters/grants/create.html +++ b/web/views/@default/clusters/grants/create.html @@ -39,6 +39,13 @@ + + SSH用户名 * + + +

SSH登录用户名。

+ + RSA私钥 * diff --git a/web/views/@default/clusters/grants/grant.html b/web/views/@default/clusters/grants/grant.html index be598164..78099f04 100644 --- a/web/views/@default/clusters/grants/grant.html +++ b/web/views/@default/clusters/grants/grant.html @@ -1,5 +1,6 @@ {$layout} {$template "grant_menu"} +{$template "/code_editor"} @@ -34,10 +35,16 @@ + + + + diff --git a/web/views/@default/clusters/grants/test.html b/web/views/@default/clusters/grants/test.html index f8f2fda4..b18f89eb 100644 --- a/web/views/@default/clusters/grants/test.html +++ b/web/views/@default/clusters/grants/test.html @@ -42,10 +42,14 @@ + + + + diff --git a/web/views/@default/clusters/grants/update.html b/web/views/@default/clusters/grants/update.html index 17b40d0f..16135728 100644 --- a/web/views/@default/clusters/grants/update.html +++ b/web/views/@default/clusters/grants/update.html @@ -40,6 +40,13 @@ + + + +
SSH用户名{{grant.username}} +

SSH登录用户名。

+
RSA私钥 - {{grant.privateKey}} + {{grant.privateKey}}

用来生成登录SSH公钥的私钥

SSH用户名{{grant.username}}
RSA私钥 - {{grant.privateKey}} +
{{grant.privateKey}}
SSH用户名 * + +

SSH登录用户名。

+
RSA私钥 *