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
+17
View File
@@ -229,6 +229,23 @@ export function clearMapDataCache(): Promise<void> {
}); });
} }
export function clearApplicationCodeCache(): Promise<void> {
if (!window.caches) {
logger.error('caches API is not supported in this browser');
return Promise.reject();
}
return window.caches.delete(SW_CODE_CACHE_NAME).then(success => {
if (success) {
logger.info(`cache "${SW_CODE_CACHE_NAME}" cleared successfully`);
} else {
logger.warn(`failed to clear cache "${SW_CODE_CACHE_NAME}"`);
}
}).catch(error => {
logger.error(`failed to clear cache "${SW_CODE_CACHE_NAME}"`, error);
});
}
export function clearAllBrowserCaches(): Promise<void> { export function clearAllBrowserCaches(): Promise<void> {
if (!window.caches) { if (!window.caches) {
logger.error('caches API is not supported in this browser'); logger.error('caches API is not supported in this browser');
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Sind Sie sicher, dass Sie sich erneut anmelden möchten?", "Are you sure you want to re-login?": "Sind Sie sicher, dass Sie sich erneut anmelden möchten?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Are you sure you want to re-login?", "Are you sure you want to re-login?": "Are you sure you want to re-login?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "¿Seguro que deseas volver a iniciar sesión?", "Are you sure you want to re-login?": "¿Seguro que deseas volver a iniciar sesión?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Êtes-vous sûr de vouloir vous reconnecter ?", "Are you sure you want to re-login?": "Êtes-vous sûr de vouloir vous reconnecter ?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Sei sicuro di voler accedere di nuovo?", "Are you sure you want to re-login?": "Sei sicuro di voler accedere di nuovo?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "再ログインしますか?", "Are you sure you want to re-login?": "再ログインしますか?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "ಮತ್ತೆ ಲಾಗಿನ್ ಮಾಡಲು ನೀವು ಖಚಿತವೇ?", "Are you sure you want to re-login?": "ಮತ್ತೆ ಲಾಗಿನ್ ಮಾಡಲು ನೀವು ಖಚಿತವೇ?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "다시 로그인하시겠습니까?", "Are you sure you want to re-login?": "다시 로그인하시겠습니까?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Weet je zeker dat je opnieuw wilt inloggen?", "Are you sure you want to re-login?": "Weet je zeker dat je opnieuw wilt inloggen?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Tem certeza de que deseja fazer login novamente?", "Are you sure you want to re-login?": "Tem certeza de que deseja fazer login novamente?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Вы уверены, что хотите войти снова?", "Are you sure you want to re-login?": "Вы уверены, что хотите войти снова?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Ali ste prepričani, da se želite ponovno prijaviti?", "Are you sure you want to re-login?": "Ali ste prepričani, da se želite ponovno prijaviti?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "மீண்டும் உள்நுழை செய்ய நீங்கள் உறுதியா?", "Are you sure you want to re-login?": "மீண்டும் உள்நுழை செய்ய நீங்கள் உறுதியா?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "คุณแน่ใจหรือว่าต้องการเข้าสู่ระบบอีกครั้ง?", "Are you sure you want to re-login?": "คุณแน่ใจหรือว่าต้องการเข้าสู่ระบบอีกครั้ง?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Tekrar giriş yapmak istediğinize emin misiniz?", "Are you sure you want to re-login?": "Tekrar giriş yapmak istediğinize emin misiniz?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Ви впевнені, що хочете увійти знову?", "Are you sure you want to re-login?": "Ви впевнені, що хочете увійти знову?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?", "Are you sure you want to clear all file cache?": "Are you sure you want to clear all file cache?",
"Clear Map Data Cache": "Clear Map Data Cache", "Clear Map Data Cache": "Clear Map Data Cache",
"Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?", "Are you sure you want to clear map data cache?": "Are you sure you want to clear map data cache?",
"Clear Application Code Cache": "Clear Application Code Cache",
"Are you sure you want to clear application code cache?": "Are you sure you want to clear application code cache?",
"Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache", "Clear Exchange Rates Data Cache": "Clear Exchange Rates Data Cache",
"Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?", "Are you sure you want to clear exchange rates data cache?": "Are you sure you want to clear exchange rates data cache?",
"Are you sure you want to re-login?": "Bạn có chắc chắn muốn đăng nhập lại không?", "Are you sure you want to re-login?": "Bạn có chắc chắn muốn đăng nhập lại không?",
+2
View File
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "您确定要清除所有文件缓存?", "Are you sure you want to clear all file cache?": "您确定要清除所有文件缓存?",
"Clear Map Data Cache": "清除地图数据缓存", "Clear Map Data Cache": "清除地图数据缓存",
"Are you sure you want to clear map data cache?": "您确定要清除地图数据缓存?", "Are you sure you want to clear map data cache?": "您确定要清除地图数据缓存?",
"Clear Application Code Cache": "清除应用代码缓存",
"Are you sure you want to clear application code cache?": "您确定要清除应用代码缓存?",
"Clear Exchange Rates Data Cache": "清除汇率数据缓存", "Clear Exchange Rates Data Cache": "清除汇率数据缓存",
"Are you sure you want to clear exchange rates data cache?": "您确定要清除汇率数据缓存?", "Are you sure you want to clear exchange rates data cache?": "您确定要清除汇率数据缓存?",
"Are you sure you want to re-login?": "您确定要重新登录?", "Are you sure you want to re-login?": "您确定要重新登录?",
+3 -1
View File
@@ -2531,7 +2531,7 @@
"Browser Cache Management": "瀏覽器快取管理", "Browser Cache Management": "瀏覽器快取管理",
"File Cache": "檔案快取", "File Cache": "檔案快取",
"Used storage": "已使用的儲存空間", "Used storage": "已使用的儲存空間",
"Application Code": "應用程式程式碼", "Application Code": "應用程式碼",
"Resource Files": "資源檔案", "Resource Files": "資源檔案",
"Map Data": "地圖資料", "Map Data": "地圖資料",
"Others": "其他", "Others": "其他",
@@ -2543,6 +2543,8 @@
"Are you sure you want to clear all file cache?": "您確定要清除所有檔案快取?", "Are you sure you want to clear all file cache?": "您確定要清除所有檔案快取?",
"Clear Map Data Cache": "清除地圖資料快取", "Clear Map Data Cache": "清除地圖資料快取",
"Are you sure you want to clear map data cache?": "您確定要清除地圖資料快取?", "Are you sure you want to clear map data cache?": "您確定要清除地圖資料快取?",
"Clear Application Code Cache": "清除應用程式碼快取",
"Are you sure you want to clear application code cache?": "您確定要清除應用程式碼快取?",
"Clear Exchange Rates Data Cache": "清除匯率資料快取", "Clear Exchange Rates Data Cache": "清除匯率資料快取",
"Are you sure you want to clear exchange rates data cache?": "您確定要清除匯率資料快取?", "Are you sure you want to clear exchange rates data cache?": "您確定要清除匯率資料快取?",
"Are you sure you want to re-login?": "您確定要重新登入?", "Are you sure you want to re-login?": "您確定要重新登入?",
@@ -12,6 +12,7 @@ import {
loadBrowserCacheStatistics, loadBrowserCacheStatistics,
updateMapCacheExpiration, updateMapCacheExpiration,
clearMapDataCache, clearMapDataCache,
clearApplicationCodeCache,
clearAllBrowserCaches clearAllBrowserCaches
} from '@/lib/cache.ts'; } from '@/lib/cache.ts';
@@ -115,6 +116,7 @@ export function useAppBrowserCacheSettingPageBase() {
// functions // functions
loadCacheStatistics, loadCacheStatistics,
clearMapDataCache, clearMapDataCache,
clearApplicationCodeCache,
clearAllBrowserCaches, clearAllBrowserCaches,
clearExchangeRatesDataCache clearExchangeRatesDataCache
}; };
@@ -72,6 +72,10 @@
:disabled="loading || !isSupportedFileCache || !fileCacheStatistics" @click="clearMapCache()"> :disabled="loading || !isSupportedFileCache || !fileCacheStatistics" @click="clearMapCache()">
{{ tt('Clear Map Data Cache') }} {{ tt('Clear Map Data Cache') }}
</v-btn> </v-btn>
<v-btn color="secondary" variant="tonal"
:disabled="loading || !isSupportedFileCache || !fileCacheStatistics" @click="clearApplicationCodeFileCache()">
{{ tt('Clear Application Code Cache') }}
</v-btn>
<v-btn class="ms-2" color="secondary" variant="tonal" <v-btn class="ms-2" color="secondary" variant="tonal"
:disabled="loading || !isSupportedFileCache || !fileCacheStatistics" @click="clearAllFileCache()"> :disabled="loading || !isSupportedFileCache || !fileCacheStatistics" @click="clearAllFileCache()">
{{ tt('Clear All File Cache') }} {{ tt('Clear All File Cache') }}
@@ -180,6 +184,7 @@ const {
exchangeRatesDataCacheExpiration, exchangeRatesDataCacheExpiration,
loadCacheStatistics, loadCacheStatistics,
clearMapDataCache, clearMapDataCache,
clearApplicationCodeCache,
clearAllBrowserCaches, clearAllBrowserCaches,
clearExchangeRatesDataCache clearExchangeRatesDataCache
} = useAppBrowserCacheSettingPageBase(); } = useAppBrowserCacheSettingPageBase();
@@ -194,6 +199,14 @@ function clearMapCache(): void {
}); });
} }
function clearApplicationCodeFileCache(): void {
confirmDialog.value?.open('Are you sure you want to clear application code cache?').then(() => {
clearApplicationCodeCache().then(() => {
loadCacheStatistics(true);
});
});
}
function clearAllFileCache(): void { function clearAllFileCache(): void {
confirmDialog.value?.open('Are you sure you want to clear all file cache?').then(() => { confirmDialog.value?.open('Are you sure you want to clear all file cache?').then(() => {
clearAllBrowserCaches().then(() => { clearAllBrowserCaches().then(() => {
@@ -101,6 +101,8 @@
<f7-actions-group v-if="isSupportedFileCache && fileCacheStatistics"> <f7-actions-group v-if="isSupportedFileCache && fileCacheStatistics">
<f7-actions-button :class="{ 'disabled': loading || !isSupportedFileCache || !fileCacheStatistics }" <f7-actions-button :class="{ 'disabled': loading || !isSupportedFileCache || !fileCacheStatistics }"
@click="clearMapCache">{{ tt('Clear Map Data Cache') }}</f7-actions-button> @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 }" <f7-actions-button :class="{ 'disabled': loading || !isSupportedFileCache || !fileCacheStatistics }"
@click="clearAllFileCache">{{ tt('Clear All File Cache') }}</f7-actions-button> @click="clearAllFileCache">{{ tt('Clear All File Cache') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
@@ -141,6 +143,7 @@ const {
exchangeRatesDataCacheExpiration, exchangeRatesDataCacheExpiration,
loadCacheStatistics, loadCacheStatistics,
clearMapDataCache, clearMapDataCache,
clearApplicationCodeCache,
clearAllBrowserCaches, clearAllBrowserCaches,
clearExchangeRatesDataCache clearExchangeRatesDataCache
} = useAppBrowserCacheSettingPageBase(); } = 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 { function clearAllFileCache(): void {
showConfirm('Are you sure you want to clear all file cache?', () => { showConfirm('Are you sure you want to clear all file cache?', () => {
clearAllBrowserCaches().then(() => { clearAllBrowserCaches().then(() => {