platypush/platypush/backend/http/app/routes/dashboard.py

26 lines
701 B
Python
Raw Normal View History

from flask import Blueprint, render_template
2020-11-21 01:12:08 +01:00
from platypush.backend.http.app import template_folder
from platypush.backend.http.app.utils import authenticate, get_websocket_port
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
# noinspection PyUnusedLocal
2020-11-21 01:12:08 +01:00
@dashboard.route('/dashboard/<name>', methods=['GET'])
@authenticate()
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())
# vim:sw=4:ts=4:et: