Commit b10f6e3c authored by jose's avatar jose

Fix some problems

parent 083ce57d
...@@ -111,43 +111,43 @@ var soft = { ...@@ -111,43 +111,43 @@ var soft = {
return '<span>' + ps + '</span>'; return '<span>' + ps + '</span>';
} }
}, },
// { {
// field: 'price', title: lan.soft.price, width: 92, templet: function (item) { field: 'price', title: lan.soft.price, width: 92, templet: function (item) {
// var price = lan.soft.free; var price = lan.soft.free;
// if (item.price > 0) { if (item.price > 0) {
// price = '<span style="color:#fc6d26">¥' + item.price + '</span>'; price = '<span style="color:#fc6d26">¥' + item.price + '</span>';
// } }
// return price; return price;
// } }
// }, },
// { {
// field: 'endtime', width: 120, title: lan.soft.expire_time, templet: function (item) { field: 'endtime', width: 120, title: lan.soft.expire_time, templet: function (item) {
// var endtime = '--'; var endtime = '--';
// if (item.pid > 0) { if (item.pid > 0) {
// if (item.endtime > 0) { if (item.endtime > 0) {
// if (item.type != 10) { 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>'; 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 { } 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>'; 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) { else if (item.endtime === 0) {
// endtime = lan.soft.permanent; endtime = lan.soft.permanent;
// } }
// else if (item.endtime === -1) { else if (item.endtime === -1) {
// endtime = lan.soft.not_open; endtime = lan.soft.not_open;
// } }
// else if (item.endtime === -2) { else if (item.endtime === -2) {
// if (item.type != 10) { 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>'; endtime = lan.soft.already_expire + '<a class="btlink" onclick="bt.soft.re_plugin_pay(\'' + item.title + '\',\'' + item.pid + '\',1)"> ('+lan.soft.renew+')</a>';
// }else { }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>'; 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; return endtime;
// } }
// }, },
{ {
field: 'path', field: 'path',
width: 40, width: 40,
...@@ -1271,23 +1271,23 @@ var soft = { ...@@ -1271,23 +1271,23 @@ var soft = {
case 'phpmyadmin_safe': case 'phpmyadmin_safe':
var sdata = $('.bt-soft-menu').data('data'); var sdata = $('.bt-soft-menu').data('data');
var con = '<div class="ver line">\ var con = '<div class="ver line">\
<span style="margin-right:10px">'+ lan.soft.pma_port + '</span>\ <span style="margin-right:10px">'+ lan.soft.pma_port + '</span>\
<input class="bt-input-text phpmyadmindk mr20" name="Name" id="pmport" value="'+ sdata.ext.port + '" placeholder="' + lan.soft.pma_port_title + '" maxlength="5" type="number">\ <input class="bt-input-text phpmyadmindk mr20" name="Name" id="pmport" value="'+ sdata.ext.port + '" placeholder="' + lan.soft.pma_port_title + '" maxlength="5" type="number">\
<button class="btn btn-success btn-sm phpmyadmin_port" >'+ lan.public.save + '</button>\ <button class="btn btn-success btn-sm phpmyadmin_port" >'+ lan.public.save + '</button>\
</div>\ </div>\
<div class="user_pw_tit">\ <div class="user_pw_tit">\
<span class="tit">'+ lan.soft.pma_pass + '</span>\ <span class="tit">'+ lan.soft.pma_pass + '</span>\
<span class="btswitch-p"><input class="btswitch btswitch-ios" id="phpmyadminsafe" type="checkbox" '+ (sdata.ext.auth ? 'checked' : '') + '>\ <span class="btswitch-p"><input class="btswitch btswitch-ios" id="phpmyadminsafe" type="checkbox" '+ (sdata.ext.auth ? 'checked' : '') + '>\
<label class="btswitch-btn phpmyadmin-btn phpmyadmin_safe" for="phpmyadminsafe" ></label>\ <label class="btswitch-btn phpmyadmin-btn phpmyadmin_safe" for="phpmyadminsafe" ></label>\
</span>\ </span>\
</div>\ </div>\
<div class="user_pw">\ <div class="user_pw">\
<p><span>'+ lan.soft.pma_user + '</span><input id="username_get" class="bt-input-text" name="username_get" value="" type="text" placeholder="' + lan.soft.edit_empty + '"></p>\ <p><span>'+ lan.soft.pma_user + '</span><input id="username_get" class="bt-input-text" name="username_get" value="" type="text" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><span>'+ lan.soft.pma_pass1 + '</span><input id="password_get_1" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\ <p><span>'+ lan.soft.pma_pass1 + '</span><input id="password_get_1" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><span>'+ lan.soft.pma_pass2 + '</span><input id="password_get_2" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\ <p><span>'+ lan.soft.pma_pass2 + '</span><input id="password_get_2" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><button class="btn btn-success btn-sm phpmyadmin_safe_save" >'+ lan.public.save + '</button></p>\ <p><button class="btn btn-success btn-sm phpmyadmin_safe_save" >'+ lan.public.save + '</button></p>\
</div>\ </div>\
<ul class="help-info-text c7"><li>'+ lan.soft.pma_ps + '</li></ul>'; <ul class="help-info-text c7"><li>'+ lan.soft.pma_ps + '</li></ul>';
$(".soft-man-con").html(con); $(".soft-man-con").html(con);
if (sdata.ext.port) { if (sdata.ext.port) {
$(".user_pw").show(); $(".user_pw").show();
......
...@@ -714,16 +714,74 @@ ServerName 127.0.0.2 ...@@ -714,16 +714,74 @@ ServerName 127.0.0.2
public.M('logs').where('id>?',(0,)).delete(); public.M('logs').where('id>?',(0,)).delete();
public.WriteLog('TYPE_CONFIG','LOG_CLOSE'); public.WriteLog('TYPE_CONFIG','LOG_CLOSE');
return public.returnMsg(True,'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 #设置PHPMyAdmin
def setPHPMyAdmin(self,get): def setPHPMyAdmin(self,get):
import re; import re;
#try: #try:
if public.get_webserver() == 'nginx': filename = self.__get_webserver_conffile()
filename = public.GetConfigValue('setup_path') + '/nginx/conf/nginx.conf';
else:
filename = public.GetConfigValue('setup_path') + '/apache/conf/extra/httpd-vhosts.conf';
conf = public.readFile(filename); conf = public.readFile(filename);
if hasattr(get,'port'): if hasattr(get,'port'):
mainPort = public.readFile('data/port.pl').strip(); mainPort = public.readFile('data/port.pl').strip();
......
...@@ -400,25 +400,27 @@ def update_to6(): ...@@ -400,25 +400,27 @@ def update_to6():
print("====================================================") print("====================================================")
#命令行菜单 #命令行菜单
def bt_cli(): def bt_cli(u_input = 0):
raw_tip = "===============================================" raw_tip = "==============================================="
print("==============="+public.GetMsg("PANEL_SHELL")+"==================") if not u_input:
print("(1) %s (8) %s" % (public.GetMsg("RESTART_PANEL"),public.GetMsg("CHANGE_PANEL_PORT"))) print("==============="+public.GetMsg("PANEL_SHELL")+"==================")
print("(2) %s (9) %s"% (public.GetMsg("STOP_PANEL"),public.GetMsg("CLEAR_PANEL_CACHE"))) print("(1) %s (8) %s" % (public.GetMsg("RESTART_PANEL"),public.GetMsg("CHANGE_PANEL_PORT")))
print("(3) %s (10) %s"% (public.GetMsg("START_PANEL"),public.GetMsg("CLEAR_PANEL_LIMIT"))) print("(2) %s (9) %s"% (public.GetMsg("STOP_PANEL"),public.GetMsg("CLEAR_PANEL_CACHE")))
print("(4) %s (11) %s"% (public.GetMsg("RELOAD_PANEL"),public.GetMsg("CANCEL_ENTRY"))) print("(3) %s (10) %s"% (public.GetMsg("START_PANEL"),public.GetMsg("CLEAR_PANEL_LIMIT")))
print("(5) %s (12) %s"% (public.GetMsg("CHANGE_PANEL_PASS"),public.GetMsg("CANCEL_DOMAIN_BIND"))) print("(4) %s (11) %s"% (public.GetMsg("RELOAD_PANEL"),public.GetMsg("CANCEL_ENTRY")))
print("(6) %s (13) %s"% (public.GetMsg("CHANGE_PANEL_USER"),public.GetMsg("CANCEL_IP_LIMIT"))) print("(5) %s (12) %s"% (public.GetMsg("CHANGE_PANEL_PASS"),public.GetMsg("CANCEL_DOMAIN_BIND")))
print("(7) %s (14) %s"% (public.GetMsg("CHANGE_MYSQL_PASS_FORCE"),public.GetMsg("GET_PANEL_DEFAULT_MSG"))) print("(6) %s (13) %s"% (public.GetMsg("CHANGE_PANEL_USER"),public.GetMsg("CANCEL_IP_LIMIT")))
print("(22) %s (15) %s"% ("Display panel error log",public.GetMsg("CLEAR_SYS_RUBBISH"))) print("(7) %s (14) %s"% (public.GetMsg("CHANGE_MYSQL_PASS_FORCE"),public.GetMsg("GET_PANEL_DEFAULT_MSG")))
print("(23) %s (16) %s"% ("Turn off BasicAuth authentication","Repair panel (check for errors and update panel files to the latest version)")) print("(22) %s (15) %s"% ("Display panel error log",public.GetMsg("CLEAR_SYS_RUBBISH")))
print("(0) Cancel") print("(23) %s (16) %s"% ("Turn off BasicAuth authentication","Repair panel (check for errors and update panel files to the latest version)"))
print(raw_tip) print("(0) Cancel")
try: print(raw_tip)
u_input = input(public.GetMsg("INPUT_CMD_NUM")) try:
if sys.version_info[0] == 3: u_input = int(u_input) u_input = input(public.GetMsg("INPUT_CMD_NUM"))
except: u_input = 0 if sys.version_info[0] == 3: u_input = int(u_input)
nums = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] except: u_input = 0
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: if not u_input in nums:
print(raw_tip) print(raw_tip)
print(public.GetMsg("CANCELLED")) print(public.GetMsg("CANCELLED"))
...@@ -527,7 +529,7 @@ def bt_cli(): ...@@ -527,7 +529,7 @@ def bt_cli():
elif u_input == 15: elif u_input == 15:
ClearSystem() ClearSystem()
elif u_input == 16: 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: elif u_input == 22:
os.system('tail -100 /www/server/panel/logs/error.log') os.system('tail -100 /www/server/panel/logs/error.log')
elif u_input == 23: 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