Added routes rough draft finished
This commit is contained in:
parent
879964487c
commit
6149c3a1b9
2 changed files with 8 additions and 4 deletions
|
|
@ -58,6 +58,9 @@ export async function PUT(request: Request, { params }: { params: { route: numbe
|
|||
body: JSON.stringify(route)
|
||||
})
|
||||
|
||||
|
||||
//console.log(JSON.stringify(route));
|
||||
|
||||
if (!res.ok) return new NextResponse(JSON.stringify({ error: true, message: "Could not save route" }), {
|
||||
status: 500,
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ export function RouteDialog({ route, routesMap }: { route: Route, routesMap: Rou
|
|||
}
|
||||
});
|
||||
|
||||
let validHosts: any[] = ["google.com"];
|
||||
let validUpstreams: any[] = ["1.1.1.1"];
|
||||
let validHosts: any[] = ["google.com", "test.com"];
|
||||
let validUpstreams: any[] = ["1.1.1.1", "69.126.24.175"];
|
||||
let handler: string = "reverse_proxy";
|
||||
|
||||
if (index != -1) {
|
||||
|
|
@ -90,6 +90,8 @@ export function RouteDialog({ route, routesMap }: { route: Route, routesMap: Rou
|
|||
"terminal": true
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(update.route))
|
||||
|
||||
if (index == -1) update.index = routesMap.length - 1;
|
||||
console.log(update.index)
|
||||
pushUpdate(update);
|
||||
|
|
@ -153,8 +155,7 @@ export function RouteDialog({ route, routesMap }: { route: Route, routesMap: Rou
|
|||
/>
|
||||
))}
|
||||
<Button type="submit">Save</Button>
|
||||
<Button type='button' onClick={() => { appendUpstreams('') }}>Add Host</Button>
|
||||
<Button type='button' onClick={() => { appendHosts('') }}>Add Upstream</Button>
|
||||
<Button type='button' onClick={() => { appendHosts('') }}>Add Host</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</DialogContent>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue