From 16f4fa6c3fd6ff2a38bfd3fef9f9dd3249351657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 5 Apr 2024 11:24:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E7=AD=96=E7=95=A5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=BB=8E=E2=80=9C=E5=86=85=E5=AD=98=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E2=80=9D=E5=88=87=E6=8D=A2=E5=88=B0=E2=80=9C=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E2=80=9C=E6=97=B6=E5=A2=9E=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../servers/components/cache/update.html | 2 +- .../@default/servers/components/cache/update.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/web/views/@default/servers/components/cache/update.html b/web/views/@default/servers/components/cache/update.html index 7084009a..6d6f4019 100644 --- a/web/views/@default/servers/components/cache/update.html +++ b/web/views/@default/servers/components/cache/update.html @@ -12,7 +12,7 @@ 缓存类型 * - diff --git a/web/views/@default/servers/components/cache/update.js b/web/views/@default/servers/components/cache/update.js index c4b6494f..8ba862cf 100644 --- a/web/views/@default/servers/components/cache/update.js +++ b/web/views/@default/servers/components/cache/update.js @@ -7,4 +7,20 @@ Tea.context(function () { 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") { + options["enableMMAP"] = true + options["dir"] = "/opt/cache" + options["memoryPolicy"] = { + capacity: { + unit: "gb", + count: 2 + } + } + } + } + } }) \ No newline at end of file