forked from Github/frigate
Add Save Only button to config editor (#5090)
* Add Save Only button to save config without restarting * Fixes * fix formatting * change to query parameter from header * lint fixes
This commit is contained in:
@@ -710,6 +710,8 @@ def config_raw():
|
||||
|
||||
@bp.route("/config/save", methods=["POST"])
|
||||
def config_save():
|
||||
save_option = request.args.get("save_option")
|
||||
|
||||
new_config = request.get_data().decode()
|
||||
|
||||
if not new_config:
|
||||
@@ -753,13 +755,16 @@ def config_save():
|
||||
400,
|
||||
)
|
||||
|
||||
try:
|
||||
restart_frigate()
|
||||
except Exception as e:
|
||||
logging.error(f"Error restarting Frigate: {e}")
|
||||
return "Config successfully saved, unable to restart Frigate", 200
|
||||
if save_option == "restart":
|
||||
try:
|
||||
restart_frigate()
|
||||
except Exception as e:
|
||||
logging.error(f"Error restarting Frigate: {e}")
|
||||
return "Config successfully saved, unable to restart Frigate", 200
|
||||
|
||||
return "Config successfully saved, restarting...", 200
|
||||
return "Config successfully saved, restarting...", 200
|
||||
else:
|
||||
return "Config successfully saved.", 200
|
||||
|
||||
|
||||
@bp.route("/config/schema.json")
|
||||
|
||||
Reference in New Issue
Block a user