mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -183,6 +183,20 @@ def close_panel():
|
||||
model.setOption('admin_close','no')
|
||||
return mw.returnData(True, '关闭面板成功!')
|
||||
|
||||
# 设置IPV6状态
|
||||
@blueprint.route('/set_ipv6_status', endpoint='set_ipv6_status', methods=['POST'])
|
||||
@panel_login_required
|
||||
def set_ipv6_status():
|
||||
__file = mw.getCommonFile()
|
||||
ipv6_file = __file['ipv6']
|
||||
if os.path.exists(ipv6_file):
|
||||
os.remove(ipv6_file)
|
||||
mw.returnData('面板设置', '关闭面板IPv6兼容!')
|
||||
else:
|
||||
mw.writeFile(ipv6_file, 'True')
|
||||
mw.writeLog('面板设置', '开启面板IPv6兼容!')
|
||||
mw.restartMw()
|
||||
return mw.returnData(True, '设置成功!')
|
||||
|
||||
# 设置站点状态
|
||||
@blueprint.route('/set_port', endpoint='set_port', methods=['POST'])
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
# Author: midoks <midoks@163.com>
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
import os
|
||||
|
||||
from admin import model
|
||||
|
||||
import core.mw as mw
|
||||
@@ -53,6 +55,12 @@ def getGlobalVar():
|
||||
data['site_count'] = model.getSitesCount()
|
||||
data['port'] = mw.getHostPort()
|
||||
|
||||
__file = mw.getCommonFile()
|
||||
if os.path.exists(__file['ipv6']):
|
||||
data['ipv6'] = 'checked'
|
||||
else:
|
||||
data['ipv6'] = ''
|
||||
|
||||
# 获取未认证状态信息
|
||||
unauthorized_status = model.getOption('unauthorized_status', default='0')
|
||||
data['unauthorized_status'] = getUnauthStatus(code=unauthorized_status)
|
||||
|
||||
Reference in New Issue
Block a user