diff --git a/class/core/files_api.py b/class/core/files_api.py index 11ae5b62a..9bf635145 100755 --- a/class/core/files_api.py +++ b/class/core/files_api.py @@ -134,6 +134,36 @@ class files_api: # self.setFileAccept(path + '/' + filename) return public.returnJson(True, '已将下载任务添加到队列!') + def removeTaskApi(self): + mid = request.form.get('id', '').encode('utf-8') + try: + name = public.M('tasks').where('id=?', (mid,)).getField('name') + status = public.M('tasks').where('id=?', (mid,)).getField('status') + public.M('tasks').delete(mid) + if status == '-1': + os.system( + "kill `ps -ef |grep 'python panelSafe.pyc'|grep -v grep|grep -v panelExec|awk '{print $2}'`") + os.system( + "kill `ps aux | grep 'python task.pyc$'|awk '{print $2}'`") + os.system(''' +pids=`ps aux | grep 'sh'|grep -v grep|grep install|awk '{print $2}'` +arr=($pids) + +for p in ${arr[@]} +do + kill -9 $p +done + ''') + + os.system( + 'rm -f ' + name.replace('扫描目录[', '').replace(']', '') + '/scan.pl') + isTask = public.getRootDir() + '/tmp/panelTask.pl' + public.writeFile(isTask, 'True') + os.system('/etc/init.d/mw start') + except: + os.system('/etc/init.d/mw start') + return public.returnJson(True, '任务已删除!') + def getRecycleBinApi(self): rPath = self.rPath if not os.path.exists(rPath): diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index 5f24b0a2d..90f6a0823 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -232,7 +232,6 @@ class plugins_api: return isTask def checkStatus(self, info): - if not info['setup']: return False diff --git a/plugins/php/versions/72/redis.sh b/plugins/php/versions/72/redis.sh new file mode 100755 index 000000000..47544c9f8 --- /dev/null +++ b/plugins/php/versions/72/redis.sh @@ -0,0 +1,90 @@ +#!/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") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=redis +sysName=`uname` +actionType=$1 +version=$2 + +extDir=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20170718/ + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + extFile=$extDir${LIBNAME}.so + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_${version}_lib + mkdir -p $php_lib + + if [ ! -f $php_lib/redis-4.2.0.tgz ];then + wget -O $php_lib/redis-4.2.0.tgz http://pecl.php.net/get/redis-4.2.0.tgz + fi + + cd $php_lib && tar xvf redis-4.2.0.tgz + cd redis-4.2.0 + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config + make && make install + + cd $php_lib + rm -rf redis-* + rm -f package.xml + fi + sleep 1 + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + echo "extension=redis.so" >> $serverPath/php/$version/etc/php.ini + + $serverPath/php/init.d/php$version reload + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php$version 未安装,请选择其它版本!" + return + fi + + extFile=$extDir${LIBNAME}.so + if [ ! -f "$extFile" ];then + echo "php$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$vphp not install memcache, Plese select other version!" + return + fi + + sed -i '_bak' '/redis.so/d' $serverPath/php/$version/etc/php.ini + + rm -f $extFile + $serverPath/php/init.d/php$version reload + echo '===============================================' + echo 'successful!' +} + + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 621e4507b..4355a234f 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -112,7 +112,8 @@ "55", "56", "70", - "71" + "71", + "72" ], "type": "缓存器", "msg": "更强大的内容缓存器,支持集群", diff --git a/route/static/app/public.js b/route/static/app/public.js index e9b6a4cfe..9d36b0fbd 100755 --- a/route/static/app/public.js +++ b/route/static/app/public.js @@ -681,17 +681,17 @@ function ActionTask() { } function removeTask(b) { - var a = layer.msg(lan.public.the_del, { + var a = layer.msg('正在删除,请稍候...', { icon: 16, time: 0, shade: [0.3, "#000"] }); - $.post("/files?action=RemoveTask", "id=" + b, function(c) { + $.post("/files/remove_task", "id=" + b, function(c) { layer.close(a); layer.msg(c.msg, { icon: c.status ? 1 : 5 }); - }).error(function(){ + },'json').error(function(){ layer.msg(lan.bt.task_close,{icon:1}); }); } @@ -990,7 +990,7 @@ function execLog(){ function remind(a){ a = a == undefined ? 1 : a; - $.post("/task/list", "tojs=remind&table=tasks&result=2,4,6,8&limit=8&p=" + a, function(g) { + $.post("/task/list", "table=tasks&result=2,4,6,8&limit=10&p=" + a, function(g) { var e = ""; var f = false; var task_count = 0; @@ -1006,7 +1006,11 @@ function remind(a){
'+e+'\ \