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