diff --git a/CHANGELOG.md b/CHANGELOG.md index e2a68f7d..fedfbbfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.40.0](https://github.com/filebrowser/filebrowser/compare/v2.39.0...v2.40.0) (2025-07-13) + + +### Features + +* add font size botton to text editor ([#5290](https://github.com/filebrowser/filebrowser/issues/5290)) ([035084d](https://github.com/filebrowser/filebrowser/commit/035084d8e83243065fad69bfac1b69559fbad5fb)) + + +### Bug Fixes + +* invalid path when uploading files ([9072cbc](https://github.com/filebrowser/filebrowser/commit/9072cbce340da55477906f5419a4cfb6d6937dc0)) +* Only left click should drag the image in extended image view ([b8454bb](https://github.com/filebrowser/filebrowser/commit/b8454bb2e41ca2848b926b66354468ba4b1c7ba5)) + ## [2.39.0](https://github.com/filebrowser/filebrowser/compare/v2.38.0...v2.39.0) (2025-07-13) diff --git a/docker/alpine/healthcheck.sh b/docker/alpine/healthcheck.sh index 70e71bf6..f86550dc 100644 --- a/docker/alpine/healthcheck.sh +++ b/docker/alpine/healthcheck.sh @@ -2,8 +2,8 @@ set -e -PORT=${FB_PORT:-$(cat /tmp/FB_CONFIG | sh /JSON.sh | grep '\["port"\]' | awk '{print $2}')} -ADDRESS=${FB_ADDRESS:-$(cat /tmp/FB_CONFIG | sh /JSON.sh | grep '\["address"\]' | awk '{print $2}' | sed 's/"//g')} +PORT=${FB_PORT:-$(cat /config/settings.json | sh /JSON.sh | grep '\["port"\]' | awk '{print $2}')} +ADDRESS=${FB_ADDRESS:-$(cat /config/settings.json | sh /JSON.sh | grep '\["address"\]' | awk '{print $2}' | sed 's/"//g')} ADDRESS=${ADDRESS:-localhost} -wget -q --spider http://$ADDRESS:$PORT/health || exit 1 \ No newline at end of file +wget -q --spider http://$ADDRESS:$PORT/health || exit 1 diff --git a/docker/alpine/init.sh b/docker/alpine/init.sh index 5ea2cf6e..a4ac72ae 100755 --- a/docker/alpine/init.sh +++ b/docker/alpine/init.sh @@ -32,7 +32,4 @@ if [ -z "$config_file" ]; then set -- --config=/config/settings.json "$@" fi -# Create a symlink to the config file for compatibility with the healthcheck script -ln -s "$config_file" /tmp/FB_CONFIG - -exec filebrowser "$@" \ No newline at end of file +exec filebrowser "$@" diff --git a/frontend/src/api/tus.ts b/frontend/src/api/tus.ts index 64efe69a..fbfef4da 100644 --- a/frontend/src/api/tus.ts +++ b/frontend/src/api/tus.ts @@ -1,5 +1,5 @@ import * as tus from "tus-js-client"; -import { baseURL, tusEndpoint, tusSettings } from "@/utils/constants"; +import { baseURL, tusEndpoint, tusSettings, origin } from "@/utils/constants"; import { useAuthStore } from "@/stores/auth"; import { useUploadStore } from "@/stores/upload"; import { removePrefix } from "@/api/utils"; @@ -35,7 +35,7 @@ export async function upload( } return new Promise((resolve, reject) => { const upload = new tus.Upload(content, { - endpoint: `${baseURL}${resourcePath}`, + endpoint: `${origin}${baseURL}${resourcePath}`, chunkSize: tusSettings.chunkSize, retryDelays: computeRetryDelays(tusSettings), parallelUploads: 1, diff --git a/frontend/src/components/files/ExtendedImage.vue b/frontend/src/components/files/ExtendedImage.vue index e872bfbe..88b78304 100644 --- a/frontend/src/components/files/ExtendedImage.vue +++ b/frontend/src/components/files/ExtendedImage.vue @@ -172,7 +172,8 @@ const setCenter = () => { imgex.value.style.top = position.value.center.y + "px"; }; -const mousedownStart = (event: Event) => { +const mousedownStart = (event: MouseEvent) => { + if (event.button !== 0) return; lastX.value = null; lastY.value = null; inDrag.value = true; @@ -184,8 +185,10 @@ const mouseMove = (event: MouseEvent) => { event.preventDefault(); }; const mouseUp = (event: Event) => { + if (inDrag.value) { + event.preventDefault(); + } inDrag.value = false; - event.preventDefault(); }; const touchStart = (event: TouchEvent) => { lastX.value = null; diff --git a/frontend/src/views/files/Editor.vue b/frontend/src/views/files/Editor.vue index 95867033..f40fa392 100644 --- a/frontend/src/views/files/Editor.vue +++ b/frontend/src/views/files/Editor.vue @@ -4,6 +4,18 @@ {{ fileStore.req?.name ?? "" }} + + {{ fontSize }}px + + (null); +const fontSize = ref(parseInt(localStorage.getItem("editorFontSize") || "14")); const isPreview = ref(false); const previewContent = ref(""); @@ -121,6 +134,7 @@ onMounted(() => { editor.value!.setTheme("ace/theme/twilight"); } + editor.value.setFontSize(fontSize.value); editor.value.focus(); }); @@ -186,6 +200,21 @@ const save = async () => { $showError(e); } }; + +const increaseFontSize = () => { + fontSize.value += 1; + editor.value?.setFontSize(fontSize.value); + localStorage.setItem("editorFontSize", fontSize.value.toString()); +}; + +const decreaseFontSize = () => { + if (fontSize.value > 1) { + fontSize.value -= 1; + editor.value?.setFontSize(fontSize.value); + localStorage.setItem("editorFontSize", fontSize.value.toString()); + } +}; + const close = () => { if (!editor.value?.session.getUndoManager().isClean()) { layoutStore.showHover("discardEditorChanges"); @@ -202,3 +231,10 @@ const preview = () => { isPreview.value = !isPreview.value; }; + + diff --git a/http/tus_handlers.go b/http/tus_handlers.go index c5eec9ad..002d78b5 100644 --- a/http/tus_handlers.go +++ b/http/tus_handlers.go @@ -147,7 +147,8 @@ func tusPostHandler() handleFunc { // Enables the user to utilize the PATCH endpoint for uploading file data registerUpload(file.RealPath(), uploadLength) - w.Header().Set("Location", "/api/tus/"+r.URL.Path) + // Signal the frontend to reuse the current request URL + w.Header().Set("Location", "") return http.StatusCreated, nil })