Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FileSystem): add crowsnest backup file filter #1332

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/widgets/filesystem/FileSystem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ export default class FileSystem extends Mixins(StateMixin, FilesMixin, ServicesM
return false
}
break
case 'crowsnest_backup_files':
if (file.type === 'file' && file.filename.match(/^crowsnest\.conf\.\d{4}-\d{2}-\d{2}-\d{4}$/)) {
return false
}
break
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/components/widgets/filesystem/FileSystemFilterMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ export default class FileSystemFilterMenu extends Vue {
})
}
if (rootFilterTypes.includes('crowsnest_backup_files')) {
filters.push({
type: 'crowsnest_backup_files',
text: this.$tc('app.file_system.filters.label.crowsnest_backup_files')
})
}
return filters
}
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ app:
file_system:
filters:
label:
crowsnest_backup_files: Filter Crowsnest backup files
print_start_time: Filter printed
print_start_time_desc: Filters out items you've already printed.
hidden_files_folders: Filter hidden files and folders
Expand Down
2 changes: 1 addition & 1 deletion src/store/files/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const getters: GetterTree<FilesState, RootState> = {
accepts: ['.conf', '.cfg', '.md', '.css', '.jpg', '.jpeg', '.png', '.gif'],
canView,
canConfigure: false,
filterTypes: ['hidden_files', 'klipper_backup_files', 'moonraker_backup_files']
filterTypes: ['hidden_files', 'klipper_backup_files', 'moonraker_backup_files', 'crowsnest_backup_files']
}
case 'config_examples':
return {
Expand Down
2 changes: 1 addition & 1 deletion src/store/files/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export interface FilesUpload extends FileDownload {
cancelled: boolean; // in a cancelled state, don't show - nor try to upload.
}

export type FileFilterType = 'print_start_time' | 'hidden_files' | 'klipper_backup_files' | 'rolled_log_files' | 'moonraker_backup_files'
export type FileFilterType = 'print_start_time' | 'hidden_files' | 'klipper_backup_files' | 'rolled_log_files' | 'moonraker_backup_files' | 'crowsnest_backup_files'

export type FileBrowserEntry = AppFile | AppFileWithMeta | AppDirectory

Expand Down
Loading