diff --git a/web/src/routes/admin/maintenance/+page.svelte b/web/src/routes/admin/maintenance/+page.svelte index 9d6698631d..b0a244b5b1 100644 --- a/web/src/routes/admin/maintenance/+page.svelte +++ b/web/src/routes/admin/maintenance/+page.svelte @@ -35,19 +35,19 @@ // svelte-ignore state_referenced_locally let integrityReport: IntegrityReportSummaryResponseDto = $state(data.integrityReport); - const TYPES: IntegrityReportType[] = [ + const reportTypes: IntegrityReportType[] = [ IntegrityReportType.UntrackedFile, IntegrityReportType.MissingFile, IntegrityReportType.ChecksumMismatch, ]; - const INTEGRITY_JOB_NAMES: Record = { + const jobNames: Record = { [IntegrityReportType.UntrackedFile]: ManualJobName.IntegrityUntrackedFiles, [IntegrityReportType.MissingFile]: ManualJobName.IntegrityMissingFiles, [IntegrityReportType.ChecksumMismatch]: ManualJobName.IntegrityChecksumMismatch, }; - const INTEGRITY_REFRESH_JOB_NAMES: Record = { + const refreshJobNames: Record = { [IntegrityReportType.UntrackedFile]: ManualJobName.IntegrityUntrackedFilesRefresh, [IntegrityReportType.MissingFile]: ManualJobName.IntegrityMissingFilesRefresh, [IntegrityReportType.ChecksumMismatch]: ManualJobName.IntegrityChecksumMismatchRefresh, @@ -77,11 +77,7 @@ }); const onJobCreate = ({ dto }: { dto: JobCreateDto }) => { - if ( - (Object.values(INTEGRITY_JOB_NAMES).includes(dto.name) || - Object.values(INTEGRITY_REFRESH_JOB_NAMES).includes(dto.name)) && - jobs - ) { + if ((Object.values(jobNames).includes(dto.name) || Object.values(refreshJobNames).includes(dto.name)) && jobs) { expectingUpdate = true; jobs.integrityCheck.queueStatus.isActive = true; } @@ -99,7 +95,7 @@ size="tiny" variant="ghost" onclick={() => { - for (const name of Object.values(INTEGRITY_JOB_NAMES)) { + for (const name of Object.values(jobNames)) { void handleCreateJob({ name }); } }} @@ -110,7 +106,7 @@ size="tiny" variant="ghost" onclick={() => { - for (const name of Object.values(INTEGRITY_REFRESH_JOB_NAMES)) { + for (const name of Object.values(refreshJobNames)) { void handleCreateJob({ name }); } }} @@ -120,7 +116,7 @@ >
- {#each TYPES as reportType (reportType)} + {#each reportTypes as reportType (reportType)} handleCreateJob({ - name: INTEGRITY_JOB_NAMES[reportType], + name: jobNames[reportType], })} size="tiny" variant="ghost" @@ -141,7 +137,7 @@