diff --git a/class/core/site_api.py b/class/core/site_api.py index f934bbd71..f653a7644 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -91,14 +91,16 @@ class site_api: return public.returnJson(True, public.getNumLines(logPath, 1000)) def getSitePhpVersion(self, siteName): - conf = public.readFile( - public.getServerDir() + '/openresty/nginx/conf/vhost/' + siteName + '.conf') + conf = public.readFile(self.getHostConf(siteName)) rep = "enable-php-([0-9]{2,3})\.conf" tmp = re.search(rep, conf).groups() data = {} data['phpversion'] = tmp[0] return public.getJson(data) + def getHostConf(self, siteName): + return public.getServerDir() + '/openresty/nginx/conf/vhost/' + siteName + '.conf' + def addDomain(self, domain, webname, pid): pass diff --git a/route/site.py b/route/site.py index 282a64de9..d4ac15e48 100644 --- a/route/site.py +++ b/route/site.py @@ -49,6 +49,13 @@ def getSitePhpVersion(): return site_api.site_api().getSitePhpVersion(siteName) +@site.route('get_host_conf', methods=['POST']) +def getHostConf(): + siteName = request.form.get('siteName', '').encode('utf-8') + host = site_api.site_api().getHostConf(siteName) + return public.getJson({'host': host}) + + @site.route('get_root_dir', methods=['POST']) def getRootDir(): data = {} diff --git a/static/app/site.js b/static/app/site.js index cf7d9dcce..922b6efc9 100755 --- a/static/app/site.js +++ b/static/app/site.js @@ -178,17 +178,12 @@ function webAdd(type) { ", }); if ($(".success-msg").height() < 150) { - $(".success-msg").find("img").css({ - "width": "150px", - "margin-top": "30px" - }); + $(".success-msg").find("img").css({"width": "150px","margin-top": "30px"}); } } } else { - layer.msg(ret.msg, { - icon: 2 - }); + layer.msg(ret.msg, {icon: 2}); } layer.close(loadT); },'json'); @@ -1020,9 +1015,9 @@ function webEdit(id,website,endTime,addtime){ +"
"+lan.site.site_menu_3+"
" +""+lan.site.site_menu_4+"
" +""+lan.site.site_menu_5+"
" - +""+lan.site.site_menu_6+"
" + +""+lan.site.site_menu_6+"
" +""+lan.site.site_menu_7+"
" - +""+lan.site.site_menu_8+"
" + +""+lan.site.site_menu_8+"
" +""+lan.site.site_menu_10+"
" +""+lan.site.site_menu_11+"
" +""+lan.site.site_menu_12+"
" @@ -2083,7 +2078,7 @@ function ChangeSaveSSL(siteName){ } //PHP版本 -function PHPVersion(siteName){ +function phpVersion(siteName){ $.post('/site/get_site_php_version','siteName='+siteName,function(version){ console.log(version); if(version.status === false){ @@ -2143,50 +2138,6 @@ function PHPVersion(siteName){ },'json'); } -//tomcat -function toTomcat(siteName){ - $.post('/site?action=GetSitePHPVersion','siteName='+siteName,function(version){ - if(version.status === false){ - layer.msg(lan.site.a_n_n,{icon:5}); - return; - } - $.post('/site?action=GetPHPVersion',function(rdata){ - var versionSelect =''; - if(version.tomcatversion){ - var tomcat_checked = ''; - if(version.tomcat != -1) tomcat_checked = 'checked'; - versionSelect += '