mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-12 19:30:26 +08:00
SSH认证支持sudo
This commit is contained in:
@@ -30,6 +30,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
PrivateKey string
|
PrivateKey string
|
||||||
Passphrase string
|
Passphrase string
|
||||||
Description string
|
Description string
|
||||||
|
Su bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
@@ -61,6 +62,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
PrivateKey: params.PrivateKey,
|
PrivateKey: params.PrivateKey,
|
||||||
Passphrase: params.Passphrase,
|
Passphrase: params.Passphrase,
|
||||||
Description: params.Description,
|
Description: params.Description,
|
||||||
|
Su: params.Su,
|
||||||
NodeId: 0,
|
NodeId: 0,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
PrivateKey string
|
PrivateKey string
|
||||||
Passphrase string
|
Passphrase string
|
||||||
Description string
|
Description string
|
||||||
|
Su bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
@@ -62,6 +63,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
PrivateKey: params.PrivateKey,
|
PrivateKey: params.PrivateKey,
|
||||||
Passphrase: params.Passphrase,
|
Passphrase: params.Passphrase,
|
||||||
Description: params.Description,
|
Description: params.Description,
|
||||||
|
Su: params.Su,
|
||||||
NodeId: 0,
|
NodeId: 0,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -74,6 +76,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
"name": params.Name,
|
"name": params.Name,
|
||||||
"method": params.Method,
|
"method": params.Method,
|
||||||
"methodName": grantutils.FindGrantMethodName(params.Method),
|
"methodName": grantutils.FindGrantMethodName(params.Method),
|
||||||
|
"username": params.Username,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建日志
|
// 创建日志
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ func (this *UpdateAction) RunPost(params struct {
|
|||||||
PrivateKey string
|
PrivateKey string
|
||||||
Passphrase string
|
Passphrase string
|
||||||
Description string
|
Description string
|
||||||
|
Su bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
@@ -97,6 +98,7 @@ func (this *UpdateAction) RunPost(params struct {
|
|||||||
PrivateKey: params.PrivateKey,
|
PrivateKey: params.PrivateKey,
|
||||||
Passphrase: params.Passphrase,
|
Passphrase: params.Passphrase,
|
||||||
Description: params.Description,
|
Description: params.Description,
|
||||||
|
Su: params.Su,
|
||||||
NodeId: 0,
|
NodeId: 0,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ func (this *UpdatePopupAction) RunGet(params struct {
|
|||||||
"description": grant.Description,
|
"description": grant.Description,
|
||||||
"privateKey": grant.PrivateKey,
|
"privateKey": grant.PrivateKey,
|
||||||
"passphrase": grant.Passphrase,
|
"passphrase": grant.Passphrase,
|
||||||
|
"su": grant.Su,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Show()
|
this.Show()
|
||||||
@@ -59,6 +60,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
PrivateKey string
|
PrivateKey string
|
||||||
Passphrase string
|
Passphrase string
|
||||||
Description string
|
Description string
|
||||||
|
Su bool
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
@@ -96,6 +98,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
Passphrase: params.Passphrase,
|
Passphrase: params.Passphrase,
|
||||||
Description: params.Description,
|
Description: params.Description,
|
||||||
NodeId: params.NodeId,
|
NodeId: params.NodeId,
|
||||||
|
Su: params.Su,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
@@ -108,6 +111,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
"name": params.Name,
|
"name": params.Name,
|
||||||
"method": params.Method,
|
"method": params.Method,
|
||||||
"methodName": grantutils.FindGrantMethodName(params.Method),
|
"methodName": grantutils.FindGrantMethodName(params.Method),
|
||||||
|
"username": params.Username,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Success()
|
this.Success()
|
||||||
|
|||||||
@@ -66,6 +66,13 @@
|
|||||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tbody v-show="moreOptionsVisible">
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr>
|
||||||
|
<td>执行sudo</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="su"></checkbox>
|
||||||
|
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>备注</td>
|
<td>备注</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -65,6 +65,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tbody v-show="moreOptionsVisible">
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr>
|
||||||
|
<td>执行sudo</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="su"></checkbox>
|
||||||
|
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>备注</td>
|
<td>备注</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -56,7 +56,13 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tr>
|
||||||
|
<td>执行sudo</td>
|
||||||
|
<td>
|
||||||
|
<span v-if="grant.su" class="green">Y</span>
|
||||||
|
<span v-else class="disabled">N</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>备注</td>
|
<td>备注</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -62,7 +62,13 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tr>
|
||||||
|
<td>执行sudo</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="su" v-model="grant.su"></checkbox>
|
||||||
|
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>备注</td>
|
<td>备注</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -67,6 +67,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tbody v-show="moreOptionsVisible">
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr>
|
||||||
|
<td>执行sudo</td>
|
||||||
|
<td>
|
||||||
|
<checkbox name="su" v-model="grant.su"></checkbox>
|
||||||
|
<p class="comment">非root的用户可以使用<code-label>sudo</code-label>获得更高权限来执行命令。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>备注</td>
|
<td>备注</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -99,12 +99,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui column no-border">
|
<div class="ui column">
|
||||||
<h4>本周流量</h4>
|
<h4>本周流量</h4>
|
||||||
<div class="value"><span>{{weekTraffic}}</span>{{weekTrafficUnit}}</div>
|
<div class="value"><span>{{weekTraffic}}</span>{{weekTrafficUnit}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui column no-border">
|
<div class="ui column">
|
||||||
<h4>昨日流量</h4>
|
<h4>昨日流量</h4>
|
||||||
<div class="value"><span>{{yesterdayTraffic}}</span>{{yesterdayTrafficUnit}}</div>
|
<div class="value"><span>{{yesterdayTraffic}}</span>{{yesterdayTrafficUnit}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user