Commit b10f6e3c authored by jose's avatar jose

Fix some problems

parent 083ce57d
......@@ -111,43 +111,43 @@ var soft = {
return '<span>' + ps + '</span>';
}
},
// {
// field: 'price', title: lan.soft.price, width: 92, templet: function (item) {
// var price = lan.soft.free;
// if (item.price > 0) {
// price = '<span style="color:#fc6d26">¥' + item.price + '</span>';
// }
// return price;
// }
// },
// {
// field: 'endtime', width: 120, title: lan.soft.expire_time, templet: function (item) {
// var endtime = '--';
// if (item.pid > 0) {
// if (item.endtime > 0) {
// if (item.type != 10) {
// endtime = bt.format_data(item.endtime, 'yyyy/MM/dd') + '<a class="btlink" onclick="bt.soft.re_plugin_pay(\'' + item.title + '\',\'' + item.pid + '\',1)"> ('+lan.soft.renew+')</a>';
// } else {
// endtime = bt.format_data(item.endtime, 'yyyy/MM/dd') + '<a class="btlink" onclick="bt.soft.re_plugin_pay_other(\'' + item.title + '\',\'' + item.pid + '\',1,'+item.price+')"> ('+lan.soft.renew+')</a>';
// }
// }
// else if (item.endtime === 0) {
// endtime = lan.soft.permanent;
// }
// else if (item.endtime === -1) {
// endtime = lan.soft.not_open;
// }
// else if (item.endtime === -2) {
// if (item.type != 10) {
// endtime = lan.soft.already_expire + '<a class="btlink" onclick="bt.soft.re_plugin_pay(\'' + item.title + '\',\'' + item.pid + '\',1)"> ('+lan.soft.renew+')</a>';
// }else {
// endtime = lan.soft.already_expire + '<a class="btlink" onclick="bt.soft.re_plugin_pay_other(\'' + item.title + '\',\'' + item.pid + '\',1,'+item.price+')"> ('+lan.soft.renew+')</a>';
// }
// }
// }
// return endtime;
// }
// },
{
field: 'price', title: lan.soft.price, width: 92, templet: function (item) {
var price = lan.soft.free;
if (item.price > 0) {
price = '<span style="color:#fc6d26">¥' + item.price + '</span>';
}
return price;
}
},
{
field: 'endtime', width: 120, title: lan.soft.expire_time, templet: function (item) {
var endtime = '--';
if (item.pid > 0) {
if (item.endtime > 0) {
if (item.type != 10) {
endtime = bt.format_data(item.endtime, 'yyyy/MM/dd') + '<a class="btlink" onclick="bt.soft.re_plugin_pay(\'' + item.title + '\',\'' + item.pid + '\',1)"> ('+lan.soft.renew+')</a>';
} else {
endtime = bt.format_data(item.endtime, 'yyyy/MM/dd') + '<a class="btlink" onclick="bt.soft.re_plugin_pay_other(\'' + item.title + '\',\'' + item.pid + '\',1,'+item.price+')"> ('+lan.soft.renew+')</a>';
}
}
else if (item.endtime === 0) {
endtime = lan.soft.permanent;
}
else if (item.endtime === -1) {
endtime = lan.soft.not_open;
}
else if (item.endtime === -2) {
if (item.type != 10) {
endtime = lan.soft.already_expire + '<a class="btlink" onclick="bt.soft.re_plugin_pay(\'' + item.title + '\',\'' + item.pid + '\',1)"> ('+lan.soft.renew+')</a>';
}else {
endtime = lan.soft.already_expire + '<a class="btlink" onclick="bt.soft.re_plugin_pay_other(\'' + item.title + '\',\'' + item.pid + '\',1,'+item.price+')"> ('+lan.soft.renew+')</a>';
}
}
}
return endtime;
}
},
{
field: 'path',
width: 40,
......
......@@ -715,15 +715,73 @@ ServerName 127.0.0.2
public.WriteLog('TYPE_CONFIG','LOG_CLOSE');
return public.returnMsg(True,'LOG_CLOSE');
def __get_webserver_conffile(self):
if public.get_webserver() == 'nginx':
filename = public.GetConfigValue('setup_path') + '/nginx/conf/nginx.conf'
else:
filename = public.GetConfigValue('setup_path') + '/apache/conf/extra/httpd-vhosts.conf'
return filename
# 获取phpmyadmin ssl状态
def get_phpmyadmin_ssl(self,get):
import re
filename = self.__get_webserver_conffile()
conf = public.readFile(filename)
rep = "listen 443 ssl;"
if re.search(rep,conf):
return True
return False
# 设置phpmyadmin ssl
def set_phpmyadmin_ssl(self,get):
import re
filename = self.__get_webserver_conffile()
conf = public.readFile(filename)
if get.v == "on":
ssl_conf = """
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#AUTH_START
auth_basic "Authorization";
auth_basic_user_file /www/server/pass/phpmyadmin.pass;
#AUTH_END
ssl_certificate /www/server/panel/ssl/certificate.pem;
ssl_certificate_key /www/server/panel/ssl/privateKey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497 https://$host$request_uri;
#SSL-END"""
listen_conf = """
listen 888 ssl;
listen 443 ssl;"""
listen_rep = "listen.*"
conf = re.sub(listen_rep, listen_conf, conf)
ssl_rep = "\s*#error_page.+;"
conf = re.sub(ssl_rep, ssl_conf, conf)
public.writeFile(filename,conf)
else:
listen_rep = "\n\s*listen.*;\n\s*.*"
listen_conf = "\n\t\tlisten 888 ssl;"
conf = re.sub(listen_rep, listen_conf, conf)
ssl_rep = "\n\s*#SSL-START(\n|.)+#SSL-END"
sslconf = """
#error_page 404/404.html;"""
conf = re.sub(ssl_rep, sslconf, conf)
public.writeFile(filename,conf)
return public.returnMsg(True,'SET_PORT_SUCCESS')
#设置PHPMyAdmin
def setPHPMyAdmin(self,get):
import re;
#try:
if public.get_webserver() == 'nginx':
filename = public.GetConfigValue('setup_path') + '/nginx/conf/nginx.conf';
else:
filename = public.GetConfigValue('setup_path') + '/apache/conf/extra/httpd-vhosts.conf';
filename = self.__get_webserver_conffile()
conf = public.readFile(filename);
if hasattr(get,'port'):
mainPort = public.readFile('data/port.pl').strip();
......
......@@ -400,8 +400,9 @@ def update_to6():
print("====================================================")
#命令行菜单
def bt_cli():
def bt_cli(u_input = 0):
raw_tip = "==============================================="
if not u_input:
print("==============="+public.GetMsg("PANEL_SHELL")+"==================")
print("(1) %s (8) %s" % (public.GetMsg("RESTART_PANEL"),public.GetMsg("CHANGE_PANEL_PORT")))
print("(2) %s (9) %s"% (public.GetMsg("STOP_PANEL"),public.GetMsg("CLEAR_PANEL_CACHE")))
......@@ -418,7 +419,8 @@ def bt_cli():
u_input = input(public.GetMsg("INPUT_CMD_NUM"))
if sys.version_info[0] == 3: u_input = int(u_input)
except: u_input = 0
nums = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
nums = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,22,23]
if not u_input in nums:
print(raw_tip)
print(public.GetMsg("CANCELLED"))
......@@ -527,7 +529,7 @@ def bt_cli():
elif u_input == 15:
ClearSystem()
elif u_input == 16:
os.system("curl http://download.bt.cn/install/update6.sh|bash")
os.system("curl http://download.bt.cn/install/update6_en.sh|bash")
elif u_input == 22:
os.system('tail -100 /www/server/panel/logs/error.log')
elif u_input == 23:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment