Files
EdgeAdmin/web/views/@default/servers/components/cache/update.js

27 lines
860 B
JavaScript
Raw Normal View History

2020-10-02 17:22:24 +08:00
Tea.context(function () {
2020-10-04 14:27:05 +08:00
this.success = NotifyReloadSuccess("保存成功 ")
2020-10-02 17:22:24 +08:00
this.policyType = this.cachePolicy.type
2022-01-12 21:09:11 +08:00
this.fileOpenFileCacheMax = 0
if (this.cachePolicy.type == "file" && this.cachePolicy.options.openFileCache != null && this.cachePolicy.options.openFileCache.isOn && this.cachePolicy.options.openFileCache.max > 0) {
this.fileOpenFileCacheMax = this.cachePolicy.options.openFileCache.max
}
this.changePolicyType = function () {
if (this.policyType == "file") {
let options = this.cachePolicy.options
if (options != null && typeof options == "object" && typeof options["dir"] === "undefined") {
2024-05-01 12:51:24 +08:00
options["enableMMAP"] = false
options["enableIncompletePartialContent"] = true
options["dir"] = "/opt/cache"
options["memoryPolicy"] = {
capacity: {
unit: "gb",
count: 2
}
}
}
}
}
2020-10-02 17:22:24 +08:00
})