This commit is contained in:
Mr Chen
2024-11-03 03:06:40 +08:00
parent 745d95bbcb
commit 06d43efd7f
4 changed files with 16 additions and 3 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
CREATE TABLE IF NOT EXISTS `network` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`up` INTEGER,
`down` INTEGER,
`up` REAL,
`down` REAL,
`total_up` INTEGER,
`total_down` INTEGER,
`down_packets` INTEGER,
+12
View File
@@ -172,6 +172,18 @@ def open_debug():
return mw.returnData(True, '开发模式开启!')
# 设置面板开关
@blueprint.route('/close_panel', endpoint='close_panel', methods=['POST'])
@panel_login_required
def close_panel():
admin_close = model.getOption('admin_close',default='no')
if admin_close == 'no':
model.setOption('admin_close','yes')
return mw.returnData(True, '开启面板成功!')
model.setOption('admin_close','no')
return mw.returnData(True, '关闭面板成功!')
# 设置站点状态
@blueprint.route('/set_port', endpoint='set_port', methods=['POST'])
@panel_login_required
+1 -1
View File
@@ -10,7 +10,7 @@
<div class="ss-text pull-left mr50">
<em>关闭面板</em>
<div class="ssh-item">
<input class="btswitch btswitch-ios" id="closePl" type="checkbox">
<input class="btswitch btswitch-ios" id="closePl" type="checkbox" {%if data['admin_close']=='yes' %}checked{%endif%}>
<label class="btswitch-btn" for="closePl" onclick="closePanel()"></label>
</div>
</div>
+1
View File
@@ -49,6 +49,7 @@ def getGlobalVar():
data['backup_path'] = model.getOption('backup_path', default=mw.getFatherDir()+'/backup')
data['admin_path'] = '/'+model.getOption('admin_path', default='')
data['debug'] = model.getOption('debug', default='close')
data['admin_close'] = model.getOption('admin_close', default='no')
data['site_count'] = model.getSitesCount()
data['port'] = mw.getHostPort()