Skip to content

Commit

Permalink
7.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
showpy committed Oct 31, 2019
1 parent 7f4f61c commit 7c4ce34
Show file tree
Hide file tree
Showing 24 changed files with 1,390 additions and 1,345 deletions.
21 changes: 12 additions & 9 deletions BTPanel/static/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -1098,10 +1098,10 @@ html .menu .menu_exit:hover {
}
.tablescroll {
overflow: auto;
/*border: #e6e6e6 1px solid;*/
border: #e6e6e6 1px solid;
}
.divtable .table {
/*border: 1px solid #ddd;*/
border: 1px solid #ddd;
color: #666;
font-size: 12px;
margin-bottom: 0;
Expand All @@ -1123,8 +1123,7 @@ html .menu .menu_exit:hover {
color: #666;
font-weight: normal;
padding: 5px 10px;
height: 35px;
font-size: 12.5px;
height: 24px;
box-sizing: content-box;
}
.divtable .table_toolbar{
Expand Down Expand Up @@ -2400,6 +2399,11 @@ html .menu .menu_exit:hover {
.list-list span.glyphicon-cloud-download {
font-size: 12px
}
.list-list tr>td{
padding: 5px 10px !important;
line-height: 1.42857143;
height: auto;
}

.newFolderName {
border: #ccc 1px solid;
Expand Down Expand Up @@ -2835,8 +2839,7 @@ html .menu .menu_exit:hover {

.table>tbody>tr>td {
vertical-align: middle;
padding: 5px 10px;
height: 40px;
height: 24px;
font-size: 12px;
box-sizing: border-box;
}
Expand Down Expand Up @@ -4916,11 +4919,11 @@ select[disabled]{
.search_box{
position: absolute;
right: 65px;
top: 12px;
top: 16px;
height: 16px;
}
.search_box input{
position: relative;
top: 2.5px;
vertical-align: sub;
}
.search_box label{
color: #666;
Expand Down
2,593 changes: 1,297 additions & 1,296 deletions BTPanel/static/js/files.js

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions BTPanel/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ var index = {
$("#messageError").show();
$("#messageError").append('<p><span class="glyphicon glyphicon-alert" style="color: #ff4040; margin-right: 10px;"></span>' + lan.index.user_warning + '<span class="c7 mr5" title="此安全问题不可忽略,请尽快处理" style="cursor:no-drop"> [不可忽略]</span><a class="btlink" href="javascript:setUserName();"> [立即修改]</a></p>')
}

if (info.isport === true) {
$("#messageError").show();
$("#messageError").append('<p><span class="glyphicon glyphicon-alert" style="color: #ff4040; margin-right: 10px;"></span>当前面板使用的是默认端口[8888],有安全隐患,请到面板设置中修改面板端口!<span class="c7 mr5" title="此安全问题不可忽略,请尽快处理" style="cursor:no-drop"> [不可忽略]</span><a class="btlink" href="/config"> [立即修改]</a></p>')
}
var _system = info.system;
$("#info").html(_system);
$("#running").html(info.time);
Expand Down Expand Up @@ -297,11 +302,16 @@ var index = {
obj.rate = item.size[3].replace('%', '');
obj.free = item.size[2];
var arr = [];
arr.push({ title: 'Inode信息', value: '' })
arr.push({ title: '<b>Inode信息</b>', value: '' })
arr.push({ title: '总数', value: item.inodes[0] })
arr.push({ title: '已使用', value: item.inodes[1] })
arr.push({ title: '已用', value: item.inodes[1] })
arr.push({ title: '可用', value: item.inodes[2] })
arr.push({ title: 'Inode使用率', value: item.inodes[3] })
arr.push({ title: '<b>容量信息</b>', value: '' })
arr.push({ title: '容量', value: item.size[0] })
arr.push({ title: '已用', value: item.size[1] })
arr.push({ title: '可用', value: item.size[2] })
arr.push({ title: '使用率', value: item.size[3] })
obj.masks = arr;
data.items.push(obj)
}
Expand Down
8 changes: 6 additions & 2 deletions BTPanel/static/js/public_backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ bt.index = {
var m = "<input id='data_" + l[h].name + "' data-info='" + l[h].name + " " + l[h].versions[0].version + "' type='checkbox' checked>";
for(var b = 0; b < l[h].versions.length; b++) {
var d = "";
if((l[h].name == "PHP" && (l[h].versions[b].version == "5.4" || l[h].versions[b].version == "54")) || (l[h].name == "MySQL" && l[h].versions[b].version == "5.5") || (l[h].name == "phpMyAdmin" && l[h].versions[b].version == "4.4")) {
if((l[h].name == "PHP" && (l[h].versions[b].version == "7.3" || l[h].versions[b].version == "7.3")) || (l[h].name == "MySQL" && l[h].versions[b].version == "5.6") || (l[h].name == "phpMyAdmin" && l[h].versions[b].version == "4.7")) {
d = "selected";
m = "<input id='data_" + l[h].name + "' data-info='" + l[h].name + " " + l[h].versions[b].version + "' type='checkbox' checked>"
}
Expand Down Expand Up @@ -1431,7 +1431,11 @@ bt.index = {
case "5.7":
max = 1500;
msg = "2GB";
break;
break;
case "8.0":
max = 5000;
msg = "6GB";
break;
case "5.6":
max = 800;
msg = "1GB";
Expand Down
2 changes: 1 addition & 1 deletion BTPanel/static/js/soft.js
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ var soft = {
},
]
})
var helps = ['请按实际需求安装扩展,不要安装不必要的PHP扩展,这会影响PHP执行效率,甚至出现异常', 'opcache/xcache/apc等脚本缓存扩展,请只安装其中1个,否则可能导致您的站点程序异常']
var helps = ['Redis扩展仅支持一个PHP版本安装使用,若在其它PHP版本已安装redis扩展,请勿再装','请按实际需求安装扩展,不要安装不必要的PHP扩展,这会影响PHP执行效率,甚至出现异常', 'opcache/xcache/apc等脚本缓存扩展,请只安装其中1个,否则可能导致您的站点程序异常']
$(".soft-man-con").append(bt.render_help(helps));

var divObj = document.getElementById('phpextdiv');
Expand Down
2 changes: 1 addition & 1 deletion BTPanel/templates/default/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h3 class="f16">{{data['lan']['C1']}}</h3>
<div class="setting-con pd15">
<form id="set-Config">
<p class="mtb15"><span class="set-tit text-right" title="{{data['lan']['CT1']}}">{{data['lan']['CT1']}}</span><input id="webname" name="webname" class="inputtxt bt-input-text" type="text" value="{{session['title']}}"><span class="set-info c7">{{data['lan']['CY1']}}</span></p>
<p class="mtb15"><span class="set-tit text-right" title="{{data['lan']['CT2']}}">{{data['lan']['CT2']}}</span><input id="banport" name="port" class="inputtxt bt-input-text" type="number" value="{{data['panel']['port']}}" maxlength="5"><span class="set-info c7">{{data['lan']['CY2']}}</span></p>
<p class="mtb15"><span class="set-tit text-right" title="{{data['lan']['CT2']}}">{{data['lan']['CT2']}}</span><input id="banport" name="port" class="inputtxt bt-input-text" type="number" value="{{data['panel']['port']}}" maxlength="5"><span class="set-info c7">{{data['lan']['CY2']}}<a style="color:red;">注意:有安全组的服务器请提前在安全组放行新端口</a></span></p>
<p class="mtb15"><span class="set-tit text-right" title="面板性能调整">并发线程</span><input name="workers" class="inputtxt bt-input-text" type="number" min="1" max="1024" value="{{data['workers']}}"><span class="set-info c7">除非每秒有超过10人访问面板,建议值不要超过2,注意:>1时会导致宝塔终端插件异常</span></p>
<p class="mtb15"><span class="set-tit text-right" title="登录会话超时间">超时时间</span><input name="session_timeout" class="inputtxt bt-input-text" type="number" value="{{data['session_timeout']}}"><span class="set-info c7">秒, 若用户在<a style="color:red;">{{data['session_timeout']}}</a>秒内没有任何操作,将自动退出面板</span></p>
<p class="mtb15"><span class="set-tit text-right" title="管理入口路径">安全入口</span><input id="admin_path" name="admin_path" class="inputtxt bt-input-text disable" type="text" value="{{data['panel']['admin_path']}}" disabled><span class="modify btn btn-xs btn-success" onclick="modify_auth_path()">{{data['lan']['CY10']}}</span><span class="set-info c7">面板管理入口,设置后只能通过指定安全入口登录面板,如: /www_bt_cn</span></p>
Expand Down
12 changes: 7 additions & 5 deletions BTPanel/templates/default/database.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@
</div>
</div>
<div class="safe bgw mtb15 pd15">
<div class="info-title-tips">
<p><span class="glyphicon glyphicon-alert" style="color: #f39c12; margin-right: 10px;"></span> 请在添加数据库后,务必到<a class="btlink" href="/crontab">[计划任务]</a>页面添加定时备份任务,以确保您的数据安全。</p>
</div>
<button onclick="database.add_database()" title="{{data['lan']['BTNT1']}}" class="btn btn-success btn-sm" type="button" style="margin-right: 5px;">{{data['lan']['BTN1']}}</button>
<button onclick="bt.database.set_root()" title="{{data['lan']['BTNT2']}}" class="btn btn-default btn-sm" type="button" style="margin-right: 5px;">{{data['lan']['BTN2']}}</button>
<button onclick="bt.database.open_phpmyadmin('','root','{{data['mysql_root']}}')" title="{{data['lan']['BTNT3']}}" class="btn btn-default btn-sm" type="button" style="margin-right: 5px;">{{data['lan']['BTN3']}}</button>
<span style="float:right">
<span style="float:right">
<button batch="true" style="float: right;display: none;margin-left:10px;" onclick="database.batch_database('del');" title="{{data['lan']['BTNT4']}}" class="btn btn-default btn-sm">{{data['lan']['BTN4']}}</button>
<button onclick="bt.recycle_bin.open_recycle_bin(6)" id="dataRecycle" title="{{data['lan']['BTNT4']}}" class="btn btn-default btn-sm" style="margin-left: 5px;"><span class="glyphicon glyphicon-trash" style="margin-right: 5px;"></span>回收站</button>
</span>
<div class="divtable mtb10">
<div class="tablescroll">
<table id="DataBody" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;">
</table>
<table id="DataBody" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;"></table>
</div>
<div id='databasePage' class="dataTables_paginate paging_bootstrap page">
<div id='databasePage' class="dataTables_paginate paging_bootstrap page">
</div>
<div class="table_toolbar">
<span class="sync btn btn-default btn-sm" style="margin-right:5px" onclick="database.sync_to_database(1)" title="{{data['lan']['TP1']}}">{{data['lan']['SP1']}}</span>
<span class="sync btn btn-default btn-sm" style="margin-right:5px" onclick="database.sync_to_database(0)" title="{{data['lan']['TP2']}}">{{data['lan']['SP2']}}</span>
<span class="sync btn btn-default btn-sm" onclick="database.sync_database()" title="{{data['lan']['TP3']}}">{{data['lan']['SP3']}}</span>
<span class="sync btn btn-default btn-sm" onclick="database.sync_database()" title="{{data['lan']['TP3']}}">{{data['lan']['SP3']}}</span>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion BTPanel/templates/default/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
</script>
<script src="/static/js/jquery-ui.min.js"></script>
<script src="/static/js/jquery.contextify.min.js"></script>
<script src="/static/js/files.js?date={{g.version}}"></script>
<script src="/static/js/files.js?f3={{g.version}}"></script>
<script src="/static/js/upload.js?date={{g.version}}"></script>
<script type="text/javascript" src="./static/ace/ace.js?date=2"></script>
<script type="text/javascript" src="./static/ace/ext-language_tools.js?date=2"></script>
Expand Down
2 changes: 1 addition & 1 deletion BTPanel/templates/default/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>{{g.title}}</title>
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon" />
<link href="/static/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/site.css?f={{g['version']}}" rel="stylesheet">
<link href="/static/css/site.css?f2={{g['version']}}" rel="stylesheet">
<link href="/static/codemirror/lib/codemirror.css" rel="stylesheet">
<!--[if lte IE 9]>
<script src="/static/js/requestAnimationFrame.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion BTPanel/templates/default/site.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>
<div class="bgw mtb15 pd15">
<div class="info-title-tips">
<p><span class="glyphicon glyphicon-alert" style="color: #f39c12; margin-right: 10px;"></span> {{data['lan']['PS']}}</p>
<p><span class="glyphicon glyphicon-alert" style="color: #f39c12; margin-right: 10px;"></span> {{data['lan']['PS']}}建站成功后,请在<a class="btlink" href="/crontab">[计划任务]</a>页面添加定时备份任务!</p>
</div>
<button onclick="site.add_site()" class="btn btn-success btn-sm btn-title" type="button">{{data['lan']['BTN1']}}</button>&nbsp;
<button onclick="site.set_default_page()" class="btn btn-default btn-sm btn-title" type="button">{{data['lan']['BTN2']}}</button>
Expand Down
2 changes: 1 addition & 1 deletion class/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def init(self):
if ua:
ua = ua.lower();
if ua.find('spider') != -1 or ua.find('bot') != -1: return redirect('https://www.baidu.com');
g.version = '7.0.2'
g.version = '7.0.14'
g.title = public.GetConfigValue('title')
g.uri = request.path
session['version'] = g.version;
Expand Down
2 changes: 1 addition & 1 deletion class/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def DelOldSession(self,get):
os.system(s)
# s = "find /tmp -mtime +1 |grep 'sess_'|wc -l"
# old_file_conf = int(public.ExecShell(s)[0].split("\n")[0])
old_file_conf = self.GetSessionCount(get)
old_file_conf = self.GetSessionCount(get)["oldfile"]
if old_file_conf == 0:
return public.returnMsg(True, '清理成功')
else:
Expand Down
2 changes: 1 addition & 1 deletion class/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def GetSql(self,get,result = '1,2,3,4,5,8'):
where += " and type='" + get.type+"'";

if get.table == 'sites' and get.search:
pid = SQL.table('domain').where('name=?',(get.search,)).getField('pid');
pid = SQL.table('domain').where("name LIKE '%"+get.search+"%'",()).getField('pid');
if pid: where = "id=" + str(pid);

if get.table == 'sites' and hasattr(get,'type'):
Expand Down
2 changes: 1 addition & 1 deletion class/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def ToBackup(self,get):
public.ExecShell("/www/server/mysql/bin/mysqldump --default-character-set="+ public.get_database_character(name) +" --force --opt \"" + name + "\" | gzip > " + backupName)
if not os.path.exists(backupName): return public.returnMsg(False,'BACKUP_ERROR');

if not self.mypass(True, root): return public.returnMsg(False, '数据库配置文件获取失败,请检查MySQL配置文件是否存在')
if not self.mypass(False, root): return public.returnMsg(False, '数据库配置文件获取失败,请检查MySQL配置文件是否存在')

sql = public.M('backup')
addTime = time.strftime('%Y-%m-%d %X',time.localtime())
Expand Down
15 changes: 6 additions & 9 deletions class/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@
from BTPanel import cache

def control_init():
global exec_tips
if exec_tips: return
exec_tips = True
sql_tips = '/dev/shm/bt_sql_tips.pl'

if not os.path.exists(sql_tips):
sql = db.Sql().dbfile('system')
sql = db.Sql().dbfile('system')
if not sql.table('sqlite_master').where('type=? AND name=?', ('table', 'load_average')).count():
csql = '''CREATE TABLE IF NOT EXISTS `load_average` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`pro` REAL,
Expand All @@ -28,17 +23,19 @@ def control_init():
`addtime` INTEGER
)'''
sql.execute(csql,())
if not public.M('sqlite_master').where('type=? AND name=? AND sql LIKE ?', ('table', 'sites','%type_id%')).count():
public.M('sites').execute("alter TABLE sites add edate integer DEFAULT '0000-00-00'",());
public.M('sites').execute("alter TABLE sites add type_id integer DEFAULT 0",());

sql = db.Sql()
sql = db.Sql()
if not sql.table('sqlite_master').where('type=? AND name=?', ('table', 'site_types')).count():
csql = '''CREATE TABLE IF NOT EXISTS `site_types` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` REAL,
`ps` REAL
)'''

sql.execute(csql,())
public.writeFile(sql_tips,'True')

filename = '/www/server/nginx/off'
if os.path.exists(filename): os.remove(filename)
Expand Down
11 changes: 6 additions & 5 deletions class/panelLets.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ def apple_lest_cert(self,get):
cpath = self.setupPath + '/panel/vhost/cert/crontab.json'
config = {}
if os.path.exists(cpath):
config = json.loads(public.readFile(cpath))
try:
config = json.loads(public.readFile(cpath))
except:pass

config[data['siteName']] = data
public.writeFile(cpath,json.dumps(config))
public.set_mode(cpath,600)
Expand Down Expand Up @@ -300,7 +303,7 @@ def set_crond(self):
import crontab
args_obj = public.dict_obj()
if not cron_id:
cronPath = public.GetConfigValue('setup_path') + '/cron/' + echo
cronPath = public.GetConfigValue('setup_path') + '/cron/' + echo
shell = 'python %s/panel/class/panelLets.py renew_lets_ssl ' % (self.setupPath)
public.writeFile(cronPath,shell)
args_obj.id = public.M('crontab').add('name,type,where1,where_hour,where_minute,echo,addtime,status,save,backupTo,sType,sName,sBody,urladdress',("续签Let's Encrypt证书",'day','','0','10',echo,time.strftime('%Y-%m-%d %X',time.localtime()),0,'','localhost','toShell','',shell,''))
Expand All @@ -321,8 +324,7 @@ def crate_let_by_oper(self,data):
result['status'] = False
try:
if not data['email']: data['email'] = public.M('users').getField('email')



#手动解析记录值
if not 'renew' in data:
BTPanel.dns_client = sewer.Client(domain_name = data['first_domain'],dns_class = None,account_key = data['account_key'],domain_alt_names = data['domains'],contact_email = str(data['email']) ,ACME_AUTH_STATUS_WAIT_PERIOD = 15,ACME_AUTH_STATUS_MAX_CHECKS = 5,ACME_REQUEST_TIMEOUT = 20,ACME_DIRECTORY_URL = self.let_url)
Expand Down Expand Up @@ -357,7 +359,6 @@ def crate_let_by_oper(self,data):
dns['finalize_url'] = finalize_url
return dns
else:

responders = data['dns']['responders']
dns_names_to_delete = data['dns']['dns_names']
finalize_url = data['dns']['finalize_url']
Expand Down
7 changes: 6 additions & 1 deletion class/panelPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,19 @@ def get_cloud_list(self,get=None):
sType = 0
try:
if hasattr(get,'type'): sType = int(get['type'])
if hasattr(get,'query'):
if get.query: sType = 0
except:pass
softList['list'] = self.get_local_plugin(softList['list'])
softList['list'] = self.get_types(softList['list'],sType)
if hasattr(get,'query'):
if get.query:
tmpList = []
for softInfo in softList['list']:
if softInfo['name'].find(get.query) != -1 or softInfo['title'].find(get.query) != -1: tmpList.append(softInfo)
if softInfo['name'].lower().find(get.query) != -1 or \
softInfo['title'].lower().find(get.query) != -1 or \
softInfo['ps'].lower().find(get.query) != -1:
tmpList.append(softInfo)
softList['list'] = tmpList
return softList

Expand Down
4 changes: 3 additions & 1 deletion class/panelSite.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,11 +918,13 @@ def CreateLet(self,get):
self.check_ssl_pack()
try:
import panelLets
public.mod_reload(panelLets)
except Exception as ex:
if str(ex).find('No module named requests') != -1:
os.system("pip install requests &")
return public.returnMsg(False,'缺少requests组件,请尝试修复面板!')
public.mod_reload(panelLets)
return public.returnMsg(False,str(ex))

lets = panelLets.panelLets()
result = lets.apple_lest_cert(get)
if result['status'] and not 'code' in result:
Expand Down
Loading

0 comments on commit 7c4ce34

Please sign in to comment.