This commit is contained in:
midoks 2019-02-21 23:05:09 +08:00
parent d97d1c5c60
commit 6cc3ce7f05
7 changed files with 45 additions and 1 deletions

1
.gitignore vendored
View File

@ -117,3 +117,4 @@ data/json/index.json
data/json/config.json
data/site.pl
data/admin_path.pl
data/close.pl

View File

@ -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')

View File

@ -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):

View File

@ -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

View File

@ -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()

View File

@ -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']});

View File

@ -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>