Skip to content

Commit

Permalink
feat: filter thumbs folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cadriel committed Nov 1, 2020
1 parent 2e27a99 commit 1857dee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'camelcase': 'never',
'camelcase': 0,
'@typescript-eslint/camelcase': 0
},
overrides: [
Expand Down
7 changes: 5 additions & 2 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ import {
mdiArrowHorizontalLock,
mdiChartTimelineVariant,
mdiFireAlert,
mdiUpload
mdiUpload,
mdiFolderUpload
} from '@mdi/js'

/**
Expand All @@ -72,7 +73,8 @@ export const Globals = Object.freeze({
KLIPPY_RETRY_DELAY: 2000,
LOCAL_STORAGE_KEY: 'appConfig',
SETTINGS_FILENAME: '.fluidd.json',
APP_NAME: 'Fluidd'
APP_NAME: 'Fluidd',
FILTERED_FILES: ['.', 'thumbs']
})

export const Icons = Object.freeze({
Expand All @@ -92,6 +94,7 @@ export const Icons = Object.freeze({
checkedCircle: mdiCheckCircleOutline,
alertCircle: mdiAlertCircle,
folderAdd: mdiFolderPlus,
folderUp: mdiFolderUpload,
folder: mdiFolder,
fileUpload: mdiUpload,
up: mdiArrowUp,
Expand Down
5 changes: 3 additions & 2 deletions src/store/files/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FileChangeSocketResponse } from '../socket/types'
import { RootState } from '../types'
import { getFileListChangeInfo } from '../helpers'
import { SocketActions } from '@/socketActions'
import { Globals } from '@/globals'

export const actions: ActionTree<FilesState, RootState> = {
async onServerFilesGetDirectory ({ commit }, payload) {
Expand All @@ -21,7 +22,7 @@ export const actions: ActionTree<FilesState, RootState> = {
}
if (payload.dirs) {
payload.dirs.forEach((dir: Directory) => {
if (!dir.dirname.startsWith('.')) {
if (!Globals.FILTERED_FILES.some(e => dir.dirname.startsWith(e))) {
dir.type = 'directory'
dir.name = dir.dirname
dir.modified = new Date(dir.modified).getTime()
Expand All @@ -31,7 +32,7 @@ export const actions: ActionTree<FilesState, RootState> = {
}
if (payload.files) {
payload.files.forEach((file: KlipperFile) => {
if (!file.filename.startsWith('.')) {
if (!Globals.FILTERED_FILES.some(e => file.filename.startsWith(e))) {
file.type = 'file'
file.name = file.filename
file.extension = file.filename.split('.').pop() || ''
Expand Down
2 changes: 1 addition & 1 deletion todo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TODO [fluidd]

## Next Up
- ufp plugin support. 300x300 thumbs, don't show thumbs folder in UI / browser.
- look into why IOS/safari fails to load some config files
- in file save window add 'save and close' option, and maybe 'save, close and restart'
- ensure tabs are also remembered in localstorage
- temperature presets
Expand Down

0 comments on commit 1857dee

Please sign in to comment.