Compare commits
2 commits
main
...
v0.25.1-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2ede26af7 | ||
|
|
aafed6e7b1 |
5 changed files with 88 additions and 78 deletions
|
|
@ -8,7 +8,7 @@ runs:
|
||||||
- uses: oven-sh/setup-bun@v2
|
- uses: oven-sh/setup-bun@v2
|
||||||
name: Install Bun
|
name: Install Bun
|
||||||
with:
|
with:
|
||||||
bun-version: "1.3.8"
|
bun-version: "1.3.6"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
ARG BUN_VERSION="1.3.8"
|
ARG BUN_VERSION="1.3.6"
|
||||||
|
|
||||||
FROM oven/bun:${BUN_VERSION}-alpine AS base
|
FROM oven/bun:${BUN_VERSION}-alpine AS base
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type { UseFormReturn } from "react-hook-form";
|
||||||
import { Check, Pencil, X, AlertTriangle } from "lucide-react";
|
import { Check, Pencil, X, AlertTriangle } from "lucide-react";
|
||||||
import { REPOSITORY_BASE } from "~/client/lib/constants";
|
import { REPOSITORY_BASE } from "~/client/lib/constants";
|
||||||
import { Button } from "../../../../components/ui/button";
|
import { Button } from "../../../../components/ui/button";
|
||||||
import { FormItem, FormLabel, FormDescription } from "../../../../components/ui/form";
|
import { FormItem, FormLabel, FormDescription, FormField, FormControl } from "../../../../components/ui/form";
|
||||||
import { DirectoryBrowser } from "../../../../components/directory-browser";
|
import { DirectoryBrowser } from "../../../../components/directory-browser";
|
||||||
import {
|
import {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
|
|
@ -26,79 +26,89 @@ export const LocalRepositoryForm = ({ form }: Props) => {
|
||||||
const [showPathWarning, setShowPathWarning] = useState(false);
|
const [showPathWarning, setShowPathWarning] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<FormField
|
||||||
<FormItem>
|
control={form.control}
|
||||||
<FormLabel>Repository Directory</FormLabel>
|
name="path"
|
||||||
<div className="flex items-center gap-2">
|
render={({ field }) => (
|
||||||
<div className="flex-1 text-sm font-mono bg-muted px-3 py-2 rounded-md border">
|
<>
|
||||||
{form.watch("path") || REPOSITORY_BASE}
|
<FormItem>
|
||||||
</div>
|
<FormLabel>Repository Directory</FormLabel>
|
||||||
<Button type="button" variant="outline" onClick={() => setShowPathWarning(true)} size="sm">
|
<FormControl>
|
||||||
<Pencil className="h-4 w-4 mr-2" />
|
<div className="flex items-center gap-2">
|
||||||
Change
|
<div className="flex-1 text-sm font-mono bg-muted px-3 py-2 rounded-md border">
|
||||||
</Button>
|
{field.value || REPOSITORY_BASE}
|
||||||
</div>
|
</div>
|
||||||
<FormDescription>The directory where the repository will be stored.</FormDescription>
|
<Button type="button" variant="outline" onClick={() => setShowPathWarning(true)} size="sm">
|
||||||
</FormItem>
|
<Pencil className="h-4 w-4 mr-2" />
|
||||||
|
Change
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>The directory where the repository will be stored.</FormDescription>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
<AlertDialog open={showPathWarning} onOpenChange={setShowPathWarning}>
|
<AlertDialog open={showPathWarning} onOpenChange={setShowPathWarning}>
|
||||||
<AlertDialogContent>
|
<AlertDialogContent>
|
||||||
<AlertDialogHeader>
|
<AlertDialogHeader>
|
||||||
<AlertDialogTitle className="flex items-center gap-2">
|
<AlertDialogTitle className="flex items-center gap-2">
|
||||||
<AlertTriangle className="h-5 w-5 text-yellow-500" />
|
<AlertTriangle className="h-5 w-5 text-yellow-500" />
|
||||||
Important: Host mount required
|
Important: Host mount required
|
||||||
</AlertDialogTitle>
|
</AlertDialogTitle>
|
||||||
<AlertDialogDescription className="space-y-3">
|
<AlertDialogDescription className="space-y-3">
|
||||||
<p>When selecting a custom path, ensure it is mounted from the host machine into the container.</p>
|
<p>When selecting a custom path, ensure it is mounted from the host machine into the container.</p>
|
||||||
<p className="font-medium">
|
<p className="font-medium">
|
||||||
If the path is not a host mount, you will lose your repository data when the container restarts.
|
If the path is not a host mount, you will lose your repository data when the container restarts.
|
||||||
</p>
|
</p>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
The default path <code className="bg-muted px-1 rounded">{REPOSITORY_BASE}</code> is safe to use if you
|
The default path <code className="bg-muted px-1 rounded">{REPOSITORY_BASE}</code> is safe to use if
|
||||||
followed the recommended Docker Compose setup.
|
you followed the recommended Docker Compose setup.
|
||||||
</p>
|
</p>
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||||
<AlertDialogAction
|
<AlertDialogAction
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setShowPathBrowser(true);
|
setShowPathBrowser(true);
|
||||||
setShowPathWarning(false);
|
setShowPathWarning(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
I Understand, Continue
|
I Understand, Continue
|
||||||
</AlertDialogAction>
|
</AlertDialogAction>
|
||||||
</AlertDialogFooter>
|
</AlertDialogFooter>
|
||||||
</AlertDialogContent>
|
</AlertDialogContent>
|
||||||
</AlertDialog>
|
</AlertDialog>
|
||||||
|
|
||||||
<AlertDialog open={showPathBrowser} onOpenChange={setShowPathBrowser}>
|
<AlertDialog open={showPathBrowser} onOpenChange={setShowPathBrowser}>
|
||||||
<AlertDialogContent className="max-w-2xl">
|
<AlertDialogContent className="max-w-2xl">
|
||||||
<AlertDialogHeader>
|
<AlertDialogHeader>
|
||||||
<AlertDialogTitle>Select Repository Directory</AlertDialogTitle>
|
<AlertDialogTitle>Select Repository Directory</AlertDialogTitle>
|
||||||
<AlertDialogDescription>
|
<AlertDialogDescription>
|
||||||
Choose a directory from the filesystem to store the repository.
|
Choose a directory from the filesystem to store the repository.
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
<div className="py-4">
|
<div className="py-4">
|
||||||
<DirectoryBrowser
|
<DirectoryBrowser
|
||||||
onSelectPath={(path) => form.setValue("path", path)}
|
onSelectPath={(path) => {
|
||||||
selectedPath={form.watch("path") || REPOSITORY_BASE}
|
field.onChange(path);
|
||||||
/>
|
}}
|
||||||
</div>
|
selectedPath={field.value || REPOSITORY_BASE}
|
||||||
<AlertDialogFooter>
|
/>
|
||||||
<AlertDialogCancel>
|
</div>
|
||||||
<X className="h-4 w-4 mr-2" />
|
<AlertDialogFooter>
|
||||||
Cancel
|
<AlertDialogCancel>
|
||||||
</AlertDialogCancel>
|
<X className="h-4 w-4 mr-2" />
|
||||||
<AlertDialogAction onClick={() => setShowPathBrowser(false)}>
|
Cancel
|
||||||
<Check className="h-4 w-4 mr-2" />
|
</AlertDialogCancel>
|
||||||
Done
|
<AlertDialogAction onClick={() => setShowPathBrowser(false)}>
|
||||||
</AlertDialogAction>
|
<Check className="h-4 w-4 mr-2" />
|
||||||
</AlertDialogFooter>
|
Done
|
||||||
</AlertDialogContent>
|
</AlertDialogAction>
|
||||||
</AlertDialog>
|
</AlertDialogFooter>
|
||||||
</>
|
</AlertDialogContent>
|
||||||
|
</AlertDialog>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
2
bun.lock
2
bun.lock
|
|
@ -78,7 +78,7 @@
|
||||||
"@tanstack/react-query-devtools": "^5.91.2",
|
"@tanstack/react-query-devtools": "^5.91.2",
|
||||||
"@testing-library/dom": "^10.4.1",
|
"@testing-library/dom": "^10.4.1",
|
||||||
"@testing-library/react": "^16.3.2",
|
"@testing-library/react": "^16.3.2",
|
||||||
"@types/bun": "^1.3.8",
|
"@types/bun": "^1.3.6",
|
||||||
"@types/node": "^25.1.0",
|
"@types/node": "^25.1.0",
|
||||||
"@types/react": "^19.2.10",
|
"@types/react": "^19.2.10",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
"@tanstack/react-query-devtools": "^5.91.2",
|
"@tanstack/react-query-devtools": "^5.91.2",
|
||||||
"@testing-library/dom": "^10.4.1",
|
"@testing-library/dom": "^10.4.1",
|
||||||
"@testing-library/react": "^16.3.2",
|
"@testing-library/react": "^16.3.2",
|
||||||
"@types/bun": "^1.3.8",
|
"@types/bun": "^1.3.6",
|
||||||
"@types/node": "^25.1.0",
|
"@types/node": "^25.1.0",
|
||||||
"@types/react": "^19.2.10",
|
"@types/react": "^19.2.10",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
|
|
@ -122,5 +122,5 @@
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"esbuild": "^0.27.2"
|
"esbuild": "^0.27.2"
|
||||||
},
|
},
|
||||||
"packageManager": "bun@1.3.8"
|
"packageManager": "bun@1.3.6"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue