From 9f53f59f1875b4ecf56665f6a424335cd762ecbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 6 Nov 2021 15:31:07 +0800 Subject: [PATCH] =?UTF-8?q?SSH=E7=99=BB=E5=BD=95=E6=94=AF=E6=8C=81Passphra?= =?UTF-8?q?se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/default/clusters/grants/create.go | 2 ++ .../default/clusters/grants/createPopup.go | 2 ++ .../actions/default/clusters/grants/grant.go | 1 + .../actions/default/clusters/grants/update.go | 3 +++ .../default/clusters/grants/updatePopup.go | 3 +++ web/views/@default/clusters/grants/create.html | 13 ++++++++++--- .../@default/clusters/grants/createPopup.html | 13 ++++++++++--- web/views/@default/clusters/grants/grant.html | 17 ++++++++++++----- web/views/@default/clusters/grants/update.html | 9 ++++++++- .../@default/clusters/grants/updatePopup.html | 9 ++++++++- 10 files changed, 59 insertions(+), 13 deletions(-) diff --git a/internal/web/actions/default/clusters/grants/create.go b/internal/web/actions/default/clusters/grants/create.go index 9cf57929..ec86f6fb 100644 --- a/internal/web/actions/default/clusters/grants/create.go +++ b/internal/web/actions/default/clusters/grants/create.go @@ -28,6 +28,7 @@ func (this *CreateAction) RunPost(params struct { Username string Password string PrivateKey string + Passphrase string Description string Must *actions.Must @@ -58,6 +59,7 @@ func (this *CreateAction) RunPost(params struct { Username: params.Username, Password: params.Password, PrivateKey: params.PrivateKey, + Passphrase: params.Passphrase, Description: params.Description, NodeId: 0, }) diff --git a/internal/web/actions/default/clusters/grants/createPopup.go b/internal/web/actions/default/clusters/grants/createPopup.go index 2d855d8e..f65514ff 100644 --- a/internal/web/actions/default/clusters/grants/createPopup.go +++ b/internal/web/actions/default/clusters/grants/createPopup.go @@ -29,6 +29,7 @@ func (this *CreatePopupAction) RunPost(params struct { Username string Password string PrivateKey string + Passphrase string Description string Must *actions.Must @@ -59,6 +60,7 @@ func (this *CreatePopupAction) RunPost(params struct { Username: params.Username, Password: params.Password, PrivateKey: params.PrivateKey, + Passphrase: params.Passphrase, Description: params.Description, NodeId: 0, }) diff --git a/internal/web/actions/default/clusters/grants/grant.go b/internal/web/actions/default/clusters/grants/grant.go index c47855a8..2f4b6e65 100644 --- a/internal/web/actions/default/clusters/grants/grant.go +++ b/internal/web/actions/default/clusters/grants/grant.go @@ -40,6 +40,7 @@ func (this *GrantAction) RunGet(params struct { "username": grant.Username, "password": strings.Repeat("*", len(grant.Password)), "privateKey": grant.PrivateKey, + "passphrase": strings.Repeat("*", len(grant.Passphrase)), "description": grant.Description, "su": grant.Su, } diff --git a/internal/web/actions/default/clusters/grants/update.go b/internal/web/actions/default/clusters/grants/update.go index a3f2f9cb..5b632244 100644 --- a/internal/web/actions/default/clusters/grants/update.go +++ b/internal/web/actions/default/clusters/grants/update.go @@ -43,6 +43,7 @@ func (this *UpdateAction) RunGet(params struct { "username": grant.Username, "password": grant.Password, "privateKey": grant.PrivateKey, + "passphrase": grant.Passphrase, "description": grant.Description, "su": grant.Su, } @@ -57,6 +58,7 @@ func (this *UpdateAction) RunPost(params struct { Username string Password string PrivateKey string + Passphrase string Description string Must *actions.Must @@ -93,6 +95,7 @@ func (this *UpdateAction) RunPost(params struct { Username: params.Username, Password: params.Password, PrivateKey: params.PrivateKey, + Passphrase: params.Passphrase, Description: params.Description, NodeId: 0, }) diff --git a/internal/web/actions/default/clusters/grants/updatePopup.go b/internal/web/actions/default/clusters/grants/updatePopup.go index 3b063179..41e402de 100644 --- a/internal/web/actions/default/clusters/grants/updatePopup.go +++ b/internal/web/actions/default/clusters/grants/updatePopup.go @@ -43,6 +43,7 @@ func (this *UpdatePopupAction) RunGet(params struct { "password": grant.Password, "description": grant.Description, "privateKey": grant.PrivateKey, + "passphrase": grant.Passphrase, } this.Show() @@ -56,6 +57,7 @@ func (this *UpdatePopupAction) RunPost(params struct { Username string Password string PrivateKey string + Passphrase string Description string Must *actions.Must @@ -91,6 +93,7 @@ func (this *UpdatePopupAction) RunPost(params struct { Username: params.Username, Password: params.Password, PrivateKey: params.PrivateKey, + Passphrase: params.Passphrase, Description: params.Description, NodeId: params.NodeId, }) diff --git a/web/views/@default/clusters/grants/create.html b/web/views/@default/clusters/grants/create.html index 82976d7e..46dd33e0 100644 --- a/web/views/@default/clusters/grants/create.html +++ b/web/views/@default/clusters/grants/create.html @@ -26,7 +26,7 @@ SSH用户名 * - +

SSH登录用户名。

@@ -42,17 +42,24 @@ SSH用户名 * - +

SSH登录用户名。

RSA私钥 * - +

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

+ + 私钥密码
(Passphrase) + + +

为私钥设置了密码(Passphrase)后需要填写。

+ + diff --git a/web/views/@default/clusters/grants/createPopup.html b/web/views/@default/clusters/grants/createPopup.html index 3b72b293..58561b18 100644 --- a/web/views/@default/clusters/grants/createPopup.html +++ b/web/views/@default/clusters/grants/createPopup.html @@ -24,7 +24,7 @@ SSH用户名 * - +

SSH登录用户名。

@@ -40,17 +40,24 @@ SSH用户名 * - +

SSH登录用户名。

RSA私钥 * - +

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

+ + 私钥密码
(Passphrase) + + +

为私钥设置了密码(Passphrase)后需要填写。

+ + diff --git a/web/views/@default/clusters/grants/grant.html b/web/views/@default/clusters/grants/grant.html index 78099f04..fc99bb1f 100644 --- a/web/views/@default/clusters/grants/grant.html +++ b/web/views/@default/clusters/grants/grant.html @@ -26,11 +26,11 @@

SSH登录用户名。

- - SSH密码 - {{grant.password}} -

SSH登录用户密码。

- + + SSH密码 + {{grant.password}} +

SSH登录用户密码。

+ @@ -48,6 +48,13 @@

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

+ + 私钥密码
(Passphrase) + + {{grant.passphrase}} + - + + diff --git a/web/views/@default/clusters/grants/update.html b/web/views/@default/clusters/grants/update.html index 16135728..cc16c202 100644 --- a/web/views/@default/clusters/grants/update.html +++ b/web/views/@default/clusters/grants/update.html @@ -50,10 +50,17 @@ RSA私钥 * - +

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

+ + 私钥密码
(Passphrase) + + +

为私钥设置了密码(Passphrase)后需要填写。

+ + diff --git a/web/views/@default/clusters/grants/updatePopup.html b/web/views/@default/clusters/grants/updatePopup.html index 126c8015..afd973fc 100644 --- a/web/views/@default/clusters/grants/updatePopup.html +++ b/web/views/@default/clusters/grants/updatePopup.html @@ -49,10 +49,17 @@ RSA私钥 * - +

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

+ + 私钥密码
(Passphrase) + + +

为私钥设置了密码(Passphrase)后需要填写。

+ +