mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 01:11:20 +03:00
chore: lint
This commit is contained in:
@@ -114,7 +114,7 @@ export class MaintenanceController {
|
|||||||
history: new HistoryBuilder().added('v9.9.9').alpha('v9.9.9'),
|
history: new HistoryBuilder().added('v9.9.9').alpha('v9.9.9'),
|
||||||
})
|
})
|
||||||
@Authenticated({ permission: Permission.Maintenance, admin: true })
|
@Authenticated({ permission: Permission.Maintenance, admin: true })
|
||||||
async downloadBackup(@Param() { filename }: FilenameParamDto, @Res() res: Response) {
|
downloadBackup(@Param() { filename }: FilenameParamDto, @Res() res: Response) {
|
||||||
res.header('Content-Disposition', 'attachment');
|
res.header('Content-Disposition', 'attachment');
|
||||||
res.sendFile(this.service.getBackupPath(filename));
|
res.sendFile(this.service.getBackupPath(filename));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export class MaintenanceWorkerController {
|
|||||||
|
|
||||||
@Get('admin/maintenance/backups/:filename')
|
@Get('admin/maintenance/backups/:filename')
|
||||||
@MaintenanceRoute()
|
@MaintenanceRoute()
|
||||||
async downloadBackup(@Param() { filename }: FilenameParamDto, @Res() res: Response) {
|
downloadBackup(@Param() { filename }: FilenameParamDto, @Res() res: Response) {
|
||||||
res.header('Content-Disposition', 'attachment');
|
res.header('Content-Disposition', 'attachment');
|
||||||
res.sendFile(this.service.getBackupPath(filename));
|
res.sendFile(this.service.getBackupPath(filename));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ export class BackupService extends BaseService {
|
|||||||
|
|
||||||
const backupsFolder = StorageCore.getBaseFolder(StorageFolder.Backups);
|
const backupsFolder = StorageCore.getBaseFolder(StorageFolder.Backups);
|
||||||
const files = await this.storageRepository.readdir(backupsFolder);
|
const files = await this.storageRepository.readdir(backupsFolder);
|
||||||
const backups = files.filter(isValidRoutineBackupName);
|
const backups = files.filter((fn) => isValidRoutineBackupName(fn));
|
||||||
const failedBackups = files.filter(isFailedBackupName);
|
const failedBackups = files.filter((fn) => isFailedBackupName(fn));
|
||||||
|
|
||||||
const toDelete = backups.slice(config.keepLastAmount);
|
const toDelete = backups.slice(config.keepLastAmount);
|
||||||
toDelete.push(...failedBackups);
|
toDelete.push(...failedBackups);
|
||||||
|
|||||||
@@ -267,8 +267,8 @@ export async function listBackups({ storage }: Pick<BackupRepos, 'storage'>): Pr
|
|||||||
const backupsFolder = StorageCore.getBaseFolder(StorageFolder.Backups);
|
const backupsFolder = StorageCore.getBaseFolder(StorageFolder.Backups);
|
||||||
const files = await storage.readdir(backupsFolder);
|
const files = await storage.readdir(backupsFolder);
|
||||||
return files
|
return files
|
||||||
.filter(isValidBackupName)
|
.filter((fn) => isValidBackupName(fn))
|
||||||
.sort((a, b) => (a.startsWith('uploaded-') !== b.startsWith('uploaded-') ? 1 : a.localeCompare(b)))
|
.sort((a, b) => (a.startsWith('uploaded-') === b.startsWith('uploaded-') ? a.localeCompare(b) : 1))
|
||||||
.toReversed();
|
.toReversed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function download(filename: string) {
|
function download(filename: string) {
|
||||||
location.href = getBaseUrl() + '/admin/maintenance/backups/' + filename;
|
location.href = getBaseUrl() + '/admin/maintenance/backups/' + filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
title: 'Download',
|
title: 'Download',
|
||||||
icon: mdiDownload,
|
icon: mdiDownload,
|
||||||
onSelect() {
|
onSelect() {
|
||||||
download(filename);
|
void download(filename);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
icon: mdiTrashCanOutline,
|
icon: mdiTrashCanOutline,
|
||||||
color: 'danger',
|
color: 'danger',
|
||||||
onSelect() {
|
onSelect() {
|
||||||
remove(filename);
|
void remove(filename);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<CardBody>
|
<CardBody>
|
||||||
<Stack>
|
<Stack>
|
||||||
{#if integrity}
|
{#if integrity}
|
||||||
{#each Object.entries(integrity.storageIntegrity) as [folder, { readable, writable }]}
|
{#each Object.entries(integrity.storageIntegrity) as [folder, { readable, writable }] (folder)}
|
||||||
<HStack>
|
<HStack>
|
||||||
<Icon
|
<Icon
|
||||||
icon={writable ? mdiCheck : mdiClose}
|
icon={writable ? mdiCheck : mdiClose}
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
>
|
>
|
||||||
</HStack>
|
</HStack>
|
||||||
{/each}
|
{/each}
|
||||||
{#each Object.entries(integrity.storageHeuristics) as [folder, { files }]}
|
{#each Object.entries(integrity.storageHeuristics) as [folder, { files }] (folder)}
|
||||||
{#if folder !== 'backups'}
|
{#if folder !== 'backups'}
|
||||||
<HStack class="items-start">
|
<HStack class="items-start">
|
||||||
<Icon
|
<Icon
|
||||||
|
|||||||
Reference in New Issue
Block a user