diff --git a/application/src/components/settings/data-retention/DataRetentionSettings.tsx b/application/src/components/settings/data-retention/DataRetentionSettings.tsx index 5aa246b..45cac93 100644 --- a/application/src/components/settings/data-retention/DataRetentionSettings.tsx +++ b/application/src/components/settings/data-retention/DataRetentionSettings.tsx @@ -52,7 +52,6 @@ const DataRetentionSettings = () => { setLastCleanup(result.lastCleanup); } } catch (error) { - console.error("Error loading retention settings:", error); toast({ title: "Error", description: "Failed to load retention settings", @@ -72,7 +71,6 @@ const DataRetentionSettings = () => { description: "Data retention settings have been updated", }); } catch (error) { - console.error("Error saving retention settings:", error); toast({ title: "Error", description: "Failed to save retention settings", @@ -96,7 +94,6 @@ const DataRetentionSettings = () => { // Reload settings to get updated last cleanup time await loadSettings(); } catch (error) { - console.error("Error during uptime cleanup:", error); toast({ title: "Error", description: "Failed to perform uptime data cleanup", @@ -120,7 +117,6 @@ const DataRetentionSettings = () => { // Reload settings to get updated last cleanup time await loadSettings(); } catch (error) { - console.error("Error during server cleanup:", error); toast({ title: "Error", description: "Failed to perform server data cleanup", @@ -144,7 +140,6 @@ const DataRetentionSettings = () => { // Reload settings to get updated last cleanup time await loadSettings(); } catch (error) { - console.error("Error during manual cleanup:", error); toast({ title: "Error", description: "Failed to perform database cleanup", @@ -170,7 +165,7 @@ const DataRetentionSettings = () => { - {t("permissionNotice")} As an admin user, you do not have access to data retention settings. These settings can only be accessed and modified by Super Admins. + Permission Notice: As an admin user, you do not have access to data retention settings. These settings can only be accessed and modified by Super Admins. @@ -210,10 +205,16 @@ const DataRetentionSettings = () => { min="1" max="365" value={settings.uptimeRetentionDays} - onChange={(e) => setSettings(prev => ({ - ...prev, - uptimeRetentionDays: parseInt(e.target.value) || 30 - }))} + onChange={(e) => { + const value = e.target.value; + if (value === '' || isNaN(Number(value))) { + return; + } + setSettings(prev => ({ + ...prev, + uptimeRetentionDays: Number(value) + })); + }} className="mt-1" />

@@ -229,10 +230,16 @@ const DataRetentionSettings = () => { min="1" max="365" value={settings.serverRetentionDays} - onChange={(e) => setSettings(prev => ({ - ...prev, - serverRetentionDays: parseInt(e.target.value) || 30 - }))} + onChange={(e) => { + const value = e.target.value; + if (value === '' || isNaN(Number(value))) { + return; + } + setSettings(prev => ({ + ...prev, + serverRetentionDays: Number(value) + })); + }} className="mt-1" />

@@ -250,63 +257,17 @@ const DataRetentionSettings = () => { )} - -

- - - - - -
- -
- -
+ +