Skip to content

Commit

Permalink
fix: linter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Aug 20, 2024
1 parent a0bc14d commit 5e7564f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { For } from 'million/react';
import { useContext, useEffect, useState } from 'react';

import FlashMessageRender from '@/components/FlashMessageRender';
Expand Down
25 changes: 15 additions & 10 deletions resources/scripts/components/server/backups/BackupRow.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { faFile, faLock } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { format, formatDistanceToNow } from 'date-fns';

import Can from '@/components/elements/Can';
Expand All @@ -15,8 +17,6 @@ import getServerBackups from '@/api/swr/getServerBackups';
import useWebsocketEvent from '@/plugins/useWebsocketEvent';

import BackupContextMenu from './BackupContextMenu';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faFile, faLock } from '@fortawesome/free-solid-svg-icons';

interface Props {
backup: ServerBackup;
Expand All @@ -36,12 +36,12 @@ export default ({ backup }: Props) => {
b.uuid !== backup.uuid
? b
: {
...b,
isSuccessful: parsed.is_successful || true,
checksum: (parsed.checksum_type || '') + ':' + (parsed.checksum || ''),
bytes: parsed.file_size || 0,
completedAt: new Date(),
},
...b,
isSuccessful: parsed.is_successful || true,
checksum: (parsed.checksum_type || '') + ':' + (parsed.checksum || ''),
bytes: parsed.file_size || 0,
completedAt: new Date(),
},
),
}),
false,
Expand Down Expand Up @@ -79,7 +79,9 @@ export default ({ backup }: Props) => {
<p className='break-words truncate text-lg'>{backup.name}</p>
</div>
</div>
<p className={`mt-1 md:mt-0 text-xs text-zinc-400 font-mono truncate`}>{backup.checksum}</p>
<p className={`mt-1 md:mt-0 text-xs text-zinc-400 font-mono truncate`}>
{backup.checksum}
</p>
</div>
</div>
</div>
Expand All @@ -90,7 +92,10 @@ export default ({ backup }: Props) => {
<span className={`text-xs sm:flex-initial sm:ml-0`}>{bytesToString(backup.bytes)}</span>
)}
<p className={`text-xs inline sm:hidden`}>,&nbsp;</p>
<p title={format(backup.createdAt, 'ddd, MMMM do, yyyy HH:mm:ss')} className={`text-xs sm:flex-initial`}>
<p
title={format(backup.createdAt, 'ddd, MMMM do, yyyy HH:mm:ss')}
className={`text-xs sm:flex-initial`}
>
{formatDistanceToNow(backup.createdAt, { includeSeconds: true, addSuffix: true })}
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ export default () => {
<span>N/A</span>
)}

<span
className={`ml-4 pl-4 border-l-4 border-neutral-600 py-px hidden sm:inline`}
/>
<span className={`ml-4 pl-4 border-l-4 border-neutral-600 py-px hidden sm:inline`} />
<br className={`sm:hidden`} />

<strong>Next run at:&nbsp;</strong>
Expand Down Expand Up @@ -131,16 +129,16 @@ export default () => {
<div>
{schedule.tasks.length > 0
? schedule.tasks
.sort((a, b) =>
a.sequenceId === b.sequenceId ? 0 : a.sequenceId > b.sequenceId ? 1 : -1,
)
.map((task) => (
<ScheduleTaskRow
key={`${schedule.id}_${task.id}`}
task={task}
schedule={schedule}
/>
))
.sort((a, b) =>
a.sequenceId === b.sequenceId ? 0 : a.sequenceId > b.sequenceId ? 1 : -1,
)
.map((task) => (
<ScheduleTaskRow
key={`${schedule.id}_${task.id}`}
task={task}
schedule={schedule}
/>
))
: null}
</div>
<EditScheduleModal visible={showEditModal} schedule={schedule} onModalDismissed={toggleEditModal} />
Expand Down
4 changes: 2 additions & 2 deletions resources/scripts/components/server/schedules/ScheduleRow.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { faCalendarAlt } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { format } from 'date-fns';

import ScheduleCronRow from '@/components/server/schedules/ScheduleCronRow';

import { Schedule } from '@/api/server/schedules/getServerSchedules';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCalendarAlt } from '@fortawesome/free-solid-svg-icons';

export default ({ schedule }: { schedule: Schedule }) => (
<>
Expand Down

0 comments on commit 5e7564f

Please sign in to comment.