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)
|
body: JSON.stringify(route)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
//console.log(JSON.stringify(route));
|
||||||
|
|
||||||
if (!res.ok) return new NextResponse(JSON.stringify({ error: true, message: "Could not save route" }), {
|
if (!res.ok) return new NextResponse(JSON.stringify({ error: true, message: "Could not save route" }), {
|
||||||
status: 500,
|
status: 500,
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ export function RouteDialog({ route, routesMap }: { route: Route, routesMap: Rou
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let validHosts: any[] = ["google.com"];
|
let validHosts: any[] = ["google.com", "test.com"];
|
||||||
let validUpstreams: any[] = ["1.1.1.1"];
|
let validUpstreams: any[] = ["1.1.1.1", "69.126.24.175"];
|
||||||
let handler: string = "reverse_proxy";
|
let handler: string = "reverse_proxy";
|
||||||
|
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
|
|
@ -90,6 +90,8 @@ export function RouteDialog({ route, routesMap }: { route: Route, routesMap: Rou
|
||||||
"terminal": true
|
"terminal": true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(JSON.stringify(update.route))
|
||||||
|
|
||||||
if (index == -1) update.index = routesMap.length - 1;
|
if (index == -1) update.index = routesMap.length - 1;
|
||||||
console.log(update.index)
|
console.log(update.index)
|
||||||
pushUpdate(update);
|
pushUpdate(update);
|
||||||
|
|
@ -153,8 +155,7 @@ export function RouteDialog({ route, routesMap }: { route: Route, routesMap: Rou
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
<Button type="submit">Save</Button>
|
<Button type="submit">Save</Button>
|
||||||
<Button type='button' onClick={() => { appendUpstreams('') }}>Add Host</Button>
|
<Button type='button' onClick={() => { appendHosts('') }}>Add Host</Button>
|
||||||
<Button type='button' onClick={() => { appendHosts('') }}>Add Upstream</Button>
|
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue