From 26a677be537db061c69e0005eb204ef007e0839a Mon Sep 17 00:00:00 2001 From: michael-grace Date: Mon, 9 Nov 2020 00:17:48 +0000 Subject: [PATCH] pure json status page --- server.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index bd8e707..832a719 100644 --- a/server.py +++ b/server.py @@ -114,7 +114,7 @@ def ui_config(): @app.route("/status") def ui_status(): channel_states = [] - for i in range(3): + for i in range(state.state["num_channels"]): channel_states.append(status(i)) data = { @@ -124,6 +124,17 @@ def ui_status(): } return render_template('status.html', data=data) + +@app.route("/status-json") +def json_status(): + channel_states = [] + for i in range(state.state["num_channels"]): + channel_states.append(status(i)) + return { + "server": state.state, + "channels": channel_states + } + # Channel Audio Options