pull/109/head
Mr Chen 7 years ago
parent 029c68ebf5
commit a2217b1b28
  1. 2
      README.md
  2. 14
      class/public.py
  3. 0
      scripts/install.sh
  4. 16
      views/plugins.py

@ -3,7 +3,7 @@
### 自动安装
```
curl -fsSL https://raw.githubusercontent.com/midoks/mdweb/master/install/install.sh | sh
curl -fsSL https://raw.githubusercontent.com/midoks/mdweb/master/sciprts/install.sh | sh
```
### 手动操作

@ -6,7 +6,7 @@ import time
import string
def runDir():
def getRunDir():
return os.getcwd()
@ -26,10 +26,9 @@ def md5(str):
except:
return False
# 文件的MD5值
def GetFileMd5(filename):
# 文件的MD5值
if not os.path.isfile(filename):
return False
import hashlib
@ -43,10 +42,9 @@ def GetFileMd5(filename):
f.close()
return myhash.hexdigest()
# 取随机字符串
def GetRandomString(length):
# 取随机字符串
from random import Random
str = ''
chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789'
@ -92,10 +90,9 @@ def returnMsg(status, msg, args=()):
msg = msg.replace(rep, args[i])
return {'status': status, 'msg': msg}
# 取提示消息
def getMsg(key, args=()):
# 取提示消息
try:
import json
logMessage = json.loads(
@ -111,10 +108,9 @@ def getMsg(key, args=()):
except:
return key
# 取提示消息
def getLan(key):
# 取提示消息
import json
logMessage = json.loads(
readFile('static/language/' + get_language() + '/template.json'))

@ -16,15 +16,9 @@ import json
plugins = Blueprint('plugins', __name__, template_folder='templates')
__plugin_name = "plugins"
@plugins.route("/")
def index():
return render_template('default/ftp.html')
@plugins.route("/file", methods=['GET'])
def file():
name = request.args.get('name', '')
@ -78,11 +72,19 @@ def list():
@plugins.route("/install", methods=['POST'])
def install():
rundir = public.getRunDir()
name = request.form['name']
if name.strip() == '':
return ''
install = "plugins/" + name + "/install.sh"
infoJson = __plugin_name + "/" + name + "/info.json"
install = __plugin_name + "/" + name + "/install.sh"
pluginInfo = json.loads(public.readFile(infoJson))
print pluginInfo
print install
os.system('/bin/bash ' + install + ' install')
print request.args

Loading…
Cancel
Save