svc: Save config after navigation
Some checks failed
dustin/hudctrl/pipeline/head There was a failure building this commit
Some checks failed
dustin/hudctrl/pipeline/head There was a failure building this commit
When a makes a *POST /screen/{name}/navigate* HTTP request, the URL list
is updated and saved to the configuration file. This provides a
mechanism for configuring the URL list, since it is now part of the
display configuration file and not a separate file manged externally.
This commit is contained in:
@@ -137,8 +137,14 @@ async def get_screenshot(
|
||||
'/screen/{name}/navigate',
|
||||
response_class=fastapi.responses.PlainTextResponse,
|
||||
)
|
||||
async def navigate(name: str, url: str = fastapi.Form(...)):
|
||||
async def navigate(
|
||||
bgtasks: fastapi.BackgroundTasks,
|
||||
name: str,
|
||||
url: str = fastapi.Form(...),
|
||||
):
|
||||
await svc.navigate(name, url)
|
||||
svc.urls[name] = url
|
||||
bgtasks.add_task(svc.save_config)
|
||||
|
||||
|
||||
@app.on_event('shutdown')
|
||||
|
||||
Reference in New Issue
Block a user