2020-09-06 16:19:34 +08:00
|
|
|
Tea.context(function () {
|
2020-10-11 10:51:13 +08:00
|
|
|
this.success = NotifySuccess("保存成功", "/api/node?nodeId=" + this.node.id)
|
2020-10-04 14:27:05 +08:00
|
|
|
|
|
|
|
|
this.hasHTTPS = this.node.listens.$any(function (k, v) {
|
|
|
|
|
return v.protocol == "https"
|
2021-01-01 20:49:19 +08:00
|
|
|
}) || (this.node.restIsOn && this.node.restListens.$any(function (k, v) {
|
|
|
|
|
return v.protocol == "https"
|
|
|
|
|
}))
|
|
|
|
|
this.grpcAddrs = []
|
|
|
|
|
this.restAddrs = []
|
|
|
|
|
|
2020-10-04 14:27:05 +08:00
|
|
|
this.changeListens = function (addrs) {
|
2021-01-01 20:49:19 +08:00
|
|
|
this.grpcAddrs = addrs
|
|
|
|
|
|
|
|
|
|
this.hasHTTPS = this.grpcAddrs.$any(function (k, v) {
|
|
|
|
|
return v.protocol == "https"
|
|
|
|
|
}) || (this.node.restIsOn && this.restAddrs.$any(function (k, v) {
|
|
|
|
|
return v.protocol == "https"
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.changeRestListens = function (addrs) {
|
|
|
|
|
this.restAddrs = addrs
|
|
|
|
|
|
|
|
|
|
this.hasHTTPS = this.grpcAddrs.$any(function (k, v) {
|
|
|
|
|
return v.protocol == "https"
|
|
|
|
|
}) || (this.node.restIsOn && this.restAddrs.$any(function (k, v) {
|
2020-10-04 14:27:05 +08:00
|
|
|
return v.protocol == "https"
|
2021-01-01 20:49:19 +08:00
|
|
|
}))
|
2020-10-04 14:27:05 +08:00
|
|
|
}
|
2020-09-06 16:19:34 +08:00
|
|
|
})
|