コード例 #1
0
from flask import Blueprint

from slick import app
from . import views

blueprint = Blueprint('dns_module',
                      __name__,
                      template_folder='templates',
                      url_prefix='/dns')

submenu = [
    ('dns_module.index', 'Zone Management'),
]

app.add_menu('left', submenu, 'Services', 4)

# Zone List
blueprint.add_url_rule('/', view_func=views.index)
blueprint.add_url_rule('/index', view_func=views.index)

# Zone View
blueprint.add_url_rule('/view/<int:zone_id>', view_func=views.zone_view)

# Record Add
blueprint.add_url_rule('/record/add/<int:zone_id>',
                       view_func=views.record_add,
                       methods=['GET', 'POST'])

# Record Delete
blueprint.add_url_rule('/record/delete/<int:record_id>',
                       view_func=views.record_delete)
コード例 #2
0
from flask import Blueprint

from slick import app
from . import views

blueprint = Blueprint('site_module', __name__, template_folder='templates')

app.add_menu('left', 'site_module.index', 'Dashboard', 0)

blueprint.add_url_rule('/', view_func=views.index)
blueprint.add_url_rule('/index', view_func=views.index)

blueprint.add_url_rule('/auth_qr_code.png', view_func=views.auth_qr_code)

blueprint.add_url_rule('/login',
                       view_func=views.login,
                       methods=['GET', 'POST'])

blueprint.add_url_rule('/logout', view_func=views.logout)

blueprint.add_url_rule('/login/twofactor',
                       view_func=views.two_factor_login,
                       methods=['GET', 'POST'])

blueprint.add_url_rule('/profile',
                       view_func=views.profile,
                       methods=['GET', 'POST'])

blueprint.add_url_rule('/search',
                       view_func=views.search,
                       methods=['GET', 'POST'])
コード例 #3
0
ファイル: __init__.py プロジェクト: RYWU/slick
from flask import Blueprint

blueprint = Blueprint('vm_module', __name__, template_folder='templates',
                      static_folder='static', url_prefix='/vm')

from slick import app
from . import views, widgets

submenu = [
    ('vm_module.index', 'List Instances'),
    ('vm_module.create', 'Create Instance'),
]
app.add_menu('left', submenu, 'Compute', 1)

for widget in widgets.get_widgets():
    app.add_widget(widget)

# VM Add
blueprint.add_url_rule('/add', view_func=views.create,
                       methods=['GET', 'POST'])

# VM Cancel
blueprint.add_url_rule('/cancel/<int:vm_id>', view_func=views.cancel)

# VM Edit
blueprint.add_url_rule('/edit/<int:vm_id>', view_func=views.edit,
                       methods=['GET', 'POST'])

# VM List
blueprint.add_url_rule('/', view_func=views.index)
blueprint.add_url_rule('/index', view_func=views.index)
コード例 #4
0
ファイル: __init__.py プロジェクト: RYWU/slick
from flask import Blueprint

from slick import app
from . import views

blueprint = Blueprint('dns_module', __name__, template_folder='templates',
                      url_prefix='/dns')

submenu = [
    ('dns_module.index', 'Zone Management'),
]

app.add_menu('left', submenu, 'Services', 4)

# Zone List
blueprint.add_url_rule('/', view_func=views.index)
blueprint.add_url_rule('/index', view_func=views.index)

# Zone View
blueprint.add_url_rule('/view/<int:zone_id>', view_func=views.zone_view)

# Record Add
blueprint.add_url_rule('/record/add/<int:zone_id>', view_func=views.record_add,
                       methods=['GET', 'POST'])

# Record Delete
blueprint.add_url_rule('/record/delete/<int:record_id>',
                       view_func=views.record_delete)

# Record Edit
blueprint.add_url_rule('/record/<int:record_id>', view_func=views.record_edit,
コード例 #5
0
ファイル: __init__.py プロジェクト: iblis17/slick
from flask import Blueprint

blueprint = Blueprint('vm_module',
                      __name__,
                      template_folder='templates',
                      static_folder='static',
                      url_prefix='/vm')

from slick import app
from . import views, widgets

submenu = [
    ('vm_module.index', 'List Instances'),
    ('vm_module.create', 'Create Instance'),
]
app.add_menu('left', submenu, 'Compute', 1)

for widget in widgets.get_widgets():
    app.add_widget(widget)

# VM Add
blueprint.add_url_rule('/add', view_func=views.create, methods=['GET', 'POST'])

# VM Cancel
blueprint.add_url_rule('/cancel/<int:vm_id>', view_func=views.cancel)

# VM Edit
blueprint.add_url_rule('/edit/<int:vm_id>',
                       view_func=views.edit,
                       methods=['GET', 'POST'])
コード例 #6
0
from flask import Blueprint

blueprint = Blueprint('network_module', __name__, template_folder='templates',
                      url_prefix='/network')

from slick import app
from . import views, widgets

submenu = [
    ('network_module.subnet_index', 'List Subnets'),
    ('network_module.vlan_index', 'List VLANs'),
]
app.add_menu('left', submenu, 'Networking', 3)

for widget in widgets.get_widgets():
    app.add_widget(widget)

# Subnet Cancel
blueprint.add_url_rule('/subnet/cancel/<int:subnet_id>',
                       view_func=views.subnet_cancel)

# Subnet Create
blueprint.add_url_rule('/subnet/create/<int:vlan_id>',
                       view_func=views.subnet_create, methods=['GET', 'POST'])

# Subnet List
blueprint.add_url_rule('/subnet', view_func=views.subnet_index)

# Subnet View
blueprint.add_url_rule('/subnet/view/<int:subnet_id>',
                       view_func=views.subnet_view)
コード例 #7
0
ファイル: __init__.py プロジェクト: RYWU/slick
from flask import Blueprint

from slick import app
from . import views

blueprint = Blueprint('site_module', __name__, template_folder='templates')

app.add_menu('left', 'site_module.index', 'Dashboard', 0)

blueprint.add_url_rule('/', view_func=views.index)
blueprint.add_url_rule('/index', view_func=views.index)

blueprint.add_url_rule('/auth_qr_code.png', view_func=views.auth_qr_code)

blueprint.add_url_rule('/login', view_func=views.login,
                       methods=['GET', 'POST'])

blueprint.add_url_rule('/logout', view_func=views.logout)

blueprint.add_url_rule('/login/twofactor',
                       view_func=views.two_factor_login,
                       methods=['GET', 'POST'])

blueprint.add_url_rule('/profile', view_func=views.profile,
                       methods=['GET', 'POST'])

blueprint.add_url_rule('/search', view_func=views.search,
                       methods=['GET', 'POST'])

blueprint.add_url_rule('/question',
                       view_func=views.security_question,
コード例 #8
0
ファイル: __init__.py プロジェクト: iblis17/slick
                      __name__,
                      template_folder='templates',
                      static_folder='static',
                      url_prefix='/server')

from slick import app
from . import views

submenu = [
    ('server_module.index', 'List Servers'),
    [[
        ('server_module.create_hourly', 'Hourly'),
        ('server_module.create_monthly', 'Monthly'),
    ], "Create"],
]
app.add_menu('left', submenu, 'Servers', 1)

# Servers Add
blueprint.add_url_rule('/add/hourly',
                       view_func=views.create_hourly,
                       methods=['GET', 'POST'])
blueprint.add_url_rule('/add/monthly', view_func=views.create_monthly)
blueprint.add_url_rule('/add/monthly/<int:package_id>',
                       view_func=views.create_monthly,
                       methods=['GET', 'POST'])

# Servers List
blueprint.add_url_rule('/', view_func=views.index)
blueprint.add_url_rule('/index', view_func=views.index)

# Server Price Check (AJAX call)