fix(template): add missing file path

This commit is contained in:
Mauricio Siu
2024-08-02 13:40:25 -06:00
parent 16791a9f4b
commit ac26bb95e3
3 changed files with 16 additions and 16 deletions

View File

@@ -82,7 +82,7 @@ export const AddVolumes = ({
defaultValues: { defaultValues: {
type: serviceType === "compose" ? "file" : "bind", type: serviceType === "compose" ? "file" : "bind",
hostPath: "", hostPath: "",
mountPath: serviceType === "compose" ? "/" : "", mountPath: "",
}, },
resolver: zodResolver(mySchema), resolver: zodResolver(mySchema),
}); });
@@ -330,22 +330,20 @@ export const AddVolumes = ({
/> />
</> </>
)} )}
{serviceType !== "compose" && ( <FormField
<FormField control={form.control}
control={form.control} name="mountPath"
name="mountPath" render={({ field }) => (
render={({ field }) => ( <FormItem>
<FormItem> <FormLabel>Mount Path (In the container)</FormLabel>
<FormLabel>Mount Path (In the container)</FormLabel> <FormControl>
<FormControl> <Input placeholder="Mount Path" {...field} />
<Input placeholder="Mount Path" {...field} /> </FormControl>
</FormControl>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
)} )}
/> />
)}
</div> </div>
</div> </div>
</form> </form>

View File

@@ -227,6 +227,7 @@ export const composeRouter = createTRPCRouter({
if (mounts && mounts?.length > 0) { if (mounts && mounts?.length > 0) {
for (const mount of mounts) { for (const mount of mounts) {
await createMount({ await createMount({
filePath: mount.filePath,
mountPath: mount.mountPath, mountPath: mount.mountPath,
content: mount.content, content: mount.content,
serviceId: compose.composeId, serviceId: compose.composeId,

View File

@@ -13,6 +13,7 @@ export interface Schema {
export interface Template { export interface Template {
envs: string[]; envs: string[];
mounts?: { mounts?: {
filePath: string;
mountPath: string; mountPath: string;
content?: string; content?: string;
}[]; }[];