mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-26 20:40:24 +08:00
实现API节点远程升级
This commit is contained in:
39
web/views/@default/api/node/upgradePopup.js
Normal file
39
web/views/@default/api/node/upgradePopup.js
Normal file
@@ -0,0 +1,39 @@
|
||||
Tea.context(function () {
|
||||
this.$delay(function () {
|
||||
this.checkLoop()
|
||||
})
|
||||
|
||||
this.success = function () {
|
||||
}
|
||||
|
||||
this.isRequesting = false
|
||||
|
||||
this.before = function () {
|
||||
this.isRequesting = true
|
||||
}
|
||||
|
||||
this.done = function () {
|
||||
this.isRequesting = false
|
||||
}
|
||||
|
||||
this.checkLoop = function () {
|
||||
if (this.currentVersion == this.latestVersion) {
|
||||
return
|
||||
}
|
||||
|
||||
this.$post(".upgradeCheck")
|
||||
.params({
|
||||
nodeId: this.nodeId
|
||||
})
|
||||
.success(function (resp) {
|
||||
if (resp.data.isOk) {
|
||||
teaweb.reload()
|
||||
}
|
||||
})
|
||||
.done(function () {
|
||||
this.$delay(function () {
|
||||
this.checkLoop()
|
||||
}, 3000)
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user