support setting exchange rate cache expiration time

This commit is contained in:
MaysWind
2026-02-28 21:36:00 +08:00
parent 247181830c
commit 8192a48bc5
27 changed files with 303 additions and 30 deletions
+1
View File
@@ -114,6 +114,7 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', fun
let localeDefaultSettings = initLocale(userStore.currentUserLanguage, settingsStore.appSettings.timeZone); let localeDefaultSettings = initLocale(userStore.currentUserLanguage, settingsStore.appSettings.timeZone);
settingsStore.updateLocalizedDefaultSettings(localeDefaultSettings); settingsStore.updateLocalizedDefaultSettings(localeDefaultSettings);
exchangeRatesStore.removeExpiredExchangeRates(true);
setExpenseAndIncomeAmountColor(userStore.currentUserExpenseAmountColor, userStore.currentUserIncomeAmountColor); setExpenseAndIncomeAmountColor(userStore.currentUserExpenseAmountColor, userStore.currentUserIncomeAmountColor);
+1
View File
@@ -221,6 +221,7 @@ watch(currentNotificationContent, (newValue) => {
let localeDefaultSettings = initLocale(userStore.currentUserLanguage, settingsStore.appSettings.timeZone); let localeDefaultSettings = initLocale(userStore.currentUserLanguage, settingsStore.appSettings.timeZone);
settingsStore.updateLocalizedDefaultSettings(localeDefaultSettings); settingsStore.updateLocalizedDefaultSettings(localeDefaultSettings);
exchangeRatesStore.removeExpiredExchangeRates(true);
setExpenseAndIncomeAmountColor(userStore.currentUserExpenseAmountColor, userStore.currentUserIncomeAmountColor); setExpenseAndIncomeAmountColor(userStore.currentUserExpenseAmountColor, userStore.currentUserIncomeAmountColor);
+2
View File
@@ -64,6 +64,7 @@ export interface ApplicationSettings extends BaseApplicationSetting {
currencySortByInExchangeRatesPage: number; currencySortByInExchangeRatesPage: number;
// Browser Cache Settings // Browser Cache Settings
mapCacheExpiration: number, mapCacheExpiration: number,
exchangeRatesDataCacheExpiration: number,
// Statistics Settings // Statistics Settings
statistics: { statistics: {
defaultChartDataType: number; defaultChartDataType: number;
@@ -191,6 +192,7 @@ export const DEFAULT_APPLICATION_SETTINGS: ApplicationSettings = {
currencySortByInExchangeRatesPage: CurrencySortingType.Default.type, currencySortByInExchangeRatesPage: CurrencySortingType.Default.type,
// Browser Cache Settings // Browser Cache Settings
mapCacheExpiration: -1, mapCacheExpiration: -1,
exchangeRatesDataCacheExpiration: 0,
// Statistics Settings // Statistics Settings
statistics: { statistics: {
defaultChartDataType: ChartDataType.Default.type, defaultChartDataType: ChartDataType.Default.type,
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "Sind Sie sicher, dass Sie sich erneut anmelden möchten?",
"Exchange Rates Data": "Wechselkursdaten", "Exchange Rates Data": "Wechselkursdaten",
"User Custom": "User Custom", "User Custom": "User Custom",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "Are you sure you want to re-login?",
"Exchange Rates Data": "Exchange Rates Data", "Exchange Rates Data": "Exchange Rates Data",
"User Custom": "User Custom", "User Custom": "User Custom",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "¿Seguro que deseas volver a iniciar sesión?",
"Exchange Rates Data": "Tipos de Cambio", "Exchange Rates Data": "Tipos de Cambio",
"User Custom": "User Custom", "User Custom": "User Custom",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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 ?", "Are you sure you want to re-login?": "Êtes-vous sûr de vouloir vous reconnecter ?",
"Exchange Rates Data": "Données de taux de change", "Exchange Rates Data": "Données de taux de change",
"User Custom": "Personnalisé utilisateur", "User Custom": "Personnalisé utilisateur",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "Sei sicuro di voler accedere di nuovo?",
"Exchange Rates Data": "Dati tassi di cambio", "Exchange Rates Data": "Dati tassi di cambio",
"User Custom": "User Custom", "User Custom": "User Custom",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?": "再ログインしますか?",
"Exchange Rates Data": "為替レートデータ", "Exchange Rates Data": "為替レートデータ",
"User Custom": "User Custom", "User Custom": "User Custom",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?": "ಮತ್ತೆ ಲಾಗಿನ್ ಮಾಡಲು ನೀವು ಖಚಿತವೇ?",
"Exchange Rates Data": "ವಿನಿಮಯ ದರ ಡೇಟಾ", "Exchange Rates Data": "ವಿನಿಮಯ ದರ ಡೇಟಾ",
"User Custom": "ಬಳಕೆದಾರ ಕಸ್ಟಮ್", "User Custom": "ಬಳಕೆದಾರ ಕಸ್ಟಮ್",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?": "다시 로그인하시겠습니까?",
"Exchange Rates Data": "환율 데이터", "Exchange Rates Data": "환율 데이터",
"User Custom": "사용자 정의", "User Custom": "사용자 정의",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "Weet je zeker dat je opnieuw wilt inloggen?",
"Exchange Rates Data": "Wisselkoersgegevens", "Exchange Rates Data": "Wisselkoersgegevens",
"User Custom": "Gebruiker aangepast", "User Custom": "Gebruiker aangepast",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "Tem certeza de que deseja fazer login novamente?",
"Exchange Rates Data": "Dados de Taxas de Câmbio", "Exchange Rates Data": "Dados de Taxas de Câmbio",
"User Custom": "Personalização do Usuário", "User Custom": "Personalização do Usuário",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?": "Вы уверены, что хотите войти снова?",
"Exchange Rates Data": "Данные о курсах валют", "Exchange Rates Data": "Данные о курсах валют",
"User Custom": "Пользовательские настройки", "User Custom": "Пользовательские настройки",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "Ali ste prepričani, da se želite ponovno prijaviti?",
"Exchange Rates Data": "Podatki o menjalnih tečajih", "Exchange Rates Data": "Podatki o menjalnih tečajih",
"User Custom": "Uporabniške nastavitve po meri", "User Custom": "Uporabniške nastavitve po meri",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?": "மீண்டும் உள்நுழை செய்ய நீங்கள் உறுதியா?",
"Exchange Rates Data": "மாற்று விகிதம் தரவு", "Exchange Rates Data": "மாற்று விகிதம் தரவு",
"User Custom": "தனிப்பயன்", "User Custom": "தனிப்பயன்",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?": "คุณแน่ใจหรือว่าต้องการเข้าสู่ระบบอีกครั้ง?",
"Exchange Rates Data": "ข้อมูลอัตราแลกเปลี่ยน", "Exchange Rates Data": "ข้อมูลอัตราแลกเปลี่ยน",
"User Custom": "กำหนดเองโดยผู้ใช้", "User Custom": "กำหนดเองโดยผู้ใช้",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "Tekrar giriş yapmak istediğinize emin misiniz?",
"Exchange Rates Data": "Döviz Kuru Verileri", "Exchange Rates Data": "Döviz Kuru Verileri",
"User Custom": "Kullanıcı Özel", "User Custom": "Kullanıcı Özel",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?": "Ви впевнені, що хочете увійти знову?",
"Exchange Rates Data": "Дані про курси валют", "Exchange Rates Data": "Дані про курси валют",
"User Custom": "User Custom", "User Custom": "User Custom",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "Others", "Others": "Others",
"Cache Expiration Time": "Cache Expiration Time", "Cache Expiration Time": "Cache Expiration Time",
"Cache Expiration for Map Data": "Cache Expiration for Map Data", "Cache Expiration for Map Data": "Cache Expiration for Map Data",
"Disable Map Cache": "Disable Map Cache", "Cache Expiration for Exchange Rates Data": "Cache Expiration for Exchange Rates Data",
"Disable Cache": "Disable Cache",
"Clear All File Cache": "Clear All File Cache", "Clear All File Cache": "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?": "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 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?", "Are you sure you want to re-login?": "Bạn có chắc chắn muốn đăng nhập lại không?",
"Exchange Rates Data": "Dữ liệu tỷ giá hối đoái", "Exchange Rates Data": "Dữ liệu tỷ giá hối đoái",
"User Custom": "User Custom", "User Custom": "User Custom",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "其他", "Others": "其他",
"Cache Expiration Time": "缓存过期时间", "Cache Expiration Time": "缓存过期时间",
"Cache Expiration for Map Data": "地图数据缓存过期时间", "Cache Expiration for Map Data": "地图数据缓存过期时间",
"Disable Map Cache": "禁用地图缓存", "Cache Expiration for Exchange Rates Data": "汇率数据缓存过期时间",
"Disable Cache": "禁用缓存",
"Clear All File Cache": "清除所有文件缓存", "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": "清除地图数据缓存",
"Are you sure you want to clear map data cache?": "您确定要清除地图数据缓存?", "Are you sure you want to clear map data 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?": "您确定要重新登录?", "Are you sure you want to re-login?": "您确定要重新登录?",
"Exchange Rates Data": "汇率数据", "Exchange Rates Data": "汇率数据",
"User Custom": "用户自定义", "User Custom": "用户自定义",
+4 -1
View File
@@ -2514,11 +2514,14 @@
"Others": "其他", "Others": "其他",
"Cache Expiration Time": "快取過期時間", "Cache Expiration Time": "快取過期時間",
"Cache Expiration for Map Data": "地圖資料快取過期時間", "Cache Expiration for Map Data": "地圖資料快取過期時間",
"Disable Map Cache": "停用地圖快取", "Cache Expiration for Exchange Rates Data": "匯率資料快取過期時間",
"Disable Cache": "停用快取",
"Clear All File Cache": "清除所有檔案快取", "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": "清除地圖資料快取",
"Are you sure you want to clear map data cache?": "您確定要清除地圖資料快取?", "Are you sure you want to clear map data 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?": "您確定要重新登入?", "Are you sure you want to re-login?": "您確定要重新登入?",
"Exchange Rates Data": "匯率資料", "Exchange Rates Data": "匯率資料",
"User Custom": "使用者自訂", "User Custom": "使用者自訂",
+39 -7
View File
@@ -1,6 +1,8 @@
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { useSettingsStore } from './setting.ts';
import { type BeforeResolveFunction, itemAndIndex } from '@/core/base.ts'; import { type BeforeResolveFunction, itemAndIndex } from '@/core/base.ts';
import type { import type {
@@ -47,8 +49,12 @@ function clearExchangeRatesFromLocalStorage(): void {
} }
export const useExchangeRatesStore = defineStore('exchangeRates', () => { export const useExchangeRatesStore = defineStore('exchangeRates', () => {
const settingsStore = useSettingsStore();
const latestExchangeRates = ref<LatestExchangeRates>(getExchangeRatesFromLocalStorage()); const latestExchangeRates = ref<LatestExchangeRates>(getExchangeRatesFromLocalStorage());
const exchangeRatesDataCacheEnabled = computed<boolean>(() => settingsStore.appSettings.exchangeRatesDataCacheExpiration >= 0);
const isUserCustomExchangeRates = computed((): boolean => { const isUserCustomExchangeRates = computed((): boolean => {
if (!latestExchangeRates.value || !latestExchangeRates.value.data) { if (!latestExchangeRates.value || !latestExchangeRates.value.data) {
return false; return false;
@@ -99,7 +105,7 @@ export const useExchangeRatesStore = defineStore('exchangeRates', () => {
latestExchangeRates.value.data.updateTime = updateTime; latestExchangeRates.value.data.updateTime = updateTime;
if (changed) { if (exchangeRatesDataCacheEnabled.value && changed) {
setExchangeRatesToLocalStorage(latestExchangeRates.value); setExchangeRatesToLocalStorage(latestExchangeRates.value);
} }
} }
@@ -120,7 +126,7 @@ export const useExchangeRatesStore = defineStore('exchangeRates', () => {
} }
} }
if (changed) { if (exchangeRatesDataCacheEnabled.value && changed) {
setExchangeRatesToLocalStorage(latestExchangeRates.value); setExchangeRatesToLocalStorage(latestExchangeRates.value);
} }
} }
@@ -135,6 +141,29 @@ export const useExchangeRatesStore = defineStore('exchangeRates', () => {
return new Blob([storageData]).size; return new Blob([storageData]).size;
} }
function removeExpiredExchangeRates(removeDataInStore?: boolean): void {
if (settingsStore.appSettings.exchangeRatesDataCacheExpiration > 0) {
const currentExchangeRateData = latestExchangeRates.value;
const now = getCurrentUnixTime();
if (currentExchangeRateData && currentExchangeRateData.time) {
if (now - currentExchangeRateData.time >= settingsStore.appSettings.exchangeRatesDataCacheExpiration) {
if (removeDataInStore) {
resetLatestExchangeRates();
} else {
clearExchangeRatesFromLocalStorage();
}
}
}
} else if (settingsStore.appSettings.exchangeRatesDataCacheExpiration < 0) { // Disable Cache
if (removeDataInStore) {
resetLatestExchangeRates();
} else {
clearExchangeRatesFromLocalStorage();
}
}
}
function resetLatestExchangeRates(): void { function resetLatestExchangeRates(): void {
latestExchangeRates.value = {}; latestExchangeRates.value = {};
clearExchangeRatesFromLocalStorage(); clearExchangeRatesFromLocalStorage();
@@ -172,11 +201,13 @@ export const useExchangeRatesStore = defineStore('exchangeRates', () => {
return; return;
} }
latestExchangeRates.value = { if (exchangeRatesDataCacheEnabled.value) {
time: now, latestExchangeRates.value = {
data: data.result time: now,
}; data: data.result
setExchangeRatesToLocalStorage(latestExchangeRates.value); };
setExchangeRatesToLocalStorage(latestExchangeRates.value);
}
resolve(data.result); resolve(data.result);
}).catch(error => { }).catch(error => {
@@ -298,6 +329,7 @@ export const useExchangeRatesStore = defineStore('exchangeRates', () => {
latestExchangeRateMap, latestExchangeRateMap,
// functions // functions
getExchangeRatesCacheSize, getExchangeRatesCacheSize,
removeExpiredExchangeRates,
resetLatestExchangeRates, resetLatestExchangeRates,
getLatestExchangeRates, getLatestExchangeRates,
updateUserCustomExchangeRate, updateUserCustomExchangeRate,
+6
View File
@@ -316,6 +316,11 @@ export const useSettingsStore = defineStore('settings', () => {
appSettings.value.mapCacheExpiration = value; appSettings.value.mapCacheExpiration = value;
} }
function setExchangeRatesDataCacheExpiration(value: number): void {
updateApplicationSettingsValue('exchangeRatesDataCacheExpiration', value);
appSettings.value.exchangeRatesDataCacheExpiration = value;
}
// Statistics Settings // Statistics Settings
function setStatisticsDefaultChartDataType(value: number): void { function setStatisticsDefaultChartDataType(value: number): void {
updateApplicationSettingsSubValue('statistics', 'defaultChartDataType', value); updateApplicationSettingsSubValue('statistics', 'defaultChartDataType', value);
@@ -539,6 +544,7 @@ export const useSettingsStore = defineStore('settings', () => {
setCurrencySortByInExchangeRatesPage, setCurrencySortByInExchangeRatesPage,
// -- Browser Cache Settings // -- Browser Cache Settings
setMapCacheExpiration, setMapCacheExpiration,
setExchangeRatesDataCacheExpiration,
// -- Statistics Settings // -- Statistics Settings
setStatisticsDefaultChartDataType, setStatisticsDefaultChartDataType,
setStatisticsDefaultTimezoneType, setStatisticsDefaultTimezoneType,
@@ -0,0 +1,112 @@
import { ref, computed } from 'vue';
import { useI18n } from '@/locales/helpers.ts';
import { useSettingsStore } from '@/stores/setting.ts';
import { useExchangeRatesStore } from '@/stores/exchangeRates.ts';
import { type NameNumeralValue } from '@/core/base.ts';
import { type BrowserCacheStatistics } from '@/core/cache.ts';
import {
loadBrowserCacheStatistics,
updateMapCacheExpiration,
clearMapDataCache,
clearAllBrowserCaches
} from '@/lib/cache.ts';
export function useAppBrowserCacheSettingPageBase() {
const { tt, formatNumberToLocalizedNumerals } = useI18n();
const isSupportedFileCache: boolean = 'serviceWorker' in navigator && !!navigator.serviceWorker.controller;
const settingsStore = useSettingsStore();
const exchangeRatesStore = useExchangeRatesStore();
const loading = ref<boolean>(true);
const fileCacheStatistics = ref<BrowserCacheStatistics | undefined>(undefined);
const exchangeRatesCacheSize = ref<number | undefined>(undefined);
const allMapCacheExpirationOptions = computed<NameNumeralValue[]>(() => {
return [
{ name: tt('Disable Cache'), value: -1 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(1) }), value: 86400 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(7) }), value: 604800 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(30) }), value: 2592000 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(90) }), value: 7776000 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(180) }), value: 15552000 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(365) }), value: 31536000 },
{ name: tt('No Expiration'), value: 0 }
];
});
const allExchangeRatesDataCacheExpirationOptions = computed<NameNumeralValue[]>(() => {
return [
{ name: tt('Disable Cache'), value: -1 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(1) }), value: 86400 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(7) }), value: 604800 },
{ name: tt('format.misc.nDays', { n: formatNumberToLocalizedNumerals(30) }), value: 2592000 },
{ name: tt('No Expiration'), value: 0 }
];
});
const mapCacheExpiration = computed<number>({
get: () => isSupportedFileCache ? settingsStore.appSettings.mapCacheExpiration : -1,
set: (value) => {
settingsStore.setMapCacheExpiration(value);
if (isSupportedFileCache) {
updateMapCacheExpiration(value);
}
}
});
const exchangeRatesDataCacheExpiration = computed<number>({
get: () => settingsStore.appSettings.exchangeRatesDataCacheExpiration,
set: (value) => {
settingsStore.setExchangeRatesDataCacheExpiration(value);
exchangeRatesStore.removeExpiredExchangeRates(true);
exchangeRatesCacheSize.value = exchangeRatesStore.getExchangeRatesCacheSize();
}
});
function loadCacheStatistics(): Promise<void> {
return new Promise((resolve, reject) => {
loading.value = true;
loadBrowserCacheStatistics().then(statistics => {
fileCacheStatistics.value = statistics;
exchangeRatesCacheSize.value = exchangeRatesStore.getExchangeRatesCacheSize();
loading.value = false;
resolve();
}).catch(error => {
loading.value = false;
reject(error);
});
});
}
function clearExchangeRatesDataCache(): void {
exchangeRatesStore.resetLatestExchangeRates();
exchangeRatesCacheSize.value = exchangeRatesStore.getExchangeRatesCacheSize();
}
return {
// constants
isSupportedFileCache,
// states
loading,
fileCacheStatistics,
exchangeRatesCacheSize,
// computed states
allMapCacheExpirationOptions,
allExchangeRatesDataCacheExpirationOptions,
mapCacheExpiration,
exchangeRatesDataCacheExpiration,
// functions
loadCacheStatistics,
clearMapDataCache,
clearAllBrowserCaches,
clearExchangeRatesDataCache
};
}
@@ -92,6 +92,13 @@
<span class="text-body-1">{{ tt('Used storage') }}</span> <span class="text-body-1">{{ tt('Used storage') }}</span>
<span class="text-xl ms-1">{{ formatVolumeToLocalizedNumerals(exchangeRatesCacheSize ?? 0, 2) }}</span> <span class="text-xl ms-1">{{ formatVolumeToLocalizedNumerals(exchangeRatesCacheSize ?? 0, 2) }}</span>
</v-card-text> </v-card-text>
<v-card-text class="mt-2">
<v-btn color="secondary" variant="tonal"
:disabled="loading || !exchangeRatesCacheSize" @click="clearExchangeRatesCache()">
{{ tt('Clear Exchange Rates Data Cache') }}
</v-btn>
</v-card-text>
</v-card> </v-card>
</v-col> </v-col>
@@ -112,6 +119,18 @@
v-model="mapCacheExpiration" v-model="mapCacheExpiration"
/> />
</v-col> </v-col>
<v-col cols="12" sm="6">
<v-select
item-title="name"
item-value="value"
persistent-placeholder
:disabled="loading"
:label="tt('Cache Expiration for Exchange Rates Data')"
:placeholder="tt('Cache Expiration for Exchange Rates Data')"
:items="allExchangeRatesDataCacheExpirationOptions"
v-model="exchangeRatesDataCacheExpiration"
/>
</v-col>
</v-row> </v-row>
</v-card-text> </v-card-text>
</v-form> </v-form>
@@ -155,10 +174,13 @@ const {
fileCacheStatistics, fileCacheStatistics,
exchangeRatesCacheSize, exchangeRatesCacheSize,
allMapCacheExpirationOptions, allMapCacheExpirationOptions,
allExchangeRatesDataCacheExpirationOptions,
mapCacheExpiration, mapCacheExpiration,
exchangeRatesDataCacheExpiration,
loadCacheStatistics, loadCacheStatistics,
clearMapDataCache, clearMapDataCache,
clearAllBrowserCaches clearAllBrowserCaches,
clearExchangeRatesDataCache
} = useAppBrowserCacheSettingPageBase(); } = useAppBrowserCacheSettingPageBase();
const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog'); const confirmDialog = useTemplateRef<ConfirmDialogType>('confirmDialog');
@@ -179,5 +201,11 @@ function clearAllFileCache(): void {
}); });
} }
function clearExchangeRatesCache(): void {
confirmDialog.value?.open('Are you sure you want to clear exchange rates data cache?').then(() => {
clearExchangeRatesDataCache();
});
}
loadCacheStatistics(); loadCacheStatistics();
</script> </script>
@@ -4,7 +4,7 @@
<f7-nav-left :class="{ 'disabled': loading }" :back-link="tt('Back')"></f7-nav-left> <f7-nav-left :class="{ 'disabled': loading }" :back-link="tt('Back')"></f7-nav-left>
<f7-nav-title :title="tt('Browser Cache Management')"></f7-nav-title> <f7-nav-title :title="tt('Browser Cache Management')"></f7-nav-title>
<f7-nav-right :class="{ 'disabled': loading }"> <f7-nav-right :class="{ 'disabled': loading }">
<f7-link icon-f7="ellipsis" :class="{ 'disabled': loading || !isSupportedFileCache || !fileCacheStatistics }" @click="showMoreActionSheet = true"></f7-link> <f7-link icon-f7="ellipsis" :class="{ 'disabled': loading || ((!isSupportedFileCache || !fileCacheStatistics) && !exchangeRatesCacheSize) }" @click="showMoreActionSheet = true"></f7-link>
</f7-nav-right> </f7-nav-right>
</f7-navbar> </f7-navbar>
@@ -30,7 +30,8 @@
<f7-list-item group-title :sortable="false"> <f7-list-item group-title :sortable="false">
<small>{{ tt('Cache Expiration Time') }}</small> <small>{{ tt('Cache Expiration Time') }}</small>
</f7-list-item> </f7-list-item>
<f7-list-item title="Map Data" after="Disable Map Cache" v-if="getMapProvider()"></f7-list-item> <f7-list-item title="Map Data" after="Disable Cache" v-if="getMapProvider()"></f7-list-item>
<f7-list-item title="Exchange Rates Data" after="Disable Cache"></f7-list-item>
</f7-list> </f7-list>
<f7-list strong inset dividers class="margin-vertical" v-if="!loading && isSupportedFileCache"> <f7-list strong inset dividers class="margin-vertical" v-if="!loading && isSupportedFileCache">
@@ -75,6 +76,25 @@
v-model="mapCacheExpiration"> v-model="mapCacheExpiration">
</list-item-selection-popup> </list-item-selection-popup>
</f7-list-item> </f7-list-item>
<f7-list-item
link="#"
:class="{ 'disabled': loading }"
:title="tt('Exchange Rates Data')"
:after="findNameByValue(allExchangeRatesDataCacheExpirationOptions, exchangeRatesDataCacheExpiration)"
@click="showExchangeRatesDataCacheExpirationPopup = true"
>
<list-item-selection-popup value-type="item"
key-field="value" value-field="value"
title-field="name"
:title="tt('Cache Expiration for Exchange Rates Data')"
:enable-filter="true"
:filter-placeholder="tt('Expiration Time')"
:filter-no-items-text="tt('No results')"
:items="allExchangeRatesDataCacheExpirationOptions"
v-model:show="showExchangeRatesDataCacheExpirationPopup"
v-model="exchangeRatesDataCacheExpiration">
</list-item-selection-popup>
</f7-list-item>
</f7-list> </f7-list>
<f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false"> <f7-actions close-by-outside-click close-on-escape :opened="showMoreActionSheet" @actions:closed="showMoreActionSheet = false">
@@ -84,6 +104,10 @@
<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>
<f7-actions-group>
<f7-actions-button :class="{ 'disabled': loading || !exchangeRatesCacheSize }"
@click="clearExchangeRatesCache">{{ tt('Clear Exchange Rates Data Cache') }}</f7-actions-button>
</f7-actions-group>
<f7-actions-group> <f7-actions-group>
<f7-actions-button bold close>{{ tt('Cancel') }}</f7-actions-button> <f7-actions-button bold close>{{ tt('Cancel') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
@@ -112,13 +136,17 @@ const {
fileCacheStatistics, fileCacheStatistics,
exchangeRatesCacheSize, exchangeRatesCacheSize,
allMapCacheExpirationOptions, allMapCacheExpirationOptions,
allExchangeRatesDataCacheExpirationOptions,
mapCacheExpiration, mapCacheExpiration,
exchangeRatesDataCacheExpiration,
loadCacheStatistics, loadCacheStatistics,
clearMapDataCache, clearMapDataCache,
clearAllBrowserCaches clearAllBrowserCaches,
clearExchangeRatesDataCache
} = useAppBrowserCacheSettingPageBase(); } = useAppBrowserCacheSettingPageBase();
const showMapDataCacheExpirationPopup = ref<boolean>(false); const showMapDataCacheExpirationPopup = ref<boolean>(false);
const showExchangeRatesDataCacheExpirationPopup = ref<boolean>(false);
const showMoreActionSheet = ref<boolean>(false); const showMoreActionSheet = ref<boolean>(false);
function reloadCacheStatistics(done?: () => void): void { function reloadCacheStatistics(done?: () => void): void {
@@ -149,5 +177,11 @@ function clearAllFileCache(): void {
}); });
} }
function clearExchangeRatesCache(): void {
showConfirm('Are you sure you want to clear exchange rates data cache?', () => {
clearExchangeRatesDataCache();
});
}
loadCacheStatistics(); loadCacheStatistics();
</script> </script>