mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-11 17:00:32 +08:00
增加在线检查最新版本功能
This commit is contained in:
24
web/views/@default/settings/updates/index.js
Normal file
24
web/views/@default/settings/updates/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
Tea.context(function () {
|
||||
this.isStarted = false
|
||||
this.isChecking = true
|
||||
this.result = {isOk: false, message: "", hasNew: false, dlURL: ""}
|
||||
|
||||
this.start = function () {
|
||||
this.isStarted = true
|
||||
this.isChecking = true
|
||||
|
||||
this.$delay(function () {
|
||||
this.check()
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
this.check = function () {
|
||||
this.$post("$")
|
||||
.success(function (resp) {
|
||||
this.result = resp.data.result
|
||||
})
|
||||
.done(function () {
|
||||
this.isChecking = false
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user