mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-23 01:40:29 +08:00
SSH认证--私钥认证方式增加用户名选项
This commit is contained in:
@@ -42,6 +42,9 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
this.FailField("username", "请输入SSH登录用户名")
|
this.FailField("username", "请输入SSH登录用户名")
|
||||||
}
|
}
|
||||||
case "privateKey":
|
case "privateKey":
|
||||||
|
if len(params.Username) == 0 {
|
||||||
|
this.FailField("username", "请输入SSH登录用户名")
|
||||||
|
}
|
||||||
if len(params.PrivateKey) == 0 {
|
if len(params.PrivateKey) == 0 {
|
||||||
this.FailField("privateKey", "请输入RSA私钥")
|
this.FailField("privateKey", "请输入RSA私钥")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ func (this *UpdateAction) RunPost(params struct {
|
|||||||
this.FailField("username", "请输入SSH登录用户名")
|
this.FailField("username", "请输入SSH登录用户名")
|
||||||
}
|
}
|
||||||
case "privateKey":
|
case "privateKey":
|
||||||
|
if len(params.Username) == 0 {
|
||||||
|
this.FailField("username", "请输入SSH登录用户名")
|
||||||
|
}
|
||||||
if len(params.PrivateKey) == 0 {
|
if len(params.PrivateKey) == 0 {
|
||||||
this.FailField("privateKey", "请输入RSA私钥")
|
this.FailField("privateKey", "请输入RSA私钥")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,13 @@
|
|||||||
|
|
||||||
<!-- 私钥 -->
|
<!-- 私钥 -->
|
||||||
<tbody v-if="method == 'privateKey'">
|
<tbody v-if="method == 'privateKey'">
|
||||||
|
<tr>
|
||||||
|
<td>SSH用户名 *</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="username" maxlength="100"/>
|
||||||
|
<p class="comment">SSH登录用户名。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>RSA私钥 *</td>
|
<td>RSA私钥 *</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{$layout}
|
{$layout}
|
||||||
{$template "grant_menu"}
|
{$template "grant_menu"}
|
||||||
|
{$template "/code_editor"}
|
||||||
|
|
||||||
<table class="ui table selectable definition">
|
<table class="ui table selectable definition">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -34,10 +35,16 @@
|
|||||||
|
|
||||||
<!-- 私钥 -->
|
<!-- 私钥 -->
|
||||||
<tbody v-if="grant.method == 'privateKey'">
|
<tbody v-if="grant.method == 'privateKey'">
|
||||||
|
<tr>
|
||||||
|
<td>SSH用户名</td>
|
||||||
|
<td>{{grant.username}}
|
||||||
|
<p class="comment">SSH登录用户名。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>RSA私钥</td>
|
<td>RSA私钥</td>
|
||||||
<td>
|
<td>
|
||||||
{{grant.privateKey}}
|
<source-code-box type="text/plain">{{grant.privateKey}}</source-code-box>
|
||||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -42,10 +42,14 @@
|
|||||||
|
|
||||||
<!-- 私钥 -->
|
<!-- 私钥 -->
|
||||||
<tbody v-if="grant.method == 'privateKey'">
|
<tbody v-if="grant.method == 'privateKey'">
|
||||||
|
<tr>
|
||||||
|
<td>SSH用户名</td>
|
||||||
|
<td>{{grant.username}}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>RSA私钥</td>
|
<td>RSA私钥</td>
|
||||||
<td>
|
<td>
|
||||||
{{grant.privateKey}}
|
<pre class="pre-box" style="max-height: 10em; overflow-y: auto">{{grant.privateKey}}</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -40,6 +40,13 @@
|
|||||||
|
|
||||||
<!-- 私钥 -->
|
<!-- 私钥 -->
|
||||||
<tbody v-if="method == 'privateKey'">
|
<tbody v-if="method == 'privateKey'">
|
||||||
|
<tr>
|
||||||
|
<td>SSH用户名 *</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="username" maxlength="100" v-model="grant.username"/>
|
||||||
|
<p class="comment">SSH登录用户名。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>RSA私钥 *</td>
|
<td>RSA私钥 *</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user