mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
support clearing application code cache
This commit is contained in:
@@ -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> {
|
||||
if (!window.caches) {
|
||||
logger.error('caches API is not supported in this browser');
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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 ?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?": "再ログインしますか?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?": "ಮತ್ತೆ ಲಾಗಿನ್ ಮಾಡಲು ನೀವು ಖಚಿತವೇ?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?": "다시 로그인하시겠습니까?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?": "Вы уверены, что хотите войти снова?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?": "மீண்டும் உள்நுழை செய்ய நீங்கள் உறுதியா?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?": "คุณแน่ใจหรือว่าต้องการเข้าสู่ระบบอีกครั้ง?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?": "Ви впевнені, що хочете увійти знову?",
|
||||
|
||||
@@ -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": "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",
|
||||
"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?",
|
||||
|
||||
@@ -2543,6 +2543,8 @@
|
||||
"Are you sure you want to clear all file cache?": "您确定要清除所有文件缓存?",
|
||||
"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": "清除汇率数据缓存",
|
||||
"Are you sure you want to clear exchange rates data cache?": "您确定要清除汇率数据缓存?",
|
||||
"Are you sure you want to re-login?": "您确定要重新登录?",
|
||||
|
||||
@@ -2531,7 +2531,7 @@
|
||||
"Browser Cache Management": "瀏覽器快取管理",
|
||||
"File Cache": "檔案快取",
|
||||
"Used storage": "已使用的儲存空間",
|
||||
"Application Code": "應用程式程式碼",
|
||||
"Application Code": "應用程式碼",
|
||||
"Resource Files": "資源檔案",
|
||||
"Map Data": "地圖資料",
|
||||
"Others": "其他",
|
||||
@@ -2543,6 +2543,8 @@
|
||||
"Are you sure you want to clear all file cache?": "您確定要清除所有檔案快取?",
|
||||
"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": "清除匯率資料快取",
|
||||
"Are you sure you want to clear exchange rates data cache?": "您確定要清除匯率資料快取?",
|
||||
"Are you sure you want to re-login?": "您確定要重新登入?",
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
loadBrowserCacheStatistics,
|
||||
updateMapCacheExpiration,
|
||||
clearMapDataCache,
|
||||
clearApplicationCodeCache,
|
||||
clearAllBrowserCaches
|
||||
} from '@/lib/cache.ts';
|
||||
|
||||
@@ -115,6 +116,7 @@ export function useAppBrowserCacheSettingPageBase() {
|
||||
// functions
|
||||
loadCacheStatistics,
|
||||
clearMapDataCache,
|
||||
clearApplicationCodeCache,
|
||||
clearAllBrowserCaches,
|
||||
clearExchangeRatesDataCache
|
||||
};
|
||||
|
||||
@@ -72,6 +72,10 @@
|
||||
:disabled="loading || !isSupportedFileCache || !fileCacheStatistics" @click="clearMapCache()">
|
||||
{{ tt('Clear Map Data Cache') }}
|
||||
</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"
|
||||
:disabled="loading || !isSupportedFileCache || !fileCacheStatistics" @click="clearAllFileCache()">
|
||||
{{ tt('Clear All File Cache') }}
|
||||
@@ -180,6 +184,7 @@ const {
|
||||
exchangeRatesDataCacheExpiration,
|
||||
loadCacheStatistics,
|
||||
clearMapDataCache,
|
||||
clearApplicationCodeCache,
|
||||
clearAllBrowserCaches,
|
||||
clearExchangeRatesDataCache
|
||||
} = 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 {
|
||||
confirmDialog.value?.open('Are you sure you want to clear all file cache?').then(() => {
|
||||
clearAllBrowserCaches().then(() => {
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user