diff --git a/class/public.py b/class/public.py index ad9e8c57b..4e89186cb 100755 --- a/class/public.py +++ b/class/public.py @@ -17,7 +17,6 @@ sys.path.append(os.getcwd() + "/class/") import db from random import Random -# from flask import jsonify def getRunDir(): @@ -35,6 +34,32 @@ def M(table): return sql.table(table) +def getWebPage(data, args): + # 取分页 + import page + # 实例化分页类 + page = page.Page() + info = {} + info['count'] = len(data) + + info['row'] = 10 + if hasattr(args, 'row'): + info['row'] = args['row'] + + info['p'] = 1 + if hasattr(args, 'p'): + info['p'] = int(get['p']) + info['uri'] = {} + info['return_js'] = '' + if hasattr(args, 'tojs'): + info['return_js'] = args.tojs + + # 获取分页数据 + result = {} + result['page'] = page.GetPage(info) + return result + + def md5(str): # 生成MD5 try: @@ -195,7 +220,7 @@ def httpGet(url, timeout=30): response = urllib2.urlopen(url, timeout=timeout) return response.read() except Exception, ex: - #WriteLog('网络诊断',str(ex) + '['+url+']'); + # WriteLog('网络诊断',str(ex) + '['+url+']'); return str(ex) @@ -214,7 +239,7 @@ def httpPost(url, data, timeout=30): response = urllib2.urlopen(req, timeout=timeout) return response.read() except Exception, ex: - #WriteLog('网络诊断',str(ex) + '['+url+']'); + # WriteLog('网络诊断',str(ex) + '['+url+']'); return str(ex) diff --git a/plugins/redis/ico.png b/plugins/redis/ico.png new file mode 100755 index 000000000..213a58309 Binary files /dev/null and b/plugins/redis/ico.png differ diff --git a/plugins/redis/index.html b/plugins/redis/index.html new file mode 100755 index 000000000..cf0b57f1b --- /dev/null +++ b/plugins/redis/index.html @@ -0,0 +1,550 @@ + + + +
+
+
+

密钥

+

面板设置

+

面板登录日志

+

SSH设置

+

SSH日志管理

+
+
+
+

+ 密钥: + +

+ +
    +
  • 宝塔企业运维后台连接您的服务器需要此密钥,请妥善记录并保存
  • +
  • 一但密钥丢失,可能导致您无法登录服务器
  • +
+
+ + + + +
+
+
+ \ No newline at end of file diff --git a/plugins/redis/info.json b/plugins/redis/info.json new file mode 100755 index 000000000..9fc21b4fe --- /dev/null +++ b/plugins/redis/info.json @@ -0,0 +1,19 @@ +{ + "sort": 7, + "ps": "最流行的SVN代码共享管理软件", + "shell": "install.sh", + "name": "redis", + "title": "Redis", + "default": false, + "versions":[ + {"status":false,"version":"1.0"} + ], + "tip": "soft", + "checks": "/www/server/php/VERSION/bin/php", + "display": 1, + "author": "Zend", + "date": "2017-04-01", + "home": "https://www.collab.net", + "type": "语言解释器", + "pid": "2" +} \ No newline at end of file diff --git a/plugins/redis/install.sh b/plugins/redis/install.sh new file mode 100755 index 000000000..c5c00a834 --- /dev/null +++ b/plugins/redis/install.sh @@ -0,0 +1,36 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") + + +install_tmp=${rootPath}/tmp/bt_install.pl + +echo "Install_csvn" + +mkdir -p $serverPath/redis + +Install_csvn() +{ + echo '正在安装脚本文件...' > $install_tmp + + echo '安装完成' > $install_tmp + +} + +Uninstall_csvn() +{ + echo "Uninstall_csvn" +} + + +action=$1 +if [ "${1}" == 'install' ];then + Install_csvn +else + Uninstall_csvn +fi diff --git a/plugins/score/install.sh b/plugins/score/install.sh index c69f4a349..716fa80ea 100755 --- a/plugins/score/install.sh +++ b/plugins/score/install.sh @@ -6,7 +6,7 @@ curPath=`pwd` rootPath=$(dirname "$curPath") rootPath=$(dirname "$rootPath") -install_tmp=${rootPath}'/tmp/bt_install.pl' +install_tmp=${rootPath}/tmp/bt_install.pl Install_score() { diff --git a/route/plugins.py b/route/plugins.py index 067a5e444..cd25253cf 100644 --- a/route/plugins.py +++ b/route/plugins.py @@ -68,7 +68,8 @@ def list(): pass ret['data'] = plugins_info - ret['list'] = get_page(plugins_info, request.args) + # request.args['row'] = __row_num + ret['list'] = public.getWebPage(plugins_info, request.args) return jsonify(ret) diff --git a/route/task.py b/route/task.py index 831741e7a..f59537db2 100644 --- a/route/task.py +++ b/route/task.py @@ -20,3 +20,9 @@ def index(): def count(): c = public.M('tasks').where("status!=?", ('1',)).count() return str(c) + + +@task.route("/list") +def list(): + c = public.M('tasks').where("status!=?", ('1',)).count() + return str(c) diff --git a/scripts/GetOS.sh b/scripts/GetOS.sh new file mode 100755 index 000000000..9b93a3a74 --- /dev/null +++ b/scripts/GetOS.sh @@ -0,0 +1,26 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then + OSNAME='CentOS' +elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then + OSNAME='RHEL' +elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then + OSNAME='Aliyun' +elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then + OSNAME='Fedora' +elif grep -Eqi "Amazon Linux AMI" /etc/issue || grep -Eq "Amazon Linux AMI" /etc/*-release; then + OSNAME='Amazon' +elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then + OSNAME='Debian' +elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then + OSNAME='Ubuntu' +elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then + OSNAME='Raspbian' +elif grep -Eqi "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then + OSNAME='Deepin' +else + OSNAME='unknow' +fi + +echo "$OSNAME" > /www/server/panel/data/osname.pl \ No newline at end of file