Skip to content

Commit

Permalink
优化批量文件上传时的权限设置效率
Browse files Browse the repository at this point in the history
  • Loading branch information
showpy committed Jun 28, 2019
1 parent 5b9f63c commit 51816f3
Show file tree
Hide file tree
Showing 17 changed files with 1,844 additions and 1,837 deletions.
29 changes: 29 additions & 0 deletions BTPanel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,35 @@ def firewall_new(pdata = None):
return publicObject(firewallObject,defs,None,pdata);


@app.route('/monitor', methods=method_all)
def panel_monitor(pdata=None):
comReturn = comm.local()
if comReturn: return comReturn
import monitor
dataObject = monitor.Monitor()
defs = ('get_access_ip', 'get_exception', 'get_exception_logs', 'get_attack_nums', 'php_count', 'return_php', 'mysql_client_count')
return publicObject(dataObject, defs, None, pdata)


@app.route('/san', methods=method_all)
def san_baseline(pdata=None):
comReturn = comm.local()
if comReturn: return comReturn
import san_baseline
dataObject = san_baseline.san_baseline()
defs = ('start', 'get_api_log', 'get_resut', 'get_ssh_errorlogin')
return publicObject(dataObject, defs, None, pdata)


@app.route('/abnormal', methods=method_all)
def abnormal(pdata=None):
comReturn = comm.local()
if comReturn: return comReturn
import abnormal
dataObject = abnormal.abnormal()
defs = ( 'mysql_server', 'mysql_cpu', 'mysql_count', 'php_server', 'php_conn_max', 'php_cpu', 'CPU', 'Memory', 'disk', 'not_root_user','start')
return publicObject(dataObject, defs, None, pdata)

@app.route('/files',methods=method_all)
def files(pdata = None):
comReturn = comm.local()
Expand Down
2 changes: 1 addition & 1 deletion BTPanel/static/js/bt_upload.js

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

2 changes: 1 addition & 1 deletion BTPanel/static/js/crontab.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ function planAdd(){
return;
}
}else{
if(sBody == ''){
if (sBody == '' && sType == 'toShell'){
$("#implement textarea[name='sBody']").focus();
layer.msg(lan.crontab.input_script_err,{icon:2});
return;
Expand Down
57 changes: 34 additions & 23 deletions BTPanel/static/js/public_backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,29 +949,40 @@ var bt =
$('.check').prop('checked',checked?'checked':'');
}
})
$(obj.table).find('th').data('checks',checks).click(function(){
var _th =$(this);
var _checks = _th.data('checks');
var _span = _th.find('span');
if(_span.length>0){
var asc = 'glyphicon-triangle-top';
var desc = 'glyphicon-triangle-bottom';
var or = _span.attr('data-id');
if(_span.hasClass(asc)){
bt.set_cookie('order',or + ' desc');
_checks[or]();
setTimeout(function(){
$(obj.table).find('th span[data-id="'+or+'"]').removeClass(asc).addClass(desc);
},500)
}else if(_span.hasClass(desc)){
bt.set_cookie('order',or + ' asc');
_checks[or]();
setTimeout(function(){
$(obj.table).find('th span[data-id="'+or+'"]').removeClass(desc).addClass(asc);
}, 500)
}
}
})
var asc = 'glyphicon-triangle-top';
var desc = 'glyphicon-triangle-bottom';

var orderby = bt.get_cookie('order');
if (orderby != undefined) {
var arrys = orderby.split(' ')
if (arrys.length == 2) {
if (arrys[1] == 'asc') {
$(obj.table).find('th span[data-id="' + arrys[0] + '"]').removeClass(desc).addClass(asc);
}
else {
$(obj.table).find('th span[data-id="' + arrys[0] + '"]').removeClass(asc).addClass(desc);
}
}
}

$(obj.table).find('th').data('checks', checks).click(function () {
var _th = $(this);
var _checks = _th.data('checks');
var _span = _th.find('span');
if (_span.length > 0) {
var or = _span.attr('data-id');
if (_span.hasClass(asc)) {
bt.set_cookie('order', or + ' desc');
$(obj.table).find('th span[data-id="' + or + '"]').removeClass(asc).addClass(desc);
_checks[or]();

} else if (_span.hasClass(desc)) {
bt.set_cookie('order', or + ' asc');
$(obj.table).find('th span[data-id="' + arrys[0] + '"]').removeClass(desc).addClass(asc);
_checks[or]();
}
}
})
}
return _tab;
}
Expand Down
4 changes: 4 additions & 0 deletions BTPanel/static/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ var site = {
//PHP-CLI
get_cli_version: function () {
$.post('/config?action=get_cli_php_version', {}, function (rdata) {
if (rdata.status === false) {
layer.msg(rdata.msg, { icon: 2 });
return;
}
var _options = '';
for (var i = rdata.versions.length - 1; i >= 0; i--) {
var ed = '';
Expand Down
3 changes: 3 additions & 0 deletions BTPanel/static/js/soft.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ var soft = {
if (rdata.list[i].id === 0) {
remove_opt = ' | <a class="btlink" onclick="soft.update_package(\'' + rdata.list[i].name + '\')">更新</a> | <a class="btlink" onclick="soft.remove_other_dep(\'' + rdata.list[i].name + '\')">删除</a>';
rdata.list[i].min_image = icon_other
} else {
rdata.list[i].min_image += '?t=' + new Date().format("yyyyMMdd");
}
zbody += '<tr>'
+ '<td><img src="' + rdata.list[i].min_image +'">' + rdata.list[i].title + '</td>'
Expand All @@ -370,6 +372,7 @@ var soft = {
+ '</tr>'
}
$("#softList").html(zbody);
$("#softPage").html('');
$(".searchInput").val('');

});
Expand Down
2 changes: 1 addition & 1 deletion BTPanel/templates/default/crontab.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h3 class="f16">{{data['lan']['H4']}}</h3>
{% endblock %}

{% block scripts %}
<script src="/static/js/crontab.js?date={{g['version']}}"></script>
<script src="/static/js/crontab.js?version={{g['version']}}"></script>
<script type="text/javascript">
setCookie('serverType',"{{session['webserver']}}");
toWeek();
Expand Down
Loading

0 comments on commit 51816f3

Please sign in to comment.