示例#1
0
import tornado.web
from tornado.escape import url_escape, url_unescape

from temboardui.web import (
    Blueprint,
    HTTPError,
    Redirect,
    TemplateRenderer,
)

PLUGIN_NAME = 'pgconf'
logger = logging.getLogger(__name__)
blueprint = Blueprint()
blueprint.generic_proxy("/pgconf/configuration", methods=["POST"])
plugin_path = path.dirname(path.realpath(__file__))
render_template = TemplateRenderer(plugin_path + "/templates")


def configuration(config):
    return {}


def get_routes(config):
    routes = blueprint.rules + [
        (r"/js/pgconf/(.*)", tornado.web.StaticFileHandler, {
            'path': plugin_path + "/static/js"
        }),
        (r"/css/pgconf/(.*)", tornado.web.StaticFileHandler, {
            'path': plugin_path + "/static/css"
        }),
    ]
示例#2
0
from os.path import realpath

import tornado.web
from tornado.escape import json_encode

from temboardui.temboardclient import TemboardError
from temboardui.web import (
    Blueprint,
    TemplateRenderer,
)

blueprint = Blueprint()
blueprint.generic_proxy(r"/dashboard")
logger = logging.getLogger(__name__)
plugin_path = realpath(__file__ + '/..')
render_template = TemplateRenderer(plugin_path + '/templates')

PLUGIN_NAME = 'dashboard'


def configuration(config):
    return {}


def get_routes(config):
    routes = blueprint.rules + [
        (r"/js/dashboard/(.*)", tornado.web.StaticFileHandler, {
            'path': plugin_path + "/static/js"
        }),
    ]
    return routes
示例#3
0
from os.path import realpath

from temboardui.web import (
    Blueprint,
    TemplateRenderer,
)

blueprint = Blueprint()
render_template = TemplateRenderer(realpath(__file__ + '/../../templates'))