Rough copy of edit menu
This commit is contained in:
parent
c5d5c94125
commit
1a485b2f64
1 changed files with 7 additions and 9 deletions
|
|
@ -93,15 +93,15 @@ export function EditRouteDialog({ route }: { route: Route }) {
|
||||||
})
|
})
|
||||||
|
|
||||||
let onSubmit = ((data: any) => {
|
let onSubmit = ((data: any) => {
|
||||||
|
console.log(modifiedRoute)
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(getHosts(route))
|
|
||||||
|
|
||||||
let handleChange = (value: any, path: any) => {
|
let handleChange = (value: any, path: any) => {
|
||||||
|
console.log(path)
|
||||||
let updatedRoute = set(modifiedRoute, path, value.target.value);
|
let updatedRoute = set(modifiedRoute, path, value.target.value);
|
||||||
|
console.log(updatedRoute)
|
||||||
setRoute(updatedRoute);
|
setRoute(updatedRoute);
|
||||||
console.log(value.target.name, value.target.value)
|
|
||||||
form.setValue(value.target.name, value.target.value)
|
form.setValue(value.target.name, value.target.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -134,12 +134,11 @@ export function EditRouteDialog({ route }: { route: Route }) {
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Upstream {index + 1}</FormLabel>
|
<FormLabel>Upstream {index + 1}</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} onChange={(value) => handleChange(value, `modifiedRoute.handle[0].upstreams`)} />
|
<Input {...field} onChange={(value) => handleChange(value, `handle[0].routes[0].handle[0].upstreams[${index}]`)} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
>
|
/>
|
||||||
</FormField>
|
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{hosts.map((host, index) => (
|
{hosts.map((host, index) => (
|
||||||
|
|
@ -151,12 +150,11 @@ export function EditRouteDialog({ route }: { route: Route }) {
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Host {index + 1}</FormLabel>
|
<FormLabel>Host {index + 1}</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} onChange={(value) => handleChange(value, `modifiedRoute.handle[0].hosts`)} />
|
<Input {...field} onChange={(value) => handleChange(value, `match[0].host[${index}]`)} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
>
|
/>
|
||||||
</FormField>
|
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<Button type="submit">Save</Button>
|
<Button type="submit">Save</Button>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue