From 614899a2476364c7e3b129244028118d6de856a7 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 4 Mar 2019 23:22:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dphpinfo=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/plugins_api.py | 23 +++++++-- plugins/php/conf/php56.ini | 5 -- plugins/php/index.py | 17 +++---- plugins/php/js/php.js | 4 +- route/static/app/site.js | 99 +++++++++++++++++++------------------- 5 files changed, 78 insertions(+), 70 deletions(-) diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index 098027f5f..a6b2b97a7 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -252,11 +252,26 @@ class plugins_api: public.execShell("rm -rf " + plugin_path) return public.returnJson(False, '安装失败!') + # 由于内容太大无法shell输出,暂时移动的插件模块中 def phpinfoApi(self): - version = request.form.get('version', '') - phpinfo = public.httpGet( - 'http://127.0.0.1/' + version + '/phpinfo.php') - return phpinfo + v = request.form.get('v', '') + sys.path.append("plugins/php") + + import index + content = index.getPhpinfo(v) + return content + + # self.checkPhpinfoFile(version) + # infoPath = public.getRootDir() + '/phpinfo' + # sPath = infoPath + '/' + version + + # public.execShell('rm -rf ' + infoPath) + # public.execShell('mkdir -p ' + sPath) + # public.writeFile(sPath + '/phpinfo.php', '') + # url = 'http://127.0.0.1/' + version + '/phpinfo.php' + # phpinfo = public.httpGet(url) + # os.system("rm -rf " + infoPath) + # return phpinfo ##### ----- end ----- ### # 进程是否存在 diff --git a/plugins/php/conf/php56.ini b/plugins/php/conf/php56.ini index 8e541fd62..a08f58d34 100644 --- a/plugins/php/conf/php56.ini +++ b/plugins/php/conf/php56.ini @@ -212,8 +212,3 @@ ldap.max_links = -1 [dba] [curl] [Zend Opcache] - -;[xhprof] -;extension=md_xhprof.so -;xhprof.output_dir="MD:/bin/tmp/xhprof" - diff --git a/plugins/php/index.py b/plugins/php/index.py index efeb31310..7e178f57d 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -484,8 +484,8 @@ def setDisableFunc(version): def checkPhpinfoFile(v): if public.isInstalledWeb(): - desc_file = public.getServerDir() + '/openresty/nginx/conf/php_status/phpinfo_' + \ - str(v) + '.conf' + desc_file = public.getServerDir( + ) + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf' if not os.path.exists(desc_file): tpl = getPluginDir() + '/conf/phpinfo.conf' content = public.readFile(tpl) @@ -496,15 +496,14 @@ def checkPhpinfoFile(v): def getPhpinfo(v): checkPhpinfoFile(v) - sPath = public.getRootDir() + '/phpinfo/' + str(v) - # public.execShell("rm -rf " + public.getRootDir() + '/phpinfo') + sPath = public.getRootDir() + '/phpinfo/' + v + public.execShell("rm -rf " + public.getRootDir() + '/phpinfo') public.execShell("mkdir -p " + sPath) public.writeFile(sPath + '/phpinfo.php', '') - # print 'http://127.0.0.1/' + str(v) + '/phpinfo.php' - phpinfo = public.httpGet('http://127.0.0.1/' + str(v) + '/phpinfo.php') - public.writeFile('/tmp/phpinfo.txt', phpinfo) - # os.system("rm -rf " + public.getRootDir() + '/phpinfo') - return '' + url = 'http://127.0.0.1/' + v + '/phpinfo.php' + phpinfo = public.httpGet(url) + os.system("rm -rf " + public.getRootDir() + '/phpinfo') + return phpinfo def getLibConf(version): diff --git a/plugins/php/js/php.js b/plugins/php/js/php.js index 33d38a4da..04c634bac 100755 --- a/plugins/php/js/php.js +++ b/plugins/php/js/php.js @@ -378,7 +378,7 @@ function getPhpinfo(version) { } //获取PHPInfo -function getPHPInfo(version) { +function getPHPInfo_old(version) { phpPost('get_phpinfo', version, '', function(data){ var rdata = data.data; layer.open({ @@ -393,7 +393,7 @@ function getPHPInfo(version) { } //获取PHPInfo -function getPHPInfo_new(version) { +function getPHPInfo(version) { $.post('/plugins/phpinfo', {v:version}, function(data) { layer.open({ type: 1, diff --git a/route/static/app/site.js b/route/static/app/site.js index e34bbdfb8..73d1706a8 100755 --- a/route/static/app/site.js +++ b/route/static/app/site.js @@ -984,8 +984,7 @@ function setIndexList(id){ /*站点修改*/ function webEdit(id,website,endTime,addtime){ - var eMenu = ''; - eMenu = "

子目录绑定

" + var eMenu = "

子目录绑定

" +"

网站目录

" +"

流量限制

" +"

伪静态

" @@ -1187,55 +1186,55 @@ function limitNet(id){ +"" +"" +"" - $("#webedit-con").html(body); + $("#webedit-con").html(body); - $("select[name='limit']").change(function(){ - var type = $(this).val(); - perserver = 300; - perip = 25; - limit_rate = 512; - switch(type){ - case '1': - perserver = 300; - perip = 25; - limit_rate = 512; - break; - case '2': - perserver = 200; - perip = 10; - limit_rate = 1024; - break; - case '3': - perserver = 50; - perip = 3; - limit_rate = 2048; - break; - case '4': - perserver = 500; - perip = 10; - limit_rate = 2048; - break; - case '5': - perserver = 400; - perip = 15; - limit_rate = 1024; - break; - case '6': - perserver = 60; - perip = 10; - limit_rate = 512; - break; - case '7': - perserver = 150; - perip = 4; - limit_rate = 1024; - break; - } - - $("input[name='perserver']").val(perserver); - $("input[name='perip']").val(perip); - $("input[name='limit_rate']").val(limit_rate); - }); + $("select[name='limit']").change(function(){ + var type = $(this).val(); + perserver = 300; + perip = 25; + limit_rate = 512; + switch(type){ + case '1': + perserver = 300; + perip = 25; + limit_rate = 512; + break; + case '2': + perserver = 200; + perip = 10; + limit_rate = 1024; + break; + case '3': + perserver = 50; + perip = 3; + limit_rate = 2048; + break; + case '4': + perserver = 500; + perip = 10; + limit_rate = 2048; + break; + case '5': + perserver = 400; + perip = 15; + limit_rate = 1024; + break; + case '6': + perserver = 60; + perip = 10; + limit_rate = 512; + break; + case '7': + perserver = 150; + perip = 4; + limit_rate = 1024; + break; + } + + $("input[name='perserver']").val(perserver); + $("input[name='perip']").val(perip); + $("input[name='limit_rate']").val(limit_rate); + }); },'json'); }