mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
SSH登录支持Passphrase
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100"/>
|
||||
<input type="text" name="username" maxlength="100" value="root"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -42,17 +42,24 @@
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100"/>
|
||||
<input type="text" name="username" maxlength="100" value="root"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
<textarea name="privateKey"></textarea>
|
||||
<textarea name="privateKey" spellcheck="false"></textarea>
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥密码<br/><em>(Passphrase)</em></td>
|
||||
<td>
|
||||
<input type="password" name="passphrase" maxlength="200"/>
|
||||
<p class="comment">为私钥设置了密码(Passphrase)后需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100"/>
|
||||
<input type="text" name="username" maxlength="100" value="root"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -40,17 +40,24 @@
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100"/>
|
||||
<input type="text" name="username" maxlength="100" value="root"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
<textarea name="privateKey"></textarea>
|
||||
<textarea name="privateKey" spellcheck="false"></textarea>
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥密码<br/><em>(Passphrase)</em></td>
|
||||
<td>
|
||||
<input type="password" name="passphrase" maxlength="200"/>
|
||||
<p class="comment">为私钥设置了密码(Passphrase)后需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SSH密码</td>
|
||||
<td>{{grant.password}}
|
||||
<p class="comment">SSH登录用户密码。</p> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SSH密码</td>
|
||||
<td>{{grant.password}}
|
||||
<p class="comment">SSH登录用户密码。</p> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 私钥 -->
|
||||
@@ -48,6 +48,13 @@
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥密码<br/><em>(Passphrase)</em></td>
|
||||
<td>
|
||||
<span v-if="grant.passphrase.length > 0">{{grant.passphrase}}</span>
|
||||
<span v-else class="disabled">-</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -50,10 +50,17 @@
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
<textarea name="privateKey" v-model="grant.privateKey"></textarea>
|
||||
<textarea name="privateKey" v-model="grant.privateKey" spellcheck="false"></textarea>
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥密码<br/><em>(Passphrase)</em></td>
|
||||
<td>
|
||||
<input type="password" name="passphrase" maxlength="200" v-model="grant.passphrase"/>
|
||||
<p class="comment">为私钥设置了密码(Passphrase)后需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -49,10 +49,17 @@
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
<textarea name="privateKey" v-model="grant.privateKey"></textarea>
|
||||
<textarea name="privateKey" v-model="grant.privateKey" spellcheck="false"></textarea>
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥密码<br/><em>(Passphrase)</em></td>
|
||||
<td>
|
||||
<input type="password" name="passphrase" maxlength="200" v-model="grant.passphrase"/>
|
||||
<p class="comment">为私钥设置了密码(Passphrase)后需要填写。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user