diff --git a/web/src/components/UpdateLocalStorageDialog.tsx b/web/src/components/UpdateLocalStorageDialog.tsx
new file mode 100644
index 000000000..15b128b50
--- /dev/null
+++ b/web/src/components/UpdateLocalStorageDialog.tsx
@@ -0,0 +1,80 @@
+import { useState } from "react";
+import { Button, Input, Typography } from "@mui/joy";
+import { toast } from "react-hot-toast";
+import * as api from "../helpers/api";
+import { generateDialog } from "./Dialog";
+import Icon from "./Icon";
+import { useGlobalStore } from "../store/module";
+
+interface Props extends DialogProps {
+ localStoragePath?: string;
+ confirmCallback?: () => void;
+}
+
+const UpdateLocalStorageDialog: React.FC
= (props: Props) => {
+ const { destroy, localStoragePath, confirmCallback } = props;
+ const globalStore = useGlobalStore();
+ const [path, setPath] = useState(localStoragePath || "");
+
+ const handleCloseBtnClick = () => {
+ destroy();
+ };
+
+ const handleConfirmBtnClick = async () => {
+ try {
+ await api.upsertSystemSetting({
+ name: "localStoragePath",
+ value: JSON.stringify(path),
+ });
+ await globalStore.fetchSystemStatus();
+ } catch (error: any) {
+ console.error(error);
+ toast.error(error.response.data.message);
+ }
+ if (confirmCallback) {
+ confirmCallback();
+ }
+ destroy();
+ };
+
+ return (
+ <>
+
+
Update local storage path
+
+
+
+
+
+ Local Path
+
+
+ {"e.g., {year}/{month}/{day}/your/path/{timestamp}_{filename}"}
+
+ setPath(e.target.value)} fullWidth />
+
+
+
+
+
+
+ >
+ );
+};
+
+function showUpdateLocalStorageDialog(localStoragePath?: string, confirmCallback?: () => void) {
+ generateDialog(
+ {
+ className: "update-local-storage-dialog",
+ dialogName: "update-local-storage-dialog",
+ },
+ UpdateLocalStorageDialog,
+ { localStoragePath, confirmCallback }
+ );
+}
+
+export default showUpdateLocalStorageDialog;
diff --git a/web/src/types/modules/system.d.ts b/web/src/types/modules/system.d.ts
index 8e95b1077..3e7de52df 100644
--- a/web/src/types/modules/system.d.ts
+++ b/web/src/types/modules/system.d.ts
@@ -28,6 +28,7 @@ interface SystemStatus {
additionalScript: string;
customizedProfile: CustomizedProfile;
storageServiceId: number;
+ localStoragePath: string;
}
interface SystemSetting {