2020-11-28 15:28:09 +01:00
|
|
|
from flask import Blueprint, render_template
|
2019-02-23 21:19:00 +01:00
|
|
|
|
2020-11-21 01:12:08 +01:00
|
|
|
from platypush.backend.http.app import template_folder
|
2019-07-15 14:12:00 +02:00
|
|
|
from platypush.backend.http.app.utils import authenticate, get_websocket_port
|
2019-02-23 21:19:00 +01:00
|
|
|
from platypush.backend.http.utils import HttpUtils
|
|
|
|
|
|
|
|
dashboard = Blueprint('dashboard', __name__, template_folder=template_folder)
|
|
|
|
|
|
|
|
# Declare routes list
|
|
|
|
__routes__ = [
|
|
|
|
dashboard,
|
|
|
|
]
|
|
|
|
|
2019-07-07 20:11:32 +02:00
|
|
|
|
2020-11-28 15:28:09 +01:00
|
|
|
# noinspection PyUnusedLocal
|
2020-11-21 01:12:08 +01:00
|
|
|
@dashboard.route('/dashboard/<name>', methods=['GET'])
|
2019-07-15 14:12:00 +02:00
|
|
|
@authenticate()
|
2020-11-28 15:28:09 +01:00
|
|
|
def render_dashboard(name):
|
2020-11-21 01:12:08 +01:00
|
|
|
""" Route for the dashboard """
|
|
|
|
return render_template('index.html',
|
|
|
|
utils=HttpUtils,
|
|
|
|
websocket_port=get_websocket_port())
|
2019-02-23 21:19:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
# vim:sw=4:ts=4:et:
|