One Hat Cyber Team
  • Dir : ~/www/server/panel/BTPanel/static/js/
  • Edit File: files.min.js
    ":'')+"
    ");$((bt.get_cookie("rank")=="icon"?"textarea":"input")+"[name=createArea]").on("input",function(){if(bt.get_cookie("rank")=="icon"){this.style.height="auto";this.style.height=this.scrollHeight+"px"}}).keyup(function(f){if(f.keyCode==13){$(this).blur()}}).blur(function(f){var g=$(this).val().replace(/[\r\n]/g,"");if(a.match_unqualified_string(g)){return layer.msg('名称不能含有 /\\:*?"<>|符号',{icon:2})}if(g==""){g=(c=="newBlankDir"?"新建文件夹":"新建文件")}setTimeout(function(){a.create_file_req({type:(c=="newBlankDir"?"folder":"file"),path:a.file_path+"/"+g},function(e){if(e.status){a.reader_file_list({path:a.file_path})}layer.msg(e.msg,{icon:e.status?1:2})});$(".createModel").remove();a.is_editor=false},300);f.preventDefault()}).focus()}else{return false}d.stopPropagation();d.preventDefault()});$(".file_nav_view .favorites_file_path ul").on("click","li",function(h){var b=$(this).data("path"),f=$(this).data("type"),g=$(".favorites_file_path .nav_down_list");if(f=="dir"){a.reader_file_list({path:b,is_operating:true})}else{if($(this).data("null")!=undefined){return false}var c=$(this).attr("title").split("."),i=c[c.length-1],d=a.determine_file_type(i);switch(d){case"text":openEditorView(0,b);break;case"video":a.open_video_play(b);break;case"images":a.open_images_preview({filename:$(this).attr("title"),path:b});break;default:a.reader_file_list({path:a.retrun_prev_path(b),is_operating:true});break}}g.css({display:function(){setTimeout(function(){g.removeAttr("style")},100);return"none"}});h.stopPropagation();h.preventDefault()});$(".terminal_view").on("click",function(){web_shell()});$(".share_file_list").on("click",function(){a.open_share_view()});$(".mount_disk_list").on("click",".nav_btn",function(){var b=$(this).data("menu");a.reader_file_list({path:b,is_operating:true})});$(".mount_disk_list").on("click",".nav_down_list li",function(){var c=$(this).data("disk"),b=$(".mount_disk_list.thezoom .nav_down_list");b.css({display:function(){setTimeout(function(){b.removeAttr("style")},100);return"none"}});a.reader_file_list({path:c,is_operating:true})});$(".file_nav_view").on("click",".recycle_bin",function(b){a.recycle_bin_view();b.stopPropagation();b.preventDefault()});$(".file_nav_view .multi").on("click",".nav_btn_group",function(b){var c=$(this).data("type");if(typeof c!="undefined"){a.batch_file_manage(c)}b.stopPropagation();b.preventDefault()});$(".file_nav_view .multi").on("click",".nav_btn_group li",function(b){var c=$(this).data("type");a.batch_file_manage(c);b.stopPropagation();b.preventDefault()});$(".file_nav_view").on("click",".file_all_paste",function(){a.paste_file_or_dir()});$(".file_list_header").on("click",".file_name,.file_size,.file_mtime,.file_accept,.file_user",function(d){var f=$(this).attr("data-tid"),b=$(this).find(".icon_sort").hasClass("active"),c=$(this).hasClass("active");if(!$(this).find(".icon_sort").hasClass("active")&&$(this).hasClass("active")){$(this).find(".icon_sort").addClass("active")}else{$(this).find(".icon_sort").removeClass("active")}$(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty();$(this).find(".icon_sort").html('');if(!c){b=true}bt.set_cookie("files_sort",f);bt.set_cookie("name_reverse",b?"True":"False");a.reader_file_list({reverse:b?"True":"False",sort:f});return false});$(".file_list_header .file_th").each(function(c,e){var b=bt.get_cookie("files_sort"),d=bt.get_cookie("name_reverse");if($(this).attr("data-tid")===b){$(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty();$(this).find(".icon_sort").html('');if(d==="False"){$(this).find(".icon_sort").addClass("active")}}});$(".file_list_header .file_check").on("click",function(c){var b=parseInt($(this).data("checkbox"));switch(b){case 0:$(this).addClass("active").removeClass("active_2").data("checkbox",1);$(".file_list_content .file_tr").addClass("active").removeClass("active_2");$(".nav_group.multi").removeClass("hide");$(".file_menu_tips").addClass("hide");a.file_table_arry=a.file_list.slice();break;case 2:$(this).addClass("active").removeClass("active_2").data("checkbox",1);$(".file_list_content .file_tr").addClass("active");$(".nav_group.multi").removeClass("hide");$(".file_menu_tips").addClass("hide");a.file_table_arry=a.file_list.slice();break;case 1:$(this).removeClass("active active_2").data("checkbox",0);$(".file_list_content .file_tr").removeClass("active");$(".nav_group.multi").addClass("hide");$(".file_menu_tips").removeClass("hide");a.file_table_arry=[];break}a.calculate_table_active()});$(".file_list_content").on("click",".file_checkbox",function(f){var b=$(this).parents(".file_tr"),d=b.data("index"),c=b.data("filename");if(b.hasClass("active")){b.removeClass("active");a.remove_check_file(a.file_table_arry,"filename",c)}else{b.addClass("active");b.attr("data-filename",a.file_list[d]["filename"]);a.file_table_arry.push(a.file_list[d])}a.calculate_table_active();f.stopPropagation()});$(".file_list_content").scroll(function(b){if($(this).scrollTop()==($(this)[0].scrollHeight-$(this)[0].clientHeight)){$(this).prev().css("opacity",1);$(this).next().css("opacity",0)}else{if($(this).scrollTop()>0){$(this).prev().css("opacity",1)}else{if($(this).scrollTop()==0){$(this).prev().css("opacity",0);$(this).next().css("opacity",1)}}}});$(".file_table_view .file_list_content").on("click",".file_tr",function(b){if($(b.target).hasClass("foo_menu_title")||$(b.target).parents().hasClass("foo_menu_title")){return true}$(this).addClass("active").siblings().removeClass("active");a.file_table_arry=[a.file_list[$(this).data("index")]];a.calculate_table_active();b.stopPropagation();b.preventDefault()});$(".file_table_view .file_list_content").on("click",".file_name .iconfont",function(f){var c=$(this).parents(".file_tr"),b=c.data("index"),d=a.file_list[b];d.index=b;if($(this).hasClass("icon-share1")){a.info_file_share(d)}if($(this).hasClass("icon-favorites")){a.cancel_file_favorites(d)}f.stopPropagation()});$(".file_table_view .file_list_content").on("dblclick",".file_tr",function(d){var b=$(this).data("index"),c=a.file_list[b];if($(d.target).hasClass("file_check")||$(d.target).parents(".foo_menu").length>0||$(d.target).hasClass("set_file_ps")||a.is_editor){return false}if(c.type=="dir"){if(c.filename=="Recycle_bin"){return a.recycle_bin_view()}a.reader_file_list({path:a.file_path+"/"+c.filename,is_operating:true})}else{switch(c.open_type){case"text":openEditorView(0,c.path);break;case"video":a.open_video_play(c);break;case"images":a.open_images_preview(c);break;case"compress":a.unpack_file_to_path(c);break}}d.stopPropagation();d.preventDefault()});$(".file_table_view .file_list_content").on("click",".file_title i,.file_ico_type .file_icon",function(f){var c=$(this).parents(".file_tr"),b=c.data("index"),d=a.file_list[b];if(d.type=="dir"){if(d.filename=="Recycle_bin"){return a.recycle_bin_view()}a.reader_file_list({path:a.file_path+"/"+d.filename,is_operating:true})}else{layer.msg(d.open_type=="compress"?"双击解压文件":"双击文件编辑")}f.stopPropagation();f.preventDefault()});$(".file_list_content").on("contextmenu",function(b){if($(b.target).attr("name")=="createArea"||$(b.target).attr("name")=="rename_file_input"){return true}else{return false}});$(".selection_right_menu").on("contextmenu",function(b){return false});$(".file_list_content").on("mousedown",".file_tr",function(b){if(b.which===1&&($(b.target).hasClass("foo_menu_title")||$(b.target).parents().hasClass("foo_menu_title"))){a.render_file_groud_menu(b,this);$(b.target).parent().addClass("foo_menu_click");$(this).siblings().find(".foo_menu").removeClass("foo_menu_click");$(this).addClass("active").siblings().removeClass("active")}else{if(b.which===3&&!a.is_editor){if(a.file_table_arry.length>1){a.render_files_multi_menu(b)}else{a.render_file_groud_menu(b,this);$(".content_right_menu").removeAttr("style");$(this).addClass("active").siblings().removeClass("active")}}else{return true}}b.stopPropagation();b.preventDefault()});$(".filePage").on("change",".showRow",function(){var b=$(this).val();console.log(b);bt.set_storage("local","showRow",b);a.reader_file_list({showRow:b,p:1,is_operating:false})});$(".filePage").on("click","div:nth-child(2) a",function(c){var b=$(this).attr("href").match(/p=([0-9]+)$/)[1];a.reader_file_list({path:a.path,p:b});c.stopPropagation();c.preventDefault()});$(".file_list_content").on("click",".folder_size",function(c){var b=a.file_list[$(this).parents(".file_tr").data("index")],d=this;a.get_file_size({path:b.path},function(e){$(d).text(bt.format_size(e.size))});c.stopPropagation();c.preventDefault()});$(".filePage").on("click","#file_all_size",function(b){if(a.file_path==="/"){layer.tips('当前目录为系统根目录(/),执行获取文件大小将占用大量磁盘IO,将导致服务器运行缓慢。',this,{tips:[1,"red"],time:5000});return false}a.get_dir_size({path:a.file_path})});$(".file_list_content").on("mousedown",function(f){if($(f.target).hasClass("file_checkbox")||$(f.target).hasClass("file_check")||$(f.target).hasClass("icon-share1")||$(f.target).hasClass("icon-favorites")||f.target.localName=="i"||$(f.target).parents(".app_menu_group").length>0||$(f.target).hasClass("createModel")||$(f.target).hasClass("editr_tr")||$(f.target).attr("name")=="createArea"||$(f.target).attr("name")=="rename_file_input"||$(f.target).hasClass("set_file_ps")||a.is_editor){return true}if(f.which==3&&!a.is_editor){$(".selection_right_menu").removeAttr("style");a.render_file_all_menu(f,this);return true}$(".file_list_content").bind("mousewheel",function(){return false});var c=$(this),g=0,e=c.offset().top,b=c.offset().left;var d={top:f.clientY-$(this).offset().top,left:f.clientX-$(this).offset().left};$(document).unbind("mousemove").mousemove(function(o){var j={top:o.clientY-e>0&&o.clientY-e1?c.height():0),left:o.clientX-b>0&&o.clientX-b1?c.width():0)};var p={top:j.top>d.top?d.top:j.top,left:j.left>d.left?d.left:j.left};if(bt.get_cookie("rank")=="list"){p.top=p.top+40}var q=Math.min(Math.abs(j.left-d.left),b+c.width()-p.left);var m=Math.min(Math.abs(j.top-d.top),e+c.height()-p.top);if(o.clientY-e<0){var n=Math.abs(o.clientY-e);c.scrollTop(c.scrollTop()-n);if(c.scrollTop()!=0){g+=n}m=m+g}if(o.clientY-(e+c.height())>1){var k=o.clientY-(e+c.height());c.scrollTop(c.scrollTop()+k);if(c[0].scrollHeight-c[0].scrollTop!==c[0].clientHeight){g+=k}m=m+g;p.top=p.top-g}if(d.top==j.top||d.left==j.left){return true}a.enter_files_box().show().css({left:p.left+"px",top:p.top+"px",width:q+"px",height:m+"px"});var r=a.enter_files_box().offset().top;var s=a.enter_files_box().offset().left;var l=a.enter_files_box().offset().left+a.enter_files_box().width();var i=a.enter_files_box().offset().top+a.enter_files_box().height();$(c).find(".file_tr").each(function(v,w){var u=$(w).offset().top;var t=$(w).offset().left;var h=$(w).offset().top+$(w).height();var x=$(w).offset().left+$(w).width();if(bt.get_cookie("rank")=="icon"){if(x>=s&&t<=l&&h>=r&&u<=i){$(w).addClass("active")}else{$(w).removeClass("active")}}else{if(x>=s&&h>=r&&u<=i){$(w).addClass("active")}else{$(w).removeClass("active")}}})});$(document).on("mouseup",function(){var i=[];var k=a.enter_files_box().offset().top;var h=a.enter_files_box().offset().left;var l=a.enter_files_box().offset().left+a.enter_files_box().width();var j=a.enter_files_box().offset().top+a.enter_files_box().height();$(c).find(".file_tr").each(function(p,q){var o=$(q).offset().top;var n=$(q).offset().left;var m=$(q).offset().top+$(q).height();var r=$(q).offset().left+$(q).width();if(bt.get_cookie("rank")=="icon"){if(r>=h&&n<=l&&m>=k&&o<=j){i.push($(q).data("index"))}}else{if(r>=h&&m>=k&&o<=j){i.push($(q).data("index"))}}});a.render_file_selected(i);a.enter_files_box().remove();$(".file_list_content").unbind("mousewheel")});f.stopPropagation();f.preventDefault()});$(".file_list_content").on("blur",".set_file_ps",function(e){var b=$(this).parents(".file_tr").data("index"),d=a.file_list[b],f=$(this).val(),c=$(this).data("value"),g=this;if(f==c){return false}bt_tools.send("files/set_file_ps",{filename:d.path,ps_type:0,ps_body:f},function(h){$(g).data("value",f)},{tips:"设置文件/目录备注",tips:true})});$(".file_list_content").on("keyup",".set_file_ps",function(b){if(b.keyCode==13){$(this).blur()}b.stopPropagation()});$(".file_list_header").on("mousedown",".file_width_resize",function(f){return false;if(f.which==3){return false}var e=$(this),b=$(this).prev().offset().left,c=$(".file_list_header").innerWidth(),d=0;d=c-$(".file_main_title").data;$(document).unbind("mousemove").mousemove(function(h){var g=h.clientX-b;a.set_style_width(e.prev().data("tid"),g)});$(document).one("mouseup",e,function(g){$(document).unbind("mousemove")});f.stopPropagation();f.preventDefault()});$(".cut_view_model").on("click",function(){var b=$(this).data("type");$(".file_table_view").addClass(b=="icon"?"icon_view":"list_view").removeClass(b!="icon"?"icon_view":"list_view").scrollLeft(0);bt.set_cookie("rank",b);$(this).addClass("active").siblings().removeClass("active")});$(".file_list_content").on("click",".set_operation_group a",function(d){var e=$(this).parents(".file_tr").data(),b=$(this).data("type"),c=a.file_list[e.index];if(b=="more"){return true}c.open=b;c.index=e.index;c.type_tips=c.type=="file"?"文件":"目录";a.file_groud_event(c)})},enter_files_box:function(){if($("#web_mouseDrag").length==0){$("
    ",{id:"web_mouseDrag",style:["position:absolute; top:0; left:0;","border:1px solid #072246; background-color: #cce8ff;","filter:Alpha(Opacity=15); opacity:0.15;","overflow:hidden;display:none;z-index:9;"].join("")}).appendTo(".file_table_view")}return $("#web_mouseDrag")},clear_table_active:function(){this.file_table_arry=[];$(".file_list_header .file_check").removeClass("active active_2");$(".file_list_content .file_tr").removeClass("active app_menu_operation");$(".file_list_content .file_tr .file_ps .foo_menu").removeClass("foo_menu_click");$(".app_menu_group").remove()},calculate_table_active:function(){var b=this,a=$(".file_list_header .file_check");if(this.file_table_arry.length==0){a.removeClass("active active_2").data("checkbox",0)}else{if(this.file_table_arry.length==this.file_list.length){a.addClass("active").removeClass("active_2").data("checkbox",1)}else{a.addClass("active_2").removeClass("active").data("checkbox",2)}}if(this.file_table_arry.length>0){$(document).unbind("keydown").on("keydown",function(g){var f=g.keyCode,d=g.target.localName.toLowerCase(),c=window.navigator.userAgent.indexOf("Mac")>-1;if(d=="input"||d=="textarea"){return true}if(g.ctrlKey&&f==67){if(b.file_table_arry.length==1){b.file_groud_event($.extend(b.file_table_arry[0],{open:"copy"}));$(".file_all_paste").removeClass("hide")}else{if(b.file_table_arry.length>1){b.batch_file_manage("copy")}}}if(g.ctrlKey&&f==88){if(b.file_table_arry.length==1){b.file_groud_event($.extend(b.file_table_arry[0],{open:"shear"}));$(".file_all_paste").removeClass("hide")}else{if(b.file_table_arry.length>1){b.batch_file_manage("shear")}}}});if(this.file_table_arry.length>1){$(".nav_group.multi").removeClass("hide");$(".file_menu_tips").addClass("hide")}else{$(".nav_group.multi").addClass("hide");$(".file_menu_tips").removeClass("hide")}}else{$(".nav_group.multi").addClass("hide");$(".file_menu_tips.multi").removeClass("hide");$(document).unbind("keydown")}$(".selection_right_menu,.file_path_input .file_dir_item .nav_down_list").removeAttr("style");b.set_menu_line_view_resize()},set_dir_view_resize:function(){var c=$(".file_path_input"),a=$(".file_path_input .file_dir_view"),e=a.attr("data-width"),d=null;if(e){parseInt(e)}else{e=a.width();a.attr("data-width",e)}if(a.width()-e<90){var b=0;$($(".file_path_input .file_dir_view .file_dir_item").toArray().reverse()).each(function(){var f=0;if(!$(this).attr("data-width")){$(this).attr("data-width",$(this).width());f=$(this).width()}else{f=parseInt($(this).attr("data-width"))}b+=f;if((c.width()-b)<=90){$(this).addClass("hide")}else{$(this).removeClass("hide")}})}var d=a.children(".file_dir_item.hide").clone(true);if(a.children(".file_dir_item.hide").length==0){c.removeClass("active").find(".file_dir_omit").addClass("hide")}else{d.each(function(){if($(this).find(".glyphicon-hdd").length==0){$(this).find(".file_dir").before('')}});c.addClass("active").find(".file_dir_omit").removeClass("hide");c.find(".file_dir_omit .nav_down_list").empty().append(d);c.find(".file_dir_omit .nav_down_list .file_dir_item").removeClass("hide")}},set_menu_line_view_resize:function(){var b=$(".file_nav_view").width(),c=0,f=0,a=0,d=$(".mount_disk_list"),e=$(".nav_group.multi");if(!d.attr("data-width")){d.attr("data-width",d.innerWidth())}if(!e.attr("data-width")&&e.innerWidth()!=0&&e.innerWidth()!=-1){e.attr("data-width",e.innerWidth())}c=parseInt(d.attr("data-width"));f=parseInt(e.attr("data-width"));$(".file_nav_view>.nav_group").not(".mount_disk_list").each(function(){a+=$(this).innerWidth()});a+=$(".menu-header-foot").innerWidth();if(b-a<(c+5)){$(".nav_group.mount_disk_list").addClass("thezoom").find(".disk_title_group_btn").removeClass("hide")}else{$(".nav_group.mount_disk_list,.nav_group.multi").removeClass("thezoom")}if(this.area[0]<1360){indexs=Math.ceil(((1360-this.area[0])/68));$(".batch_group_list>.nav_btn_group").each(function(g){if(g>=$(".batch_group_list>.nav_btn_group").length-(indexs+2)){$(this).hide()}else{$(this).show()}});$(".batch_group_list>.nav_btn_group:last-child").removeClass("hide").show()}else{$(".batch_group_list>.nav_btn_group").css("display","inline-block");$(".batch_group_list>.nav_btn_group:last-child").addClass("hide")}},set_file_forward:function(){var b=this,a=$(".forward_path span");if(b.file_operating.length==1){a.addClass("active")}else{if(b.file_pointer==b.file_operating.length-1){a.eq(0).removeClass("active");a.eq(1).addClass("active")}else{if(b.file_pointer==0){a.eq(0).addClass("active");a.eq(1).removeClass("active")}else{a.removeClass("active")}}}},set_file_view:function(){var b=$(".file_list_content"),a=this.area[1]-$(".file_table_view")[0].offsetTop-170;$(".file_bodys").height(this.area[1]-100);if((this.file_list.length*50)>a){b.attr("data-height",b.data("height")||b.height()).css({overflow:"hidden","overflow-y":"auto",height:a+"px"});$(".file_shadow_bottom").css("opacity",1)}else{b.css({overflow:"hidden","overflow-y":"auto",height:a+"px"});$(".file_shadow_top,.file_shadow_bottom").css("opacity",0)}},open_share_view:function(){var a=this;layer.open({type:1,shift:5,closeBtn:2,area:["850px","580px"],title:"分享列表",content:'
    分享名称文件地址过期时间操作
    ',success:function(){a.render_share_list();$(".download_url_list").on("click",".info_down",function(){var b=$(this).attr("data-index");a.file_share_view(a.file_share_list[b],"list")});$(".download_table .download_url_page").on("click","a",function(c){var b=$(this).attr("href").match(/p=([0-9]+)$/)[1];a.render_share_list({p:b});c.stopPropagation();c.preventDefault()})}})},render_share_list:function(c){var b=this,a="";if(typeof c=="undefined"){c={p:1}}bt_tools.send("files/get_download_url_list",c,function(d){b.file_share_list=d.data;if(d.data.length>0){$.each(d.data,function(e,f){a+=''+f.ps+''+f.filename+""+bt.format_data(f.expire)+'详情 | 关闭'})}else{a='暂无分享数据'}$(".download_url_list").html(a);$(".download_url_page").html(d.page);$(".download_table").on("click",".del_down",function(){var f=$(this).attr("data-id"),e=$(this).attr("data-ps");b.remove_download_url({id:f,fileName:e},function(g){if(g.status){b.render_share_list(c)}layer.msg(g.msg,{icon:g.status?1:2})})})},"获取分享列表")},remove_check_file:function(d,b,c){var a=d.length;while(a--){if(d[a][b]==c){d.splice(a,1)}}},open_download_view:function(){var a=this;a.reader_form_line({url:"DownloadFile",beforeSend:function(b){return{url:b.url,path:b.path,filename:b.filename}},overall:{width:"310px"},data:[{label:"URL地址:",name:"url",placeholder:"URL地址",value:"http://",eventType:["input","focus"],input:function(){var c=$(this).val(),b=c.split("/");$('[name="filename"]').val(b[b.length-1])}},{label:"下载到:",name:"path",placeholder:"下载到",value:a.file_path},{label:"文件名:",name:"filename",placeholder:"保存文件名",value:"",eventType:"enter",enter:function(){$(".download_file_view .layui-layer-btn0").click()}}]},function(c,b){var d=bt.open({type:1,title:"下载文件",area:"500px",shadeClose:false,skin:"download_file_view",content:b[0].outerHTML,btn:["确认","关闭"],success:function(){c.setEvent()},yes:function(f,e){var g=c.getVal();if(!bt.check_url(g.url)){layer.msg("请输入有效的url地址..",{icon:2});return false}c.submitForm(function(h){a.render_present_task_list();layer.msg(h.msg,{icon:h.status?1:2});d.close()})}})})},set_style_width:function(d,c){var b=bt.get_cookie("formHeader")||$("#file_list_info").html(),a="",f=new RegExp("\\.file_"+d+"\\s?\\{width\\s?\\:\\s?(\\w+)\\s\\!important;\\}","g"),e={name:150,type:80,size:80,mtime:150,accept:80,user:80,ps:150};a=b.replace(f,function(h,g,j,i){return".file_"+d+"{width:"+(c<80?e[d]+"px":c+"px")+" !important;}"});$("#file_list_info").html(a)},set_file_table_width:function(){var f=this,i=$(".file_table_view")[0].offsetWidth,h=0,a=0,j=0,e="",c=0,d=45,g="",b={};$.each(this.file_header,function(k,l){if(l=="auto"){h++;b[k]=0}else{a+=l;e+="."+k+"{width:"+(k!="file_operation"?l:l-16)+"px !important;}"}});if(this.is_mobile){$(".file_operation.file_th").attr("style","margin-right:-10px !important;")}if((this.file_list.length*d)>$(".file_list_content").height()){b.file_tr=i-(this.is_mobile?0:this.scroll_width);i=i;g+=".file_td.file_operation{width:"+(this.file_header.file_operation-(this.is_mobile?0:this.scroll_width)-10)+"px !important;}";g+=".file_th.file_operation{padding-right:"+(10+(this.is_mobile?0:this.scroll_width))+"px !important}"}else{i=i;b.file_tr=i;if(this.is_mobile){g+=".file_td.file_operation{width:"+(this.file_header.file_operation-20)+"px !important;}"}}b.file_list_header=i;j=i-a;c=j/h;$.each(b,function(k,l){e+="."+k+"{width:"+(l==0?c:l)+"px !important;}"});$("#file_list_info").html(e+g)},render_path_list:function(h){var e=this,d='
    ',b="",g=this.file_path.split("/").splice(1),f=this.file_path.split("/")[0];if(bt.os==="Windows"){if(g.length==0){g=[]}g.unshift('本地磁盘('+f+")")}else{if(this.file_path=="/"){g=[]}g.unshift("根目录")}for(var c=0;c '+g[c]+' '}$(".path_input").val("").attr("data-path",this.file_path);var a=$(".file_path_input .file_dir_view");a.html(d);a.attr("data-width",a.width());e.set_dir_view_resize.delay(e,100)},render_path_down_list:function(b,e,f){var c=this,a="",d=$(b).parent().next().find(".file_dir").attr("title");this.get_dir_list({path:e},function(g){$.each(c.data_reconstruction(g.DIR),function(h,j){var i=(e!="/"?e:"")+"/"+j.filename;a+='
  • '+j.filename+"
  • "});$(b).html(a)})},reader_file_list:function(d,g){var c=this,a="",e="",b=bt.get_cookie("rank"),f=bt.get_cookie("record_paste_type");if(f!="null"&&f!=undefined){$(".file_nav_view .file_all_paste").removeClass("hide")}else{$(".file_nav_view .file_all_paste").addClass("hide")}$(".file_table_view").removeClass(".list_view,.icon_view").addClass(b=="list"?"list_view":"icon_view");$(".cut_view_model:nth-child("+(b=="list"?"2":"1")+")").addClass("active").siblings().removeClass("active");this.file_images_list=[];this.get_dir_list(d,function(h){if(h.status===false&&h.msg.indexOf("指定目录不存在!")>-1){return c.reader_file_list({path:"/www"})}c.file_path=c.path_check(h.PATH);c.file_list=$.merge(c.data_reconstruction(h.DIR,"DIR"),c.data_reconstruction(h.FILES));c.is_recycle=h.FILE_RECYCLE;c.file_store_list=h.STORE;bt.set_cookie("Path",c.path_check(h.PATH));c.reader_file_list_content(c.file_list,function(n){$(".path_input").attr("data-path",c.file_path);$(".file_nav_view .multi").addClass("hide");$(".selection_right_menu").removeAttr("style");var m=["100","200","500","1000","2000"];for(var j=0;j"+k+""}var l=$(h.PAGE);l.append('每页");$(".filePage").html('
    共'+n.is_dir_num+"个目录,"+(c.file_list.length-n.is_dir_num)+'个文件,文件大小:计算
    '+l[0].outerHTML);if(d.is_operating){d.is_operating=false}if(d.is_operating&&c.file_operating[c.file_pointer]!=h.PATH){e=c.file_operating[c.file_pointer+1];if(typeof e!="undefined"&&e!=h.PATH){c.file_operating.splice(c.file_pointer+1)}c.file_operating.push(h.PATH);c.file_pointer=c.file_operating.length-1}c.render_path_list();c.set_file_forward();c.render_favorites_list();c.set_file_view();c.set_file_table_width();if(g){g(h)}})})},data_reconstruction:function(c,a,f){var b=this,e=[],d=[["/etc","PS: 系统主要配置文件目录"],["/home","PS: 用户主目录"],["/tmp","PS: 公共的临时文件存储点"],["/root","PS: 系统管理员的主目录"],["/home","PS: 用户主目录"],["/usr","PS: 系统应用程序目录"],["/boot","PS: 系统启动核心目录"],["/lib","PS: 系统资源文件类库目录"],["/mnt","PS: 存放临时的映射文件系统"],["/www","PS: 宝塔面板程序目录"],["/bin","PS: 存放二进制可执行文件目录"],["/dev","PS: 存放设备文件目录"],["/www/wwwlogs","PS: 默认网站日志目录"],["/www/server","PS: 宝塔软件安装目录"],["/www/wwwlogs","PS: 网站日志目录"],["/www/Recycle_bin","PS: 回收站目录,勿动"],["/www/server/panel","PS: 宝塔主程序目录,勿动"],["/www/server/panel/plugin","PS: 宝塔插件安装目录"],["/www/server/panel/BTPanel","PS: 宝塔面板前端文件"],["/www/server/panel/BTPanel/static","PS: 宝塔面板前端静态文件"],["/www/server/panel/BTPanel/templates","PS: 宝塔面板前端模板文件"],[bt.get_cookie("backup_path"),"PS: 默认备份目录"],[bt.get_cookie("sites_path"),"PS: 默认建站目录"]];if(c.length<1){return[]}$.each(c,function(g,l){var j=l.split(";"),m="",n=j[0].split("."),k=n[n.length-1];switch(j[0]){case".user.ini":m="PS: PHP用户配置文件(防跨站)!";break;case".htaccess":m="PS: Apache用户配置文件(伪静态)";break;case"swap":m="PS: 宝塔默认设置的SWAP交换分区文件";break}if(j[0].indexOf(".upload.tmp")!=-1){m="PS: 宝塔文件上传临时文件,重新上传从断点续传,可删除"}for(var h=0;h0){$.each(this.file_store_list,function(b,c){a+='
  • '+c.name+"
  • "});a+='
  • 管理
  • '}else{a='
  • (空)
  • '}$(".favorites_file_path .nav_down_list").html(a)},set_favorites_manage:function(){var a=this;layer.open({type:1,title:"管理收藏夹",area:["850px","580px"],closeBtn:2,shift:5,shadeClose:false,content:"
    路径操作
    ",success:function(b){a.render_favorites_type_list();setTimeout(function(){$(b).css("top",($(window).height()-$(b).height())/2)},50)},cancel:function(){a.reader_file_list({path:a.file_path})}})},render_favorites_type_list:function(){var a="";this.$http("get_files_store",function(b){if(b.length>0){$.each(b,function(d,c){a+=''+c.path+'删除"})}else{a='暂无收藏'}$(".favorites_body").html(a);if(jQuery.prototype.fixedThead){$(".stroe_tab_list .divtable").fixedThead({resize:false})}else{$(".stroe_tab_list .divtable").css({overflow:"auto"})}})},load_favorites_index_list:function(){var a=this;this.$http("get_files_store",function(b){a.file_store_list=b;a.render_favorites_list()})},del_favorites:function(b){var a=this;layer.confirm("是否确定删除路径【"+b+"】?",{title:"删除收藏夹",closeBtn:2,icon:3},function(c){a.$http("del_files_store",{path:b},function(d){if(d.status){a.render_favorites_type_list()}layer.msg(d.msg,{icon:d.status?1:2})})})},reader_file_list_content:function(e,f){var a="",d=this,c=0,b=0;$.each(e,function(i,l){var j=l.filename,h=bt.get_random(10),m=(d.file_path+"/"+l.filename).replace("//","/"),k=d.determine_file_type(l.ext,"compress"),g=(function(){var n="打开";switch(d.determine_file_type(l.ext)){case"images":n="预览";break;case"video":n="播放";break;default:if(d.determine_file_type(l.ext)=="compress"){n=""}else{n="编辑"}break}l.type=="dir"?n="打开":"";return n}(l));d.file_list[i]["only_id"]=h;a+='
    "+l.filename+l.soft_link+""+(l.caret?'':"")+(l.down_id!=0?'':"")+'
    '+(l.type=="dir"?"文件夹":d.ext_type_tips(l.ext))+'
    '+l.user+" / "+l.root_level+'
    '+(l.type=="dir"?'计算':bt.format_size(l.size))+'
    '+bt.format_data(l.mtime)+'
    '+(l.is_os_ps?l.ps:'')+'
    ';if(l.type=="dir"){c++}l.path=m;l.open_type=d.determine_file_type(l.ext);if(l.open_type=="images"){l.images_id=b;d.file_images_list.push(l.path);b++}});$(".file_list_content").html(a);if(f){f({is_dir_num:c})}d.clear_table_active()},render_file_disk_list:function(){var c=this,a="",b="";c.get_disk_list(function(d){$.each(d,function(e,f){a+='";b+='
  • '+(f.path=="/"?"根目录":f.path)+" ("+f.size[2]+")
  • "});$(".mount_disk_list").html('
    磁盘分区
    '+a+"
    ");c.set_menu_line_view_resize()})},render_file_groud_menu:function(h,b){var f=this,g=$(b).data("index"),a="打开",d=f.file_list[g],j=["zip","rar","gz","war","tgz","bz2"],i=0,c={open:a,split_0:true,download:"下载",share:"分享目录/文件",cancel_share:"取消分享",favorites:"收藏目录/文件",cancel_favorites:"取消收藏",split_1:true,dir_kill:"目录查杀",authority:"权限",split_2:true,copy:"复制",shear:"剪切",rename:"重命名",del:"删除",split_3:true,compress:"创建压缩",unzip:"解压",open_find_dir:"打开文件所在目录",split_4:true,property:"属性"};switch(f.determine_file_type(d.ext)){case"images":a="预览";break;case"video":a="播放";break;default:a="编辑";break}c.open=(d.type=="dir"?"打开":a);if(d.type==="dir"){delete c.download}if(d.open_type=="compress"){delete c.open}if(d.down_id!=0){delete c.share}else{delete c.cancel_share;c.share=(d.type=="dir"?"分享目录":"分享文件")}if(d.caret!==false){delete c.favorites}else{delete c.cancel_favorites;c.favorites=(d.type=="dir"?"收藏目录":"收藏文件")}if(d.ext=="php"){c.dir_kill="文件查杀"}if(d.ext!="php"&&d.type!="dir"){delete c.dir_kill}var e=0;$.each(j,function(k,l){if(l==d.ext){e++}});if(e==0){delete c.unzip}if(!d.is_search){delete c.open_find_dir}else{c.open_find_dir=(d.type=="dir"?"打开该目录":"打开文件所在目录")}f.file_selection_operating=c;f.reader_menu_list({el:$(".selection_right_menu"),ev:h,data:d,list:c})},render_file_all_menu:function(e,c){var d=this,b={refresh:"刷新",split_0:true,upload:"上传",create:["新建文件夹/文件",{create_dir:"新建文件夹",create_files:"新建文件",soft_link:"软链接文件"}],web_shell:"终端",split_1:true,paste:"粘贴"},a=0,f=bt.get_cookie("record_paste_type");if(f=="null"||f==undefined){delete b.split_1;delete b.paste}d.reader_menu_list({el:$(".selection_right_menu"),ev:e,data:{},list:b})},render_files_multi_menu:function(e){var d=this,f=[["copy","复制"],["shear","剪切"],["authority","权限"],["compress","创建压缩"],["del","删除"]],c=$(".selection_right_menu").find("ul"),b=c.height(),a=c.width(),g=e.clientX-((this.area[0]-e.clientX)')}else{c.append($('
  • '+h[1]+"
  • ").append(i).on("click",{type:h[0],data:d.file_table_arry},function(k){$(".selection_right_menu").removeAttr("style");d.batch_file_manage(k.data.type);k.stopPropagation();k.preventDefault()}))}});$(".selection_right_menu").css({left:g,top:e.clientY-((this.area[1]-e.clientY)')}else{if(Array.isArray(l)){i=$('
      ');j=i.find(".set_group");$.each(l[1],function(n,m){j.append($('
    • '+m+"
    • ").on("click",{type:n,data:b.data},function(o){f.file_groud_event($.extend(o.data.data,{open:o.data.type,index:parseInt($(b.ev.currentTarget).data("index")),element:b.ev.currentTarget,type_tips:b.data.type=="dir"?"文件夹":"文件"}));b.el.removeAttr("style");o.stopPropagation();o.preventDefault()}))})}e.append($('
    • '+(Array.isArray(l)?l[0]:l)+"
    • ").append(i).on("click",{type:k,data:b.data},function(m){f.file_groud_event($.extend(m.data.data,{open:m.data.type,index:parseInt($(b.ev.currentTarget).data("index")),element:b.ev.currentTarget,type_tips:b.data.type=="dir"?"文件夹":"文件"}));if(k!="compress"&&k!="create"){b.el.removeAttr("style")}m.stopPropagation();m.preventDefault()}))}});d=e.innerHeight();g=b.ev.clientY-((this.area[1]-b.ev.clientY)当前未开启回收站,批量删除后将无法恢复,是否继续删除?',function(){a.$http("SetBatchData",b,function(c){if(c.status){a.reader_file_list({path:a.file_path})}layer.msg(c.msg,{icon:c.status?1:2})})})}},batch_file_paste:function(){var a=this,b=bt.get_cookie("record_paste_type");this.check_exists_files_req({dfile:this.file_path},function(c){if(c.length>0){var d="";for(var e=0;e'+c[e].filename+""+ToSize(c[e].size)+""+getLocalTime(c[e].mtime)+""}var f='
      '+d+"
      文件名大小最后修改时间
      ";SafeMessage("即将覆盖以下文件",f,function(){a.$http("BatchPaste",{type:b,path:a.file_path},function(g){if(g.status){bt.set_cookie("record_paste_type",null);a.reader_file_list({path:a.file_path})}layer.msg(g.msg,{icon:g.status?1:2})})})}else{a.$http("BatchPaste",{type:b,path:a.file_path},function(g){if(g.status){bt.set_cookie("record_paste_type",null);a.reader_file_list({path:a.file_path})}layer.msg(g.msg,{icon:g.status?1:2})})}})},recycle_bin_view:function(){var a=this;layer.open({title:lan.files.recycle_bin_title,type:1,skin:"recycle_view",area:["1100px","672px"],closeBtn:2,content:'
      '+lan.files.recycle_bin_on+'
      '+lan.files.recycle_bin_on_db+'
      '+lan.files.recycle_bin_ps+'

      '+lan.files.recycle_bin_type1+'

      '+lan.files.recycle_bin_type2+'

      '+lan.files.recycle_bin_type3+'

      '+lan.files.recycle_bin_type4+'

      '+lan.files.recycle_bin_type5+'

      '+lan.files.recycle_bin_type6+'

      ',success:function(){if(window.location.href.indexOf("database")!=-1){$(".re-con-menu p:last-child").addClass("on").siblings().removeClass("on");$(".re-con-menu p:eq(5)").click()}else{$(".re-con-menu p:eq(0)").click()}var b=a.render_recycle_list();$(".re-con-menu").on("click","p",function(){var c=$(this).data("type");$(this).addClass("on").siblings().removeClass("on");b.$refresh_table_list(true)})}})},render_recycle_list:function(){var a=this;$("#recycle_table").empty();var b=bt_tools.table({el:"#recycle_table",url:"/files?action=Get_Recycle_bin",height:480,dataFilter:function(e){var k=[];switch($(".re-con-menu p.on").index()){case 0:for(var d=0;d-1){h.dname=h.dname.replace("BTDB_","");h.name=h.name.replace("BTDB_","");k.push($.extend(h,{type:"files"}))}else{if(f=="images"){k.push($.extend(h,{type:f}))}else{k.push($.extend(h,{type:"files"}))}}}break;case 1:for(var d=0;d-1){h.dname=h.dname.replace("BTDB_","");h.name=h.name.replace("BTDB_","");console.log();k.push($.extend(h,{type:"files"}))}}break}$("#Set_Recycle_bin").attr("checked",e.status);$("#Set_Recycle_bin_db").attr("checked",e.status_db);return{data:k}},column:[{type:"checkbox","class":"",width:18},{fid:"name",title:lan.files.recycle_bin_th1,width:155,template:function(c){return'
      '+c.name+"
      "}},{fid:"dname",title:lan.files.recycle_bin_th2,width:310,template:function(c){return''+c.dname+""}},{fid:"size",title:lan.files.recycle_bin_th3,width:70,template:function(c){return''+bt.format_size(c.size)+""}},{fid:"time",title:lan.files.recycle_bin_th4,width:120,template:function(d,c){return''+bt.format_data(d.time)+""}},{type:"group",align:"right",width:95,title:lan.files.recycle_bin_th5,group:[{title:lan.files.recycle_bin_re,event:function(g,c,f,d,e){bt_file.ReRecycleBin(g.rname,function(){e.$delete_table_row(c)})}},{title:lan.files.recycle_bin_del,event:function(g,c,f,d,e){bt_file.DelRecycleBin(g.rname,function(){e.$delete_table_row(c)})}}]}],tootls:[{type:"batch",positon:["left","bottom"],placeholder:"请选择批量操作",buttonValue:"批量操作",disabledSelectValue:"请选择需要批量操作的端口!",selectList:[{title:"恢复",url:"/files?action=Re_Recycle_bin",load:true,param:function(c){return{path:c.rname}},callback:function(c){bt.confirm({title:"批量恢复文件",msg:"是否批量恢复选中的文件,是否继续?",icon:0},function(d){layer.close(d);c.start_batch({},function(h){var f="";for(var e=0;e"+g.name+'
      '+(g.request.status?"恢复成功":"恢复失败")+"
      "}b.$batch_success_table({title:"批量恢复文件",th:"文件名称",html:f});b.$refresh_table_list(true)})})}},{title:"永久删除文件",url:"/files?action=Del_Recycle_bin",load:true,param:function(c){return{path:c.rname}},callback:function(c){bt.confirm({title:"批量删除文件",msg:"是否批量删除选中的文件,文件将彻底删除,不可恢复,是否继续?",icon:0},function(d){layer.close(d);c.start_batch({},function(h){var f="";for(var e=0;e"+g.name+'
      '+(g.request.status?"删除成功":"删除失败")+"
      "}b.$batch_success_table({title:"批量删除文件",th:"文件名称",html:f});b.$refresh_table_list(true)})})}}]}]});bt_tools.$fixed_table_thead("#recycle_table .divtable");return b},Set_Recycle_bin:function(a){var d=layer.msg(lan["public"].the,{icon:16,time:0,shade:[0.3,"#000"]});var b=this,c={};if(a==1){c={db:a}}$.post("/files?action=Recycle_bin",c,function(e){layer.close(d);if(e.status){if(a==undefined){b.is_recycle=$("#Set_Recycle_bin").prop("checked")}}layer.msg(e.msg,{icon:e.status?1:5})})},ReRecycleBin:function(a,b){layer.confirm(lan.files.recycle_bin_re_msg,{title:lan.files.recycle_bin_re_title,closeBtn:2,icon:3},function(){var c=layer.msg(lan.files.recycle_bin_re_the,{icon:16,time:0,shade:[0.3,"#000"]});$.post("/files?action=Re_Recycle_bin","path="+encodeURIComponent(a),function(d){layer.close(c);layer.msg(d.msg,{icon:d.status?1:5});if(b){b(d)}})})},DelRecycleBin:function(a,b){layer.confirm(lan.files.recycle_bin_del_msg,{title:lan.files.recycle_bin_del_title,closeBtn:2,icon:3},function(){var c=layer.msg(lan.files.recycle_bin_del_the,{icon:16,time:0,shade:[0.3,"#000"]});$.post("/files?action=Del_Recycle_bin","path="+encodeURIComponent(a),function(d){layer.close(c);layer.msg(d.msg,{icon:d.status?1:5});if(b){b(d)}})})},CloseRecycleBin:function(){var a=this;layer.confirm(lan.files.recycle_bin_close_msg,{title:lan.files.recycle_bin_close,closeBtn:2,icon:3},function(){var b=layer.msg("
      "+lan.files.recycle_bin_close_the+"
      ",{icon:16,time:0,shade:[0.3,"#000"]});setTimeout(function(){getSpeed(".myspeed")},1000);$.post("/files?action=Close_Recycle_bin","",function(c){layer.close(b);layer.msg(c.msg,{icon:c.status?1:5});a.render_recycle_list();$("#RecycleBody").html("")})})},open_property_view:function(a){console.log(a);var b=this;b.$http("get_file_attribute",{filename:a.path},function(c){layer.open({type:1,closeBtn:2,title:"[ "+a.filename+" ] - "+(a.is_dir?"文件夹":"文件")+"属性",area:["580px","500px"],shadeClose:false,content:'
      常规 详细信息 历史版本
      类型:
      '+((c.is_dir||c.is_link)?c.st_type:b.ext_type_tips(c.st_type))+'
      文件路径:
      '+c.path+'
      大小:
      '+bt.format_size(c.st_size)+" ("+(b.font_thousandth(c.st_size)+" 字节")+')
      权限:
      '+c.mode+'
      所属组:
      '+c.group+'
      所属用户:
      '+c.user+'
      访问时间:
      '+bt.format_data(c.st_atime)+'
      修改时间:
      '+bt.format_data(c.st_mtime)+'
      属性
      修改时间
      文件大小
      MD5
      操作
      ',success:function(j,h){$(".bt-property-setting .tab-nav span").click(function(){var i=$(this).index();$(this).addClass("on").siblings().removeClass("on");$(".property-box:eq("+i+")").addClass("active").siblings().removeClass("active")});$(".history_box_view").on("click",".open_history_file",function(){var i=$(this).attr("data-time");openEditorView(0,a.path);setTimeout(function(){aceEditor.openHistoryEditorView({filename:a.path,history:i},function(){layer.close(h);$(".ace_conter_tips").show();$(".ace_conter_tips .tips").html("只读文件,文件为"+_item.path+",历史版本 [ "+bt.format_data(new Number(i))+' ]点击恢复当前历史版本')})},500)});$(".history_box_view").on("click",".recovery_file_historys",function(){aceEditor.event_ecovery_file(this)});var d={filename:["文件名",a.filename],type:["类型",(c.is_dir||c.is_link)?c.st_type:b.ext_type_tips(c.st_type)],path:"文件路径",st_size:["文件大小",bt.format_size(c.st_size)+" ("+(b.font_thousandth(c.st_size)+" 字节")+")"],st_atime:["访问时间",bt.format_data(c.st_atime)],st_mtime:["修改时间",bt.format_data(c.st_mtime)],st_ctime:["元数据修改时间",bt.format_data(c.st_ctime)],md5:"文件MD5",sha1:"文件sha1",user:"所属用户",group:"所属组",mode:"文件权限",lsattr:"特殊权限",st_uid:"用户id",st_gid:"用户组id",st_nlink:"inode的链接数",st_ino:"inode的节点号",st_mode:"inode保护模式",st_dev:"inode驻留设备"},g="",k="";for(var m in d){if(Object.hasOwnProperty.call(d,m)){var f=d[m],l=($.isArray(f)?f[1]:c[m]);g+='
      '+($.isArray(f)?f[0]:f)+'
      '+l+"
      "}}for(var e=0;e
      '+bt.format_data(n.st_mtime)+'
      '+bt.format_size(n.st_size)+"
      "+n.md5+'
      查看  |  恢复
      '}if(k===""){k+='
      当前文件无历史版本
      '}$(".details_list").html(g);$(".history_list ").html(k);b.fixed_table_thead(".details_box_view");b.fixed_table_thead(".history_box_view ")}})})},fixed_table_thead:function(a){$(a).scroll(function(){var b=this.scrollTop;this.querySelector("thead").style.transform="translateY("+b+"px)"})},font_thousandth:function(a){var b=String(a).split(".");b[0]=b[0].replace(new RegExp("(\\d)(?=(\\d{3})+$)","ig"),"$1,");return b.join(".")},open_images_preview:function(e){var d=this,a=$('
      '+e.filename+'
      '),c={natural_width:0,natural_height:0,init_width:0,init_height:0,preview_width:0,preview_height:0,current_width:0,current_height:0,current_left:0,current_top:0,rotate:0,scale:1,images_mouse:false};if($(".preview_images_mask").length>0){$("#preview_images").attr("src","/download?filename="+e.path);return false}$("body").css("overflow","hidden").append(a);c.preview_width=a[0].clientWidth;c.preview_height=a[0].clientHeight;$(".preview_body img").load(function(){var f=$(this)[0];if(!$(this).attr("data-index")){$(this).attr("data-index",e.images_id)}c.natural_width=f.naturalWidth;c.natural_height=f.naturalHeight;b(false)});$(".preview_images_mask .preview_head").on("mousedown",function(i){i=i||window.event;var h=$(this).parent();$("body").addClass("select");$(this).onselectstart=$(this).ondrag=function(){return false};if($(i.target).hasClass("preview_close")){return}var g=i.clientX-h.offset().left;var f=i.clientY-h.offset().top;$(document).on("mousemove",function(l){l=l||window.event;var k=l.clientX-g;var j=l.clientY-f;if(k<0){k=0}else{if(k>window.innerWidth-h.width()){k=window.innerWidth-h.width()}}if(j<0){j=0}else{if(j>window.innerHeight-h.height()){j=window.innerHeight-h.height()}}h.css({left:k,top:j,margin:0})}).on("mouseup",function(){$(this).unbind("mousemove mouseup")})});$(".preview_images_mask #preview_images").on("mousedown",function(j){j=j||window.event;$(this).onselectstart=$(this).ondrag=function(){return false};var f=$(this);var i=$(".preview_images_mask").offset();var h=j.clientX-i.left;var g=j.clientY-i.top;$(".preview_images_mask").on("mousemove",function(p){p=p||window.event;var o=p.clientX-i.left-h,n=p.clientY-i.top-g,l=Math.abs(c.rotate/90),q=(l%2==0?c.preview_width:c.preview_height),s=(l%2==0?c.preview_height:c.preview_width),k,r;if(c.current_width>q){var t=q-c.current_width;k=c.current_left+o;if(k>0){k=0}else{if(ks){var m=s-c.current_height;r=c.current_top+n;if(r>0){r=0}else{if(rs&&c.current_top<=0){if((c.current_height-s)<=c.current_top){c.current_top-=n}}f.css({left:c.current_left,top:c.current_top})}).on("mouseup",function(){$(this).unbind("mousemove mouseup")}).on("dragstart",function(){j.preventDefault()})}).on("dragstart",function(){return false});$(".preview_close").click(function(f){$(".preview_images_mask").remove()});$(".preview_toolbar a").click(function(){var g=$(this).index(),f=$("#preview_images");switch(g){case 0:case 1:c.rotate=g?(c.rotate+90):(c.rotate-90);b();break;case 2:case 3:if(c.scale==3&&g==2||c.scale==0.2&&g==3){layer.msg((c.scale>=1?"图像放大,已达到最大尺寸。":"图像缩小,已达到最小尺寸。"));return false}c.scale=(g==2?Math.round((c.scale+0.4)*10):Math.round((c.scale-0.4)*10))/10;b();break;case 4:var h=c.rotate%360;if(h>=180){c.rotate+=(360-h)}else{c.rotate-=h}c.scale=1;b();break}});$(".preview_full,.preview_small").click(function(){if($(this).hasClass("preview_full")){$(this).addClass("hidden").prev().removeClass("hidden");c.preview_width=d.area[0];c.preview_height=d.area[1];a.css({width:d.area[0],height:d.area[1],top:0,left:0,margin:0}).data("type","full");b()}else{$(this).addClass("hidden").next().removeClass("hidden");$(".preview_images_mask").removeAttr("style");c.preview_width=750;c.preview_height=650;b()}});$(".preview_cut_view a").click(function(){var h="",f=$("#preview_images"),g=parseInt(f.attr("data-index"));if(!$(this).index()){g=g===0?(d.file_images_list.length-1):g-1;h=d.file_images_list[g]}else{g=(g==(d.file_images_list.length-1))?0:(g+1);h=d.file_images_list[g]}f.attr("data-index",g).attr("src","/download?filename="+h);$(".preview_title").html(d.get_path_filename(h))});function b(k){var h=Math.abs(c.rotate/90),g=(h%2==0?c.preview_width:c.preview_height),j=(h%2==0?c.preview_height:c.preview_width),i=$("#preview_images"),f={};c.init_width=c.natural_width;c.init_height=c.natural_height;if(c.init_width>g){c.init_width=g;c.init_height=parseFloat(((g/c.natural_width)*c.init_height).toFixed(2))}if(c.init_height>j){c.init_width=parseFloat(((j/c.natural_height)*c.init_width).toFixed(2));c.init_height=j}c.current_width=parseFloat(c.init_width*c.scale);c.current_height=parseFloat(c.init_height*c.scale);c.current_left=parseFloat(((c.preview_width-c.current_width)/2).toFixed(2));c.current_top=parseFloat(((c.preview_height-c.current_height)/2).toFixed(2));f={width:c.current_width,height:c.current_height,top:c.current_top,left:c.current_left,display:"inline",transform:"rotate("+c.rotate+"deg)",opacity:1,transition:"all 100ms"};if(k===false){delete f.transition}i.css(f)}},open_video_play:function(b){var e=b.path,d="/download?filename="+b.path,a=b.path.split("/"),c=a.slice(0,a.length-1).join("/");layer.open({type:1,closeBtn:2,title:'正在播放['+a[a.length-1]+"]",area:["890px","402px"],shadeClose:false,skin:"movie_pay",content:'
      ',success:function(){$.post("/files?action=get_videos",{path:c},function(k){var j='',g=0;for(var h=0;h"}j+="
      文件名大小
      '+k[h].name+''+ToSize(k[h].size)+"
      ";$(".video-list").html(j).scrollTop(g*34)})}})},play_file:function(d,b){if($("#btvideo video").attr("data-filename")==b){return false}var e="/download?filename="+b+"&play=true";var a='';$("#btvideo").html(a);var c=b.split("/");$(".btvideo-title").html(c[c.length-1]);$(".video-avt").removeClass("video-avt");$(d).parents("tr").addClass("video-avt")},copy_file_or_dir:function(a){bt.set_cookie("record_paste",a.path);bt.set_cookie("record_paste_type","copy");$(".file_all_paste").removeClass("hide");layer.msg("复制成功,请点击粘贴按钮,或Ctrl+V粘贴")},cut_file_or_dir:function(a){bt.set_cookie("record_paste",a.path);bt.set_cookie("record_paste_type","cut");$(".file_all_paste").removeClass("hide");layer.msg("剪切成功,请点击粘贴按钮,或Ctrl+V粘贴")},paste_file_or_dir:function(){var c=this,d=bt.get_cookie("record_paste_type"),a=bt.get_cookie("record_paste"),b="";if(a!="null"&&a!=undefined){b=a.split("/").pop()}if(c.file_path.indexOf(a)>-1){layer.msg("文件夹禁止粘贴到项目本身!",{icon:0});return false}if(d!="null"&&d!=undefined){switch(d){case"cut":case"copy":this.check_exists_files_req({dfile:this.file_path,filename:b},function(e){if(e.length>0){var f="";for(var g=0;g'+e[g].filename+""+ToSize(e[g].size)+""+getLocalTime(e[g].mtime)+""}var h='
      '+f+"
      文件名大小最后修改时间
      ";SafeMessage("即将覆盖以下文件",h,function(){c.config_paste_to(a,b)})}else{c.config_paste_to(a,b)}});break;case"1":case"2":c.batch_file_paste();break}}},config_paste_to:function(d,b){var c=this,a=bt.get_cookie("record_paste_type");this.$http(a=="copy"?"CopyFile":"MvFile",{sfile:d,dfile:(this.file_path+"/"+b)},function(e){if(e.status){bt.set_cookie("record_paste",null);bt.set_cookie("record_paste_type",null);c.reader_file_list({path:c.file_path})}layer.msg(e.msg,{icon:e.status?1:2})})},rename_file_or_dir:function(b){var a=this;a.is_editor=true;$(".file_list_content .file_tr:nth-child("+(b.index+1)+")").addClass("editr_tr").find(".file_title").empty().append($((bt.get_cookie("rank")=="icon"?'":'')));if(bt.get_cookie("rank")=="icon"){$("textarea[name=rename_file_input]").css({height:$("textarea[name=rename_file_input]")[0].scrollHeight})}$((bt.get_cookie("rank")=="icon"?"textarea":"input")+"[name=rename_file_input]").on("input",function(){if(bt.get_cookie("rank")=="icon"){this.style.height="auto";this.style.height=this.scrollHeight+"px"}if(b.type=="file"){var d=$(this).val().split("."),c=d[d.length-1];$(this).parent().prev().find(".file_icon").removeAttr("class").addClass("file_icon file_"+c)}}).keyup(function(c){if(c.keyCode==13){$(this).blur()}c.stopPropagation();c.preventDefault()}).blur(function(){var d=$(this).val().replace(/[\r\n]/g,""),c={sfile:b.path,dfile:a.path_resolve(a.file_path,d)};if(b.filename==d||d==""){$(".file_list_content .file_tr:nth-child("+(b.index+1)+")").removeClass("editr_tr").find(".file_title").empty().append($(""+b.filename+""));a.is_editor=false;return false}if(a.match_unqualified_string(d)){return layer.msg('名称不能含有 /\\:*?"<>|符号',{icon:2})}a.rename_file_req(c,function(e){a.reader_file_list({path:a.file_path},function(){layer.msg(e.msg,{icon:e.status?1:2})})});a.is_editor=false}).focus()},set_file_share:function(b){var a=this;this.loadY=bt.open({type:1,shift:5,closeBtn:2,area:"450px",title:"设置分享"+b.type_tips+"-["+b.filename+"]",btn:["生成外链","取消"],content:'
      分享名称
      有效期
      提取码
      ',yes:function(g,e){var f=$("[name=ps]").val(),c=$("[name=expire]:checked").val(),d=$("[name=password]").val();if(f===""){layer.msg("分享名称不能为空",{icon:2});return false}a.create_download_url({filename:b.path,ps:f,password:d,expire:c},function(h){if(!h.status){layer.msg(h.msg,{icon:h.status?1:2});return false}else{var i=h.msg;a.file_list[b.index]=$.extend(a.file_list[b.index],{down_id:i.id,down_info:i});a.loadY.close();a.info_file_share(b);a.reader_file_list_content(a.file_list)}})},success:function(d,c){$("#random_paw").click(function(){$(this).prev().val(bt.get_random(6))})}})},info_file_share:function(b){var a=this;if(typeof b.down_info=="undefined"){this.get_download_url_find({id:b.down_id},function(c){a.file_list[b.index]=$.extend(a.file_list[b.index],{down_info:c});a.file_share_view(a.file_list[b.index],"fonticon")});return false}this.file_share_view(b,"fonticon")},file_share_view:function(a,c){var e=a;if(c=="fonticon"){e=a.down_info}var d=this,b=location.origin+"/down/"+e.token;this.loadY=bt.open({type:1,shift:5,closeBtn:2,area:"550px",title:"外链分享-["+e.filename+"]",content:'
      分享名称
      过期时间
      '+((e.expire>(new Date("2099-01-01 00:00:00").getTime())/1000)?'永久有效':bt.format_data(e.expire))+'
      ',success:function(i,g){var h=new ClipboardJS(".copy_url");var f=new ClipboardJS(".copy_paw");h.on("success",function(j){layer.msg("复制链接成功!",{icon:1});j.clearSelection()});f.on("success",function(j){layer.msg("复制链接及提取码成功!",{icon:1});j.clearSelection()});$(".layer_close").click(function(){layer.close(g)});$(".QR_code").click(function(){layer.closeAll("tips");layer.tips('
      ',".QR_code",{area:["150px","150px"],tips:[1,"#ececec"],time:0,shade:[0.05,"#000"],shadeClose:true,success:function(){jQuery("#QR_code").qrcode({render:"canvas",text:b,height:130,width:130})}})});$(".close_down").click(function(){d.remove_download_url({id:e.id,fileName:e.filename},function(j){d.loadY.close();if(c=="fonticon"){d.file_list[a.index].down_id=0;d.reader_file_list_content(d.file_list)}if(c=="list"){d.render_share_list()}layer.msg(j.msg,{icon:j.status?1:2})})})}})},del_file_or_dir:function(b){var a=this;if(a.is_recycle){bt.confirm({title:"删除"+b.type_tips+"[ "+b.filename+" ]",msg:"您确定要删除该"+b.type_tips+"[ "+b.path+" ]吗,删除后将移至回收站,是否继续操作?"},function(){a.del_file_req(b,function(c){a.reader_file_list({path:a.file_path});layer.msg(c.msg,{icon:c.status?1:2})})})}else{bt.show_confirm("删除"+b.type_tips+"[ "+b.filename+" ]",'当前未开启回收站,删除该'+(b.type=="dir"?"文件夹":"文件")+"后将无法恢复,是否继续删除?
      ",function(){a.del_file_req(b,function(c){a.reader_file_list({path:a.file_path});layer.msg(c.msg,{icon:c.status?1:2})})})}},cancel_file_favorites:function(c){var b=this,a=c.index;this.loadY=bt.confirm({title:"取消"+c.filename+"收藏",msg:"是否取消["+c.path+"]的收藏,是否继续?"},function(){b.$http("del_files_store",{path:c.path},function(d){if(d.status){b.file_list[a].caret=false;b.reader_file_list_content(b.file_list);b.load_favorites_index_list()}layer.msg(d.msg,{icon:d.status?1:2})})})},set_soft_link:function(b){var a=this;bt_tools.open({title:"创建软链接",area:"520px",content:{"class":"pd20",formLabelWidth:"110px",form:[{label:"文件夹或目录",group:{type:"text",name:"sfile",width:"280px",placeholder:"请选择需要创建的软链的文件夹和文件",icon:{type:"glyphicon-folder-open",event:function(c){},select:"all"},value:"",input:function(c){console.log(arguments)}}},{label:"",group:{type:"help",style:{"margin-top":"0"},"class":"none-list-style",list:["提示:请选择需要创建的软链的文件夹和文件"]}}]},yes:function(e,g,d){var c=e.sfile,f=c.split("/");e=$.extend(e,{dfile:a.file_path+"/"+f[f.length-1]});bt_tools.send("files/CreateLink",e,function(h){if(h.status){layer.close(g);bt.msg(h);a.reader_file_list()}},{tips:"创建软链接"})}})},set_file_authority:function(c,a){var b=this;b.get_file_authority({path:c.path},function(d){b.loadY=layer.open({type:1,closeBtn:2,title:lan.files.set_auth+"["+c.filename+"]",area:"400px",shadeClose:false,content:'
      '+lan.files.file_own+'

      '+lan.files.file_read+'

      '+lan.files.file_write+'

      '+lan.files.file_exec+"

      "+lan.files.file_group+'

      '+lan.files.file_read+'

      '+lan.files.file_write+'

      '+lan.files.file_exec+"

      "+lan.files.file_public+'

      '+lan.files.file_read+'

      '+lan.files.file_write+'

      '+lan.files.file_exec+'

      '+lan.files.file_menu_auth+", "+lan.files.file_own+'
      ",success:function(e,f){b.edit_access_authority();$("#access").keyup(function(){b.edit_access_authority()});$("input[type=checkbox]").change(function(){var i=["owner","group","public"];var h="";for(var j=0;j'})},render_present_task_list:function(){var a=this;this.get_task_req({status:-3},function(b){if(b.length==0){layer.close(a.file_present_task);a.file_present_task=null;a.reader_file_list({path:a.file_path,is_operating:false});return}var d="",c=false;$.each(b,function(e,f){if(f.status==-1){if(!a.file_present_task){a.get_present_task_view()}if(f.type=="1"){d+='
      • 正在下载: '+f.shell+''+f.log.pre+'%取消
        '+f.log.used+"/"+ToSize(f.log.total)+''+(f.log.speed==0?"正在连接..":f.log.speed)+'/s预计还要: '+f.log.time+"
      "}else{d+='
      '+f.name+": "+f.shell+'取消
      '+f.log+"
      "}}else{if(!c){d+='
      等待执行任务
        ';c=true}d+='
      • '+f.name+": "+f.shell+'X
      • '}});if(a.file_present_task){if(c){d+="
      "}$(".message-list").html(d)}setTimeout(function(){a.render_present_task_list()},1000)})},remove_present_task:function(b){var a=this;layer.confirm("是否取消上传当前列表的文件,若取消上传,已上传的文件,需用户手动删除,是否继续?",{title:"取消上传文件",icon:0},function(c){bt.send("remove_task","task/remove_task",{id:b},function(d){layer.msg(d.msg,{icon:1});layer.close(a.file_present_task);a.file_present_task=null});layer.close(c)})},edit_access_authority:function(){var a=$("#access").val();var c=["owner","group","public"];for(var e=0;ec.length){continue}if(b>7){$("#access").val(a.substr(0,a.length-1))}switch(b){case"1":$("#"+c[d]+"_x").prop("checked",true);break;case"2":$("#"+c[d]+"_w").prop("checked",true);break;case"3":$("#"+c[d]+"_x").prop("checked",true);$("#"+c[d]+"_w").prop("checked",true);break;case"4":$("#"+c[d]+"_r").prop("checked",true);break;case"5":$("#"+c[d]+"_r").prop("checked",true);$("#"+c[d]+"_x").prop("checked",true);break;case"6":$("#"+c[d]+"_r").prop("checked",true);$("#"+c[d]+"_w").prop("checked",true);break;case"7":$("#"+c[d]+"_r").prop("checked",true);$("#"+c[d]+"_w").prop("checked",true);$("#"+c[d]+"_x").prop("checked",true);break}}},get_file_authority:function(a,b){this.$http("GetFileAccess",{filename:a.path},function(c){if(b){b(c)}})},set_dir_kill:function(b){var a=this;if(b.ext=="php"){a.$http("file_webshell_check",{filename:b.path},function(c){layer.msg(c.msg,{icon:c.status?1:2})})}else{layer.confirm("目录查杀将包含子目录中的php文件,是否操作?",{title:"目录查杀["+b.filename+"]",closeBtn:2,icon:3},function(c){a.$http("dir_webshell_check",{path:b.path},function(d){layer.msg(d.msg,{icon:d.status?1:2})})})}},path_resolve:function(d,c){var b="",a="";if(!Array.isArray(c)){c=[c]}d.replace(/([\/|\/]*)$/,function(e){a=e;return"www"});$.each(c,function(e,f){b+="/"+f});return(d+b).replace("//","/")},get_ext_name:function(e){var c=e.split(".");var b=["folder","folder-unempty","sql","c","cpp","cs","flv","css","js","htm","html","java","log","mht","php","url","xml","ai","bmp","cdr","gif","ico","jpeg","jpg","JPG","png","psd","webp","ape","avi","mkv","mov","mp3","mp4","mpeg","mpg","rm","rmvb","swf","wav","webm","wma","wmv","rtf","docx","fdf","potm","pptx","txt","xlsb","xlsx","7z","cab","iso","rar","zip","gz","bt","file","apk","bookfolder","folder-empty","fromchromefolder","documentfolder","fromphonefolder","mix","musicfolder","picturefolder","videofolder","sefolder","access","mdb","accdb","fla","doc","docm","dotx","dotm","dot","pdf","ppt","pptm","pot","xls","csv","xlsm"];var d=c[c.length-1];for(var a=0;a')},yes:function(){var g=e.getVal();if(g.dfile==""){return layer.msg("请选择有效的地址",{icon:2})}e.submitForm(function(i,h){setTimeout(function(){a.reader_file_list({path:h.path})},1000);if(i==null||i==undefined){layer.msg(lan.files.zip_ok,{icon:1})}if(i.status){a.render_present_task_list()}layer.close(f)})}})})},unpack_file_to_path:function(d){var c=this,a="zip",b="";b=d.path.substring(0,d.path.lastIndexOf("/"));this.reader_form_line({url:"UnZip",overall:{width:"310px"},data:[{label:"文件名",name:"z_name",placeholder:"压缩文件名",value:d.path},{label:"解压到",name:"z_path",placeholder:"解压路径",value:b},{label:"编码",name:"z_code",type:"select",value:"UTF-8",list:[["UTF-8","UTF-8"],["gb18030","GBK"]]}],beforeSend:function(e){return{sfile:e.z_name,dfile:e.z_path,type:a,coding:e.z_code,password:e.z_password}}},function(f,e){var g=layer.open({type:1,title:"解压文件 [ "+d.filename+" ]",area:"480px",shadeClose:false,closeBtn:2,skin:"unpack_file_view",btn:["解压","关闭"],content:e[0].outerHTML,success:function(){if(d.ext=="gz"){a="tar"}if(a=="zip"){$(".unpack_file_view .line:nth-child(2)").append('
      解压密码
      ')}},yes:function(){var h=f.getVal();if(h.z_name==""){return layer.msg("请输入文件名路径",{icon:2})}if(h.z_path==""){return layer.msg("请输入解压地址",{icon:2})}f.submitForm(function(j,i){layer.close(g);setTimeout(function(){c.reader_file_list({path:i.path})},1000);if(j.status){c.render_present_task_list()}layer.msg(j.msg,{icon:j.status?1:2})})}})})},match_unqualified_string:function(a){var b=RegExp(/[(\*)(\|)(\\)(\:)(\")(\/)(\<)(\>)(\?)(\)]+/);return b.test(a)},reader_form_line:function(a,g){var e=this,d=bt.get_random(10),b=$(''),f=a,c=[],e=this;if(!Array.isArray(a)){f=a.data}$.each(f,function(k,m){var h=m.labelWidth||a.overall.labelWidth||null,i=bt.get_random(10),l=m.labelWidth||a.overall.width||null,j=$('
      "+(m.label||"")+'
      '),n=$((function(){switch(m.type){case"select":return"";break;case"text":default:return"';break}}(m)));if(m.eventType||m.event){if(!Array.isArray(m.eventType)){m.eventType=[m.eventType]}$.each(m.eventType,function(p,o){c.push({el:i,type:o||"click",event:m[o]||null});if(a.el){var q=$('[data-event="'+m.el+'"]');if(m[o]){if(o=="enter"){q.on("keyup",function(s){if(s.keyCode==13){m.event(s)}})}else{q.on(m||"click",m.event)}}else{if(o=="focus"){var r=q.val();if(r!=""){q.val("").focus().val(r)}}else{q[o]()}}}})}j.find(".info-r").append(n);b.append(j)});if(a.el){$(a.el).empty().append(b)}if(g){g({getVal:function(){return $("#"+d).serializeObject()},setEvent:function(){$.each(c,function(h,j){var i=$('[data-event="'+j.el+'"]');if(j.event===null){if(j.type=="focus"){var k=i.val();if(k!=""){i.val("").focus().val(k)}}else{i[j.type]()}}else{if(j.type=="enter"){i.on("keyup",function(l){if(l.keyCode==13){j.event(l)}})}else{i.on(j.type,j.event)}}})},submitForm:function(i){var h=this.getVal();if(a.beforeSend){h=a.beforeSend(h)}e.loadT=bt.load("提交表单内容");bt.send(a.url,("files/"+a.url),h,function(j){e.loadT.close();if(i){i(j,h)}})}},b)}},$http:function(c,b,e){var a=this,d="";if(typeof c=="string"){if(typeof b!="object"){e=b,b={}}if(!Array.isArray(a.method_list[c])){a.method_list[c]=["files",a.method_list[c]]}a.$http({method:c,tips:(a.method_list[c][1]?"正在"+a.method_list[c][1]+",请稍候...":false),module:a.method_list[c][0],data:b,msg:true},e)}else{if(typeof c.tips!="undefined"&&c.tips){d=bt.load(c.tips)}bt.send(c.method,(c.module||"files")+"/"+c.method,c.data||{},function(f){if(d!=""){d.close()}if(typeof f=="string"){f=JSON.parse(f)}if(f.status===false&&f.msg){bt.msg(f);return false}if(b){b(f)}})}}};bt_file.init();Function.prototype.delay=function(a,c,b){if(!Array.isArray(c)){b=c,c=[]}if(typeof b=="undefined"){b=0}setTimeout(this.apply(a,c),b);return this};jQuery.prototype.serializeObject=function(){var b,g,d,c,f;b=this.serializeArray();g={};d=g.hasOwnProperty;for(c=0;c