diff --git a/Components/Pages/Jobs.razor b/Components/Pages/Jobs.razor index 7e2eb9a..d415766 100644 --- a/Components/Pages/Jobs.razor +++ b/Components/Pages/Jobs.razor @@ -3019,9 +3019,10 @@ else /// Opens a URL in a new tab that automatically closes after a delay. /// Used for fetch-details fallback where the browser extension captures data. /// - private async Task OpenTabAndAutoClose(string url, int delaySeconds = 30) + private async Task OpenTabAndAutoClose(string url, int? delaySeconds = null) { - await JSRuntime.InvokeVoidAsync("crawlPagesRunner.openAndScheduleClose", url, delaySeconds, true); + var delay = delaySeconds ?? SettingsService.GetSettings().FetchDetailsAutoCloseSeconds; + await JSRuntime.InvokeVoidAsync("crawlPagesRunner.openAndScheduleClose", url, delay, true); } private async Task ShareToWhatsApp(JobListing job) diff --git a/Components/Pages/Settings.razor b/Components/Pages/Settings.razor index a715933..7d88cdd 100644 --- a/Components/Pages/Settings.razor +++ b/Components/Pages/Settings.razor @@ -1282,6 +1282,27 @@ + +
+
+
Fetch Details Settings
+
+
+
+ +
+ + seconds +
+ How long to keep browser tabs open when fetching job details before auto-closing. Default: 30 seconds. Range: 5-300 seconds. +
+ + +
+
+
@@ -1478,6 +1499,7 @@ // Backup directory private string editBackupDirectory = ""; private int editHistoryMax = 50000; + private int editFetchDetailsAutoCloseSeconds = 30; private bool editBackupOnStartup; private int editBackupsToKeep = 10; @@ -1561,6 +1583,7 @@ editBackupOnStartup = settings.BackupOnStartup; editBackupsToKeep = settings.BackupsToKeep > 0 ? settings.BackupsToKeep : 10; editHistoryMax = settings.HistoryMaxEntries > 0 ? settings.HistoryMaxEntries : 50000; + editFetchDetailsAutoCloseSeconds = settings.FetchDetailsAutoCloseSeconds > 0 ? settings.FetchDetailsAutoCloseSeconds : 30; editSmtpHost = settings.SmtpHost; editSmtpPort = settings.SmtpPort; editSmtpUsername = settings.SmtpUsername; @@ -2195,6 +2218,15 @@ SettingsService.Save(); } + private void SaveFetchDetailsSettings() + { + var settings = SettingsService.GetSettings(); + settings.FetchDetailsAutoCloseSeconds = editFetchDetailsAutoCloseSeconds >= 5 && editFetchDetailsAutoCloseSeconds <= 300 + ? editFetchDetailsAutoCloseSeconds + : 30; + SettingsService.Save(); + } + private string GetDefaultBackupPath() { if (StorageBackend is not JsonStorageBackend jsonBackend) return "Data/Backups"; diff --git a/Models/AppSettings.cs b/Models/AppSettings.cs index 9830191..e7bd6ff 100644 --- a/Models/AppSettings.cs +++ b/Models/AppSettings.cs @@ -45,6 +45,7 @@ public class AppSettings public bool BackupOnStartup { get; set; } public int BackupsToKeep { get; set; } = 10; public int HistoryMaxEntries { get; set; } = 50000; + public int FetchDetailsAutoCloseSeconds { get; set; } = 30; public List CrawlPages { get; set; } = new(); public List SearchQueries { get; set; } = new(); public SkillExtractionSettings SkillExtraction { get; set; } = new();