From bd3c1941ff8289a5dae877e08f7e25fa9b2a92c5 Mon Sep 17 00:00:00 2001 From: kloon15 Date: Sun, 1 Oct 2023 18:09:13 +0200 Subject: [PATCH 1/8] fix: revert fetchURL changes in auth (Fixes #2729) (#2739) --- frontend/src/utils/auth.js | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/frontend/src/utils/auth.js b/frontend/src/utils/auth.js index d29890cd..03d35d74 100644 --- a/frontend/src/utils/auth.js +++ b/frontend/src/utils/auth.js @@ -1,7 +1,7 @@ import store from "@/store"; import router from "@/router"; import { Base64 } from "js-base64"; -import { fetchURL } from "@/api/utils"; +import { baseURL } from "@/utils/constants"; export function parseToken(token) { const parts = token.split("."); @@ -32,17 +32,13 @@ export async function validateLogin() { export async function login(username, password, recaptcha) { const data = { username, password, recaptcha }; - const res = await fetchURL( - `/api/login`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(data), + const res = await fetch(`${baseURL}/api/login`, { + method: "POST", + headers: { + "Content-Type": "application/json", }, - false - ); + body: JSON.stringify(data), + }); const body = await res.text(); @@ -54,7 +50,7 @@ export async function login(username, password, recaptcha) { } export async function renew(jwt) { - const res = await fetchURL(`/api/renew`, { + const res = await fetch(`${baseURL}/api/renew`, { method: "POST", headers: { "X-Auth": jwt, @@ -73,17 +69,13 @@ export async function renew(jwt) { export async function signup(username, password) { const data = { username, password }; - const res = await fetchURL( - `/api/signup`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(data), + const res = await fetch(`${baseURL}/api/signup`, { + method: "POST", + headers: { + "Content-Type": "application/json", }, - false - ); + body: JSON.stringify(data), + }); if (res.status !== 200) { throw new Error(res.status); From 94844545840f916e4fdfab3854c128b11a1f8be9 Mon Sep 17 00:00:00 2001 From: Isaak Tsalicoglou Date: Thu, 2 Nov 2023 09:43:32 +0200 Subject: [PATCH 2/8] chore: update en translation (#2776) --- frontend/src/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index d9ba48cc..2041fd2e 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -197,7 +197,7 @@ "userScopeGenerationPlaceholder": "The scope will be auto generated", "createUserHomeDirectory": "Create user home directory", "customStylesheet": "Custom Stylesheet", - "defaultUserDescription": "This are the default settings for new users.", + "defaultUserDescription": "These are the default settings for new users.", "disableExternalLinks": "Disable external links (except documentation)", "disableUsedDiskPercentage": "Disable used disk percentage graph", "documentation": "documentation", From d0c3aeace1a82a0aaa280246c1f4124bd8c0f8c2 Mon Sep 17 00:00:00 2001 From: Isaak Tsalicoglou Date: Thu, 2 Nov 2023 09:43:50 +0200 Subject: [PATCH 3/8] chore: update en translation (#2777) --- frontend/src/i18n/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index 2041fd2e..e74cd5aa 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -204,7 +204,7 @@ "examples": "Examples", "executeOnShell": "Execute on shell", "executeOnShellDescription": "By default, File Browser executes the commands by calling their binaries directly. If you want to run them on a shell instead (such as Bash or PowerShell), you can define it here with the required arguments and flags. If set, the command you execute will be appended as an argument. This apply to both user commands and event hooks.", - "globalRules": "This is a global set of allow and disallow rules. They apply to every user. You can define specific rules on each user's settings to override this ones.", + "globalRules": "This is a global set of allow and disallow rules. They apply to every user. You can define specific rules on each user's settings to override these ones.", "globalSettings": "Global Settings", "hideDotfiles": "Hide dotfiles", "insertPath": "Insert the path", From cdcd9a313aa50c2e6806a182b6838462d42dcafe Mon Sep 17 00:00:00 2001 From: kloon15 Date: Thu, 2 Nov 2023 08:47:55 +0100 Subject: [PATCH 4/8] fix: display file size as base 2 (KiB instead of KB) (#2779) --- frontend/src/components/files/ListingItem.vue | 2 +- frontend/src/components/prompts/Info.vue | 4 ++-- frontend/src/utils/index.js | 6 ++++++ frontend/src/views/Share.vue | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 frontend/src/utils/index.js diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 677d30e9..71813bcf 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -37,7 +37,7 @@