support clearing application code cache

This commit is contained in:
MaysWind
2026-03-11 00:52:43 +08:00
parent edcf33f49c
commit 13488efdaf
23 changed files with 82 additions and 1 deletions
@@ -101,6 +101,8 @@
<f7-actions-group v-if="isSupportedFileCache && fileCacheStatistics">
<f7-actions-button :class="{ 'disabled': loading || !isSupportedFileCache || !fileCacheStatistics }"
@click="clearMapCache">{{ tt('Clear Map Data Cache') }}</f7-actions-button>
<f7-actions-button :class="{ 'disabled': loading || !isSupportedFileCache || !fileCacheStatistics }"
@click="clearApplicationCodeFileCache">{{ tt('Clear Application Code Cache') }}</f7-actions-button>
<f7-actions-button :class="{ 'disabled': loading || !isSupportedFileCache || !fileCacheStatistics }"
@click="clearAllFileCache">{{ tt('Clear All File Cache') }}</f7-actions-button>
</f7-actions-group>
@@ -141,6 +143,7 @@ const {
exchangeRatesDataCacheExpiration,
loadCacheStatistics,
clearMapDataCache,
clearApplicationCodeCache,
clearAllBrowserCaches,
clearExchangeRatesDataCache
} = useAppBrowserCacheSettingPageBase();
@@ -165,6 +168,14 @@ function clearMapCache(): void {
});
}
function clearApplicationCodeFileCache(): void {
showConfirm('Are you sure you want to clear application code cache?', () => {
clearApplicationCodeCache().then(() => {
loadCacheStatistics(true);
});
});
}
function clearAllFileCache(): void {
showConfirm('Are you sure you want to clear all file cache?', () => {
clearAllBrowserCaches().then(() => {