mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-19 23:50:25 +08:00
修改SSH时自动填入SSH主机地址/节点设置--SSH设置增加连接测试
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="ui message" v-if="isTesting">正在测试是否连接 ...</div>
|
||||
<div class="ui message green" v-if="resp != null && resp.isOk">连接成功!</div>
|
||||
<div class="ui message red" v-if="resp != null && !resp.isOk">连接失败:{{resp.error}}</div>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
@@ -27,4 +27,27 @@ Tea.context(function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 测试相关
|
||||
this.resp = null
|
||||
this.isTesting = false
|
||||
|
||||
if (this.grant != null && this.grant.id > 0 && this.sshHost.length > 0 && this.sshPort.toString().length > 0) {
|
||||
this.isTesting = true
|
||||
this.$delay(function () {
|
||||
this.$post(".test")
|
||||
.params({
|
||||
grantId: this.grant.id,
|
||||
host: this.sshHost,
|
||||
port: this.sshPort
|
||||
})
|
||||
.success(function (resp) {
|
||||
this.resp = resp.data
|
||||
})
|
||||
.done(function () {
|
||||
this.isTesting = false
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user