diff --git a/app.vue b/app.vue index e50a53a..7e9a888 100644 --- a/app.vue +++ b/app.vue @@ -5,6 +5,7 @@ import { useDisplay } from 'vuetify/lib/framework.mjs'; import { HistoryManager } from './composables/history-manager'; import { FilesManager } from './composables/files-manager'; import type { iFile } from "composables/worker/7zip-manager" +import { videoExtensions, binaryExtensions } from '#imports'; let display = useDisplay(); let drawer = ref(!display.mdAndDown.value); @@ -57,6 +58,8 @@ watchEffect(async () => { const file = filesManager.getFile(selectedPath.value); filesGridList.value = file?.content; + console.log("Selected file", file); + selectedList.value = []; for (const selectedElement of document.querySelectorAll(".selectable.selected")) { selectedElement.classList.remove("selected"); @@ -193,9 +196,13 @@ function stepUp(path: string) { + v-if="!filesManager.getFile(selectedPath)?.isFolder && files.length && !videoExtensions.includes(filesManager.getFile(selectedPath)?.extension) && !binaryExtensions.includes(filesManager.getFile(selectedPath)?.extension)"> + + + diff --git a/components/binary-viewer.vue b/components/binary-viewer.vue new file mode 100644 index 0000000..f84170d --- /dev/null +++ b/components/binary-viewer.vue @@ -0,0 +1,144 @@ + + + + + + Loading... + + + + + {{ row.address }} + {{ row.hex }} + {{ row.ascii }} + + + + + + + diff --git a/composables/files-manager.ts b/composables/files-manager.ts index 37176b1..c9a7db1 100644 --- a/composables/files-manager.ts +++ b/composables/files-manager.ts @@ -10,7 +10,8 @@ import mime from 'mime'; export const videoExtensions = ['mp4', 'avi', 'mov', 'mkv']; export const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp']; export const audioExtensions = ['mp3', 'wav', 'ogg', 'flac']; -export const textExtensions = ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'md', 'js', 'ts', 'php', 'c', 'cpp', 'py', 'html', 'css', 'scss', 'sass', 'less', 'json', 'xml', 'sql', 'java', 'go', 'rb', 'sh', 'bat', 'ps1', 'cmd', 'yml', 'yaml', 'ini', 'toml', 'csv', 'tsv', 'gitignore', 'lock', 'htaccess', 'htpasswd', 'env', 'dockerfile', 'gitattributes', 'gitmodules', 'editorconfig', 'babelrc', 'eslintrc', 'eslintignore', 'prettierrc', 'prettierignore', 'stylelintrc', 'stylelintignore', 'postcssrc', 'postcss.config', 'jsx', 'tsx', 'license'] +export const textExtensions = ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'md', 'js', 'ts', 'php', 'c', 'cpp', 'py', 'html', 'css', 'scss', 'sass', 'less', 'json', 'xml', 'sql', 'java', 'go', 'rb', 'sh', 'bat', 'ps1', 'cmd', 'yml', 'yaml', 'ini', 'toml', 'csv', 'tsv', 'gitignore', 'lock', 'htaccess', 'htpasswd', 'env', 'dockerfile', 'gitattributes', 'gitmodules', 'editorconfig', 'babelrc', 'eslintrc', 'eslintignore', 'prettierrc', 'prettierignore', 'stylelintrc', 'stylelintignore', 'postcssrc', 'postcss.config', 'jsx', 'tsx', 'license']; +export const binaryExtensions = ['exe', 'dll', 'so', 'dylib', 'bin', 'dat', 'db', 'sqlite', 'o', 'class', 'pyc']; export class FilesManager { consoleOutputBuffer: string[] = []; diff --git a/package-lock.json b/package-lock.json index a6beedf..496db13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2662,9 +2662,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001487", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001487.tgz", - "integrity": "sha512-83564Z3yWGqXsh2vaH/mhXfEM0wX+NlBCm1jYHOb97TrTWJEmPTccZgeLTPBUUb0PNVo+oomb7wkimZBIERClA==", + "version": "1.0.30001677", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001677.tgz", + "integrity": "sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog==", "dev": true, "funding": [ {