update
This commit is contained in:
parent
d97d1c5c60
commit
6cc3ce7f05
|
|
@ -117,3 +117,4 @@ data/json/index.json
|
|||
data/json/config.json
|
||||
data/site.pl
|
||||
data/admin_path.pl
|
||||
data/close.pl
|
||||
|
|
|
|||
|
|
@ -16,13 +16,24 @@ from random import Random
|
|||
import public
|
||||
import db
|
||||
|
||||
from flask import redirect
|
||||
|
||||
|
||||
def init():
|
||||
|
||||
checkClose()
|
||||
|
||||
initDB()
|
||||
initInitD()
|
||||
initUserInfo()
|
||||
|
||||
|
||||
# 检查面板是否关闭
|
||||
def checkClose():
|
||||
if os.path.exists('data/close.pl'):
|
||||
return redirect('/close')
|
||||
|
||||
|
||||
def initDB():
|
||||
try:
|
||||
sql = db.Sql().dbfile('default')
|
||||
|
|
|
|||
|
|
@ -144,6 +144,10 @@ class config_api:
|
|||
public.execShell("chown root.root " + filename)
|
||||
return public.returnJson(True, '面板已关闭!')
|
||||
|
||||
def getApi(self):
|
||||
data = {}
|
||||
|
||||
return public.getJson(data)
|
||||
##### ----- end ----- ###
|
||||
|
||||
def getVersion(self):
|
||||
|
|
|
|||
|
|
@ -683,6 +683,7 @@ class plugins_api:
|
|||
if not os.path.exists(path):
|
||||
return ('', '')
|
||||
data = public.execShell(py_cmd)
|
||||
# data = os.popen(py_cmd).read()
|
||||
|
||||
if public.isAppleSystem():
|
||||
print py_cmd
|
||||
|
|
|
|||
|
|
@ -112,6 +112,15 @@ def test():
|
|||
return public.getLocalIp()
|
||||
|
||||
|
||||
@app.route('/close')
|
||||
def close():
|
||||
if not os.path.exists('data/close.pl'):
|
||||
return redirect('/')
|
||||
data = {}
|
||||
data['cmd'] = 'rm -rf ' + public.getRunDir() + '/data/close.pl'
|
||||
return render_template('close.html', data=data)
|
||||
|
||||
|
||||
@app.route("/code")
|
||||
def code():
|
||||
import vilidate
|
||||
|
|
@ -140,7 +149,7 @@ def checkLogin():
|
|||
|
||||
@app.route("/login")
|
||||
def login():
|
||||
print session
|
||||
# print session
|
||||
dologin = request.args.get('dologin', '')
|
||||
if dologin == 'True':
|
||||
session.clear()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
|
||||
$.post('/config/get','',function(rdata){
|
||||
console.log(rdata);
|
||||
},'json');
|
||||
|
||||
|
||||
$(".set-submit").click(function(){
|
||||
var data = $("#set_config").serialize();
|
||||
layer.msg('正在保存配置...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>抱歉,管理员已关闭面板</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>开启命令</h1>
|
||||
<p>{{data['cmd']}}</p>
|
||||
<hr>
|
||||
<!-- <address>Linux面板<a href="" target="_blank">请求帮助</a></address> -->
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue