Skip to content

Commit

Permalink
6.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
showpy committed Jun 17, 2019
1 parent 1197870 commit 355a1a6
Show file tree
Hide file tree
Showing 171 changed files with 20,125 additions and 8,992 deletions.
256 changes: 249 additions & 7 deletions BTPanel.pyproj

Large diffs are not rendered by default.

505 changes: 384 additions & 121 deletions BTPanel/__init__.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion BTPanel/static/bootstrap-3.3.5/css/bootstrap.min.css

Large diffs are not rendered by default.

574 changes: 491 additions & 83 deletions BTPanel/static/css/site.css

Large diffs are not rendered by default.

561 changes: 561 additions & 0 deletions BTPanel/static/img/dep_ico/bfz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/dep_ico/wordpress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
562 changes: 562 additions & 0 deletions BTPanel/static/img/dep_ico/wp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
561 changes: 561 additions & 0 deletions BTPanel/static/img/dep_ico/z-blog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-backup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-baidu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-btco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-disk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-diskquota.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-dns_manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-dnsext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-domains.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-frpc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-idown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-jiokong.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-loganalyse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-lvs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added BTPanel/static/img/soft_ico/ico-mail_sys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-mfsearch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-msg_push.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-nfsserver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BTPanel/static/img/soft_ico/ico-openfogos.png
Binary file added BTPanel/static/img/soft_ico/ico-ossfs.png
Binary file added BTPanel/static/img/soft_ico/ico-pgsql_manager.png
Binary file added BTPanel/static/img/soft_ico/ico-psync_api.png
Binary file added BTPanel/static/img/soft_ico/ico-pythonmamager.png
Binary file added BTPanel/static/img/soft_ico/ico-qiankeji.png
Binary file added BTPanel/static/img/soft_ico/ico-redisutil.png
Binary file added BTPanel/static/img/soft_ico/ico-safeip.png
Binary file added BTPanel/static/img/soft_ico/ico-sitecount.png
Binary file added BTPanel/static/img/soft_ico/ico-sshkey.png
Binary file added BTPanel/static/img/soft_ico/ico-syssafe.png
Binary file added BTPanel/static/img/soft_ico/ico-tomcat2.png
Binary file added BTPanel/static/img/soft_ico/ico-w7_assistant.png
Binary file added BTPanel/static/img/soft_ico/ico-w7assistant.png
Binary file added BTPanel/static/img/soft_ico/ico-webshell.png
Binary file added BTPanel/static/img/soft_ico/ico_idown.png
8 changes: 8 additions & 0 deletions BTPanel/static/js/bootstrap-select.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions BTPanel/static/js/bt_upload.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions BTPanel/static/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,82 @@ function bt_init() {
$('.wxapp_p .inputtxt').val("未绑定宝塔账号");
$('.wxapp_p .modify').attr("onclick", "");
}
}



function GetPanelApi() {
var loadT = layer.msg('正在获取API接口信息...', { icon: 16, time: 0, shade: [0.3, '#000'] });
$.post('/config?action=get_token', {}, function (rdata) {
layer.close(loadT);
isOpen = rdata.open ? 'checked' : '';
layer.open({
type: 1,
area: "500px",
title: "配置面板API",
closeBtn: 2,
shift: 5,
shadeClose: false,
content: ' <div class="bt-form bt-form" style="padding:15px 25px">\
<div class="line">\
<span class="tname">API接口</span>\
<div class="info-r" style="height:28px;">\
<input class="btswitch btswitch-ios" id="panelApi_s" type="checkbox" '+ isOpen+'>\
<label style="position: relative;top: 5px;" class="btswitch-btn" for="panelApi_s" onclick="SetPanelApi(2)"></label>\
</div>\
</div>\
<div class="line">\
<span class="tname">接口密钥</span>\
<div class="info-r">\
<input disabled="disabled" name="panel_token_value" class="bt-input-text mr5 disable" type="text" style="width: 310px" value="'+rdata.token+'" disable>\
<button class="btn btn-xs btn-success btn-sm" style="margin-left: -50px;" onclick="SetPanelApi(1)">重置</button>\
</div>\
</div>\
<div class="line ">\
<span class="tname" style="overflow: initial;height:20px;line-height:20px;">IP白名单</br>(每行1个)</span>\
<div class="info-r">\
<textarea name="api_limit_addr" class="bt-input-text mr5" type="text" style="width: 310px;height:80px;line-height: 20px;padding: 5px 8px;margin-bottom:10px;">'+ rdata.limit_addr +'</textarea>\
<button class="btn btn-success btn-sm" onclick="SetPanelApi(3)">保存</button>\
</div>\
</div>\
<ul class="help-info-text c7">\
<li>开启API后,必需在IP白名单列表中的IP才能访问面板API接口</li>\
<li>接口密钥只要重置时显示1次,之后不再显示,请保管好您的密钥</li>\
<li>API接口文档在这里:<a class="btlink" href="https://www.bt.cn/bbs/thread-20376-1-1.html" target="_blank">https://www.bt.cn/bbs/thread-20376-1-1.html</a></li>\
</ul>\
</div>'
})
});
}


function SetPanelApi(t_type) {
var pdata = {}
pdata['t_type'] = t_type
if (t_type == 3) {
pdata['limit_addr'] = $("textarea[name='api_limit_addr']").val()
}
var loadT = layer.msg('正在提交...', { icon: 16, time: 0, shade: [0.3, '#000'] });
$.post('/config?action=set_token', pdata, function (rdata) {
if (t_type == 1) {
if (rdata.status) {
$("input[name='panel_token_value']").val(rdata.msg);
layer.msg('接口密钥已生成,请保管好您的新密钥,此密钥只显示一次!', { icon: 1 });
return;
}
}

layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
if (rdata.msg == '开启成功!') {
GetPanelApi();
}
})
}

function SetIPv6() {
var loadT = layer.msg('正在配置,请稍候...', { icon: 16, time: 0, shade: [0.3, '#000'] });
$.post('/config?action=set_ipv6_status', {}, function (rdata) {
layer.close(loadT);
bt.msg(rdata);
});
}
10 changes: 7 additions & 3 deletions BTPanel/static/js/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ $(".st").hover(function(){
$(this).hide();
})
})

$(".searcTime .gt").click(function(){
$(this).addClass("on").siblings().removeClass("on");
})
Expand Down Expand Up @@ -392,8 +393,8 @@ function disk(b, e) {
//var zData = [];

for (var i = 0; i < rdata.length; i++) {
rData.push((rdata[i].read_bytes / 1024).toFixed(3));
wData.push((rdata[i].write_bytes / 1024).toFixed(3));
rData.push((rdata[i].read_bytes / 1024 / 60).toFixed(3));
wData.push((rdata[i].write_bytes / 1024 / 60).toFixed(3));
xData.push(rdata[i].addtime);
//yData.push(rdata[i].read_count);
//zData.push(rdata[i].write_count);
Expand Down Expand Up @@ -947,4 +948,7 @@ function getload(b,e){
myChartgetload.resize();
})
})
}
}

$('.btime').val(GetToday() + ' 00:00:00');
$('.etime').val(GetToday() + ' 23:59:59');
27 changes: 19 additions & 8 deletions BTPanel/static/js/crontab.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function getCronData(){
$.post('/crontab?action=GetCrontab',"",function(rdata){
layer.close(laid);
var cbody="";
if(rdata == ""){
if(rdata == []){
layer.close(laid);
cbody="<tr><td colspan='6'>"+lan.crontab.task_empty+"</td></tr>"
}
Expand All @@ -56,7 +56,7 @@ function getCronData(){
optName = ''
}
}
var arrs = ['site','database']
var arrs = ['site','database','path'];
if ($.inArray(rdata[i].sType, arrs) == -1) optName = "--";
cbody += "<tr>\
<td><input type='checkbox' onclick='checkSelect();' title='"+rdata[i].name+"' name='id' value='"+rdata[i].id+"'></td>\
Expand Down Expand Up @@ -122,7 +122,7 @@ function edit_task_info(id){
weekDom += '<li><a role="menuitem" href="javascript:;" value="'+ obj['weekArray'][i][0] +'">'+ obj['weekArray'][i][1] +'</a></li>';
}
if(obj.from.sType == 'site' || obj.from.sType == 'database' || obj.from.sType == 'path' || obj.from.sType == 'logs'){
$.post('/crontab?action=GetDataList',{type:obj.from.sType == 'databases'?'database':'sites'},function(rdata){
$.post('/crontab?action=GetDataList',{type:obj.from.sType == 'database'?'databases':'sites'},function(rdata){
obj.sNameArray = rdata.data;
obj.sNameArray.unshift({name:'ALL',ps:'所有'});
obj.backupsArray = rdata.orderOpt;
Expand Down Expand Up @@ -419,8 +419,8 @@ function planDel(id,name){
var data='id='+id;
$.post('/crontab?action=DelCrontab',data,function(rdata){
layer.closeAll();
layer.msg(rdata.msg,{icon:rdata.status?1:2});
getCronData();
getCronData();
setTimeout(function () { layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });},1000)
});
});
}
Expand Down Expand Up @@ -578,7 +578,7 @@ function planAdd(){
$("#set-Config input[name='sType']").val(sType);
$("#set-Config textarea[name='sBody']").val(decodeURIComponent(sBody));

if(sType == 'site' || sType == 'database'){
if(sType == 'site' || sType == 'database' || sType == 'path'){
var backupTo = $(".planBackupTo").find("b").attr("val");
$("#backupTo").val(backupTo);
}
Expand Down Expand Up @@ -611,8 +611,10 @@ function planAdd(){

$.post('/crontab?action=AddCrontab',data,function(rdata){
layer.closeAll();
layer.msg(rdata.msg,{icon:rdata.status?1:2});
getCronData();
getCronData();
setTimeout(function () {
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
}, 1000)
});
}

Expand Down Expand Up @@ -786,6 +788,15 @@ function toBackup(type){
}else{
$(".planname input[name='name']").val(sMsg+'[/www/wwwroot/]');
sOptBody = '<div class="info-r" style="display: inline-block;float: left;margin-right: 25px;"><input id="inputPath" class="bt-input-text mr5" type="text" name="path" value="/www/wwwroot/" placeholder="备份目录" style="width:208px;height:33px;"><span class="glyphicon glyphicon-folder-open cursor" onclick="ChangePath(&quot;inputPath&quot;)"></span></div>'
setCookie('default_dir_path','/www/wwwroot/');
setCookie('path_dir_change','/www/wwwroot/');
setInterval(function(){
if(getCookie('path_dir_change') != getCookie('default_dir_path')){
var path_dir_change = getCookie('path_dir_change')
$(".planname input").val('备份目录['+getCookie('path_dir_change')+']');
setCookie('default_dir_path',path_dir_change);
}
},500);
}
var orderOpt = ''
for (var i=0;i<rdata.orderOpt.length;i++){
Expand Down
Loading

0 comments on commit 355a1a6

Please sign in to comment.