diff --git a/internal/web/actions/default/clusters/grants/create.go b/internal/web/actions/default/clusters/grants/create.go index ec86f6fb..54d7e29d 100644 --- a/internal/web/actions/default/clusters/grants/create.go +++ b/internal/web/actions/default/clusters/grants/create.go @@ -30,6 +30,7 @@ func (this *CreateAction) RunPost(params struct { PrivateKey string Passphrase string Description string + Su bool Must *actions.Must }) { @@ -61,6 +62,7 @@ func (this *CreateAction) RunPost(params struct { PrivateKey: params.PrivateKey, Passphrase: params.Passphrase, Description: params.Description, + Su: params.Su, NodeId: 0, }) if err != nil { diff --git a/internal/web/actions/default/clusters/grants/createPopup.go b/internal/web/actions/default/clusters/grants/createPopup.go index f65514ff..49d8f171 100644 --- a/internal/web/actions/default/clusters/grants/createPopup.go +++ b/internal/web/actions/default/clusters/grants/createPopup.go @@ -31,6 +31,7 @@ func (this *CreatePopupAction) RunPost(params struct { PrivateKey string Passphrase string Description string + Su bool Must *actions.Must }) { @@ -62,6 +63,7 @@ func (this *CreatePopupAction) RunPost(params struct { PrivateKey: params.PrivateKey, Passphrase: params.Passphrase, Description: params.Description, + Su: params.Su, NodeId: 0, }) if err != nil { @@ -74,6 +76,7 @@ func (this *CreatePopupAction) RunPost(params struct { "name": params.Name, "method": params.Method, "methodName": grantutils.FindGrantMethodName(params.Method), + "username": params.Username, } // 创建日志 diff --git a/internal/web/actions/default/clusters/grants/update.go b/internal/web/actions/default/clusters/grants/update.go index 5b632244..00eb4b4b 100644 --- a/internal/web/actions/default/clusters/grants/update.go +++ b/internal/web/actions/default/clusters/grants/update.go @@ -60,6 +60,7 @@ func (this *UpdateAction) RunPost(params struct { PrivateKey string Passphrase string Description string + Su bool Must *actions.Must }) { @@ -97,6 +98,7 @@ func (this *UpdateAction) RunPost(params struct { PrivateKey: params.PrivateKey, Passphrase: params.Passphrase, Description: params.Description, + Su: params.Su, NodeId: 0, }) if err != nil { diff --git a/internal/web/actions/default/clusters/grants/updatePopup.go b/internal/web/actions/default/clusters/grants/updatePopup.go index 41e402de..184757ae 100644 --- a/internal/web/actions/default/clusters/grants/updatePopup.go +++ b/internal/web/actions/default/clusters/grants/updatePopup.go @@ -44,6 +44,7 @@ func (this *UpdatePopupAction) RunGet(params struct { "description": grant.Description, "privateKey": grant.PrivateKey, "passphrase": grant.Passphrase, + "su": grant.Su, } this.Show() @@ -59,6 +60,7 @@ func (this *UpdatePopupAction) RunPost(params struct { PrivateKey string Passphrase string Description string + Su bool Must *actions.Must }) { @@ -96,6 +98,7 @@ func (this *UpdatePopupAction) RunPost(params struct { Passphrase: params.Passphrase, Description: params.Description, NodeId: params.NodeId, + Su: params.Su, }) if err != nil { this.ErrorPage(err) @@ -108,6 +111,7 @@ func (this *UpdatePopupAction) RunPost(params struct { "name": params.Name, "method": params.Method, "methodName": grantutils.FindGrantMethodName(params.Method), + "username": params.Username, } this.Success() diff --git a/web/views/@default/clusters/grants/create.html b/web/views/@default/clusters/grants/create.html index 46dd33e0..ee60dda6 100644 --- a/web/views/@default/clusters/grants/create.html +++ b/web/views/@default/clusters/grants/create.html @@ -66,6 +66,13 @@
非root的用户可以使用
非root的用户可以使用
非root的用户可以使用
非root的用户可以使用