perf: optimize Docker build with layer caching and BuildKit support
This commit is contained in:
@@ -66,12 +66,33 @@ export class FileExplorerComponent {
|
||||
selectedNoteId = input<string | null>(null);
|
||||
foldersOnly = input<boolean>(false);
|
||||
useTrashCounts = input<boolean>(false);
|
||||
quickLinkFilter = input<'favoris' | 'publish' | 'draft' | 'template' | 'task' | 'private' | 'archive' | null>(null);
|
||||
fileSelected = output<string>();
|
||||
folderSelected = output<string>();
|
||||
|
||||
private vaultService = inject(VaultService);
|
||||
|
||||
folderCount(path: string): number {
|
||||
const quickLink = this.quickLinkFilter();
|
||||
if (quickLink) {
|
||||
// Compute filtered count
|
||||
let filteredNotes = this.vaultService.allNotes().filter(note => {
|
||||
const frontmatter = note.frontmatter || {};
|
||||
return frontmatter[quickLink] === true;
|
||||
});
|
||||
|
||||
// Apply folder filter
|
||||
if (path) {
|
||||
const folder = path.toLowerCase().replace(/^\/+|\/+$/g, '');
|
||||
filteredNotes = filteredNotes.filter(note => {
|
||||
const originalPath = (note.originalPath || '').toLowerCase().replace(/^\/+|\/+$/g, '');
|
||||
return originalPath === folder || originalPath.startsWith(folder + '/');
|
||||
});
|
||||
}
|
||||
|
||||
return filteredNotes.length;
|
||||
}
|
||||
|
||||
if (this.useTrashCounts()) {
|
||||
const counts = this.vaultService.trashFolderCounts();
|
||||
const raw = (path || '').replace(/\\/g, '/');
|
||||
|
||||
Reference in New Issue
Block a user