mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:59:25 +08:00
修复phpinfo显示
This commit is contained in:
@@ -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', '<?php phpinfo(); ?>')
|
||||
# url = 'http://127.0.0.1/' + version + '/phpinfo.php'
|
||||
# phpinfo = public.httpGet(url)
|
||||
# os.system("rm -rf " + infoPath)
|
||||
# return phpinfo
|
||||
##### ----- end ----- ###
|
||||
|
||||
# 进程是否存在
|
||||
|
||||
@@ -212,8 +212,3 @@ ldap.max_links = -1
|
||||
[dba]
|
||||
[curl]
|
||||
[Zend Opcache]
|
||||
|
||||
;[xhprof]
|
||||
;extension=md_xhprof.so
|
||||
;xhprof.output_dir="MD:/bin/tmp/xhprof"
|
||||
|
||||
|
||||
@@ -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', '<?php phpinfo(); ?>')
|
||||
# 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):
|
||||
|
||||
@@ -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,
|
||||
|
||||
+49
-50
@@ -984,8 +984,7 @@ function setIndexList(id){
|
||||
|
||||
/*站点修改*/
|
||||
function webEdit(id,website,endTime,addtime){
|
||||
var eMenu = '';
|
||||
eMenu = "<p onclick='dirBinding("+id+")' title='子目录绑定'>子目录绑定</p>"
|
||||
var eMenu = "<p onclick='dirBinding("+id+")' title='子目录绑定'>子目录绑定</p>"
|
||||
+"<p onclick='webPathEdit("+id+")' title='网站目录'>网站目录</p>"
|
||||
+"<p onclick='limitNet("+id+")' title='流量限制'>流量限制</p>"
|
||||
+"<p onclick=\"rewrite('"+website+"')\" title='伪静态'>伪静态</p>"
|
||||
@@ -1187,55 +1186,55 @@ function limitNet(id){
|
||||
+"<button class='btn btn-success btn-sm mt10' onclick='saveLimitNet("+id+",1)'>"+lan.public.save+"</button>"
|
||||
+"</div>"
|
||||
+"<ul class='help-info-text c7 mtb15'><li>"+lan.site.limit_net_11+"</li><li>"+lan.site.limit_net_13+"</li><li>"+lan.site.limit_net_15+"</li></ul>"
|
||||
$("#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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user