chore: change variable name casing

This commit is contained in:
izzy
2026-02-24 17:16:13 +00:00
parent df51bea585
commit e32ed6cb4d
+9 -13
View File
@@ -35,19 +35,19 @@
// svelte-ignore state_referenced_locally // svelte-ignore state_referenced_locally
let integrityReport: IntegrityReportSummaryResponseDto = $state(data.integrityReport); let integrityReport: IntegrityReportSummaryResponseDto = $state(data.integrityReport);
const TYPES: IntegrityReportType[] = [ const reportTypes: IntegrityReportType[] = [
IntegrityReportType.UntrackedFile, IntegrityReportType.UntrackedFile,
IntegrityReportType.MissingFile, IntegrityReportType.MissingFile,
IntegrityReportType.ChecksumMismatch, IntegrityReportType.ChecksumMismatch,
]; ];
const INTEGRITY_JOB_NAMES: Record<IntegrityReportType, ManualJobName> = { const jobNames: Record<IntegrityReportType, ManualJobName> = {
[IntegrityReportType.UntrackedFile]: ManualJobName.IntegrityUntrackedFiles, [IntegrityReportType.UntrackedFile]: ManualJobName.IntegrityUntrackedFiles,
[IntegrityReportType.MissingFile]: ManualJobName.IntegrityMissingFiles, [IntegrityReportType.MissingFile]: ManualJobName.IntegrityMissingFiles,
[IntegrityReportType.ChecksumMismatch]: ManualJobName.IntegrityChecksumMismatch, [IntegrityReportType.ChecksumMismatch]: ManualJobName.IntegrityChecksumMismatch,
}; };
const INTEGRITY_REFRESH_JOB_NAMES: Record<IntegrityReportType, ManualJobName> = { const refreshJobNames: Record<IntegrityReportType, ManualJobName> = {
[IntegrityReportType.UntrackedFile]: ManualJobName.IntegrityUntrackedFilesRefresh, [IntegrityReportType.UntrackedFile]: ManualJobName.IntegrityUntrackedFilesRefresh,
[IntegrityReportType.MissingFile]: ManualJobName.IntegrityMissingFilesRefresh, [IntegrityReportType.MissingFile]: ManualJobName.IntegrityMissingFilesRefresh,
[IntegrityReportType.ChecksumMismatch]: ManualJobName.IntegrityChecksumMismatchRefresh, [IntegrityReportType.ChecksumMismatch]: ManualJobName.IntegrityChecksumMismatchRefresh,
@@ -77,11 +77,7 @@
}); });
const onJobCreate = ({ dto }: { dto: JobCreateDto }) => { const onJobCreate = ({ dto }: { dto: JobCreateDto }) => {
if ( if ((Object.values(jobNames).includes(dto.name) || Object.values(refreshJobNames).includes(dto.name)) && jobs) {
(Object.values(INTEGRITY_JOB_NAMES).includes(dto.name) ||
Object.values(INTEGRITY_REFRESH_JOB_NAMES).includes(dto.name)) &&
jobs
) {
expectingUpdate = true; expectingUpdate = true;
jobs.integrityCheck.queueStatus.isActive = true; jobs.integrityCheck.queueStatus.isActive = true;
} }
@@ -99,7 +95,7 @@
size="tiny" size="tiny"
variant="ghost" variant="ghost"
onclick={() => { onclick={() => {
for (const name of Object.values(INTEGRITY_JOB_NAMES)) { for (const name of Object.values(jobNames)) {
void handleCreateJob({ name }); void handleCreateJob({ name });
} }
}} }}
@@ -110,7 +106,7 @@
size="tiny" size="tiny"
variant="ghost" variant="ghost"
onclick={() => { onclick={() => {
for (const name of Object.values(INTEGRITY_REFRESH_JOB_NAMES)) { for (const name of Object.values(refreshJobNames)) {
void handleCreateJob({ name }); void handleCreateJob({ name });
} }
}} }}
@@ -120,7 +116,7 @@
> >
<div class="mt-5 flex justify-between max-lg:flex-wrap gap-4"> <div class="mt-5 flex justify-between max-lg:flex-wrap gap-4">
{#each TYPES as reportType (reportType)} {#each reportTypes as reportType (reportType)}
<ServerStatisticsCard <ServerStatisticsCard
title={$t(`admin.maintenance_integrity_${reportType}`)} title={$t(`admin.maintenance_integrity_${reportType}`)}
value={integrityReport[reportType]} value={integrityReport[reportType]}
@@ -130,7 +126,7 @@
<Button <Button
onclick={() => onclick={() =>
handleCreateJob({ handleCreateJob({
name: INTEGRITY_JOB_NAMES[reportType], name: jobNames[reportType],
})} })}
size="tiny" size="tiny"
variant="ghost" variant="ghost"
@@ -141,7 +137,7 @@
<Button <Button
onclick={() => onclick={() =>
handleCreateJob({ handleCreateJob({
name: INTEGRITY_REFRESH_JOB_NAMES[reportType], name: refreshJobNames[reportType],
})} })}
size="tiny" size="tiny"
variant="ghost" variant="ghost"