mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 02:39:26 +08:00
update
This commit is contained in:
@@ -26,6 +26,8 @@ socketio = SocketIO(manage_session=False, async_mode='threading',
|
||||
app = Flask(__name__, template_folder='templates/default')
|
||||
socketio.init_app(app, cors_allowed_origins="*")
|
||||
|
||||
from whitenoise import WhiteNoise
|
||||
app.wsgi_app = WhiteNoise(app.wsgi_app, root="../web/static/", prefix="static/", max_age=604800)
|
||||
|
||||
# 加载模块
|
||||
from .submodules import get_submodules
|
||||
@@ -51,6 +53,4 @@ app.logger.debug("Python syspath: %s", sys.path)
|
||||
# cli_mode = False
|
||||
# if app_name.endswith('-cli'):
|
||||
# cli_mode = True
|
||||
|
||||
|
||||
# return app
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
blueprint = Blueprint('dashboard', __name__, url_prefix='/')
|
||||
blueprint = Blueprint('dashboard', __name__, url_prefix='/', template_folder='../../templates/default')
|
||||
@blueprint.route('/')
|
||||
def index():
|
||||
return "dashboard"
|
||||
return render_template('index.html', data = {})
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# coding:utf-8
|
||||
|
||||
# ---------------------------------------------------------------------------------
|
||||
# MW-Linux面板
|
||||
# ---------------------------------------------------------------------------------
|
||||
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved.
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: midoks <midoks@163.com>
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
blueprint = Blueprint('site', __name__, url_prefix='/site', template_folder='../../templates/default')
|
||||
@blueprint.route('/index', endpoint='index')
|
||||
def index():
|
||||
return render_template('site.html', data={})
|
||||
@@ -1,7 +1,11 @@
|
||||
|
||||
from .dashboard import blueprint as DashboardModule
|
||||
from .site import blueprint as SiteModule
|
||||
from .task import blueprint as TaskModule
|
||||
|
||||
def get_submodules():
|
||||
return [
|
||||
DashboardModule,
|
||||
SiteModule,
|
||||
TaskModule,
|
||||
]
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# coding:utf-8
|
||||
|
||||
# ---------------------------------------------------------------------------------
|
||||
# MW-Linux面板
|
||||
# ---------------------------------------------------------------------------------
|
||||
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved.
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Author: midoks <midoks@163.com>
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
blueprint = Blueprint('task', __name__, url_prefix='/task', template_folder='../../templates/default')
|
||||
@blueprint.route('/count', endpoint='task_count')
|
||||
def task_count():
|
||||
return "0"
|
||||
Reference in New Issue
Block a user