mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-22 17:30:29 +08:00
31 lines
589 B
JavaScript
31 lines
589 B
JavaScript
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
|
|
})
|
|
}
|
|
|
|
this.changeAutoCheck = function () {
|
|
this.$post(".update")
|
|
.params({
|
|
autoCheck: this.config.autoCheck ? 1 : 0
|
|
})
|
|
}
|
|
}) |