mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Refactor manage_bunkerweb function call in instances route in web UI
This commit is contained in:
parent
046f46f768
commit
aa6089fd2d
1 changed files with 2 additions and 17 deletions
|
|
@ -818,24 +818,9 @@ def instances():
|
|||
):
|
||||
return redirect_flash_error("Missing operation parameter on /instances.", "instances")
|
||||
|
||||
app.config["RELOADING"] = True
|
||||
app.config["LAST_RELOAD"] = time()
|
||||
Thread(
|
||||
target=manage_bunkerweb,
|
||||
name="Reloading instances",
|
||||
args=("instances", request.form["INSTANCE_ID"]),
|
||||
kwargs={"operation": request.form["operation"]},
|
||||
).start()
|
||||
manage_bunkerweb("instances", request.form["INSTANCE_ID"], operation=request.form["operation"])
|
||||
|
||||
sleep(0.2)
|
||||
|
||||
return redirect(
|
||||
url_for(
|
||||
"loading",
|
||||
next=url_for("instances"),
|
||||
message=(f"{request.form['operation'].title()}ing" if request.form["operation"] != "stop" else "Stopping") + " instance",
|
||||
)
|
||||
)
|
||||
return redirect(url_for("instances"))
|
||||
|
||||
# Display instances
|
||||
instances = app.config["INSTANCES"].get_instances()
|
||||
|
|
|
|||
Loading…
Reference in a new issue