Add admin panel refresh settings

This commit is contained in:
gpt-engineer-app[bot]
2025-10-03 18:37:16 +00:00
parent 47138df86d
commit e6238c45b3
5 changed files with 270 additions and 54 deletions

View File

@@ -115,6 +115,17 @@ export function useAdminSettings() {
return value === true || value === 'true';
};
const getAdminPanelRefreshMode = () => {
const value = getSettingValue('system.admin_panel_refresh_mode', 'auto');
// Remove quotes if they exist (JSON string stored in DB)
return typeof value === 'string' ? value.replace(/"/g, '') : value;
};
const getAdminPanelPollInterval = () => {
const value = getSettingValue('system.admin_panel_poll_interval', 30);
return parseInt(value?.toString() || '30') * 1000; // Convert to milliseconds
};
return {
settings,
isLoading,
@@ -132,5 +143,7 @@ export function useAdminSettings() {
getReportThreshold,
getAuditRetentionDays,
getAutoCleanupEnabled,
getAdminPanelRefreshMode,
getAdminPanelPollInterval,
};
}