This commit is contained in:
Mr Chen
2024-10-19 21:27:24 +08:00
parent d3e228bcd6
commit ce2affb119
6 changed files with 44 additions and 6 deletions
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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 = {})
+17
View File
@@ -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={})
+4
View File
@@ -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,
]
+17
View File
@@ -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"