From c85152e85abbbebc05cb19c46b8bf18aa3b48c6c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 25 Oct 2018 19:32:21 +0800 Subject: [PATCH] update --- app.py | 3 +++ data/default.db | Bin 17408 -> 17408 bytes route/plugins.py | 16 ++++++++++++++-- templates/default/layout.html | 4 ++-- test/index.html | 1 - 5 files changed, 19 insertions(+), 5 deletions(-) delete mode 100644 test/index.html diff --git a/app.py b/app.py index 704b53f3d..bd1260bb4 100644 --- a/app.py +++ b/app.py @@ -4,6 +4,9 @@ import sys import io import os +reload(sys) +sys.setdefaultencoding('utf8') + import route from flask import Flask from datetime import timedelta diff --git a/data/default.db b/data/default.db index 1145da3e2b1593d3e714010e2d2cd711bbad4018..e56a78de4e5c29cf1d851fe1f457073b10942785 100755 GIT binary patch delta 303 zcmZqZU~K4MoFL7pI8nx#RgpnYrD0>r0(L%D<`WFeUzwjX-(|kcd}6a8%Qj|iPF7}d z#*)P1>|*xKm$?m1cvzSf7?@8mPhgHD1JeKl^#kVv-2>CJ5d^~nv(pPP JG_wQ*`~#QD5SIV| diff --git a/route/plugins.py b/route/plugins.py index 6392b962f..f8a0c6ea0 100644 --- a/route/plugins.py +++ b/route/plugins.py @@ -76,6 +76,11 @@ def install(): rundir = public.getRunDir() name = request.form.get('name', '') + mmsg = '安装' + if hasattr(request.form, 'upgrade'): + mtype = 'update' + mmsg = 'upgrade' + if name.strip() == '': return public.retJson(-1, "缺少name数据!", ()) @@ -86,8 +91,15 @@ def install(): pluginInfo = json.loads(public.readFile(infoJsonPos)) - sh = __plugin_name + '/' + name + '/' + pluginInfo['shell'] - os.system('/bin/bash ' + sh + ' install') + print name + taskAdd = (None, mmsg + '[' + name + '-' + "1" + ']', + 'execshell', '0', time.strftime('%Y-%m-%d %H:%M:%S'), '1') + + print taskAdd + public.M('tasks').add('id,name,type,status,addtime, execstr', taskAdd) + + # sh = __plugin_name + '/' + name + '/' + pluginInfo['shell'] + # os.system('/bin/bash ' + sh + ' install') print request.args return '' diff --git a/templates/default/layout.html b/templates/default/layout.html index 0702eabe2..4f877b544 100755 --- a/templates/default/layout.html +++ b/templates/default/layout.html @@ -5,7 +5,7 @@ - MDWEB-Linux面板 + mdserver-web|linux面板 @@ -49,7 +49,7 @@ {% block content %}{% endblock %} - + diff --git a/test/index.html b/test/index.html deleted file mode 100644 index b2d525b29..000000000 --- a/test/index.html +++ /dev/null @@ -1 +0,0 @@ -index \ No newline at end of file