mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-21 05:10:41 +00:00
feat: enhance backup functionality with attachment options
- Added support for including attachments in backup exports. - Updated backup-related interfaces and functions to handle attachment options. - Introduced a new UI component for selecting attachment inclusion during backup operations. - Modified existing components to integrate the new attachment functionality. - Improved user feedback and error handling during backup processes.
This commit is contained in:
@@ -100,9 +100,12 @@ function getRemoteItemSortTime(item: RemoteBackupItem): number {
|
||||
}
|
||||
|
||||
export function compareRemoteItems(a: RemoteBackupItem, b: RemoteBackupItem): number {
|
||||
const aIsAttachmentsDir = a.isDirectory && a.name === 'attachments';
|
||||
const bIsAttachmentsDir = b.isDirectory && b.name === 'attachments';
|
||||
if (aIsAttachmentsDir !== bIsAttachmentsDir) return aIsAttachmentsDir ? -1 : 1;
|
||||
if (a.isDirectory !== b.isDirectory) return a.isDirectory ? -1 : 1;
|
||||
const timeDiff = getRemoteItemSortTime(b) - getRemoteItemSortTime(a);
|
||||
if (timeDiff !== 0) return timeDiff;
|
||||
if (a.isDirectory !== b.isDirectory) return a.isDirectory ? -1 : 1;
|
||||
return b.name.localeCompare(a.name, 'en');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user