diff --git a/imports/dashboard/files/editor.tsx b/imports/dashboard/files/editor.tsx index 1a8a333..1406a4f 100644 --- a/imports/dashboard/files/editor.tsx +++ b/imports/dashboard/files/editor.tsx @@ -25,8 +25,9 @@ const Editor = (props: { setSaving(true) // Save the file. const formData = new FormData() - formData.append('upload', new Blob([content]), `${props.path}${name}`) - const r = await props.ky.post(`server/${props.server}/file`, { body: formData }) + formData.append('upload', new Blob([content]), name) + const path = encodeURIComponent(props.path) + const r = await props.ky.post(`server/${props.server}/file?path=${path}`, { body: formData }) if (r.status !== 200) props.setMessage((await r.json<{ error: string }>()).error) else props.setMessage('Saved successfully!') setSaving(false) diff --git a/imports/dashboard/files/fileList.tsx b/imports/dashboard/files/fileList.tsx index dad6d6a..7f96103 100644 --- a/imports/dashboard/files/fileList.tsx +++ b/imports/dashboard/files/fileList.tsx @@ -41,7 +41,7 @@ const FileListItem = ({ file, style, disabled, filesSelected, onItemClick, onChe }) => ( e.preventDefault()} style={{ textDecoration: 'none', color: 'inherit', ...style }}> openMenu(file.name, e.currentTarget)} size='large' @@ -65,6 +65,7 @@ const FileListItem = ({ file, style, disabled, filesSelected, onItemClick, onChe primary={file.name} secondary={`Last modified ${tsts(file.lastModified)} | Size: ${bytesToGb(file.size)}`} secondaryTypographyProps={{/* variant: 'caption' */}} + primaryTypographyProps={{ noWrap: true }} /> @@ -122,9 +123,11 @@ const FileList = (props: FileItemData) => { ) ) const sortedList = props.files.sort((a, b) => { + const aName = a.name.toLowerCase() + const bName = b.name.toLowerCase() if (a.folder && !b.folder) return -1 else if (!a.folder && b.folder) return 1 - else return a.name === b.name ? 0 : (a.name > b.name ? 1 : -1) + else return aName === bName ? 0 : (aName > bName ? 1 : -1) }) return (
diff --git a/imports/dashboard/files/fileManager.tsx b/imports/dashboard/files/fileManager.tsx index 85cdf7a..d84d5fe 100644 --- a/imports/dashboard/files/fileManager.tsx +++ b/imports/dashboard/files/fileManager.tsx @@ -233,7 +233,9 @@ const FileManager = (props: { const handleDecompressMenuButton = async () => { setMenuOpen('') setFetching(true) - const a = await ky.post(`server/${server}/decompress?path=${euc(path + menuOpen)}`) + const a = await ky.post(`server/${server}/decompress?path=${euc(path + menuOpen)}`, { + body: path + menuOpen.split('.').slice(0, -1).join('.') + }) .json<{ error: string }>() if (a.error) setMessage(a.error) setFetching(false)