From d6a71a76d8248c01966a9f83b2c5a9f772ed8df3 Mon Sep 17 00:00:00 2001 From: Gareth George Date: Sat, 30 Mar 2024 09:54:38 +0000 Subject: [PATCH] feat: make hostname configurable in settings panel --- webui/src/views/SettingsModal.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/webui/src/views/SettingsModal.tsx b/webui/src/views/SettingsModal.tsx index 70ddecc0..d549216d 100644 --- a/webui/src/views/SettingsModal.tsx +++ b/webui/src/views/SettingsModal.tsx @@ -31,11 +31,11 @@ interface FormData { needsBcrypt?: boolean; })[]; } + host: string; } export const SettingsModal = () => { let [config, setConfig] = useConfig(); - const configObj = JSON.parse(config!.toJsonString()); const showModal = useShowModal(); const alertsApi = useAlertApi()!; const [form] = Form.useForm(); @@ -62,6 +62,7 @@ export const SettingsModal = () => { // Update configuration let newConfig = config!.clone(); newConfig.auth = new Auth().fromJson(formData.auth, { ignoreUnknownFields: false }); + newConfig.host = formData.host; if (!newConfig.auth?.users && !newConfig.auth?.disabled) { throw new Error("At least one user must be configured or authentication must be disabled"); @@ -110,7 +111,7 @@ export const SettingsModal = () => { labelCol={{ span: 6 }} wrapperCol={{ span: 16 }} > - {users.length > 0 ? null : ( + {(users.length > 0 || config.auth?.disabled) ? null : ( <> Initial backrest setup!

@@ -121,6 +122,16 @@ export const SettingsModal = () => {

)} + + +