From d81a069d942117f8808be2c8bfaf44ce55919f71 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 27 Nov 2018 23:29:28 +0800 Subject: [PATCH] openresty --- class/core/{plugin.py => plugin_api.py} | 3 ++- plugins/openresty/install.sh | 16 ++++++++-------- route/plugins.py | 4 ++-- static/js/soft.js | 6 ++---- 4 files changed, 14 insertions(+), 15 deletions(-) rename class/core/{plugin.py => plugin_api.py} (95%) diff --git a/class/core/plugin.py b/class/core/plugin_api.py similarity index 95% rename from class/core/plugin.py rename to class/core/plugin_api.py index 3142c3c63..fdc0a3998 100755 --- a/class/core/plugin.py +++ b/class/core/plugin_api.py @@ -8,10 +8,11 @@ import re import json -class plugin: +class plugin_api: __tasks = None __plugin_dir = "plugins" __type = "data/json/type.json" + __index = 'data/json/index.json' setupPath = None def __init__(self): diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index e2e4ce6c3..11896308a 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -9,27 +9,27 @@ serverPath=$(dirname "$rootPath") install_tmp=${rootPath}/tmp/bt_install.pl +openrestyDir=${serverPath}/source/openresty Install_openresty() { - mkdir -p $serverPath/tmp + mkdir -p ${openrestyDir} echo '正在安装脚本文件...' > $install_tmp - if [ ! -d $serverPath/tmp/openresty.tar.gz ];then - wget -O $serverPath/tmp/openresty.tar.gz https://openresty.org/download/openresty-1.13.6.2.tar.gz + if [ ! -f ${openrestyDir}/openresty-1.13.6.2.tar.gz ];then + wget -O ${openrestyDir}/openresty-1.13.6.2.tar.gz https://openresty.org/download/openresty-1.13.6.2.tar.gz fi - cd $serverPath/tmp && tar -zxvf openresty.tar.gz + cd ${openrestyDir} && tar -zxvf openresty-1.13.6.2.tar.gz - mkdir -p $serverPath/openresty - cd $serverPath/tmp/openresty* && ./configure --prefix=$serverPath/openresty \ - --with-openssl=$serverPath/tmp/openssl-1.0.2q && make && make install + cd ${openrestyDir}/openresty* && ./configure --prefix=$serverPath/openresty \ + --with-openssl=$serverPath/source/lib/openssl-1.0.2q && make && make install echo '安装完成' > $install_tmp } Uninstall_openresty() { - rm -f $serverPath/openresty + rm -rf $serverPath/openresty echo '卸载完成' > $install_tmp } diff --git a/route/plugins.py b/route/plugins.py index f82d86fd7..fa181318e 100644 --- a/route/plugins.py +++ b/route/plugins.py @@ -12,7 +12,7 @@ import json sys.path.append("class/core") import public -import plugin +import plugin_api plugins = Blueprint('plugins', __name__, template_folder='templates') @@ -41,7 +41,7 @@ def file(): @plugins.route('/list', methods=['GET', 'POST']) def list(): typeVal = request.args.get('type', '0') - data = plugin.plugin().getPluginList(typeVal, 1) + data = plugin_api.plugin_api().getPluginList(typeVal, 1) return public.getJson(data) diff --git a/static/js/soft.js b/static/js/soft.js index 5e2225507..d493c3cd2 100755 --- a/static/js/soft.js +++ b/static/js/soft.js @@ -262,8 +262,7 @@ function oneInstall(name, version) { closeBtn: 2, shadeClose: true, content: "
\ -
" + lan.soft.install_version + ":" + name + " " + version + "" + optw + "
\ -
" + lan.bt.install_type + ":
\ +
安装版本:" + name + " " + version + "" + optw + "
\
\ \ \ @@ -359,8 +358,7 @@ function AddVersion(name, ver, type, obj, title) { closeBtn: 2, shadeClose: true, content: "
\ -
" + lan.soft.install_version + ":
\ -
" + lan.bt.install_type + ":
\ +
安装版本:
\
\ \ \