mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:29:26 +08:00
update
This commit is contained in:
@@ -282,13 +282,14 @@ def _read_conf(path, l=None):
|
||||
return json.loads(conf)
|
||||
|
||||
def getBlackList():
|
||||
_black_list = getServerDir + "/black_list.json"
|
||||
_black_list = getServerDir() + "/black_list.json"
|
||||
conf = _read_conf(_black_list, l=1)
|
||||
if not conf:
|
||||
return ''
|
||||
if not conf:
|
||||
return []
|
||||
return "\n".join(conf)
|
||||
content = "\n".join(conf)
|
||||
return mw.returnJson(True, 'ok', content)
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
@@ -318,5 +319,7 @@ if __name__ == "__main__":
|
||||
print(configTpl())
|
||||
elif func == 'read_config_tpl':
|
||||
print(readConfigTpl())
|
||||
elif func == 'get_black_list':
|
||||
print(getBlackList())
|
||||
else:
|
||||
print('error')
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"path": "server/fail2ban",
|
||||
"display": 1,
|
||||
"author": "fail2ban",
|
||||
"date": "2025-07-28",
|
||||
"date": "2024-07-28",
|
||||
"home": "https://www.fail2ban.org",
|
||||
"type": 0,
|
||||
"pid": "4"
|
||||
|
||||
@@ -81,4 +81,9 @@ function f2bBanIp(){
|
||||
matchBrackets:true,
|
||||
});
|
||||
editor.focus();
|
||||
|
||||
f2bPost('get_black_list', '', {}, function(data){
|
||||
console.log(data);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ def getGogsConf():
|
||||
result = []
|
||||
|
||||
for g in gets:
|
||||
rep = g['name'] + '\s*=\s*(.*)'
|
||||
rep = g['name'] + '\\s*=\\s*(.*)'
|
||||
tmp = re.search(rep, conf)
|
||||
if not tmp:
|
||||
continue
|
||||
@@ -447,7 +447,7 @@ def submitGogsConf():
|
||||
conf = mw.readFile(filename)
|
||||
for g in gets:
|
||||
if g in args:
|
||||
rep = g + '\s*=\s*(.*)'
|
||||
rep = g + '\\s*=\\s*(.*)'
|
||||
val = g + ' = ' + args[g]
|
||||
conf = re.sub(rep, val, conf)
|
||||
mw.writeFile(filename, conf)
|
||||
|
||||
@@ -14,4 +14,10 @@ from flask import Blueprint, render_template
|
||||
blueprint = Blueprint('config', __name__, url_prefix='/config', template_folder='../../templates/default')
|
||||
@blueprint.route('/index', endpoint='index')
|
||||
def index():
|
||||
return render_template('config.html', data={})
|
||||
return render_template('config.html', data={})
|
||||
|
||||
|
||||
|
||||
@blueprint.route('/get_panel_list', endpoint='get_panel_list', methods=['POST'])
|
||||
def get_panel_list():
|
||||
return []
|
||||
@@ -14,4 +14,10 @@ from flask import Blueprint, render_template
|
||||
blueprint = Blueprint('plugins', __name__, url_prefix='/plugins', template_folder='../../templates/default')
|
||||
@blueprint.route('/index', endpoint='index')
|
||||
def index():
|
||||
return render_template('plugins.html', data={})
|
||||
return render_template('plugins.html', data={})
|
||||
|
||||
|
||||
# 插件列表
|
||||
@blueprint.route('/list', endpoint='list', methods=['GET'])
|
||||
def list():
|
||||
return []
|
||||
Reference in New Issue
Block a user