2020-07-30 22:41:35 +08:00
|
|
|
Tea.context(function () {
|
2021-07-31 22:23:07 +08:00
|
|
|
this.clusterId = 0
|
2020-07-30 22:41:35 +08:00
|
|
|
if (this.node.cluster != null && this.node.cluster.id > 0) {
|
2021-07-31 22:23:07 +08:00
|
|
|
this.clusterId = this.node.cluster.id
|
2020-07-30 22:41:35 +08:00
|
|
|
}
|
|
|
|
|
|
2021-07-31 22:23:07 +08:00
|
|
|
this.success = function () {
|
|
|
|
|
let that = this
|
|
|
|
|
teaweb.success("保存成功", function () {
|
|
|
|
|
window.location = "/clusters/cluster/node/detail?clusterId=" + that.clusterId + "&nodeId=" + that.node.id
|
|
|
|
|
})
|
|
|
|
|
}
|
2020-08-21 21:09:42 +08:00
|
|
|
|
|
|
|
|
// IP地址相关
|
2021-07-31 22:23:07 +08:00
|
|
|
this.ipAddresses = this.node.ipAddresses
|
2020-08-21 21:09:42 +08:00
|
|
|
|
|
|
|
|
// 认证相关
|
2021-07-31 22:23:07 +08:00
|
|
|
this.grant = null
|
2020-08-21 21:09:42 +08:00
|
|
|
|
2021-07-31 22:23:07 +08:00
|
|
|
this.sshHost = ""
|
|
|
|
|
this.sshPort = ""
|
|
|
|
|
this.loginId = 0
|
2020-07-30 22:41:35 +08:00
|
|
|
if (this.node.login != null) {
|
2021-07-31 22:23:07 +08:00
|
|
|
this.loginId = this.node.login.id
|
2020-07-30 22:41:35 +08:00
|
|
|
|
|
|
|
|
if (this.node.login.params != null) {
|
2021-07-31 22:23:07 +08:00
|
|
|
this.sshHost = this.node.login.params.host
|
2020-09-06 16:19:34 +08:00
|
|
|
if (this.node.login.params.port > 0) {
|
2021-07-31 22:23:07 +08:00
|
|
|
this.sshPort = this.node.login.params.port
|
2020-09-06 16:19:34 +08:00
|
|
|
}
|
2020-07-30 22:41:35 +08:00
|
|
|
}
|
|
|
|
|
|
2020-09-06 16:19:34 +08:00
|
|
|
if (this.node.login.grant != null && typeof this.node.login.grant.id != "undefined") {
|
2020-07-30 22:41:35 +08:00
|
|
|
this.grant = {
|
|
|
|
|
id: this.node.login.grant.id,
|
|
|
|
|
name: this.node.login.grant.name,
|
|
|
|
|
method: this.node.login.grant.method,
|
|
|
|
|
methodName: this.node.login.grant.methodName
|
2021-07-31 22:23:07 +08:00
|
|
|
}
|
2020-07-30 22:41:35 +08:00
|
|
|
}
|
|
|
|
|
}
|
2021-07-31 22:23:07 +08:00
|
|
|
|
|
|
|
|
this.changeClusters = function (info) {
|
|
|
|
|
this.clusterId = info.clusterId
|
|
|
|
|
}
|
|
|
|
|
})
|