diff --git a/app/client/components/path-selector.tsx b/app/client/components/path-selector.tsx index 4d6e6a4d..bbd6292b 100644 --- a/app/client/components/path-selector.tsx +++ b/app/client/components/path-selector.tsx @@ -8,12 +8,7 @@ type Props = { label?: string; }; -/** - * A reusable path selector component that shows the selected path - * with a "Change" button, and expands to a DirectoryBrowser when clicked. - * Matches the pattern used in the volume creation form. - */ -export const PathSelector = ({ value, onChange, label = "Selected path:" }: Props) => { +export const PathSelector = ({ value, onChange }: Props) => { const [showBrowser, setShowBrowser] = useState(false); if (showBrowser) { @@ -26,25 +21,18 @@ export const PathSelector = ({ value, onChange, label = "Selected path:" }: Prop }} selectedPath={value} /> - ); } + console.log("Rendering PathSelector with value:", value); return (
-
-
{label}
-
{value}
-
-
diff --git a/app/client/modules/backups/components/snapshot-file-browser.tsx b/app/client/modules/backups/components/snapshot-file-browser.tsx index 5ba32251..bb08b982 100644 --- a/app/client/modules/backups/components/snapshot-file-browser.tsx +++ b/app/client/modules/backups/components/snapshot-file-browser.tsx @@ -142,7 +142,6 @@ export const SnapshotFileBrowser = (props: Props) => { path: { name: repositoryName }, body: { snapshotId: snapshot.short_id, - target: targetPath || undefined, include: includePaths, delete: deleteExtraFiles, excludeXattr: excludeXattrArray && excludeXattrArray.length > 0 ? excludeXattrArray : undefined, @@ -282,11 +281,7 @@ export const SnapshotFileBrowser = (props: Props) => { {restoreLocation === "custom" && (
- setCustomTargetPath(e.target.value)} - /> +

Files will be restored directly to this path

)} diff --git a/app/client/modules/repositories/components/restore-snapshot-dialog.tsx b/app/client/modules/repositories/components/restore-snapshot-dialog.tsx index d6389c70..e799f4d9 100644 --- a/app/client/modules/repositories/components/restore-snapshot-dialog.tsx +++ b/app/client/modules/repositories/components/restore-snapshot-dialog.tsx @@ -61,7 +61,7 @@ export const RestoreSnapshotDialog = ({ name, snapshotId }: Props) => { path: { name }, body: { snapshotId, - target: values.target || undefined, + targetPath: values.targetPath || undefined, include: include && include.length > 0 ? include : undefined, exclude: exclude && exclude.length > 0 ? exclude : undefined, excludeXattr: excludeXattr && excludeXattr.length > 0 ? excludeXattr : undefined, diff --git a/app/client/modules/repositories/components/restore-snapshot-form.tsx b/app/client/modules/repositories/components/restore-snapshot-form.tsx index 466beaf8..12dffd2e 100644 --- a/app/client/modules/repositories/components/restore-snapshot-form.tsx +++ b/app/client/modules/repositories/components/restore-snapshot-form.tsx @@ -14,10 +14,11 @@ import { } from "~/client/components/ui/form"; import { Input } from "~/client/components/ui/input"; import { Button } from "~/client/components/ui/button"; +import { PathSelector } from "~/client/components/path-selector"; const restoreSnapshotFormSchema = type({ path: "string?", - target: "string?", + targetPath: "string?", include: "string?", exclude: "string?", excludeXattr: "string?", @@ -38,7 +39,7 @@ export const RestoreSnapshotForm = ({ formId, onSubmit, className }: Props) => { resolver: arktypeResolver(restoreSnapshotFormSchema), defaultValues: { path: "", - target: "", + targetPath: "", include: "", exclude: "", excludeXattr: "", @@ -72,12 +73,12 @@ export const RestoreSnapshotForm = ({ formId, onSubmit, className }: Props) => { ( Target Directory (Optional) - + Restore to a custom location instead of the original path (defaults to /)