mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 05:59:25 +08:00
up
This commit is contained in:
@@ -72,10 +72,6 @@ def GetRandomString(length):
|
||||
return str
|
||||
|
||||
|
||||
def retJson(status, msg, data=()):
|
||||
return jsonify({'status': status, 'msg': msg, 'data': data})
|
||||
|
||||
|
||||
def getJson(data):
|
||||
import json
|
||||
return json.dumps(data)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{
|
||||
"sort": 7,
|
||||
"ps": "最流行的SVN代码共享管理软件",
|
||||
"install": "install.sh",
|
||||
"uninstall": "uninstall.sh",
|
||||
"shell": "install.sh",
|
||||
"name": "csvn",
|
||||
"title": "CSVN",
|
||||
"default": false,
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
"type":"扩展",
|
||||
"ps":"测试服务器基础性能!",
|
||||
"versions":"1.3",
|
||||
"install":"install.sh",
|
||||
"uninstall":"uninstall.sh",
|
||||
"shell":"install.sh",
|
||||
"checks":"/www/server/panel/plugin/score",
|
||||
"author":"mdserver-web",
|
||||
"home":"github.com/midoks/mdserver-web",
|
||||
|
||||
+7
-3
@@ -77,6 +77,7 @@ def install():
|
||||
|
||||
rundir = public.getRunDir()
|
||||
name = request.form.get('name', '')
|
||||
version = request.form.get('version', '')
|
||||
|
||||
mmsg = '安装'
|
||||
if hasattr(request.form, 'upgrade'):
|
||||
@@ -84,7 +85,10 @@ def install():
|
||||
mmsg = 'upgrade'
|
||||
|
||||
if name.strip() == '':
|
||||
return public.retJson(-1, "缺少name数据!", ())
|
||||
return public.returnJson(-1, "缺少name数据!", ())
|
||||
|
||||
if version.strip() == '':
|
||||
return public.returnJson(-1, "缺少版本信息!", ())
|
||||
|
||||
infoJsonPos = __plugin_name + '/' + name + '/' + 'info.json'
|
||||
|
||||
@@ -94,9 +98,9 @@ def install():
|
||||
pluginInfo = json.loads(public.readFile(infoJsonPos))
|
||||
|
||||
execstr = "cd " + os.getcwd() + "/plugins/" + \
|
||||
name + " && /bin/bash " + pluginInfo["install"]
|
||||
name + " && /bin/bash " + pluginInfo["shell"] + " install" + version
|
||||
|
||||
taskAdd = (None, mmsg + '[' + name + '-' + "1" + ']',
|
||||
taskAdd = (None, mmsg + '[' + name + '-' + version + ']',
|
||||
'execshell', '0', time.strftime('%Y-%m-%d %H:%M:%S'), execstr)
|
||||
|
||||
public.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd)
|
||||
|
||||
Reference in New Issue
Block a user