diff --git a/BTPanel/static/css/files_style.css b/BTPanel/static/css/files_style.css index d8f1cfd1..fe49206b 100644 --- a/BTPanel/static/css/files_style.css +++ b/BTPanel/static/css/files_style.css @@ -2847,4 +2847,125 @@ background: #20a53a; border-color: #38983b; color: #fff; +} +.bt-property-setting .tab-nav{ + font-size: 0px; +} +.bt-property-setting .tab-nav span{ + font-size: 12px; +} +.bt-property-setting .tab-con{ + padding: 5px 0 0; +} +.bt-property-setting .property-box{ + display: none; +} + +.bt-property-setting .property-box.active{ + display: inline-block; + width: 100%; +} + +.bt-property-setting .property-box .attr-box{ + margin: 5px 0; + width: 100%; +} + + +.bt-property-setting .property-box .attr-name{ + width: 90px; + padding-left: 10px; + float: left; +} + +.bt-property-setting .property-box .attr-content{ + margin-left: 80px; +} +.bt-property-setting .property-box .attr-content input{ + height: 32px; + line-height: 32px; + border:1px solid#ccc; + outline: none; + padding-left: 5px; + width: 350px; + border-radius: 2px; +} +.bt-property-setting .property-box .attr-content input:focus{ + border-color: #20a53a; +} + +.bt-property-setting .property-box .file_icon{ + height: 50px; + width: 50px; + position: relative; + display: inline-block; + left:-10px; + top: 2px; +} + +.bt-property-setting .property-box .dividing{ + width: 100%; + height: 1px; + margin: 10px 0; + background-color: #ececec; +} + +.bt-property-setting .property-box .attr-box .attr-name, +.bt-property-setting .property-box .attr-box .attr-content{ + height: 25px; + line-height: 25px; +} +.bt-property-setting .property-box .attr-box .attr-content span{ + width: 450px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; +} +.details_box_view,.history_box_view{ + border:1px solid #ececec; +} +.details_box_view, +.history_box_view, +.property-box{ + height:388px !important; + overflow:auto; +} +.details_box_view table, +.history_box_view table{ + width: 100%; +} +/* .details_box_view table td, +.history_box_view table th{ + + padding: 5 10px; +} */ +.details_box_view thead tr, +.history_box_view thead tr{ + background-color: #f6f6f6; + color: #555; + font-weight: 400; +} +.details_box_view tbody tr:hover, +.history_box_view tbody tr:hover{ + background: #f0f9f7; + cursor: pointer; +} +.details_box_view td div, +.details_box_view th div, +.history_box_view td div, +.history_box_view th div{ + padding: 5px; + height: 30px; + line-height: 20px; +} +.details_box_view thead, +.history_box_view thead{ + border-bottom: 1px solid #f6f6f6; +} +.ellipsis{ + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; } \ No newline at end of file diff --git a/BTPanel/static/css/files_style.min.css b/BTPanel/static/css/files_style.min.css index ebfb2a20..b4942c80 100644 --- a/BTPanel/static/css/files_style.min.css +++ b/BTPanel/static/css/files_style.min.css @@ -1 +1 @@ -.webDelete .vcode #vcodeResult{width:50px;height:26px}*{margin:0;padding:0}.file_table_view.list_view::-webkit-scrollbar{width:12px;height:7px;padding:2px;position:relative}.file_table_view.list_view::-webkit-scrollbar-thumb{border-radius:3px;box-shadow:inset 0 0 6px rgba(0,0,0,.1);background:#bbb}.file_table_view.list_view::-webkit-scrollbar-track{border-radius:3px;box-shadow:inset 0 0 6px rgba(0,0,0,.1);background:#ededed}.file_list_header{height:40px;background:#f6f6f6;border-bottom:none;position:relative;z-index:999;overflow-y:hidden}.file_list_header .file_checkbox,.file_table_view.list_view .file_list_content .file_checkbox{padding:12px!important;margin-left:0!important;cursor:default}.file_list_header .file_checkbox input,.file_table_view.list_view .file_list_content .file_checkbox input{display:none}.file_list_header .file_check,.file_table_view.list_view .file_list_content .file_check{width:16px;height:16px;line-height:16px;border:1px solid #d2d2d2;box-sizing:border-box;border-radius:2px;cursor:pointer;transition:all .2s;background-color:#fff}.file_list_header .file_main_title{line-height:40px;height:40px;overflow:hidden;border:1px solid transparent;border-bottom:none}.file_list_header .file_check i,.file_table_view.list_view .file_list_content .file_check i{position:relative;top:-2px;font-size:14px}.file_table_view.icon_view{position:relative;overflow:hidden}.file_table_view.list_view{position:relative;overflow:auto;z-index:1}.file_table_view .file_name .file_title i:hover{color:#000;cursor:pointer}.file_table_view.list_view .file_name{min-width:120px}.file_table_view.icon_view .file_list_header{display:none}.file_table_view.icon_view .app_menu_group,.file_table_view.icon_view .file_accept,.file_table_view.icon_view .file_checkbox,.file_table_view.icon_view .file_mtime,.file_table_view.icon_view .file_name .iconfont,.file_table_view.icon_view .file_ps,.file_table_view.icon_view .file_size,.file_table_view.icon_view .file_type,.file_table_view.icon_view .file_user{display:none}.file_table_view.icon_view .file_tr{display:inline-block;width:80px!important;min-height:90px;padding:5px;vertical-align:top;margin:0 10px 10px 0}.file_table_view.icon_view .file_name{width:100%!important;position:relative}.file_table_view.icon_view .file_ico_type{height:60px}.file_table_view.icon_view .file_list_content .file_icon{width:45px;height:45px;left:21%}.file_table_view.icon_view .file_name i{font-style:inherit}.file_table_view.icon_view .file_title.file_dir_status,.file_table_view.icon_view .file_title.file_file_status{width:70px;text-align:center;word-break:break-all;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}.file_table_view.icon_view .file_list_content .file_tr:hover{background:#f0f9f7!important}.file_table_view.icon_view .file_list_content .file_tr.active{background:#f0f9f7!important;border:1px solid #ddefeb;box-sizing:border-box;padding:4px}.file_list_header .file_th{float:left;padding-left:10px;padding-right:10px;height:40px;line-height:40px;font-size:13px;color:#333;position:relative;cursor:pointer;margin-left:-5px}.file_list_header .file_th>span{vertical-align:middle}.file_table_view.list_view .file_type{min-width:80px;max-width:300px}.file_list_header .file_th{color:#333}.file_list_header .file_th.active{background:#eee;color:#555}.file_list_header .file_th:hover{background:#eee}.file_list_header .file_checkbox:hover,.file_list_header .file_operation:hover{background:#f3f3f3}.file_ps_title .set_file_ps{height:25px;line-height:25px;border:1px solid transparent;width:100%;border-radius:2px;padding-left:5px;outline:0}.file_ps_title .set_file_ps:hover{border:1px solid #20a53a!important;background-color:#fff!important}.file_list_header .file_width_resize{float:left;width:10px;margin-left:-5px;height:40px;overflow:hidden;position:relative;z-index:998}.file_list_header .file_width_resize::after{content:'';display:block;background:#e2e2e2;width:1px;height:25px;position:absolute;top:50%;left:50%;margin-left:-1px;margin-top:-12.5px}.file_list_header .file_name{margin-left:0}.file_operation.file_td .set_operation_group{display:none}.file_table_view.list_view .file_tr.active .set_operation_group.is_mobile{display:block!important}.file_list_header .icon_sort{display:inline-block;height:40px;line-height:40px;transition:all .5s;float:right}.file_list_header .icon_sort.active{transform:rotate(180deg)}.file_list_header .icon_sort .iconfont{vertical-align:bottom}.file_table_view.list_view .file_list_shadow{width:100%;height:8px;position:absolute;left:0;right:0;background:-webkit-linear-gradient(top,rgba(220,220,220,.5),rgba(255,255,255,0));z-index:99}.file_table_view.list_view .file_shadow_bottom{background:-webkit-linear-gradient(top,rgba(255,255,255,0),rgba(220,220,220,.5));bottom:0}.align-center{text-align:center}.align-left{text-align:left}.align-right{text-align:right}.btlink{color:#20a53a;text-decoration:none}.file_table_view.list_view .file_list_content{min-width:750px;overflow:auto;border-top:1px solid #ececec}.file_table_view.list_view .file_list_content .file_tr{height:45px;box-sizing:border-box;color:#fff;border-bottom:1px solid #f3f3f3;border-left:1px solid transparent;border-right:1px solid transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file_table_view.list_view .file_list_content .file_tr.editr_tr .file_td{display:none}.file_table_view.list_view .file_list_content .file_tr.editr_tr .file_name{display:inline-block;margin-left:40px}.file_table_view.list_view .file_name .iconfont{display:block}.file_table_view.list_view .file_list_content .file_tr.editr_tr .file_name .iconfont{display:none}.file_table_view.list_view .file_name .icon-favorites,.file_table_view.list_view .file_name .icon-share1{font-size:18px;width:18px;height:18px;vertical-align:middle;position:absolute;top:50%;right:5px;margin-top:-9px;color:#2e973e;display:inline-block}.file_table_view.list_view .file_name .icon-favorites{color:#f5a623;font-size:17px}.file_table_view.list_view .file_name .icon-favorites:before,.file_table_view.list_view .file_name .icon-share1:before{position:relative;top:-16px;height:18px;width:18px;cursor:pointer}.file_table_view.list_view .file_list_content .file_tr.editr_tr .rename_file_input{height:32px;line-height:30px;border:1px solid #cfcfcf;border-radius:2px;padding-left:5px;margin-right:15px;width:150px}.file_table_view.list_view .file_list_content .file_tr.editr_tr .rename_file_input:focus{outline:0;border:1px solid #20a53a}.file_table_view.list_view .file_list_content .file_tr.editr_tr .add_file_btn,.file_table_view.list_view .file_list_content .file_tr.editr_tr .clear_file_btn{height:32px;line-height:30px;padding:0 18px;margin-right:10px;background-color:#20a53a;border-color:#20a53a;border-radius:2px;color:#fff;border:1px solid transparent}.file_table_view.list_view .file_list_content .file_tr.editr_tr .clear_file_btn{color:#555;background-color:#fff;border-color:#ccc}.file_table_view.list_view .file_list_content .file_tr.editr_tr .add_file_btn::focus,.file_table_view.list_view .file_list_content .file_tr.editr_tr .clear_file_btn::focus{outline:0}.file_table_view.list_view .file_list_content .file_tr.editr_tr .add_file_btn:hover{color:#fff;background-color:#10952a;border-color:#398439}.file_table_view.list_view .file_ps .foo_menu{display:none}.file_table_view.list_view .file_tr:hover .foo_menu{display:inline-block;position:absolute;right:10px}.file_table_view.list_view .file_tr .foo_menu_title{position:relative;padding-right:10px}.file_table_view.list_view .file_tr .foo_menu_title i{display:inline-block;width:7px;height:7px;color:#20a53a;border-left:1px solid;border-bottom:1px solid;transform:rotate(-45deg);position:absolute;top:3px;right:0}.file_table_view.list_view .file_tr.active .foo_menu{display:inline-block;position:absolute;right:10px}.file_table_view.list_view .file_tr.active .foo_menu .foo_menu_title,.file_table_view.list_view .file_tr:hover .foo_menu .foo_menu_title{border:1px solid #20a53a;color:#20a53a!important;background:#fff;border-radius:2px;padding:4px 18px 4px 8px;font-size:12px;cursor:pointer;position:relative}.file_table_view.list_view .file_tr .foo_menu .foo_menu_title:hover,.file_table_view.list_view .file_tr.active .foo_menu .foo_menu_title:hover{border:1px solid #20a53a;color:#fff!important;background:#20a53a}.file_table_view.list_view .file_tr .foo_menu.foo_menu_click .foo_menu_title,.file_table_view.list_view .file_tr.active .foo_menu .foo_menu_title:hover,.file_table_view.list_view .file_tr:hover .foo_menu .foo_menu_title:hover{border:1px solid #20a53a;color:#fff!important;background:#20a53a}.file_table_view.list_view .file_tr .foo_menu.foo_menu_click .foo_menu_title::after,.file_table_view.list_view .file_tr.active .foo_menu .foo_menu_title:hover::after,.file_table_view.list_view .file_tr:hover .foo_menu .foo_menu_title:hover::after{color:#fff}.app_menu_group ul{color:#20a53a;height:50px;line-height:50px;display:inline-block;margin-left:8px}.app_menu_group ul li{display:inline-block;margin-right:10px}.app_menu_group ul li i,.app_menu_group ul li.separate,.file_table_view.list_view .file_list_content .file_tr.app_menu_operation .file_td:nth-child(n+3){display:none}.file_table_view.list_view .file_list_content .file_tr:last-child{border-bottom:1px solid #ececec}.file_table_view.list_view .file_list_content .file_tr.active,.file_table_view.list_view .file_list_content .file_tr:hover{background:#f0f9f7!important;border:1px solid #ddefeb;border-top:none}.file_table_view.list_view .file_list_content .file_tr:hover .set_operation_group{display:block}.file_table_view.list_view .file_list_content .file_tr.active .set_file_ps,.file_table_view.list_view .file_list_content .file_tr:hover .set_file_ps{border:1px solid transparent;background-color:#eff9f7}.file_table_view.list_view .file_list_content .file_td{height:45px;line-height:45px;padding:0 8px;color:#777;overflow:hidden;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:top}.file_table_view.list_view .file_list_content .file_td.file_operation{text-overflow:clip;text-align:right}.file_table_view.list_view .file_list_content .file_checkbox{padding:14px 12px!important}.file_table_view.list_view .file_list_content .file_ico_type{height:40px;line-height:40px;display:inline-block;position:relative}.file_table_view.list_view .file_title{vertical-align:top;padding-left:38px;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.file_table_view.list_view .file_title.file_file_status i{font-style:normal}.file_table_view.list_view .file_title i{font-style:normal;cursor:pointer;color:#555}.file_table_view.list_view .file_title i:hover{color:#20a53a}.file_edit_input{height:31px;display:inline-block;width:100%;padding-left:5px;outline:0;border:1px solid #ebf3f1;margin-left:-5px;border-radius:2px}.file_table_view .file_list_content .file_icon{width:100%;width:30px;height:30px;position:absolute;top:7.5px;background-repeat:no-repeat;background-size:cover;background-position:center;image-rendering:-webkit-optimize-contrast;background-image:url(../img/file_icon/file.png);cursor:pointer}.file_table_view .file_list_content .file_html{background-image:url(../img/file_icon/html.png)}.file_table_view .file_list_content .file_css{background-image:url(../img/file_icon/css.png)}.file_table_view .file_list_content .file_js{background-image:url(../img/file_icon/javascript.png)}.file_table_view .file_list_content .file_json{background-image:url(../img/file_icon/json.png)}.file_table_view .file_list_content .file_folder{background-image:url(../img/file_icon/folder.png)}.file_table_view .file_list_content .file_php{background-image:url(../img/file_icon/php.png)}.file_table_view .file_list_content .file_log{background-image:url(../img/file_icon/log.png)}.file_table_view .file_list_content .file_txt{background-image:url(../img/file_icon/file.png)}.file_table_view .file_list_content .file_py{background-image:url(../img/file_icon/python.png);width:30px;height:30px;left:2.5px;top:10px}.file_table_view .file_list_content .file_png{background-image:url(../img/file_icon/png.png)}.file_table_view .file_list_content .file_lua{background-image:url(../img/file_icon/lua.png);width:30px;height:30px;left:2.5px;top:10px}.file_table_view .file_list_content .file_access{background-image:url(../img/file_icon/access.png)}.file_table_view .file_list_content .file_apk{background-image:url(../img/file_icon/apk.png)}.file_table_view .file_list_content .file_avi{background-image:url(../img/file_icon/avi.png)}.file_table_view .file_list_content .file_bmp{background-image:url(../img/file_icon/bmp.png)}.file_table_view .file_list_content .file_cdr{background-image:url(../img/file_icon/cdr.png)}.file_table_view .file_list_content .file_gif{background-image:url(../img/file_icon/gif.png)}.file_table_view .file_list_content .file_ico{background-image:url(../img/file_icon/ico.png)}.file_table_view .file_list_content .file_java{background-image:url(../img/file_icon/java.png)}.file_table_view .file_list_content .file_jpeg{background-image:url(../img/file_icon/jpeg.png)}.file_table_view .file_list_content .file_jpg{background-image:url(../img/file_icon/jpg.png)}.file_table_view .file_list_content .file_mkv{background-image:url(../img/file_icon/mkv.png)}.file_table_view .file_list_content .file_mov{background-image:url(../img/file_icon/mov.png)}.file_table_view .file_list_content .file_mp4{background-image:url(../img/file_icon/mp4.png)}.file_table_view .file_list_content .file_mpeg{background-image:url(../img/file_icon/mpeg.png)}.file_table_view .file_list_content .file_mpg{background-image:url(../img/file_icon/mpg.png)}.file_table_view .file_list_content .file_pdf{background-image:url(../img/file_icon/pdf.png)}.file_table_view .file_list_content .file_ppt,.file_table_view .file_list_content .file_pptx{background-image:url(../img/file_icon/ppt.png);width:30px;height:30px;left:2.5px}.file_table_view .file_list_content .file_rar{background-image:url(../img/file_icon/rar.png)}.file_table_view .file_list_content .file_rm{background-image:url(../img/file_icon/rm.png)}.file_table_view .file_list_content .file_rmvb{background-image:url(../img/file_icon/rmvb.png)}.file_table_view .file_list_content .file_sql{background-image:url(../img/file_icon/sql.png)}.file_table_view .file_list_content .file_swf{background-image:url(../img/file_icon/swf.png)}.file_table_view .file_list_content .file_tar{background-image:url(../img/file_icon/tar.png)}.file_table_view .file_list_content .file_webm{background-image:url(../img/file_icon/webm.png)}.file_table_view .file_list_content .file_webp{background-image:url(../img/file_icon/webp.png)}.file_table_view .file_list_content .file_wma{background-image:url(../img/file_icon/wma.png)}.file_table_view .file_list_content .file_wmv{background-image:url(../img/file_icon/wmv.png)}.file_table_view .file_list_content .file_doc,.file_table_view .file_list_content .file_docx{background-image:url(../img/file_icon/doc.png);width:30px;height:30px;left:2.5px}.file_table_view .file_list_content .file_xls,.file_table_view .file_list_content .file_xlsx{background-image:url(../img/file_icon/xls.png);width:30px;height:30px;left:2.5px}.file_table_view .file_list_content .file_xml{background-image:url(../img/file_icon/xml.png)}.file_table_view .file_list_content .file_zip{background-image:url(../img/file_icon/zip.png)}.file_table_view .file_list_content .file_gz,.file_table_view .file_list_content .file_tar{background-image:url(../img/file_icon/tar.png)}.content_right_menu,.file_right_menu,.selection_right_menu{padding:5px 0;width:190px;border:1px solid #dadada;box-shadow:5px 5px 12px rgba(0,0,0,.15);position:fixed;left:-100%;top:-100%;z-index:9999;background:#fff}.content_right_menu li,.file_right_menu li,.selection_right_menu li{list-style-type:none;margin:0;padding:0;height:30px;font-size:12px;color:#555;line-height:30px;padding-left:48px;box-sizing:border-box;position:relative;font-weight:400;border-radius:2px}.selection_right_menu li span{color:#666}.content_right_menu li.separate,.file_right_menu li.separate,.selection_right_menu li.separate{height:1px;background:#ececec}.content_right_menu li:hover,.file_right_menu li:hover,.selection_right_menu li:hover{background:#efefef;cursor:pointer}.selection_right_menu li:hover .file_menu_down .set_group{display:inline-block}.content_right_menu li .file_menu_icon,.file_right_menu li .file_menu_icon,.nav_down_list li .file_menu_icon,.nav_group .nav_btn_group .file_menu_icon,.selection_right_menu li .file_menu_icon{display:inline-block;background-image:url(../img/file_icon/file_menu_icon.png);background-size:auto!important;background-repeat:no-repeat;width:16px;height:16px;position:absolute;left:22px;top:50%;margin-top:-8px;font-style:normal}.nav_down_list:before{content:'';display:inline-block;width:100%;height:5px;position:absolute;top:-5px}.edit_file_icon,.open_file_icon,.open_find_dir_file_icon{background-position:-16px -16px}.copy_file_icon{background-position:0 -96px}.paste_file_icon{background-position:-16px -64px}.shear_file_icon{background-position:-16px -80px}.rename_file_icon{background-position:0 -64px}.del_file_icon{background-position:0 -80px}.download_file_icon{background-position:-16px -48px}.folad_file_icon,.killing_file_icon,.unzip_file_icon{background-position:0 -32px}.decompression_file_icon{background-position:0 -32px}.authority_file_icon,.cancel_share_file_icon,.dir_kill_file_icon,.share_file_icon{background-position:-17px -773px;background-image:none!important;width:17px!important;height:17px!important;font-size:19px;top:0!important;margin-top:0!important;color:#31dc48}.dir_kill_file_icon{font-size:17px;color:#c77f22}.authority_file_icon{color:#f2ce4d}.cancel_favorites_file_icon,.favorites_file_icon{background-position:0 -32px;background-position:-17px -773px;width:17px!important;height:17px!important;margin-top:-8.5px!important}.file_menu_down .glyphicon-triangle-right{font-size:8px;position:absolute;right:8px;top:8px;color:#555;transform:scale(.8)}.selection_right_menu.left_menu .file_menu_down .set_group{top:-6px;left:-210px}.file_menu_down .set_group{display:none;padding:5px 0;background:#fff;width:210px;border:1px solid #dadada;position:absolute;right:-210px;top:-6px;box-shadow:5px 5px 12px rgba(0,0,0,.15)}.file_right_menu li:hover .set_group{display:inline-block}.file_right_menu li .power_file_icon,.nav_group .nav_btn_group .power_file_icon{background-image:url(../img/file_icon/power_file_icon.png)!important;background-size:16px!important}.add_favorites_icon{background-position:-16px -773px}.refresh_file_icon{background-position:-16px -513px}.upload_file_icon{background-position:0 -48px}.create_dir_file_icon,.create_file_icon,.newly_file_icon{background-position:0 -16px}.compress_file_icon,.rar_file_icon,.tar_gz_file_icon,.zip_file_icon{background-position:-16px -32px}.paste_file_icon{background-position:-16px -64px}.total_icon_icon{background-position:0 -561px}.total_list_icon{background-position:-16px -625px}.selection_right_menu li .file_menu_icon.web_shell_file_icon{background-image:url(../img/file_icon/ico-cmd.png)}.onselectstart{position:fixed;display:none;width:0;height:0;background:#bbf1e3;border:1px dashed #a1d0c3;opacity:.5}.file_list_header .file_check.active,.file_list_header .file_check.active_2,.file_tr.active .file_check{background:#5fb878!important;border:1px solid #5fb878!important;color:#fff}.file_list_header .file_check.active_2::before{font-weight:700;content:"";height:2px;width:10px;display:inline-block;border-radius:1px;position:relative;background-color:#fff;top:-4px;left:2px}.file_list_header .file_check.active::before,.file_tr.active .file_check::before{font-weight:700;content:"\e75e";position:relative;top:-2px;font-size:14px;font-family:iconfont!important;font-style:normal;-webkit-font-smoothing:antialiased}.statistics{display:inline-block;height:30px;line-height:30px;padding:0 10px;position:absolute;border-left:4px solid #20a53a;bottom:38px;font-size:14px}.statistics span{margin:0 2px;font-size:14px}.bt_file_updated{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;background:rgba(32,165,58,.5);z-index:9999;display:none}.updated_title{text-align:center;position:absolute;z-index:99999;color:#fff;width:100%;font-size:50px;opacity:.8;top:50%}.updated_icon{position:absolute;top:50%;left:50%;margin-left:-125px;margin-top:-200px}.updated_icon .btn{width:250px;height:200px;position:relative;text-align:center;margin:15px;overflow:hidden;border-radius:100%;display:inline-block}.updated_icon .cloud{width:200px;height:80px;position:relative;background:#fff;display:inline-block;border-radius:50px;margin:40px auto 0}.updated_icon .cloud:after{content:'';position:absolute;width:120px;height:80px;border-radius:80px 80px 0 0;top:-40px;background:#fff;left:40px}.updated_icon .cloud:before{content:'';position:absolute;background:#dedede;border-radius:10px;width:90px;height:6px;z-index:2;left:0;right:0;bottom:25px;margin:auto}.updated_icon .file{position:absolute;left:0;right:0;margin:auto;z-index:5;top:50px;width:80px;height:100px;display:inline-block;overflow:hidden}.updated_icon .file:after{content:'';position:absolute;background:#5fb878;width:80px;height:80px;left:0;top:0;border-radius:0 0 10px 10px;-webkit-animation:uplaod 3s linear infinite;animation:uplaod 3s linear infinite}.updated_icon .file:before{content:'';background:#e2e3e3;color:#e2e3e3;width:60px;height:5px;position:absolute;left:0;right:0;top:20px;z-index:3;margin:auto;-webkit-animation:uplaod 3s linear infinite;animation:uplaod 3s linear infinite;box-shadow:0 15px,0 30px}@-webkit-keyframes uplaod{0%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(-100px);transform:translateY(-100px)}}@keyframes uplaod{0%{-ms-transform:translateY(0);-webkit-transform:translateY(0);transform:translateY(0)}100%{-ms-transform:translateY(-100px);-webkit-transform:translateY(-100px);transform:translateY(-100px)}}.file_nav_view{height:32px;margin:15px 0;font-size:0}.file_nav_view .nav_group{display:inline-block;vertical-align:top}.file_nav_view .nav_group.dividing{border-color:#fff;height:100%;width:1px;background:#cfcfcf;cursor:default;margin:0 10px}.nav_group .nav_btn:hover,.nav_group .nav_btn_group:hover{background-color:#20a53a;border-color:#20a53a}.nav_group .nav_btn:hover .nav_btn_title,.nav_group .nav_btn_group:hover .nav_btn_title{color:#fff}.nav_group .nav_btn:hover>.iconfont,.nav_group .nav_btn_group:hover>.iconfont{color:#fff}.file_nav_view .nav_btn_group.active:hover{border-color:#cfcfcf}.file_nav_view .nav_btn:hover .nav_down_list,.file_nav_view .nav_btn_group:hover .nav_down_list{display:block}.file_nav_view .nav_btn::before{content:'';display:none;width:100%;height:5px;position:absolute;bottom:-5px;left:0}.file_nav_view .nav_btn:hover::before{display:inline-block}.nav_group .nav_btn,.nav_group .nav_btn_group{padding:0 10px;display:inline-block;box-sizing:border-box}.terminal_view .nav_btn_title{vertical-align:middle!important;margin-left:5px}.terminal_view{padding:4px 10px!important}.terminal_view .iconfont{vertical-align:middle}.nav_group .nav_btn,.nav_group .nav_btn_group{display:inline-block;margin-right:5px;border:1px solid #cfcfcf;box-sizing:border-box;cursor:pointer;border-radius:2px;transition:all .1s;position:relative;padding:7px 10px}.nav_group{font-size:0}.nav_group .share_file_list{margin-right:8px}.nav_group .nav_btn_group{margin-right:0;vertical-align:bottom}.nav_group .nav_btn_group{padding-left:28px}.nav_group .nav_btn_group .file_menu_icon{left:7.5px}.nav_group .nav_btn .icon-xiala,.nav_group .nav_btn_group .icon-xiala{font-size:12px;margin-left:2px;vertical-align:middle}.nav_group .nav_btn .nav_btn_title,.nav_group .nav_btn_group .nav_btn_title{font-size:12px;color:#555;vertical-align:top}.nav_group .nav_btn_group{border-right-width:1px;border-left-width:0;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:0}.nav_group .nav_btn_group.active{background:#ececec}.nav_group .nav_btn_group:last-child{border-right-width:1px;border-top-right-radius:2px;border-bottom-right-radius:2px}.nav_group .nav_btn_group:first-child{border-left-width:1px;border-top-left-radius:2px;border-bottom-left-radius:2px}.nav_group .nav_btn.nav_btn_title .icon-terminal,.nav_group .nav_btn_group .nav_btn_title .icon-terminal{font-size:17px}.nav_group .nav_btn .icon-shangchuanxiazai,.nav_group .nav_btn_group .icon-shangchuanxiazai{font-size:12px;margin-right:5px;color:#555}.nav_group.mount_disk_list{padding-left:8px;border-left:1px solid #ececec}.nav_group.multi{padding-right:8px;border-right:1px solid #ececec}.nav_group.mount_disk_list>.glyphicon{font-size:13px;color:#666;position:relative;top:2px}.float_r.menu-header-foot{font-size:0}.nav_group.file_all_paste,.nav_group.recycle_bin{padding-left:8px}.nav_group.recycle_bin .nav_btn{margin-right:8px}.nav_group.mount_disk_list .nav_btn,.nav_group.recycle_bin .nav_btn{padding:7px 10px 7px 5px}.nav_group.mount_disk_list .nav_btn span,.nav_group.recycle_bin .nav_btn span{font-size:12px;margin-left:5px;color:#666}.file_disk_list .nav_btn span:nth-child(0){font-size:12px}.nav_group.recycle_bin .nav_btn .glyphicon{top:2px}.nav_group.mount_disk_list .nav_btn:hover span,.nav_group.recycle_bin .nav_btn:hover span{color:#fff!important}.nav_down_list{display:none;transition:all .5s;list-style:none;background:#fff;border-radius:2px;box-shadow:4px 2px 5px 0 #ececec;border:1px solid #cfcfcf;position:absolute;left:-1px;top:32px;z-index:999999;overflow:auto;max-height:300px;max-width:140px}.nav_group.mount_disk_list .disk_title_group_btn{display:none}.nav_group.mount_disk_list.thezoom .disk_title_group_btn{border-radius:2px;height:32px;line-height:32px;border:1px solid #cfcfcf;padding:7px 10px;display:inline-block;width:115px;box-sizing:border-box;cursor:pointer;position:relative;transition:all .5s}.nav_group.mount_disk_list .file_disk_list .nav_btn:last-child{margin-right:0!important}.nav_group.mount_disk_list.thezoom .file_disk_list{display:none}.nav_group.mount_disk_list.thezoom .disk_title_group_btn .disk_title_group{font-size:12px;color:#666;position:absolute;top:0}.nav_group.mount_disk_list.thezoom .disk_title_group_btn::before,.nav_group.multi.thezoom .batch_multi_title::before{content:'';display:none;width:100%;height:5px;position:absolute;bottom:-5px;left:0}.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover::before,.nav_group.multi.thezoom .batch_multi_title:hover::before{display:inline-block}.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover,.nav_group.multi.thezoom .batch_multi_title:hover{background-color:#20a53a;border-color:#20a53a}.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover .disk_title_group,.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover>i,.nav_group.multi.thezoom .batch_multi_title:hover>i,.nav_group.multi.thezoom .batch_multi_title:hover>span{color:#fff}.nav_group.mount_disk_list.thezoom .disk_title_group_btn>i{font-size:12px;margin-left:2px;position:absolute;right:9px;top:0}.nav_group.mount_disk_list.thezoom .disk_title_group_btn .nav_down_list{max-width:360px}.nav_group.mount_disk_list.thezoom .disk_title_group_btn .nav_down_list li i{font-size:13px;position:absolute;left:8px;top:8px;color:#666}.nav_group.mount_disk_list.thezoom .disk_title_group_btn .nav_down_list li span{width:100%;padding-right:10px}.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover ul.nav_down_list{display:block}.nav_group.multi.thezoom{padding-right:0;border-right:none}.nav_group.multi .batch_multi_title>i,.nav_group.multi .batch_multi_title>span{display:none}.nav_group.multi.thezoom .batch_multi_title>i,.nav_group.multi.thezoom .batch_multi_title>span{display:inline-block;font-size:12px;color:#666}.nav_group.multi.thezoom .batch_multi_title>i{font-size:12px;margin-left:2px;position:absolute;right:9px;top:7px}.nav_group.multi.thezoom{position:relative}.nav_group.multi.thezoom:hover .batch_group_list{display:block}.nav_group.multi.thezoom .batch_multi_title{border-radius:2px;height:32px;border:1px solid #cfcfcf;padding:7px 10px;display:inline-block;width:85px;box-sizing:border-box;cursor:pointer;position:relative}.nav_group.multi.thezoom .batch_group_list{display:none;width:85px;margin-top:12px;position:absolute;left:0;border:1px solid #cfcfcf;border-radius:2px;box-shadow:4px 2px 5px 0 #ececec;z-index:9999;background-color:#fff}.nav_group.multi.thezoom .batch_group_list .nav_btn_group{width:100%;border:none}.nav_group.multi.thezoom .batch_group_list .nav_btn_group:hover{background-color:#f0f0f0}.nav_group.multi.thezoom .batch_group_list .nav_btn_group:hover span{color:#666}.selection_right_menu li .file_menu_icon.create_files_file_icon{height:17px;background-image:url(../img/file_icon/file_text2.png)}.file_nav_view .nav_down_list li i.file_new_icon{width:17px;height:17px;position:absolute;top:7.5px;left:5px;background-repeat:no-repeat;background-size:cover;background-position:center;image-rendering:-webkit-optimize-contrast;background-image:url(../img/file_icon/file_text2.png)}.file_nav_view .nav_down_list li i.file_new_folder_icon{width:19px;height:17px;position:absolute;top:7.5px;left:4px;background-repeat:no-repeat;background-size:cover;background-position:center;image-rendering:-webkit-optimize-contrast;background-image:url(../img/file_icon/folder.png)}.file_list_content .file_tr textarea:focus{outline:0!important;border:1px solid #ccc}.file_table_view .file_list_content .file_tr.editr_tr textarea,.file_table_view.icon_view .createModel textarea{width:70px;padding:5px 2px;border-color:#ccc;overflow:hidden;resize:none}.file_table_view .file_list_content .file_tr.editr_tr input,.file_table_view.list_view .createModel input{width:100%;padding:0 0 0 5px;height:25px;border:1px solid #ececec;outline:0;vertical-align:middle;line-height:25px}.favorites_file_path .nav_down_list{max-width:230px}.favorites_file_path .nav_down_list li span{width:230px!important;padding-right:20px}.favorites_body .favorites_span{width:680px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.favorites_file_path .nav_down_list li span.icon-shezhi1{left:6px}.nav_down_list li{height:30px;line-height:30px;position:relative;box-sizing:border-box;overflow:hidden;color:#555}.nav_down_list li:last-child{border:none}.nav_down_list li:hover{background:#f0f0f0;color:#555}.file_dir_item .nav_down_list li span{line-height:30px!important}.file_dir_item .file_dir span{color:#666}.nav_down_list li span:nth-child(1){font-size:14px;position:absolute;line-height:28px;top:0;left:12px;color:#666}.nav_down_list li span:nth-child(2){display:inline-block;font-size:12px;color:#555;line-height:30px;padding-left:28px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:140px}.nav_down_list li .iconfont{color:#aaa;font-size:19px;position:absolute;left:5px}.nav_down_list li .file_menu_icon{left:5px;margin-top:-8.5px}.nav_down_list li .icon-yingpan{font-size:15px}.nav_group.btn-group-sm>.btn.cut_view_model{padding:6px 10px}.file_path_views{height:30px;border-bottom:1px solid #eee;font-size:0;box-sizing:content-box;padding-bottom:15px}.file_path_views .file_path_upper{display:inline-block;height:30px;line-height:30px;vertical-align:top;border:1px solid #cfcfcf;box-sizing:border-box;text-align:center;vertical-align:top;border-top-left-radius:2px;border-bottom-left-radius:2px;border-right:none;color:#666}.file_path_views .file_path_upper{padding:0 12px}.file_path_views .file_path_upper:hover{background-color:#20a53a;color:#fff;cursor:pointer;border:1px solid #20a53a;border-right:none}.file_path_views .file_path_upper:hover i{background-position:-60px 6px}.file_path_views .file_path_upper span{font-size:12px;display:inline-block;height:28px;line-height:28px;vertical-align:top;top:0}.file_path_views .forward_path{display:inline-block;height:30px;line-height:30px;vertical-align:top;margin-right:-1px}.file_path_views .forward_path>span{display:inline-block;text-align:center;height:30px;line-height:30px;width:auto;padding:0 9px;border:1px solid #cfcfcf;box-sizing:border-box;border-radius:2px;cursor:pointer}.file_path_views .forward_path>span span{font-size:15px}.file_path_views .forward_path span:hover{background:#20a53a;border:1px solid #20a53a}.file_path_views .forward_path span:hover:first-child i{background-position:-90px 6px}.file_path_views .forward_path span:hover:last-child i{background-position:-75px 6px}.file_path_views .forward_path span.active:hover{background:#efefef;box-shadow:inset 0 3px 6px rgba(0,0,0,.1);border-color:#cfcfcf}.file_path_views .forward_path span:active{box-shadow:inset 0 3px 6px rgba(0,0,0,.1)}.file_path_views .forward_path span.active{background:#efefef;box-shadow:inset 0 3px 6px rgba(0,0,0,.1);cursor:no-drop;transition:all .5s}.file_path_views .forward_path span:first-child{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.file_path_views .forward_path span:last-child{border-left:1px solid #cfcfcf;border-radius:0}.file_path_input{display:inline-block;height:30px;width:50%;box-sizing:border-box;position:relative}.file_path_input input{border:1px solid #cfcfcf;display:inline-block;width:100%;position:absolute;top:0;left:0;height:30px;padding-left:5px;box-sizing:border-box;background:#f3f3f3;font-size:13px}.file_path_input input.focus{background-color:#fff}.file_dir_omit{display:inline-block;font-size:0;height:30px;line-height:28px;position:relative;left:0;width:45px;cursor:pointer;border:1px solid transparent}.file_dir_omit.active{background-color:#f0f9f7;border-top:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf;border-right:1px solid #ececec}.file_dir_omit.active .iconfont{background-color:#f0f9f7;border-left:#dadada;border-right:#dadada}.file_dir_icon,.file_dir_omit>span{display:inline-block;font-size:14px;background-image:url(../img/file_icon/file_menu_icon.png);background-position:0 -16px;background-size:auto;height:16px;position:absolute;top:6px;width:16px;left:5px;z-index:99}.file_dir_icon{left:8px;top:7px}.file_dir_omit .iconfont{position:absolute;top:0;right:0;font-size:12px!important;padding:0 2px}.file_dir_omit:hover{background:#f3fbf9;border-top:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf;border-right:1px solid #ececec}.file_dir_omit:hover .iconfont{background:#f3fbf9;border-left:1px solid #ececec}.file_dir_omit .nav_down_list{overflow:hidden}.file_dir_omit .nav_down_list .file_dir_item{display:block;height:32px;position:relative;box-sizing:border-box}.file_dir_omit .nav_down_list .file_dir_item .file_dir{width:140px;background:#fff;height:32px;line-height:32px;padding-left:28px}.file_dir_omit .nav_down_list .file_dir_item .iconfont,.file_dir_omit .nav_down_list .file_dir_item .nav_down_list{display:none}.file_dir_item{display:inline-block;font-size:0;height:28px;line-height:28px;cursor:pointer;color:#777;box-sizing:border-box;position:relative;top:1px!important}.file_dir_item.active .nav_down_list{display:block;top:30px}.file_dir_view{position:relative;font-size:0;z-index:99;display:inline-block}.file_dir_view .file_dir_item.active{background:#f3fbf9;border:1px solid #d1e8e0;box-sizing:border-box;margin-top:-1px;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.file_dir_view .file_dir_item.active .iconfont{border-left:1px solid #d1e8e0}.file_dir_item .iconfont,.file_dir_omit .iconfont{vertical-align:top;font-size:14px;font-weight:600;height:28px;display:inline-block;border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3;transition:all .5s;background:#f3f3f3}.file_dir_item .file_dir{display:inline-block;padding:0 5px;font-size:12.5px;position:relative;height:28px;line-height:29px;color:#555;background:#f3f3f3;border-left:1px solid transparent;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file_dir_item .nav_down_list li{height:30px;line-height:30px;background:#f9f9f9}.file_dir_item .nav_down_list li.active{font-weight:600;color:#333;background-color:#eee}.file_dir_item .nav_down_list li:hover{background:#eee}.file_dir_item:first-child .file_dir{position:relative;top:0;font-size:12.4px;padding-left:10px}.file_dir_item:first-child{left:-1px}.file_dir_item:first-child .file_dir span:first-child{vertical-align:text-top}.file_dir_view .file_dir_item:hover{background:#f3fbf9;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.file_dir_view .file_dir_item:hover .file_dir{background:#f3fbf9;border-left:1px solid #ececec}.file_dir_view .file_dir_item:hover .iconfont{border-left:1px solid #ececec;border-right:1px solid #ececec;background:#f3fbf9}.file_path_refresh{display:inline-block;width:30px;height:30px;line-height:30px;border:1px solid #cfcfcf;box-sizing:border-box;text-align:center;vertical-align:top;border-left:0;border-top-right-radius:2px;border-bottom-right-radius:2px;cursor:pointer}.file_path_refresh:hover i{background-position:-105px 6px}.file_path_collect:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.file_path_collect i{font-size:14px;position:relative;top:-1px}.file_path_collect .icon-wujiaoxing{color:#ffca2e}.file_path_collect:hover{background:#20a53a;border-color:#38983b;color:#fff}.search_path_views{border:1px solid #20a53a;display:inline-block;vertical-align:top;float:right;font-size:0;position:relative}.search_path_views .set_updown{height:30px;line-height:30px;position:absolute}.file_path_views .forward_path i{top:0}.search_path_views .file_search_input{border:none;display:inline-block;height:28px;box-sizing:border-box;width:250px;padding-left:8px;box-sizing:border-box;outline:0;border-right:none;font-size:12px}.search_path_views .is_search_children{margin:0 5px;color:#cfcfcf;font-size:13px}.search_path_views .is_search_children:hover{color:#20a53a;cursor:pointer}.search_path_views .path_btn{display:inline-block;height:28px;background:#20a53a;vertical-align:top;color:#fff;border:none;width:35px;text-align:center;cursor:pointer;outline:0}.search_path_views .path_btn:hover{background-color:#38983b}.search_path_views .path_btn:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.search_path_views .set_up{display:none;position:absolute;top:30px;left:0;width:210px;height:30px;background:#fff;box-shadow:4px 2px 5px 0 #ececec;z-index:9999;border:1px solid #ececec;border-radius:2px}.search_path_views .file_search_config{position:absolute;right:35px;font-size:12px;color:#666;width:105px;border-top:none;background:#fff;height:28px;line-height:28px;top:0}.search_path_views .file_search_config .file_search_checked{position:relative;height:15px;width:15px;border-radius:1px;cursor:pointer;text-align:center;margin:0;vertical-align:sub;border:1px solid #aaa;border-radius:2px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased}.search_path_views .file_search_config .file_search_checked.active{background:#20a53a;color:#fff;border-color:#20a53a}.search_path_views .file_search_config .file_search_checked.active:after{content:"\e013";font-size:12px;transform:scale(.85);position:absolute;left:.75px;top:.75px}.search_path_views .file_search_config label{position:absolute;right:3px;cursor:pointer;top:0;font-weight:400}.mr0{margin-right:0!important}.ml0{margin-left:0!important}.plr25{padding:0 25px}.float_r{float:right}.file_bodys{background-color:#fff;margin:10px 15px;padding:15px 20px;font-size:12px;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.file_list_icon{border-top:1px solid #eee;padding-top:15px}.file_list_icon .file_table_view.list_view .file_list_content .file_tr{display:inline-block;width:auto;background:#fff;border-color:#fff;position:relative;height:auto;margin:2.5px 5px;cursor:pointer;vertical-align:top}.file_table_view.list_view .file_list_content .file_tr.selected{background:#f0f9f7!important}.file_list_icon .file_table_view.list_view .file_list_content .file_tr .file_td{height:auto;padding:0;line-height:normal}.file_list_icon .file_table_view.list_view .file_list_content .file_tr .file_td:not(.file_name){display:none}.file_list_icon .file_table_view.list_view .file_list_content .file_tr .file_td:nth-of-type(1){position:absolute;left:0;top:0}.file_list_icon .file_table_view.list_view .file_list_content .file_tr .file_td:nth-of-type(2){width:99px;min-width:99px}.file_list_icon .file_table_view.list_view .file_list_content .file_type{width:100%;height:65px}.file_list_icon .file_table_view.list_view .file_list_content .file_icon{top:15px;width:50px;height:50px;left:50%;margin-left:-25px;background-size:auto}.file_list_icon .file_title{display:inline-block;text-align:center;color:#666;padding:10px 5px 15px 5px;font-size:12px;word-break:break-all;white-space:initial}[data-type=folder] .file_title{cursor:pointer}.file_tips{margin-left:30px;color:#999;font-size:12px}.file_bodys{margin-bottom:57px;-webkit-box-sizing:initial;-moz-box-sizing:initial;box-sizing:initial}.file_path_input{position:relative}.file_path_input .file_dir_view{white-space:nowrap;position:absolute;left:1px;height:30px;line-height:28px}.not-btn-border .layui-layer-btn{background-color:#fff;border-top:none}.not-btn-border .layui-layer-btn a{line-height:30px;padding:0 15px}.not-btn-border .layui-layer-btn0{margin-left:15px;border-radius:2px;padding:0 15px}.not-btn-border .layui-layer-btn1{border-radius:2px}.not-btn-border .layui-layer-btn{padding:9px 15px 10px}.file_upload_view{padding:10px 15px 0 15px}.file_select_file{padding-bottom:10px}.file_select_file button{padding:7.5px 12px;border-radius:2px;border:none;background-color:#4592f0;border-color:#367fa9;margin-right:15px;color:#fff;outline:0}.file_select_file button:hover{background-color:#4188de;border-color:#367fa9}.file_select_file button:active{box-shadow:inset 0 3px 6px rgba(0,0,0,.2)}.file_content_list{width:100%;height:355px;background-color:#fafbfe;border-radius:2px;border:#e4e5e9 1px solid;position:relative}.file_upload_tips{text-align:center;color:#ccc;font-size:28px;position:absolute;width:100%;height:40px;line-height:40px;top:50%;margin-top:-40px}.upload_or_download .glyphicon{color:#666}.upload_or_download_view{padding:10px 20px}.upload_btn_group{margin-top:15px;display:inline-block;text-align:right;width:100%}.upload_btn_group button{margin-right:15px}.upload_btn_group button:last-child{margin:auto}.filePage{width:100%;height:auto}.filePage>div{margin-top:10px}.filePage>.page_num{float:left;line-height:30px;padding:0 5px}.filePage>.page_num a{float:initial;border:none;line-height:30px;color:#20a53a;display:inline;font-size:13px;padding:0 5px}.filePage>.page_num a:hover{background:#fff;color:#20a53a;text-shadow:0 1px 0 #fff;cursor:pointer}.filePage.showRow{margin:0 3px;border:#cfcfcf 1px solid}.filePage .page span{height:30px;line-height:30px;padding:0 12px}.filePage .Pcount-item{border-left:none;border-right:1px solid #ececec;color:#333}.filePage .Pcount-item .showRow{margin:0 3px;border:1px solid #eee;border-radius:2px}.preview_images_mask{position:fixed;left:50%;top:50%;background:rgb(0 0 0 /.85);z-index:9999;height:650px;width:750px;margin-left:-375px;margin-top:-325px;overflow:hidden;-webkit-box-shadow:0 0 3px 1px rgba(0,0,0,.3);-moz-box-shadow:0 0 3px 1px rgba(0,0,0,.3);box-shadow:0 0 3px 1px rgba(0,0,0,.3);border-radius:4px}.preview_images_mask .preview_head{height:45px;line-height:45px;width:100%;position:absolute;z-index:999}.preview_images_mask .preview_title{text-align:center;width:100%;display:inline-block;font-size:16px;background-color:rgb(0 0 0 /.45);color:#cacaca;cursor:all-scroll}.preview_images_mask .preview_close,.preview_images_mask .preview_full,.preview_images_mask .preview_small{position:absolute;right:0;width:45px;height:45px;line-height:47px;font-size:19px;text-align:center;color:#d6d6d6}.preview_images_mask .preview_full,.preview_images_mask .preview_small{right:45px;font-size:18px}.preview_images_mask .preview_close:hover,.preview_images_mask .preview_full:hover,.preview_images_mask .preview_small:hover{background-color:#444;color:#fff;cursor:pointer}.preview_images_mask .preview_body{position:relative;height:100%;z-index:99;padding:45px 0}.preview_images_mask:hover .preview_cut_view{opacity:1}.preview_images_mask:hover .preview_toolbar{opacity:1}.preview_images_mask .preview_body img{position:absolute;display:none;transition:all .2s;cursor:all-scroll;display:inline-block;opacity:0;webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.preview_images_mask .preview_toolbar{position:absolute;bottom:0;width:250px;left:50%;margin-left:-125px;height:45px;border-radius:3px;background-color:rgb(0 0 0 /.65);font-size:18px;z-index:999;opacity:0;transition:all 1s}.preview_images_mask .preview_toolbar a{width:50px;height:45px;line-height:45px;text-align:center;display:inline-block;transition:all .5s;border-radius:3px}.preview_images_mask .preview_toolbar a:hover{background-color:rgb(86 86 86 / 75%)}.preview_images_mask .preview_toolbar span{vertical-align:middle;color:#bbb}.preview_images_mask .preview_toolbar span.reverse-repeat{transform:rotateY(180deg)}.preview_images_mask .preview_cut_view{opacity:0;transition:all .5s}.preview_images_mask .preview_cut_view a:hover{background-color:#3a3a3a;color:#fff}.preview_images_mask .preview_cut_view a{position:absolute;font-size:26px;width:50px;height:50px;text-align:center;line-height:50px;top:50%;margin-top:-25px;background-color:rgb(194 194 194 / 80%);border-radius:50%;transition:all .2s;z-index:999}.preview_images_mask .preview_cut_view a:nth-child(1){left:3%}.preview_images_mask .preview_cut_view a:nth-child(2){right:3%}.preview_images_mask .preview_cut_view span{vertical-align:top;height:50px;width:50px;text-align:center;line-height:50px}.exists_files_style{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:145px}.readonly-form-input:focus{outline:0;background-color:-internal-light-dark(rgba(239,239,239,.4),rgba(59,59,59,.4));cursor:default}.readonly-form-input:active{border-color:#ccc;box-shadow:none;-webkit-box-shadow:none}.icon-file-upper{background-position:0 6px}.icon-file-back{background-position:-30px 6px}.icon-file-forward{background-position:-15px 6px}.icon-file-refresh{background-position:-45px 6px}.icon-file{display:inline-block;background-image:url(../images/iconfont-file.png);height:28px;line-height:28px;width:15px;background-repeat:no-repeat}.bt-warp{min-width:1400px}.file_menu_tips{display:inline-block;font-size:14px;line-height:32px}.file_menu_tips span{vertical-align:middle;margin-right:3px;color:#f0ad4e}.file_menu_tips span:nth-child(2){font-size:12px}.file_path_collect:hover,.file_path_refresh:hover{background:#20a53a;border-color:#38983b;color:#fff} \ No newline at end of file +.webDelete .vcode #vcodeResult{width:50px;height:26px}*{margin:0;padding:0}.file_table_view.list_view::-webkit-scrollbar{width:12px;height:7px;padding:2px;position:relative}.file_table_view.list_view::-webkit-scrollbar-thumb{border-radius:3px;box-shadow:inset 0 0 6px rgba(0,0,0,.1);background:#bbb}.file_table_view.list_view::-webkit-scrollbar-track{border-radius:3px;box-shadow:inset 0 0 6px rgba(0,0,0,.1);background:#ededed}.file_list_header{height:40px;background:#f6f6f6;border-bottom:none;position:relative;z-index:999;overflow-y:hidden}.file_list_header .file_checkbox,.file_table_view.list_view .file_list_content .file_checkbox{padding:12px!important;margin-left:0!important;cursor:default}.file_list_header .file_checkbox input,.file_table_view.list_view .file_list_content .file_checkbox input{display:none}.file_list_header .file_check,.file_table_view.list_view .file_list_content .file_check{width:16px;height:16px;line-height:16px;border:1px solid #d2d2d2;box-sizing:border-box;border-radius:2px;cursor:pointer;transition:all .2s;background-color:#fff}.file_list_header .file_main_title{line-height:40px;height:40px;overflow:hidden;border:1px solid transparent;border-bottom:none}.file_list_header .file_check i,.file_table_view.list_view .file_list_content .file_check i{position:relative;top:-2px;font-size:14px}.file_table_view.icon_view{position:relative;overflow:hidden}.file_table_view.list_view{position:relative;overflow:auto;z-index:1}.file_table_view .file_name .file_title i:hover{color:#000;cursor:pointer}.file_table_view.list_view .file_name{min-width:120px}.file_table_view.icon_view .file_list_header{display:none}.file_table_view.icon_view .app_menu_group,.file_table_view.icon_view .file_accept,.file_table_view.icon_view .file_checkbox,.file_table_view.icon_view .file_mtime,.file_table_view.icon_view .file_name .iconfont,.file_table_view.icon_view .file_ps,.file_table_view.icon_view .file_size,.file_table_view.icon_view .file_type,.file_table_view.icon_view .file_user{display:none}.file_table_view.icon_view .file_tr{display:inline-block;width:80px!important;min-height:90px;padding:5px;vertical-align:top;margin:0 10px 10px 0}.file_table_view.icon_view .file_name{width:100%!important;position:relative}.file_table_view.icon_view .file_ico_type{height:60px}.file_table_view.icon_view .file_list_content .file_icon{width:45px;height:45px;left:21%}.file_table_view.icon_view .file_name i{font-style:inherit}.file_table_view.icon_view .file_title.file_dir_status,.file_table_view.icon_view .file_title.file_file_status{width:70px;text-align:center;word-break:break-all;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}.file_table_view.icon_view .file_list_content .file_tr:hover{background:#f0f9f7!important}.file_table_view.icon_view .file_list_content .file_tr.active{background:#f0f9f7!important;border:1px solid #ddefeb;box-sizing:border-box;padding:4px}.file_list_header .file_th{float:left;padding-left:10px;padding-right:10px;height:40px;line-height:40px;font-size:13px;color:#333;position:relative;cursor:pointer;margin-left:-5px}.file_list_header .file_th>span{vertical-align:middle}.file_table_view.list_view .file_type{min-width:80px;max-width:300px}.file_list_header .file_th{color:#333}.file_list_header .file_th.active{background:#eee;color:#555}.file_list_header .file_th:hover{background:#eee}.file_list_header .file_checkbox:hover,.file_list_header .file_operation:hover{background:#f3f3f3}.file_ps_title .set_file_ps{height:25px;line-height:25px;border:1px solid transparent;width:100%;border-radius:2px;padding-left:5px;outline:0}.file_ps_title .set_file_ps:hover{border:1px solid #20a53a!important;background-color:#fff!important}.file_list_header .file_width_resize{float:left;width:10px;margin-left:-5px;height:40px;overflow:hidden;position:relative;z-index:998}.file_list_header .file_width_resize::after{content:'';display:block;background:#e2e2e2;width:1px;height:25px;position:absolute;top:50%;left:50%;margin-left:-1px;margin-top:-12.5px}.file_list_header .file_name{margin-left:0}.file_operation.file_td .set_operation_group{display:none}.file_table_view.list_view .file_tr.active .set_operation_group.is_mobile{display:block!important}.file_list_header .icon_sort{display:inline-block;height:40px;line-height:40px;transition:all .5s;float:right}.file_list_header .icon_sort.active{transform:rotate(180deg)}.file_list_header .icon_sort .iconfont{vertical-align:bottom}.file_table_view.list_view .file_list_shadow{width:100%;height:8px;position:absolute;left:0;right:0;background:-webkit-linear-gradient(top,rgba(220,220,220,.5),rgba(255,255,255,0));z-index:99}.file_table_view.list_view .file_shadow_bottom{background:-webkit-linear-gradient(top,rgba(255,255,255,0),rgba(220,220,220,.5));bottom:0}.align-center{text-align:center}.align-left{text-align:left}.align-right{text-align:right}.btlink{color:#20a53a;text-decoration:none}.file_table_view.list_view .file_list_content{min-width:750px;overflow:auto;border-top:1px solid #ececec}.file_table_view.list_view .file_list_content .file_tr{height:45px;box-sizing:border-box;color:#fff;border-bottom:1px solid #f3f3f3;border-left:1px solid transparent;border-right:1px solid transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file_table_view.list_view .file_list_content .file_tr.editr_tr .file_td{display:none}.file_table_view.list_view .file_list_content .file_tr.editr_tr .file_name{display:inline-block;margin-left:40px}.file_table_view.list_view .file_name .iconfont{display:block}.file_table_view.list_view .file_list_content .file_tr.editr_tr .file_name .iconfont{display:none}.file_table_view.list_view .file_name .icon-favorites,.file_table_view.list_view .file_name .icon-share1{font-size:18px;width:18px;height:18px;vertical-align:middle;position:absolute;top:50%;right:5px;margin-top:-9px;color:#2e973e;display:inline-block}.file_table_view.list_view .file_name .icon-favorites{color:#f5a623;font-size:17px}.file_table_view.list_view .file_name .icon-favorites:before,.file_table_view.list_view .file_name .icon-share1:before{position:relative;top:-16px;height:18px;width:18px;cursor:pointer}.file_table_view.list_view .file_list_content .file_tr.editr_tr .rename_file_input{height:32px;line-height:30px;border:1px solid #cfcfcf;border-radius:2px;padding-left:5px;margin-right:15px;width:150px}.file_table_view.list_view .file_list_content .file_tr.editr_tr .rename_file_input:focus{outline:0;border:1px solid #20a53a}.file_table_view.list_view .file_list_content .file_tr.editr_tr .add_file_btn,.file_table_view.list_view .file_list_content .file_tr.editr_tr .clear_file_btn{height:32px;line-height:30px;padding:0 18px;margin-right:10px;background-color:#20a53a;border-color:#20a53a;border-radius:2px;color:#fff;border:1px solid transparent}.file_table_view.list_view .file_list_content .file_tr.editr_tr .clear_file_btn{color:#555;background-color:#fff;border-color:#ccc}.file_table_view.list_view .file_list_content .file_tr.editr_tr .add_file_btn::focus,.file_table_view.list_view .file_list_content .file_tr.editr_tr .clear_file_btn::focus{outline:0}.file_table_view.list_view .file_list_content .file_tr.editr_tr .add_file_btn:hover{color:#fff;background-color:#10952a;border-color:#398439}.file_table_view.list_view .file_ps .foo_menu{display:none}.file_table_view.list_view .file_tr:hover .foo_menu{display:inline-block;position:absolute;right:10px}.file_table_view.list_view .file_tr .foo_menu_title{position:relative;padding-right:10px}.file_table_view.list_view .file_tr .foo_menu_title i{display:inline-block;width:7px;height:7px;color:#20a53a;border-left:1px solid;border-bottom:1px solid;transform:rotate(-45deg);position:absolute;top:3px;right:0}.file_table_view.list_view .file_tr.active .foo_menu{display:inline-block;position:absolute;right:10px}.file_table_view.list_view .file_tr.active .foo_menu .foo_menu_title,.file_table_view.list_view .file_tr:hover .foo_menu .foo_menu_title{border:1px solid #20a53a;color:#20a53a!important;background:#fff;border-radius:2px;padding:4px 18px 4px 8px;font-size:12px;cursor:pointer;position:relative}.file_table_view.list_view .file_tr .foo_menu .foo_menu_title:hover,.file_table_view.list_view .file_tr.active .foo_menu .foo_menu_title:hover{border:1px solid #20a53a;color:#fff!important;background:#20a53a}.file_table_view.list_view .file_tr .foo_menu.foo_menu_click .foo_menu_title,.file_table_view.list_view .file_tr.active .foo_menu .foo_menu_title:hover,.file_table_view.list_view .file_tr:hover .foo_menu .foo_menu_title:hover{border:1px solid #20a53a;color:#fff!important;background:#20a53a}.file_table_view.list_view .file_tr .foo_menu.foo_menu_click .foo_menu_title::after,.file_table_view.list_view .file_tr.active .foo_menu .foo_menu_title:hover::after,.file_table_view.list_view .file_tr:hover .foo_menu .foo_menu_title:hover::after{color:#fff}.app_menu_group ul{color:#20a53a;height:50px;line-height:50px;display:inline-block;margin-left:8px}.app_menu_group ul li{display:inline-block;margin-right:10px}.app_menu_group ul li i,.app_menu_group ul li.separate,.file_table_view.list_view .file_list_content .file_tr.app_menu_operation .file_td:nth-child(n+3){display:none}.file_table_view.list_view .file_list_content .file_tr:last-child{border-bottom:1px solid #ececec}.file_table_view.list_view .file_list_content .file_tr.active,.file_table_view.list_view .file_list_content .file_tr:hover{background:#f0f9f7!important;border:1px solid #ddefeb;border-top:none}.file_table_view.list_view .file_list_content .file_tr:hover .set_operation_group{display:block}.file_table_view.list_view .file_list_content .file_tr.active .set_file_ps,.file_table_view.list_view .file_list_content .file_tr:hover .set_file_ps{border:1px solid transparent;background-color:#eff9f7}.file_table_view.list_view .file_list_content .file_td{height:45px;line-height:45px;padding:0 8px;color:#777;overflow:hidden;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:top}.file_table_view.list_view .file_list_content .file_td.file_operation{text-overflow:clip;text-align:right}.file_table_view.list_view .file_list_content .file_checkbox{padding:14px 12px!important}.file_table_view.list_view .file_list_content .file_ico_type{height:40px;line-height:40px;display:inline-block;position:relative}.file_table_view.list_view .file_title{vertical-align:top;padding-left:38px;width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.file_table_view.list_view .file_title.file_file_status i{font-style:normal}.file_table_view.list_view .file_title i{font-style:normal;cursor:pointer;color:#555}.file_table_view.list_view .file_title i:hover{color:#20a53a}.file_edit_input{height:31px;display:inline-block;width:100%;padding-left:5px;outline:0;border:1px solid #ebf3f1;margin-left:-5px;border-radius:2px}.file_list_content .file_icon{width:100%;width:30px;height:30px;position:absolute;top:7.5px;background-repeat:no-repeat;background-size:cover;background-position:center;image-rendering:-webkit-optimize-contrast;background-image:url(../img/file_icon/file.png);cursor:pointer}.file_list_content .file_html{background-image:url(../img/file_icon/html.png)}.file_list_content .file_css{background-image:url(../img/file_icon/css.png)}.file_list_content .file_js{background-image:url(../img/file_icon/javascript.png)}.file_list_content .file_json{background-image:url(../img/file_icon/json.png)}.file_list_content .file_folder{background-image:url(../img/file_icon/folder.png)}.file_list_content .file_php{background-image:url(../img/file_icon/php.png)}.file_list_content .file_log{background-image:url(../img/file_icon/log.png)}.file_list_content .file_txt{background-image:url(../img/file_icon/file.png)}.file_list_content .file_py{background-image:url(../img/file_icon/python.png);width:30px;height:30px;left:2.5px;top:10px}.file_list_content .file_png{background-image:url(../img/file_icon/png.png)}.file_list_content .file_lua{background-image:url(../img/file_icon/lua.png);width:30px;height:30px;left:2.5px;top:10px}.file_list_content .file_access{background-image:url(../img/file_icon/access.png)}.file_list_content .file_apk{background-image:url(../img/file_icon/apk.png)}.file_list_content .file_avi{background-image:url(../img/file_icon/avi.png)}.file_list_content .file_bmp{background-image:url(../img/file_icon/bmp.png)}.file_list_content .file_cdr{background-image:url(../img/file_icon/cdr.png)}.file_list_content .file_gif{background-image:url(../img/file_icon/gif.png)}.file_list_content .file_ico{background-image:url(../img/file_icon/ico.png)}.file_list_content .file_java{background-image:url(../img/file_icon/java.png)}.file_list_content .file_jpeg{background-image:url(../img/file_icon/jpeg.png)}.file_list_content .file_jpg{background-image:url(../img/file_icon/jpg.png)}.file_list_content .file_mkv{background-image:url(../img/file_icon/mkv.png)}.file_list_content .file_mov{background-image:url(../img/file_icon/mov.png)}.file_list_content .file_mp4{background-image:url(../img/file_icon/mp4.png)}.file_list_content .file_mpeg{background-image:url(../img/file_icon/mpeg.png)}.file_list_content .file_mpg{background-image:url(../img/file_icon/mpg.png)}.file_list_content .file_pdf{background-image:url(../img/file_icon/pdf.png)}.file_list_content .file_ppt,.file_list_content .file_pptx{background-image:url(../img/file_icon/ppt.png);width:30px;height:30px;left:2.5px}.file_list_content .file_rar{background-image:url(../img/file_icon/rar.png)}.file_list_content .file_rm{background-image:url(../img/file_icon/rm.png)}.file_list_content .file_rmvb{background-image:url(../img/file_icon/rmvb.png)}.file_list_content .file_sql{background-image:url(../img/file_icon/sql.png)}.file_list_content .file_swf{background-image:url(../img/file_icon/swf.png)}.file_list_content .file_tar{background-image:url(../img/file_icon/tar.png)}.file_list_content .file_webm{background-image:url(../img/file_icon/webm.png)}.file_list_content .file_webp{background-image:url(../img/file_icon/webp.png)}.file_list_content .file_wma{background-image:url(../img/file_icon/wma.png)}.file_list_content .file_wmv{background-image:url(../img/file_icon/wmv.png)}.file_list_content .file_doc,.file_list_content .file_docx{background-image:url(../img/file_icon/doc.png);width:30px;height:30px;left:2.5px}.file_list_content .file_xls,.file_list_content .file_xlsx{background-image:url(../img/file_icon/xls.png);width:30px;height:30px;left:2.5px}.file_list_content .file_xml{background-image:url(../img/file_icon/xml.png)}.file_list_content .file_zip{background-image:url(../img/file_icon/zip.png)}.file_list_content .file_gz,.file_list_content .file_tar{background-image:url(../img/file_icon/tar.png)}.content_right_menu,.file_right_menu,.selection_right_menu{padding:5px 0;width:190px;border:1px solid #dadada;box-shadow:5px 5px 12px rgba(0,0,0,.15);position:fixed;left:-100%;top:-100%;z-index:9999;background:#fff}.content_right_menu li,.file_right_menu li,.selection_right_menu li{list-style-type:none;margin:0;padding:0;height:30px;font-size:12px;color:#555;line-height:30px;padding-left:48px;box-sizing:border-box;position:relative;font-weight:400;border-radius:2px}.selection_right_menu li span{color:#666}.content_right_menu li.separate,.file_right_menu li.separate,.selection_right_menu li.separate{height:1px;background:#ececec}.content_right_menu li:hover,.file_right_menu li:hover,.selection_right_menu li:hover{background:#efefef;cursor:pointer}.selection_right_menu li:hover .file_menu_down .set_group{display:inline-block}.content_right_menu li .file_menu_icon,.file_right_menu li .file_menu_icon,.nav_down_list li .file_menu_icon,.nav_group .nav_btn_group .file_menu_icon,.selection_right_menu li .file_menu_icon{display:inline-block;background-image:url(../img/file_icon/file_menu_icon.png);background-size:auto!important;background-repeat:no-repeat;width:16px;height:16px;position:absolute;left:22px;top:50%;margin-top:-8px;font-style:normal}.selection_right_menu li .property_file_icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA7klEQVQ4T6WTQUrDUBCG///lBnZboeAFvEBvUcWV0BIy3dadJ3CnSzNJcF20d+giF/AALRTi1t7gZaQhkVJ0kb5ZDMyb+T+YNzPEiRVFceG9nwAYkxwf0mZWAiijKFrFcbw/lvA4yLLszsyeAIxOwW28I/mYJMmyy/8CVNX+Ef35LCKNtnGq+gxg0QcA4EVEHpjn+bCu608Ag56Ab+fcNdM0nZJ86yluys1sdgC8kpyfCUipqhsAVy3gQ0RuVbUCMCR5772vnHNrAF8icqmq7wBu2vptOCC4heBPDB5j8CJ14wta5Q4SdEwdpO85/wAdKopJjTYPqgAAAABJRU5ErkJggg==)!important}.nav_down_list:before{content:'';display:inline-block;width:100%;height:5px;position:absolute;top:-5px}.edit_file_icon,.open_file_icon,.open_find_dir_file_icon{background-position:-16px -16px}.copy_file_icon{background-position:0 -96px}.paste_file_icon{background-position:-16px -64px}.shear_file_icon{background-position:-16px -80px}.rename_file_icon{background-position:0 -64px}.del_file_icon{background-position:0 -80px}.download_file_icon{background-position:-16px -48px}.folad_file_icon,.killing_file_icon,.unzip_file_icon{background-position:0 -32px}.decompression_file_icon{background-position:0 -32px}.authority_file_icon,.cancel_share_file_icon,.dir_kill_file_icon,.share_file_icon{background-position:-17px -773px;background-image:none!important;width:17px!important;height:17px!important;font-size:19px;top:0!important;margin-top:0!important;color:#31dc48}.dir_kill_file_icon{font-size:17px;color:#c77f22}.authority_file_icon{color:#f2ce4d}.cancel_favorites_file_icon,.favorites_file_icon{background-position:0 -32px;background-position:-17px -773px;width:17px!important;height:17px!important;margin-top:-8.5px!important}.file_menu_down .glyphicon-triangle-right{font-size:8px;position:absolute;right:8px;top:8px;color:#555;transform:scale(.8)}.selection_right_menu.left_menu .file_menu_down .set_group{top:-6px;left:-210px}.file_menu_down .set_group{display:none;padding:5px 0;background:#fff;width:210px;border:1px solid #dadada;position:absolute;right:-210px;top:-6px;box-shadow:5px 5px 12px rgba(0,0,0,.15)}.file_right_menu li:hover .set_group{display:inline-block}.file_right_menu li .power_file_icon,.nav_group .nav_btn_group .power_file_icon{background-image:url(../img/file_icon/power_file_icon.png)!important;background-size:16px!important}.add_favorites_icon{background-position:-16px -773px}.refresh_file_icon{background-position:-16px -513px}.upload_file_icon{background-position:0 -48px}.create_dir_file_icon,.create_file_icon,.newly_file_icon{background-position:0 -16px}.compress_file_icon,.rar_file_icon,.tar_gz_file_icon,.zip_file_icon{background-position:-16px -32px}.paste_file_icon{background-position:-16px -64px}.total_icon_icon{background-position:0 -561px}.total_list_icon{background-position:-16px -625px}.selection_right_menu li .file_menu_icon.web_shell_file_icon{background-image:url(../img/file_icon/ico-cmd.png)}.onselectstart{position:fixed;display:none;width:0;height:0;background:#bbf1e3;border:1px dashed #a1d0c3;opacity:.5}.file_list_header .file_check.active,.file_list_header .file_check.active_2,.file_tr.active .file_check{background:#5fb878!important;border:1px solid #5fb878!important;color:#fff}.file_list_header .file_check.active_2::before{font-weight:700;content:"";height:2px;width:10px;display:inline-block;border-radius:1px;position:relative;background-color:#fff;top:-4px;left:2px}.file_list_header .file_check.active::before,.file_tr.active .file_check::before{font-weight:700;content:"\e75e";position:relative;top:-2px;font-size:14px;font-family:iconfont!important;font-style:normal;-webkit-font-smoothing:antialiased}.statistics{display:inline-block;height:30px;line-height:30px;padding:0 10px;position:absolute;border-left:4px solid #20a53a;bottom:38px;font-size:14px}.statistics span{margin:0 2px;font-size:14px}.bt_file_updated{position:fixed;width:100%;height:100%;left:0;top:0;right:0;bottom:0;background:rgba(32,165,58,.5);z-index:9999;display:none}.updated_title{text-align:center;position:absolute;z-index:99999;color:#fff;width:100%;font-size:50px;opacity:.8;top:50%}.updated_icon{position:absolute;top:50%;left:50%;margin-left:-125px;margin-top:-200px}.updated_icon .btn{width:250px;height:200px;position:relative;text-align:center;margin:15px;overflow:hidden;border-radius:100%;display:inline-block}.updated_icon .cloud{width:200px;height:80px;position:relative;background:#fff;display:inline-block;border-radius:50px;margin:40px auto 0}.updated_icon .cloud:after{content:'';position:absolute;width:120px;height:80px;border-radius:80px 80px 0 0;top:-40px;background:#fff;left:40px}.updated_icon .cloud:before{content:'';position:absolute;background:#dedede;border-radius:10px;width:90px;height:6px;z-index:2;left:0;right:0;bottom:25px;margin:auto}.updated_icon .file{position:absolute;left:0;right:0;margin:auto;z-index:5;top:50px;width:80px;height:100px;display:inline-block;overflow:hidden}.updated_icon .file:after{content:'';position:absolute;background:#5fb878;width:80px;height:80px;left:0;top:0;border-radius:0 0 10px 10px;-webkit-animation:uplaod 3s linear infinite;animation:uplaod 3s linear infinite}.updated_icon .file:before{content:'';background:#e2e3e3;color:#e2e3e3;width:60px;height:5px;position:absolute;left:0;right:0;top:20px;z-index:3;margin:auto;-webkit-animation:uplaod 3s linear infinite;animation:uplaod 3s linear infinite;box-shadow:0 15px,0 30px}@-webkit-keyframes uplaod{0%{-webkit-transform:translateY(0);transform:translateY(0)}100%{-webkit-transform:translateY(-100px);transform:translateY(-100px)}}@keyframes uplaod{0%{-ms-transform:translateY(0);-webkit-transform:translateY(0);transform:translateY(0)}100%{-ms-transform:translateY(-100px);-webkit-transform:translateY(-100px);transform:translateY(-100px)}}.file_nav_view{height:32px;margin:15px 0;font-size:0}.file_nav_view .nav_group{display:inline-block;vertical-align:top}.file_nav_view .nav_group.dividing{border-color:#fff;height:100%;width:1px;background:#cfcfcf;cursor:default;margin:0 10px}.nav_group .nav_btn:hover,.nav_group .nav_btn_group:hover{background-color:#20a53a;border-color:#20a53a}.nav_group .nav_btn:hover .nav_btn_title,.nav_group .nav_btn_group:hover .nav_btn_title{color:#fff}.nav_group .nav_btn:hover>.iconfont,.nav_group .nav_btn_group:hover>.iconfont{color:#fff}.file_nav_view .nav_btn_group.active:hover{border-color:#cfcfcf}.file_nav_view .nav_btn:hover .nav_down_list,.file_nav_view .nav_btn_group:hover .nav_down_list{display:block}.file_nav_view .nav_btn::before{content:'';display:none;width:100%;height:5px;position:absolute;bottom:-5px;left:0}.file_nav_view .nav_btn:hover::before{display:inline-block}.nav_group .nav_btn,.nav_group .nav_btn_group{padding:0 10px;display:inline-block;box-sizing:border-box}.terminal_view .nav_btn_title{vertical-align:middle!important;margin-left:5px}.terminal_view{padding:4px 10px!important}.terminal_view .iconfont{vertical-align:middle}.nav_group .nav_btn,.nav_group .nav_btn_group{display:inline-block;margin-right:5px;border:1px solid #cfcfcf;box-sizing:border-box;cursor:pointer;border-radius:2px;transition:all .1s;position:relative;padding:7px 10px}.nav_group{font-size:0}.nav_group .share_file_list{margin-right:8px}.nav_group .nav_btn_group{margin-right:0;vertical-align:bottom}.nav_group .nav_btn_group{padding-left:28px}.nav_group .nav_btn_group .file_menu_icon{left:7.5px}.nav_group .nav_btn .icon-xiala,.nav_group .nav_btn_group .icon-xiala{font-size:12px;margin-left:2px;vertical-align:middle}.nav_group .nav_btn .nav_btn_title,.nav_group .nav_btn_group .nav_btn_title{font-size:12px;color:#555;vertical-align:top}.nav_group .nav_btn_group{border-right-width:1px;border-left-width:0;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:0}.nav_group .nav_btn_group.active{background:#ececec}.nav_group .nav_btn_group:last-child{border-right-width:1px;border-top-right-radius:2px;border-bottom-right-radius:2px}.nav_group .nav_btn_group:first-child{border-left-width:1px;border-top-left-radius:2px;border-bottom-left-radius:2px}.nav_group .nav_btn.nav_btn_title .icon-terminal,.nav_group .nav_btn_group .nav_btn_title .icon-terminal{font-size:17px}.nav_group .nav_btn .icon-shangchuanxiazai,.nav_group .nav_btn_group .icon-shangchuanxiazai{font-size:12px;margin-right:5px;color:#555}.nav_group.mount_disk_list{padding-left:8px;border-left:1px solid #ececec}.nav_group.multi{padding-right:8px;border-right:1px solid #ececec}.nav_group.mount_disk_list>.glyphicon{font-size:13px;color:#666;position:relative;top:2px}.float_r.menu-header-foot{font-size:0}.nav_group.file_all_paste,.nav_group.recycle_bin{padding-left:8px}.nav_group.recycle_bin .nav_btn{margin-right:8px}.nav_group.mount_disk_list .nav_btn,.nav_group.recycle_bin .nav_btn{padding:7px 10px 7px 5px}.nav_group.mount_disk_list .nav_btn span,.nav_group.recycle_bin .nav_btn span{font-size:12px;margin-left:5px;color:#666}.file_disk_list .nav_btn span:nth-child(0){font-size:12px}.nav_group.recycle_bin .nav_btn .glyphicon{top:2px}.nav_group.mount_disk_list .nav_btn:hover span,.nav_group.recycle_bin .nav_btn:hover span{color:#fff!important}.nav_down_list{display:none;transition:all .5s;list-style:none;background:#fff;border-radius:2px;box-shadow:4px 2px 5px 0 #ececec;border:1px solid #cfcfcf;position:absolute;left:-1px;top:32px;z-index:999999;overflow:auto;max-height:300px;max-width:140px}.nav_group.mount_disk_list .disk_title_group_btn{display:none}.nav_group.mount_disk_list.thezoom .disk_title_group_btn{border-radius:2px;height:32px;line-height:32px;border:1px solid #cfcfcf;padding:7px 10px;display:inline-block;width:115px;box-sizing:border-box;cursor:pointer;position:relative;transition:all .5s}.nav_group.mount_disk_list .file_disk_list .nav_btn:last-child{margin-right:0!important}.nav_group.mount_disk_list.thezoom .file_disk_list{display:none}.nav_group.mount_disk_list.thezoom .disk_title_group_btn .disk_title_group{font-size:12px;color:#666;position:absolute;top:0}.nav_group.mount_disk_list.thezoom .disk_title_group_btn::before,.nav_group.multi.thezoom .batch_multi_title::before{content:'';display:none;width:100%;height:5px;position:absolute;bottom:-5px;left:0}.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover::before,.nav_group.multi.thezoom .batch_multi_title:hover::before{display:inline-block}.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover,.nav_group.multi.thezoom .batch_multi_title:hover{background-color:#20a53a;border-color:#20a53a}.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover .disk_title_group,.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover>i,.nav_group.multi.thezoom .batch_multi_title:hover>i,.nav_group.multi.thezoom .batch_multi_title:hover>span{color:#fff}.nav_group.mount_disk_list.thezoom .disk_title_group_btn>i{font-size:12px;margin-left:2px;position:absolute;right:9px;top:0}.nav_group.mount_disk_list.thezoom .disk_title_group_btn .nav_down_list{max-width:360px}.nav_group.mount_disk_list.thezoom .disk_title_group_btn .nav_down_list li i{font-size:13px;position:absolute;left:8px;top:8px;color:#666}.nav_group.mount_disk_list.thezoom .disk_title_group_btn .nav_down_list li span{width:100%;padding-right:10px}.nav_group.mount_disk_list.thezoom .disk_title_group_btn:hover ul.nav_down_list{display:block}.nav_group.multi.thezoom{padding-right:0;border-right:none}.nav_group.multi .batch_multi_title>i,.nav_group.multi .batch_multi_title>span{display:none}.nav_group.multi.thezoom .batch_multi_title>i,.nav_group.multi.thezoom .batch_multi_title>span{display:inline-block;font-size:12px;color:#666}.nav_group.multi.thezoom .batch_multi_title>i{font-size:12px;margin-left:2px;position:absolute;right:9px;top:7px}.nav_group.multi.thezoom{position:relative}.nav_group.multi.thezoom:hover .batch_group_list{display:block}.nav_group.multi.thezoom .batch_multi_title{border-radius:2px;height:32px;border:1px solid #cfcfcf;padding:7px 10px;display:inline-block;width:85px;box-sizing:border-box;cursor:pointer;position:relative}.nav_group.multi.thezoom .batch_group_list{display:none;width:85px;margin-top:12px;position:absolute;left:0;border:1px solid #cfcfcf;border-radius:2px;box-shadow:4px 2px 5px 0 #ececec;z-index:9999;background-color:#fff}.nav_group.multi.thezoom .batch_group_list .nav_btn_group{width:100%;border:none}.nav_group.multi.thezoom .batch_group_list .nav_btn_group:hover{background-color:#f0f0f0}.nav_group.multi.thezoom .batch_group_list .nav_btn_group:hover span{color:#666}.selection_right_menu li .file_menu_icon.create_files_file_icon{height:17px;background-image:url(../img/file_icon/file_text2.png)}.file_nav_view .nav_down_list li i.file_new_icon{width:17px;height:17px;position:absolute;top:7.5px;left:5px;background-repeat:no-repeat;background-size:cover;background-position:center;image-rendering:-webkit-optimize-contrast;background-image:url(../img/file_icon/file_text2.png)}.file_nav_view .nav_down_list li i.file_new_folder_icon{width:19px;height:17px;position:absolute;top:7.5px;left:4px;background-repeat:no-repeat;background-size:cover;background-position:center;image-rendering:-webkit-optimize-contrast;background-image:url(../img/file_icon/folder.png)}.file_list_content .file_tr textarea:focus{outline:0!important;border:1px solid #ccc}.file_table_view .file_list_content .file_tr.editr_tr textarea,.file_table_view.icon_view .createModel textarea{width:70px;padding:5px 2px;border-color:#ccc;overflow:hidden;resize:none}.file_table_view .file_list_content .file_tr.editr_tr input,.file_table_view.list_view .createModel input{width:100%;padding:0 0 0 5px;height:25px;border:1px solid #ececec;outline:0;vertical-align:middle;line-height:25px}.favorites_file_path .nav_down_list{max-width:230px}.favorites_file_path .nav_down_list li span{width:230px!important;padding-right:20px}.favorites_body .favorites_span{width:680px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.favorites_file_path .nav_down_list li span.icon-shezhi1{left:6px}.nav_down_list li{height:30px;line-height:30px;position:relative;box-sizing:border-box;overflow:hidden;color:#555}.nav_down_list li:last-child{border:none}.nav_down_list li:hover{background:#f0f0f0;color:#555}.file_dir_item .nav_down_list li span{line-height:30px!important}.file_dir_item .file_dir span{color:#666}.nav_down_list li span:nth-child(1){font-size:14px;position:absolute;line-height:28px;top:0;left:12px;color:#666}.nav_down_list li span:nth-child(2){display:inline-block;font-size:12px;color:#555;line-height:30px;padding-left:28px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:140px}.nav_down_list li .iconfont{color:#aaa;font-size:19px;position:absolute;left:5px}.nav_down_list li .file_menu_icon{left:5px;margin-top:-8.5px}.nav_down_list li .icon-yingpan{font-size:15px}.nav_group.btn-group-sm>.btn.cut_view_model{padding:6px 10px}.file_path_views{height:30px;border-bottom:1px solid #eee;font-size:0;box-sizing:content-box;padding-bottom:15px}.file_path_views .file_path_upper{display:inline-block;height:30px;line-height:30px;vertical-align:top;border:1px solid #cfcfcf;box-sizing:border-box;text-align:center;vertical-align:top;border-top-left-radius:2px;border-bottom-left-radius:2px;border-right:none;color:#666}.file_path_views .file_path_upper{padding:0 12px}.file_path_views .file_path_upper:hover{background-color:#20a53a;color:#fff;cursor:pointer;border:1px solid #20a53a;border-right:none}.file_path_views .file_path_upper:hover i{background-position:-60px 6px}.file_path_views .file_path_upper span{font-size:12px;display:inline-block;height:28px;line-height:28px;vertical-align:top;top:0}.file_path_views .forward_path{display:inline-block;height:30px;line-height:30px;vertical-align:top;margin-right:-1px}.file_path_views .forward_path>span{display:inline-block;text-align:center;height:30px;line-height:30px;width:auto;padding:0 9px;border:1px solid #cfcfcf;box-sizing:border-box;border-radius:2px;cursor:pointer}.file_path_views .forward_path>span span{font-size:15px}.file_path_views .forward_path span:hover{background:#20a53a;border:1px solid #20a53a}.file_path_views .forward_path span:hover:first-child i{background-position:-90px 6px}.file_path_views .forward_path span:hover:last-child i{background-position:-75px 6px}.file_path_views .forward_path span.active:hover{background:#efefef;box-shadow:inset 0 3px 6px rgba(0,0,0,.1);border-color:#cfcfcf}.file_path_views .forward_path span:active{box-shadow:inset 0 3px 6px rgba(0,0,0,.1)}.file_path_views .forward_path span.active{background:#efefef;box-shadow:inset 0 3px 6px rgba(0,0,0,.1);cursor:no-drop;transition:all .5s}.file_path_views .forward_path span:first-child{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.file_path_views .forward_path span:last-child{border-left:1px solid #cfcfcf;border-radius:0}.file_path_input{display:inline-block;height:30px;width:50%;box-sizing:border-box;position:relative}.file_path_input input{border:1px solid #cfcfcf;display:inline-block;width:100%;position:absolute;top:0;left:0;height:30px;padding-left:5px;box-sizing:border-box;background:#f3f3f3;font-size:13px}.file_path_input input.focus{background-color:#fff}.file_dir_omit{display:inline-block;font-size:0;height:30px;line-height:28px;position:relative;left:0;width:45px;cursor:pointer;border:1px solid transparent}.file_dir_omit.active{background-color:#f0f9f7;border-top:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf;border-right:1px solid #ececec}.file_dir_omit.active .iconfont{background-color:#f0f9f7;border-left:#dadada;border-right:#dadada}.file_dir_icon,.file_dir_omit>span{display:inline-block;font-size:14px;background-image:url(../img/file_icon/file_menu_icon.png);background-position:0 -16px;background-size:auto;height:16px;position:absolute;top:6px;width:16px;left:5px;z-index:99}.file_dir_icon{left:8px;top:7px}.file_dir_omit .iconfont{position:absolute;top:0;right:0;font-size:12px!important;padding:0 2px}.file_dir_omit:hover{background:#f3fbf9;border-top:1px solid #cfcfcf;border-bottom:1px solid #cfcfcf;border-right:1px solid #ececec}.file_dir_omit:hover .iconfont{background:#f3fbf9;border-left:1px solid #ececec}.file_dir_omit .nav_down_list{overflow:hidden}.file_dir_omit .nav_down_list .file_dir_item{display:block;height:32px;position:relative;box-sizing:border-box}.file_dir_omit .nav_down_list .file_dir_item .file_dir{width:140px;background:#fff;height:32px;line-height:32px;padding-left:28px}.file_dir_omit .nav_down_list .file_dir_item .iconfont,.file_dir_omit .nav_down_list .file_dir_item .nav_down_list{display:none}.file_dir_item{display:inline-block;font-size:0;height:28px;line-height:28px;cursor:pointer;color:#777;box-sizing:border-box;position:relative;top:1px!important}.file_dir_item.active .nav_down_list{display:block;top:30px}.file_dir_view{position:relative;font-size:0;z-index:99;display:inline-block}.file_dir_view .file_dir_item.active{background:#f3fbf9;border:1px solid #d1e8e0;box-sizing:border-box;margin-top:-1px;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.file_dir_view .file_dir_item.active .iconfont{border-left:1px solid #d1e8e0}.file_dir_item .iconfont,.file_dir_omit .iconfont{vertical-align:top;font-size:14px;font-weight:600;height:28px;display:inline-block;border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3;transition:all .5s;background:#f3f3f3}.file_dir_item .file_dir{display:inline-block;padding:0 5px;font-size:12.5px;position:relative;height:28px;line-height:29px;color:#555;background:#f3f3f3;border-left:1px solid transparent;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file_dir_item .nav_down_list li{height:30px;line-height:30px;background:#f9f9f9}.file_dir_item .nav_down_list li.active{font-weight:600;color:#333;background-color:#eee}.file_dir_item .nav_down_list li:hover{background:#eee}.file_dir_item:first-child .file_dir{position:relative;top:0;font-size:12.4px;padding-left:10px}.file_dir_item:first-child{left:-1px}.file_dir_item:first-child .file_dir span:first-child{vertical-align:text-top}.file_dir_view .file_dir_item:hover{background:#f3fbf9;box-shadow:inset 0 0 2px rgba(0,0,0,.1)}.file_dir_view .file_dir_item:hover .file_dir{background:#f3fbf9;border-left:1px solid #ececec}.file_dir_view .file_dir_item:hover .iconfont{border-left:1px solid #ececec;border-right:1px solid #ececec;background:#f3fbf9}.file_path_refresh{display:inline-block;width:30px;height:30px;line-height:30px;border:1px solid #cfcfcf;box-sizing:border-box;text-align:center;vertical-align:top;border-left:0;border-top-right-radius:2px;border-bottom-right-radius:2px;cursor:pointer}.file_path_refresh:hover i{background-position:-105px 6px}.file_path_collect:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.file_path_collect i{font-size:14px;position:relative;top:-1px}.file_path_collect .icon-wujiaoxing{color:#ffca2e}.file_path_collect:hover{background:#20a53a;border-color:#38983b;color:#fff}.search_path_views{border:1px solid #20a53a;display:inline-block;vertical-align:top;float:right;font-size:0;position:relative}.search_path_views .set_updown{height:30px;line-height:30px;position:absolute}.file_path_views .forward_path i{top:0}.search_path_views .file_search_input{border:none;display:inline-block;height:28px;box-sizing:border-box;width:250px;padding-left:8px;box-sizing:border-box;outline:0;border-right:none;font-size:12px}.search_path_views .is_search_children{margin:0 5px;color:#cfcfcf;font-size:13px}.search_path_views .is_search_children:hover{color:#20a53a;cursor:pointer}.search_path_views .path_btn{display:inline-block;height:28px;background:#20a53a;vertical-align:top;color:#fff;border:none;width:35px;text-align:center;cursor:pointer;outline:0}.search_path_views .path_btn:hover{background-color:#38983b}.search_path_views .path_btn:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.search_path_views .set_up{display:none;position:absolute;top:30px;left:0;width:210px;height:30px;background:#fff;box-shadow:4px 2px 5px 0 #ececec;z-index:9999;border:1px solid #ececec;border-radius:2px}.search_path_views .file_search_config{position:absolute;right:35px;font-size:12px;color:#666;width:105px;border-top:none;background:#fff;height:28px;line-height:28px;top:0}.search_path_views .file_search_config .file_search_checked{position:relative;height:15px;width:15px;border-radius:1px;cursor:pointer;text-align:center;margin:0;vertical-align:sub;border:1px solid #aaa;border-radius:2px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased}.search_path_views .file_search_config .file_search_checked.active{background:#20a53a;color:#fff;border-color:#20a53a}.search_path_views .file_search_config .file_search_checked.active:after{content:"\e013";font-size:12px;transform:scale(.85);position:absolute;left:.75px;top:.75px}.search_path_views .file_search_config label{position:absolute;right:3px;cursor:pointer;top:0;font-weight:400}.mr0{margin-right:0!important}.ml0{margin-left:0!important}.plr25{padding:0 25px}.float_r{float:right}.file_bodys{background-color:#fff;margin:10px 15px;padding:15px 20px;font-size:12px;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}.file_list_icon{border-top:1px solid #eee;padding-top:15px}.file_list_icon .file_table_view.list_view .file_list_content .file_tr{display:inline-block;width:auto;background:#fff;border-color:#fff;position:relative;height:auto;margin:2.5px 5px;cursor:pointer;vertical-align:top}.file_table_view.list_view .file_list_content .file_tr.selected{background:#f0f9f7!important}.file_list_icon .file_table_view.list_view .file_list_content .file_tr .file_td{height:auto;padding:0;line-height:normal}.file_list_icon .file_table_view.list_view .file_list_content .file_tr .file_td:not(.file_name){display:none}.file_list_icon .file_table_view.list_view .file_list_content .file_tr .file_td:nth-of-type(1){position:absolute;left:0;top:0}.file_list_icon .file_table_view.list_view .file_list_content .file_tr .file_td:nth-of-type(2){width:99px;min-width:99px}.file_list_icon .file_table_view.list_view .file_list_content .file_type{width:100%;height:65px}.file_list_icon .file_table_view.list_view .file_list_content .file_icon{top:15px;width:50px;height:50px;left:50%;margin-left:-25px;background-size:auto}.file_list_icon .file_title{display:inline-block;text-align:center;color:#666;padding:10px 5px 15px 5px;font-size:12px;word-break:break-all;white-space:initial}[data-type=folder] .file_title{cursor:pointer}.file_tips{margin-left:30px;color:#999;font-size:12px}.file_bodys{margin-bottom:57px;-webkit-box-sizing:initial;-moz-box-sizing:initial;box-sizing:initial}.file_path_input{position:relative}.file_path_input .file_dir_view{white-space:nowrap;position:absolute;left:1px;height:30px;line-height:28px}.not-btn-border .layui-layer-btn{background-color:#fff;border-top:none}.not-btn-border .layui-layer-btn a{line-height:30px;padding:0 15px}.not-btn-border .layui-layer-btn0{margin-left:15px;border-radius:2px;padding:0 15px}.not-btn-border .layui-layer-btn1{border-radius:2px}.not-btn-border .layui-layer-btn{padding:9px 15px 10px}.file_upload_view{padding:10px 15px 0 15px}.file_select_file{padding-bottom:10px}.file_select_file button{padding:7.5px 12px;border-radius:2px;border:none;background-color:#4592f0;border-color:#367fa9;margin-right:15px;color:#fff;outline:0}.file_select_file button:hover{background-color:#4188de;border-color:#367fa9}.file_select_file button:active{box-shadow:inset 0 3px 6px rgba(0,0,0,.2)}.file_content_list{width:100%;height:355px;background-color:#fafbfe;border-radius:2px;border:#e4e5e9 1px solid;position:relative}.file_upload_tips{text-align:center;color:#ccc;font-size:28px;position:absolute;width:100%;height:40px;line-height:40px;top:50%;margin-top:-40px}.upload_or_download .glyphicon{color:#666}.upload_or_download_view{padding:10px 20px}.upload_btn_group{margin-top:15px;display:inline-block;text-align:right;width:100%}.upload_btn_group button{margin-right:15px}.upload_btn_group button:last-child{margin:auto}.filePage{width:100%;height:auto}.filePage>div{margin-top:10px}.filePage>.page_num{float:left;line-height:30px;padding:0 5px}.filePage>.page_num a{float:initial;border:none;line-height:30px;color:#20a53a;display:inline;font-size:13px;padding:0 5px}.filePage>.page_num a:hover{background:#fff;color:#20a53a;text-shadow:0 1px 0 #fff;cursor:pointer}.filePage.showRow{margin:0 3px;border:#cfcfcf 1px solid}.filePage .page span{height:30px;line-height:30px;padding:0 12px}.filePage .Pcount-item{border-left:none;border-right:1px solid #ececec;color:#333}.filePage .Pcount-item .showRow{margin:0 3px;border:1px solid #eee;border-radius:2px}.preview_images_mask{position:fixed;left:50%;top:50%;background:rgb(0 0 0 /.85);z-index:9999;height:650px;width:750px;margin-left:-375px;margin-top:-325px;overflow:hidden;-webkit-box-shadow:0 0 3px 1px rgba(0,0,0,.3);-moz-box-shadow:0 0 3px 1px rgba(0,0,0,.3);box-shadow:0 0 3px 1px rgba(0,0,0,.3);border-radius:4px}.preview_images_mask .preview_head{height:45px;line-height:45px;width:100%;position:absolute;z-index:999}.preview_images_mask .preview_title{text-align:center;width:100%;display:inline-block;font-size:16px;background-color:rgb(0 0 0 /.45);color:#cacaca;cursor:all-scroll}.preview_images_mask .preview_close,.preview_images_mask .preview_full,.preview_images_mask .preview_small{position:absolute;right:0;width:45px;height:45px;line-height:47px;font-size:19px;text-align:center;color:#d6d6d6}.preview_images_mask .preview_full,.preview_images_mask .preview_small{right:45px;font-size:18px}.preview_images_mask .preview_close:hover,.preview_images_mask .preview_full:hover,.preview_images_mask .preview_small:hover{background-color:#444;color:#fff;cursor:pointer}.preview_images_mask .preview_body{position:relative;height:100%;z-index:99;padding:45px 0}.preview_images_mask:hover .preview_cut_view{opacity:1}.preview_images_mask:hover .preview_toolbar{opacity:1}.preview_images_mask .preview_body img{position:absolute;display:none;transition:all .2s;cursor:all-scroll;display:inline-block;opacity:0;webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.preview_images_mask .preview_toolbar{position:absolute;bottom:0;width:250px;left:50%;margin-left:-125px;height:45px;border-radius:3px;background-color:rgb(0 0 0 /.65);font-size:18px;z-index:999;opacity:0;transition:all 1s}.preview_images_mask .preview_toolbar a{width:50px;height:45px;line-height:45px;text-align:center;display:inline-block;transition:all .5s;border-radius:3px}.preview_images_mask .preview_toolbar a:hover{background-color:rgb(86 86 86 / 75%)}.preview_images_mask .preview_toolbar span{vertical-align:middle;color:#bbb}.preview_images_mask .preview_toolbar span.reverse-repeat{transform:rotateY(180deg)}.preview_images_mask .preview_cut_view{opacity:0;transition:all .5s}.preview_images_mask .preview_cut_view a:hover{background-color:#3a3a3a;color:#fff}.preview_images_mask .preview_cut_view a{position:absolute;font-size:26px;width:50px;height:50px;text-align:center;line-height:50px;top:50%;margin-top:-25px;background-color:rgb(194 194 194 / 80%);border-radius:50%;transition:all .2s;z-index:999}.preview_images_mask .preview_cut_view a:nth-child(1){left:3%}.preview_images_mask .preview_cut_view a:nth-child(2){right:3%}.preview_images_mask .preview_cut_view span{vertical-align:top;height:50px;width:50px;text-align:center;line-height:50px}.exists_files_style{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:145px}.readonly-form-input:focus{outline:0;background-color:-internal-light-dark(rgba(239,239,239,.4),rgba(59,59,59,.4));cursor:default}.readonly-form-input:active{border-color:#ccc;box-shadow:none;-webkit-box-shadow:none}.icon-file-upper{background-position:0 6px}.icon-file-back{background-position:-30px 6px}.icon-file-forward{background-position:-15px 6px}.icon-file-refresh{background-position:-45px 6px}.icon-file{display:inline-block;background-image:url(../images/iconfont-file.png);height:28px;line-height:28px;width:15px;background-repeat:no-repeat}.bt-warp{min-width:1400px}.file_menu_tips{display:inline-block;font-size:14px;line-height:32px}.file_menu_tips span{vertical-align:middle;margin-right:3px;color:#f0ad4e}.file_menu_tips span:nth-child(2){font-size:12px}.file_path_collect:hover,.file_path_refresh:hover{background:#20a53a;border-color:#38983b;color:#fff}.bt-property-setting .tab-nav{font-size:0}.bt-property-setting .tab-nav span{font-size:12px}.bt-property-setting .tab-con{padding:5px 0 0}.bt-property-setting .property-box{display:none}.bt-property-setting .property-box.active{display:inline-block;width:100%}.bt-property-setting .property-box .attr-box{margin:5px 0;width:100%}.bt-property-setting .property-box .attr-name{width:120px;padding-left:10px;float:left}.bt-property-setting .property-box .attr-content{margin-left:120px}.bt-property-setting .property-box .attr-content input{height:32px;line-height:32px;border:1px solid#ccc;outline:0;padding-left:5px;width:350px;border-radius:2px}.bt-property-setting .property-box .attr-content input:focus{border-color:#20a53a}.bt-property-setting .property-box .file_icon{height:50px;width:50px;position:relative;display:inline-block;left:-10px;top:2px}.bt-property-setting .property-box .dividing{width:100%;height:1px;margin:10px 0;background-color:#ececec}.bt-property-setting .property-box .attr-box .attr-content,.bt-property-setting .property-box .attr-box .attr-name{height:25px;line-height:25px}.bt-property-setting .property-box .attr-box .attr-content span{width:450px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.details_box_view,.history_box_view{border:1px solid #ececec}.details_box_view,.history_box_view,.property-box{height:388px!important;overflow:auto}.details_box_view table,.history_box_view table{width:100%}.details_box_view thead tr,.history_box_view thead tr{background-color:#f6f6f6;color:#555;font-weight:400}.details_box_view tbody tr:hover,.history_box_view tbody tr:hover{background:#f0f9f7;cursor:pointer}.details_box_view td div,.details_box_view th div,.history_box_view td div,.history_box_view th div{padding:5px;height:30px;line-height:20px}.details_box_view thead,.history_box_view thead{border-bottom:1px solid #f6f6f6}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block} \ No newline at end of file diff --git a/BTPanel/static/css/login.css b/BTPanel/static/css/login.css index 65ec9530..7f83ce2a 100644 --- a/BTPanel/static/css/login.css +++ b/BTPanel/static/css/login.css @@ -590,9 +590,9 @@ textarea:active, } .list_scan { - margin: 0 auto; - margin-top: 15px; - width: 150px + margin: 0 auto; + margin-top: 15px; + width: 155px } .list_scan>img { @@ -645,7 +645,7 @@ textarea:active, top: 10px; right: 65px; padding: 5px 10px; - width: 115px; + width: 200px; border-radius: 4px; background: #dff0d8; color: #20a53a; diff --git a/BTPanel/static/css/site.css b/BTPanel/static/css/site.css index ad22e03e..91ba44c0 100644 --- a/BTPanel/static/css/site.css +++ b/BTPanel/static/css/site.css @@ -980,11 +980,11 @@ html { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAKnAAACpwB9NLfEgAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAF0SURBVDiNpdJNiM5RGAXw38ukkJVvMYqZRsqYZmyYDTZWbCxsKLG3pCSaWNmNJU2NmhU7pQjFRhYsJCTWykfJRz5eH8fmefn39lLy1FPn3nPv7Zzz3FYS/1Oz/sItwg3cwuo/HWp1KRjEQtzBTizAfHzCDMbwDk97PTCECXzBWyzGYXzDCXzGGjzHJB6DJJ3ekuRc4R1JNja4VUl2FZ5OsrXDNTO4jRcYx1W8wTEcx1xcwna0cbM7xGXYgxF8LakTuIbLZWVdWevHXixvWniY5ECSkVqfbGBJBpOcKjyc5FCSR90WXjXSnV1hdqqNVuH3eInvTQUDSfYnmUkylmRDkvNJ1icZSjJV+wNJriQ5WKr01avPqtfW3O/hNPaVmrO1N14qp35pa/jclORM4dHqDjevMdYLSTZ3uD6/q405mMYHjOJojewIluJHjfdj51L3Vx7GElzHbqzAXazERWzDazzoZaG7+5PcT/Kkwux5rlvBP9dPgIpDWf6ENxgAAAAASUVORK5CYII=") } .menu .menu_xterm { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK6wAACusBgosNWgAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAADaSURBVDiNrZO9FYJAEIQ/lAZICaEEDQ2xDrNNNaQEW3BSy9ASpAVKkBLO5EDQE/Fnknv7bmd29vY2cs4BICnjA5hZDRA555B0ARYj+Q2QPJy1mS3naZpmwH6EXAGlL7ABVsAO2FZVdYx7ifULgaRX4ODPrmDs7QCs277eQVICXAFmDxd7SWPtPGHmLXYaQDNBpOMMHPgWzhNFngW+QX8K7WcqgMTMSklFgNNwf/jBFAAMwMxKH59eCORBBz1iG0ch236MwJ/eoFXLJE3ldYs3dZlCqM0sj35d5xuDSFMDX6z07gAAAABJRU5ErkJggg==") + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMBJREFUeNpiYKAQMM6cOVMASBuQozk9Pf0AC5AuAOJ6cgwAWt7IhMQvRKIfAPEEYgxhQWL3o9EFpBgwAeifQhKdD7YI5oWPUMEEmAQR4COyATBwAIgdgIacB2IFYkxhQouWB0BsCA3E86QGIsxvDSBXgGIDSxr5ALTgAk4XADWAQt4fiB2BChcAaQVoGoHheLwuAGqagBz/UNsciQ4DEgE/zAUfQM4DOt+eRANAYTMRZADIrxfIdMUFSnMzA0CAAQD0hjqnYxWD2gAAAABJRU5ErkJggg==") } .menu .current .menu_xterm, .menu .menu_xterm:hover{ - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK6wAACusBgosNWgAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAACwSURBVDiNpZPRDYJADEAfhgVc4ViFFVzBGRjBGVxFR2AFHEFGeH5YkVwAj/iSpjR3fSmXtFIJEvt4AKCi9m7zXMi9Cmr60dyrJ3VQ28inOEuVmoBhGqmcBDSox48tfqckpp5DZr1EFHMAjrP6CowFkqknn+AB3Asli4Ld1FmdgJb3iF1854wRk2CcHZ4jd5FvK4JmbYIuq6sFAWw84m7qmW3PMn3vFi7TEoNK5Z/r/AIpZQNuvOKqnwAAAABJRU5ErkJggg==") + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALhJREFUeNpiYKAQMH78+FEASBuQo5mfn/8AC5AuAOJ6cgwAWt7IhMQvRKIfAPEEYgxhQWL3o9EFpBgwAeifQhKdD7YI5oWPUMEEmAQxZiAbAAMHgNgBaMh5IFYgxhQmtGh5AMSG0EA8T2ogwvzWAHIFKDawpJEPQAsu4DQAqAEU8v5A7AhSCOQboKWRC1CM3QCgpgnI8Q+1zZHoMCA1JcNc8AHkTKBz7Uk0AOS9iRRlJvTwIAsABBgAqiNCt+zqQrsAAAAASUVORK5CYII=") } .menu .menu_folder { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAE3SURBVDiNpZO9SgNBFIW/OySiaBCtbCwE8ReUgGDpE9gExNJmd6O+hM8gmGJn3yKxt7WyEARBUUSbIPhTGFAwxyarSwoZ2AO3mjkf98y9Y5IoI1fKDVQA0jRtOOd2B8BRST5Jkk4IwCSRZVkbOAYeACdpD3iX9DrUpQO+gHaz2XwuRnCSLuM4vpU0AnSAvplNmdlkocbNbN3MTrz3de/9WKVA/07TdN85twbcA5/A8AsLuAO6wI6k2UrhoGZmy3EcH4Zk995vAAd5hA9gBXgJMQ+0ZWanOaAH1IGrEGer1TJgxszOckAFWATOQwDVanUO6EVR9JYD5oGJJEmeAtvfBG7gb4xLwEWgGWA1v59PoQs8Zlm2ANg/RgETwLRz7voXIOnIzBrAdgCgBvgoivowWOUyKv0bfwCvBmEVd9ynHgAAAABJRU5ErkJggg==") @@ -1063,6 +1063,9 @@ html .menu .menu_control:hover { html .menu .menu_firewall:hover { background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP////39/fv7+/f39+3t7evr6+np6efn5+Xl5ePj4+Hh4d/f393d3dnZ2dfX19XV1dHR0cvLy8nJycfHx8PDw8HBwb+/v729vbu7u7m5ube3t7W1tbOzs7Gxsa+vr6enp6WlpaOjo5+fnwDZNpeXl42NjYuLi4mJiSitSCqpSiypSoeHhyirSC6lTIWFhTKhTjiZUDyXUnx8fECRVEKPVHp6enh4eEqHWEiHWHR0dFB+XHBwcFpyYGZmZgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAwA9ACwAAAAADwAQAAAGdMCesEeiHAACR2c17J0oiUXEE/pgHAsFptYjQFzN4c6UmPQKoXAYIzl/1M1M5AyCDzdzwtveu8wRdXwXbQ8afD0SGD0dEIcNIj01CDl2NQeUPRZzcA8WTQWKYRUGYTkJDlw9MgwLO3AaBh0bBhyHJQEDYE1BACH5BAUEAD0ALAMABgACAAMAAAYHwB6PN+qlggAh+QQFBAA9ACwFAAcAAQADAAAGBUDaCBUEACH5BAUIAD0ALAYACAACAAMAAAYHwBtuNGKpggAh+QQFCAA9ACwIAAcAAQADAAAGBcDZSBUEACH5BAUIAD0ALAkABgABAAMAAAYFwNioFQQAIfkEBQgAPQAsCgAFAAEAAwAABgVA2OgVBAAh+QQFBgA9ACwLAAQAAgADAAAGB0Aab6SD9YIAIfkECTIAPQAsAAAAAA8AEAAABhXAnnBILBqPyKRyyWw6n9CodEqtJoMAOw==") } +html .menu .menu_xterm:hover { + background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQXAJ6ipUFITySRPIiMkDFRQuXm5jJKQy1kQCGeOzBXQSl3PiWLPVhfZSxrQCpxP9na2yeEPTREQ8LExmRqb5OXm/Hx8TU9RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjMyQjYwMTU3OTA2QTExRUJCN0NFQUUwQjRDMzM4RDJDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjMyQjYwMTU4OTA2QTExRUJCN0NFQUUwQjRDMzM4RDJDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MzJCNjAxNTU5MDZBMTFFQkI3Q0VBRTBCNEMzMzhEMkMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MzJCNjAxNTY5MDZBMTFFQkI3Q0VBRTBCNEMzMzhEMkMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87NzMvKycjHxsXEw8LBwL++vby7urm4t7a1tLOysbCvrq2sq6qpqKempaSjoqGgn56dnJuamZiXlpWUk5KRkI+OjYyLiomIh4aFhIOCgYB/fn18e3p5eHd2dXRzcnFwb25tbGtqaWhnZmVkY2JhYF9eXVxbWllYV1ZVVFNSUVBPTk1MS0pJSEdGRURDQkFAPz49PDs6OTg3NjU0MzIxMC8uLSwrKikoJyYlJCMiISAfHh0cGxoZGBcWFRQTEhEQDw4NDAsKCQgHBgUEAwIBAAAh+QQFMgAXACwAAAAAEAAQAAAFU6AljmRpBVOqrqtFVXAsy9Q7VMMDzHHN/5UawGQC1CiWg4IoOiINAoGB6BxBENSjyIE4oFKMprYhIFgYkvTQpWWOqm6RcVBI2+/2AuXL6k8CcSYhACH5BAUyABcALAcACQAFAAIAAAUIYJSMBLGcSggAIfkEBTIAFwAsBwAJAAUAAgAABQhgMI0MI51ACAAh+QQFMgAXACwHAAkABQACAAAFCGCUjASxnEoIADs=") +} html .menu .menu_day:hover { background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAANPT09HR0c3NzcvLy8nJycfHx8XFxcPDw8HBwb+/v729vbu7u7m5ubW1tbOzs7Gxsa2trampqaenp6WlpaOjo6GhoQDZNpubm5WVlY+Pj42NjYuLi4mJiYeHh4WFhYODg35+fnZ2dnR0dHJycnBwcGZmZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAlACwAAAEADwAOAAAGesCSUKQRGkua0RGjAFQm0EkFoMAIFY9HAHPpXjABiINREohKoaMwHSKUBgvKJEKvTygLw1vCyWj+gBkcEnoGHCUWFmpCHAglBYeLRhsHjxuSRhqOBJeYSI4FnZgeegMdniUgBSULER8dHrCxG7QRDUIPCQq7vLsJDyVBACH5BAUKACUALAcABwACAAEAAAYEQIslCAAh+QQFCgAlACwKAAcAAgABAAAGBECLJQgAIfkEBQoAJQAsBAAJAAIAAQAABgRAiyUIACH5BAUKACUALAcACQACAAEAAAYEQIslCAAh+QQFCgAlACwKAAkAAgABAAAGBECLJQgAIfkEBQoAJQAsBAALAAIAAQAABgRAiyUIACH5BAUKACUALAcACwACAAEAAAYEQIslCAAh+QQFCgAlACwKAAsAAgABAAAGBECLJQgAIfkECTIAJQAsAAABAA8ADgAABhTAknBILBqPyKRyyWw6n9CodEoNAgA7") @@ -1130,7 +1133,46 @@ html .menu .menu_exit:hover { line-height: 50px; border-bottom: 1px solid #eee } +.title { + height: 50px; + line-height: 50px; + border-bottom: 1px solid #eee +} +.title.tabs-nav{ + padding:0; + position: relative; +} +.title.tabs-nav select{ + position: absolute; + right: 5px; + top: 50%; + margin-top: -12px; +} +.tabs-content{ + height: 442px; +} +.tabs-content .tabs-item{ + display: none; + height: 100%; + width: 100%; + background-color: #fff; +} +.tabs-content .tabs-active.tabs-item{ + display: inline-block; +} + + +.title.tabs-nav span{ + padding: 0 25px; + height: 100%; + cursor: pointer; + display: inline-block; +} +.title.tabs-nav span.active{ + border-bottom: 2px solid #20a53a; + +} .title h3 { display: inline-block; line-height: 50px; @@ -1618,10 +1660,13 @@ html .menu .menu_exit:hover { height:80px; } .bw-info > div{ - float:left; - padding-top:25px; - text-align:center; + float: left; + padding-top: 35px; + text-align: center; } + + + .bw-info > div p{ margin-bottom:7px; } @@ -1629,19 +1674,27 @@ html .menu .menu_exit:hover { font-size:14px; color: #666; } -.bw-info .ico-up{ - width:14px; - height:8px; - background-color:#f7b851; +.bw-info .ico-down, +.bw-info .ico-up, +.bw-info .ico-write, +.bw-info .ico-read{ + width:10px; + height:10px; display:inline-block; margin-right:3px; + border-radius: 5px; } .bw-info .ico-down{ - width:14px; - height:8px; - background-color:#52a9ff; - display:inline-block; - margin-right:3px; + background-color:#52a9ff; +} +.bw-info .ico-up{ + background-color:#f7b851; +} +.bw-info .ico-write{ + background-color:#6CC0CF; +} +.bw-info .ico-read{ + background-color:#FF4683; } .bw-info ul li { height: 56px; @@ -2511,6 +2564,12 @@ html .menu .menu_exit:hover { color: #444; font-size: 12px; font-weight: bold + display: inline-block; + width: 450px; + white-space: pre; + text-overflow: ellipsis; + overflow: hidden; + vertical-align: middle; } .changepath .path-con-left { @@ -2541,11 +2600,11 @@ html .menu .menu_exit:hover { color: #666 } -.changepath .path-con-right { +.changepath .path-con-right{ float: left; height: 450px; overflow: auto; - width: 520px + width: 550px } .changepath .path-con-right .default li { @@ -2562,18 +2621,45 @@ html .menu .menu_exit:hover { } .path-con-right .file-list { - display: none + display: none; + height:450px; } +.list-list tr:last-child{ + border-bottom: 1px solid #ececec +} +.list-list tr input{ + border-color: #ddd; + margin-top: 6px; +} + +.list-list .bt_open_dir span:nth-child(2){ + width: 155px; + display: inline-block; + text-overflow: ellipsis; + overflow: hidden; + white-space: pre; + vertical-align: middle; +} .path-con-right .list-list td { - padding-left: 10px; - cursor: pointer + line-height: 22px; + cursor: pointer; + border-top: 1px solid #ececec; + white-space: pre; +} +.path-con-right .list-list tr{ + box-sizing: border-box; } .list-list span.glyphicon { color: #666; margin-right: 10px; - font-size: 18px + font-size: 16px; + vertical-align: middle; + top: 1px; +} +.list-list span.glyphicon-file{ + font-size: 18px; } .list-list span.glyphicon-folder-open { @@ -2583,11 +2669,6 @@ 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; @@ -4067,7 +4148,7 @@ html .menu .menu_exit:hover { .re-con { float: left; - height: 500px; + height: 567px; width: 100% } @@ -4090,9 +4171,8 @@ html .menu .menu_exit:hover { } .re-con-con { - height: 500px; + height: 567px; margin-left: 120px; - overflow: auto } @media only screen and (max-width:768px) { @@ -4346,20 +4426,19 @@ html .menu .menu_exit:hover { .color-green{ color:green; } -.btpro{ - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADsAAAAUCAMAAAAEAbViAAAAA3NCSVQICAjb4U/gAAABXFBMVEX///+7jAC7jAC7jAC7jAC7jAC7jAC7jAC7jAC7jAC7jAC7jAC7jAC7jAC7jAD////+/fv+/fr8+vX8+vP69uv38eD28N3179v07NXz69Lz6tHz6c/x6Mzv48Pu48Hr3rX74jnq27D54Djp2av43zfo16fo2Kj33TX33Tbm1aLl1Z/12Tbl057z1zLk0Znj0Jfx1DDizpPu0DPv0S7fyIbqzCroyC/cxH3oySjawXXZv3DkwyTYvWzivyzXu2jWumXevCDUtVzctinathzSslXSs1bRsVHRsVLWsBjVrSbNqkPTrBXLqD3PpCLJozTOphHIozLIojDIoS/HoCzKoQ7GninGnyrFnifJnB/FnCTFnSbEmiDEmyLFmQnCmBvBlxjBlhbBlRXAlRPCkhy/kxDAkwW+kQq9kAi9jwa9jwK9jQC8jgS8jQO8ihm7jAC2gRWweBKpbw+jZgydXgnhk9RtAAAAdHRSTlMAESIzRFVmd4iZqrvM3e7//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wol0KMAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDUvMzEvMTikOWwBAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAAg5JREFUOI2dlGlz0zAQhhUHJ45jST2gXKUVR4BijmKKCwX1CKcKLoVQcCmFYgcSjqiy8/9nWCtOJvlEwusZe3Q80rurlRFCyLDsSi7bMtAkKlSlU602W61o+3VDvrnOxlTGliUxkdFcfRjN0aWm3ByXBdgglaqN7N2pmb2t6edba0e3xmctBxWxjecoPfPh2afTtPGkN+J6/2SLxC6ajrQvLC4uPJXvLs6/aC7rkZD35/Awb8RMMc5FGAc9FktMiJS42W5HX+SP6Nv+n13GlFJdlWmEVfCkYcD9fF9MTNO0iHX15o3aRnTncq0W7WcDQvQmeEHO1rlm1ZBnw6lAvrBJQY+3s9fOPSbCMA21BEvdHnvssa7qCm3Hz3N1gpQRsu1ZSk8drFC60nrAmM/DmGv5LAg06yVM75mF0fFyFpWkiUrEoHTx6wKt/d7U/R2hUZjkppoFBxCrYCrkfd9ZcVSkUcAlOrW+Q8+3X13S/SIzHHeFXiZjlctYwiFevwNrDdgCdsD09OzbtZmPh9d6/QFQbiJGzsgFksM5Zcv0WVSUlumcPHdwdv3Xcp5DF5KVowMWvioW7nHKh1gIuYznlxq35aOhshFJCBvEaqC4ztKkntQ9FQ+xEDK5u3r08+Vo0dVHm3Ayvu9nhr1htuDIvc/y/RU2ifqX2MBSHo59g0ZZZJLv9/8ThXyZE/1tQH8B/ly2lqVFKXEAAAAASUVORK5CYII="); - background-size: 50px; +.btpro,.btpro-gray{ + background-position: 10px center; background-repeat:no-repeat; padding:2px 0 2px 64px; margin-right:5px; cursor:pointer; + background-size: 48px; +} +.btpro{ + background-image: url('../img/pro.svg'); } .btpro-gray{ - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADsAAAAUCAMAAAAEAbViAAAAA3NCSVQICAjb4U/gAAAA51BMVEX////6+vr4+Pj29vbx8fHu7u7r6+vp6eno6Ojl5eXk5OTj4+Pi4uLf39/e3t7d3d3b29vU1NTT09PNzc3Ly8vIyMjFxcXDw8PAwMC+vr67u7u6urq5ubm4uLi3t7e2tra0tLSzs7OysrKxsbGvr6+srKyrq6upqamoqKikpKSjo6OgoKCfn5+enp6dnZ2cnJybm5uampqZmZmYmJiXl5eWlpaVlZWTk5OSkpKQkJCPj4+NjY2MjIyLi4uKioqIiIiHh4eGhoaFhYWDg4OCgoKBgYGAgIB/f39+fn59fX14eHh0dHT///9HdDDXAAAATXRSTlP/////////////////////////////////////////////////////////////////////////////////////////////////////ANNqEYAAAAAJcEhZcwAADpwAAA6cAQeUU90AAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAFnRFWHRDcmVhdGlvbiBUaW1lADA1LzMxLzE4pDlsAQAAAeZJREFUOI2VlH1XmzAUxjNbZutxL2hnXeiGA1kiNdspbJlEC9FmLtD7/T/PkkC78tfw4Rw4IfeXPDf3AgIALyBRJxJ4MFgIYLTU+XJZbTYluVnp4jMeKMvOtfTBq84/lAAnlV4OZTECT0ZLAoQB5AuIFhcPX4azQQ5TQYQxgLKrnwhWq3YmjP/LTiWZ+rkmr8bjoyv93UNR1UKc7mIo7wYFVphSxousZYUWUmotKqVKoZ/Kkj8zjJVSW2XVY5W5Gp7RpNtXSN/3Axkcn55OPpZvX08mJbcTjLUBcdaxKXWsOvDs5ZGpsPBtwebE3m6vMeO84U4MN2HLPsZ4q7bM2Um6s3on5wDEUnB3BnC2IRgnlBfUKcFZ5ti4xm5Pm8Y67liYaR9m0vTT+P4IJr/b+q6ZQ01Q2DjWODC5Mqw43fk2LETaG4kZwOUtQoov3HtmDRdb5paxrAoxrqnJN1lT/o8didyZ/naBflRdS2aGCmvWq1FoSGrqZJfZsTDVgZ8DukOXf3YNEZrD6tA9a56qYOFjQw9Yk/JcoJPVG31z0Das5maDQu1VpLip0zqNVXHAmpTl+/OH57zfdGl/aCqTJIk1HB+yo1znv/T9J/wSdazpDq2rwV9QnwVfbr6+DIU9CzN/+N+m1V+TNr+ixpmAWwAAAABJRU5ErkJggg=="); - background-repeat:no-repeat; - padding:2px 0 2px 64px; - margin-right:5px; - cursor:pointer; + background-image: url('../img/pro-default.svg'); } /*插件付费*/ @@ -4535,7 +4614,7 @@ html .menu .menu_exit:hover { } .bt-radio:checked + .bt-radioinput:after{ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAKBAMAAAB293L0AAAAA3NCSVQICAjb4U/gAAAAKlBMVEX///////////////////////////////////////////////////////9q+00tAAAADnRSTlMAETNEVWZ3iJmqu93u/wlUiAQAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDYvMDIvMTjAxKOiAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAADpJREFUCJljYACDTAjFcgRC+xpAuFcYGCqAtK0DA4P2BAbmq0A2404G3QSQpPTi62BFjGsTIJpEQQQATscJDpRQCfQAAAAASUVORK5CYII="); - background-repeat: no-repeat; + background-repeat: no-repeat; border-radius:100%; content:""; display:inline-block; @@ -4961,7 +5040,7 @@ select[disabled]{ line-height:26px; } .domain-ul-list li .checkbox-text{ - margin-right:5px; + margin-right:5px; vertical-align:-2px } .btswitch-btn.bt-waf-firewall{ @@ -5010,7 +5089,7 @@ select[disabled]{ .tab-db-status .tname{ width: 155px; - padding-right:10px; + padding-right:10px; height: 30px; line-height: 30px; } @@ -5115,7 +5194,7 @@ select[disabled]{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - + } .bootstrap-select .dropdown-toggle{ height: 30px; @@ -7095,7 +7174,7 @@ select[disabled]{ height: 5px; } .upload_btn_groud{ - margin-bottom: 5px; + margin-bottom: 5px; height: 40px; line-height: 40px; } @@ -7268,7 +7347,7 @@ select[disabled]{ background: #effffa; } .module_details_item:hover .module_details_body{ - background: #f8fffd; + background: #f8fffd; } .module_details_item:before{ /*content:'';*/ @@ -7341,7 +7420,7 @@ select[disabled]{ color: #20a53a; } .module_details_item{ - + } .module_details_head{ height: 40px; @@ -7418,7 +7497,7 @@ select[disabled]{ } .module_details_block .line_content{ width:250px; - + } /*END*/ @@ -7731,7 +7810,7 @@ select[disabled]{ } .xterm .xterm-viewport:hover::-webkit-scrollbar-thumb{ background:#aaa; - + } .xterm .xterm-viewport::-webkit-scrollbar-track{ box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); @@ -7963,6 +8042,40 @@ select[disabled]{ margin-right: 4px; color: #ffa515; } +.term-move-border{ + width: 100%; + height: 5px; + cursor: n-resize; + margin-top: -5px; + opacity: 0; +} +.term-tool-button{ + position: absolute; + right: 0px; + top: 50%; + width: 28px; + height: 60px; + background-color: #565656; + border-top-left-radius: 30px; + border-bottom-left-radius: 30px; + cursor: pointer; + z-index: 999; + margin-top: -30px; +} +.term-tool-button span{ + font-size: 12px; + position: relative; + left: 15%; + top: 35%; + font-size: 18px; + color: #FFFFFF; + cursor: pointer; +} +.term-tool-button:hover{ + background-color: #D8D8D8; +} + + .term_item_tab{ background: #f1f1f1; font-size: 0; @@ -8137,7 +8250,7 @@ select[disabled]{ display: block; height: 19px; color: #bbb; - /* vertical-align: bottom; + /* vertical-align: bottom; } */ .term_item_tab .tab_tootls .glyphicon-resize-full, .term_item_tab .tab_tootls .glyphicon-resize-small{ @@ -8262,7 +8375,7 @@ select[disabled]{ } .xterm .xterm-viewport:hover::-webkit-scrollbar-thumb{ background:#aaa; - + } .xterm .xterm-viewport::-webkit-scrollbar-track{ box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); @@ -8478,7 +8591,7 @@ select[disabled]{ margin-top: -200px; border-radius: 2px; padding-bottom: 45px; - + } .localhost-form-view>button{ margin-left: 100px; @@ -9282,9 +9395,9 @@ select[name="network-io"]{ /*批量操作*/ .batch_title{ - height: 30px; - display: inline-block; - width: 100%; + height: 30px; + display: inline-block; + width: 100%; margin-top: 25px; text-align: center; } @@ -9311,7 +9424,55 @@ select[name="network-io"]{ .bt_table .divtable{ overflow: auto; } +.bt_table .text-overflow{ + display: inline-block; + vertical-align: middle; + word-wrap:break-word; +} +#recycle_table .divtable{ + max-height: 480px; +} +.re-con-con .text-overflow span{ + vertical-align: middle; + margin-left: 5px; + display: inline-block; + text-overflow: ellipsis; + overflow: hidden; + white-space: pre; +} +.recycle_view .layui-layer-content{ + overflow: initial !important; +} +.re-con-con .table thead{ + position: relative; + z-index: 99; +} +.re-con-con .divtable .table{ + border: none +} +.re-con-con .divtable{ + border: 1px solid #ddd; +} +.bt_table .file_icon{ + width: 26px; + height: 26px; + display: inline-block; + background-repeat: no-repeat; + background-size: cover; + background-position: center; + image-rendering: -webkit-optimize-contrast; + background-image: url(../img/file_icon/file.png); + cursor: pointer; + vertical-align: middle; + margin-left: -5px; +} +.bt_table .file_folder{ + background-image: url(../img/file_icon/folder.png); +} +.bt_table .file_images{ + background-image: url(../img/file_icon/png.png); +} .bt_table .table-mask{ position: absolute; top: 0; @@ -9657,7 +9818,7 @@ select[name="network-io"]{ opacity: .65; cursor: no-drop; box-shadow: none; - + } .bt_table_select_group .bt_selects{ display: none; @@ -9677,7 +9838,7 @@ select[name="network-io"]{ } .bt_table_select_group.active .bt_selects{ display: inline-block; - + } .bt_table_select_group .bt_selects .item{ width: 100%; @@ -9725,7 +9886,7 @@ select[name="network-io"]{ } .inlineBlock{ - display: inline-block; + display: inline-block; } /*批量操作end*/ @@ -9875,9 +10036,10 @@ background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODIiIGhlaWdodD0iODIiIHh width: 70px; } .pro-font-icon{ - background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAATCAYAAAFTgessAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQqADAAQAAAABAAAAEwAAAADt3mdsAAAHFElEQVRYCe2YfZCOVRTAz3137WJZMq2vqDETrZIaIYoMIwy2aX0sWuQPYyIZkxmU8VU0NFOaigzThEnaXR+7CaORr5QZKmLKKiVFLSYlSct6n37nPO/z7Pu+bHZq/FPdnfvcc88599xzzz3n3POuSDWa84pksESl0HhryO1SwdyTpyRPMmStNJLLstFoMPYKBHqFkhbCRZLvrZW7gnmVo/MKEExzQ8Qh4RTgqxKRVW6QfAXtqK2EsMKApI9XInWd4mC4BzkzxclLjO+rtCRem3qrpaVKtjX+znvhzIz4VFnHmCMpcg5kE8PFPhymlYLeGulgY4EsN5KTM2zW0eVJts3/yUcNcB4B6RwhBQ3UGD2RfFCFYoyt7NTDYDXtJdkfM9omuOdwR7siLKzNwgXKRNML/EwBBM8Av91GRcQa8xGsSedC22P1HEODPKnXElxNwKwjtAM2rpF2AR0nmAS8IZgbP4ylBiR9uIG2SSifvwS3ooXXhtRl+OCj4HZKqkzhfLuN00nbwCY2vw4f9cqFqJKLbY5h3HEossH28VDDSWfgvTpHkaaG54NrdMKO2dDTsaXZHfRxN1COQ+sO/gxyfofny9jFLWL9OCz1Aft0gT5RaslSk3dBPN+xC2QViKEI7M7ibUZ0hIUnLRRWQYaL+9g9OPk4QLFJ4LPvSA2ZHiiBzKVusIxRvvDuIvIcsn8EtYGxU4JwNI1CUIZpbLsEAZuIpmIVkNwQOAucRuQ5FMhUOkHUEPv1BryZfhE5z0MfqTTaabq6+gHw6sWfAx+hl9ETG4qk4Uh3JGL/AzPfJwrlTkxkcUhkdMah5jHvxnUs5z5HXW87aJryFdAU5eQRvGILm64H7st4L30nd56RrAghXYCCQ5LxOjcHrIHcCrnE2sOGK5RFjHM5WEMO+CQ9h16PfWprxt4MoJ7aDgXeMNhZGusA06vgzyJ0IaM1lM6yEI1Kno5BVyJ8i32uyi/0nuHMEdYeThuV2wjRprhnBkpeSIWhMQTH31Tg5sB+87CKkA90HpHtPtK+Y7kuTXP7GXsFeCLjLCcv9NZJfeKislXIm0waGyIiX7CmArie/EHkeHIDcH4ETYL3azyCjxqz//GTlsjbmL0owMP/DPB39Jp0Tfpq1kw3QA5B28rL8iy4+GYvEIib2P4Hxn7scwhrjAAepoy+AsGjmRJ3x54UQP+eRGWMyhw0NltGb03XBNUAs84IaIxhZmWzJtjl4RitRZj0NMk5+RDlX1SaKYGwMlJ2LqYabQscDiSSxSJNOlc0rSG4/yPmgCJ5LocUTcNf9HR+crtsVurIJQ2wJCbSJiaoB3utAe5Kn+R5MUPEiCpkBb00vk4KaFWNJLbgpFWxGB65tRTQmoYelh/gU65YqNkSQtoVhP8R198C4SOKG+QTNdPwkomMm2Nbn8SJe+DEfrQ6ossjCsUviLjMPvjyAtbMJYpXVldd9uqPnDbEw7xqr3mXlHIBX0+jEo6yc4U8RBovdn3l12QZ5k1ZaHUa7SMk/hTK7lz5JZ6P2GpEOmuFHh567HLeRiqB34haT1rGGLUCqA1cBk5zW6KyEZmCIqls0JTxPPTJts5Rw9eR9ldVrMCKxmXGd+3PbBLDrGQ2gtwKbA7Vir3TSYkH0TObQ9jLFM+PIfSVakEfzRmOs0YfpAeYa5Wk9dxh8KXoWxrom4oRtFAcQ69saeTUclJdhGQn1HvJzWHdNF68i9Ia0qaQrLJE9oRzAJTqx6CZ74ThtaQSbtd/MaOGS/yMZs1eDqh1/GL46gMPTWRJnOFhr3OwmvDlhxQPb6XotXlUVjO+DE8W/emQ55zpd4J1zVL57GHjGTDMDhnKOWTEUrhf8IaEGJDCy1ou+1jTJCQ5mYksfdgSGjgNq2aK9NbLjbh3GeA48K8p7i+bk8ehn0K/QYz2qzGZnzLhfvx2FIV1pS7CXTt5D97hxp/FD8pTMhbcbvrX4NK0DkLuR8w/VZ7QD7xtvMqnZQeH62iLHYo64i9KKMS3iMyHJ5M+Nsa3Bzt3c90pDq7ReA0Gsk4f3cTmEa+eVZCvEBYT4onc9mRowwnGEfrbMyE01OUvU+ZE5AkOtiJYhyftMN3FwkBLmQnMuyKnnPXzMdw34PSCukldaa7hERoiFFIod7NgF/MMNugJvJh+q9EdvxCcPIZxtjA/D9yFm90frL3WaA92kbzFum+RXYycCL2E+THW9keWestVW3VzBLdcBwE/I3MQxilh/hNzNeY8RjVIMeNa5n3YfTo8c5iDrqIhYCrMk7iJ3ljwE2NL5R8gFVYRv4DSKvhvN+R3ZrFWP0PYpwFKLUSp8YFAPOE+8BuDebVG/6dBLYw7Fc96UNfEDLEP8Axda5NszpSrdSh7jGSPJeCGVWkIiMKLkk505WOuW3TOomO40kpcqdzm/6LPn2VLecVt1xB4AAAAAElFTkSuQmCC); + background-image:url('../img/pro.svg'); background-repeat: no-repeat; - background-size: auto; + background-size: 50px; + background-position: center; display: inline-block; width: 66px; height: 19px; diff --git a/BTPanel/static/img/dns-server.png b/BTPanel/static/img/dns-server.png new file mode 100644 index 00000000..3e251666 Binary files /dev/null and b/BTPanel/static/img/dns-server.png differ diff --git a/BTPanel/static/img/mail-server.png b/BTPanel/static/img/mail-server.png new file mode 100644 index 00000000..df8f74d3 Binary files /dev/null and b/BTPanel/static/img/mail-server.png differ diff --git a/BTPanel/static/img/pro-default.svg b/BTPanel/static/img/pro-default.svg new file mode 100644 index 00000000..9803c770 --- /dev/null +++ b/BTPanel/static/img/pro-default.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/BTPanel/static/img/pro.svg b/BTPanel/static/img/pro.svg new file mode 100644 index 00000000..1939e2b7 --- /dev/null +++ b/BTPanel/static/img/pro.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/BTPanel/static/js/config.js b/BTPanel/static/js/config.js index 90f73500..a374e32a 100644 --- a/BTPanel/static/js/config.js +++ b/BTPanel/static/js/config.js @@ -228,14 +228,18 @@ $('.open_two_verify_view').click(function(){ } }); }); - +var three_channel_status = {}; (function(){ check_two_step(function(res){ $('#panel_verification').prop('checked',res.status); }); get_three_channel(function(res){ + three_channel_status = res; $('#channel_auth').val(!res.user_mail.user_name && !res.dingding.dingding ? 'Email is not set':(res.user_mail.user_name? 'Email is set':(res.dingding.dingding? 'dingding is set': ''))) }); + get_login_send(function(rdata){ + $('#panel_report').val(!rdata.status ? 'Email is not set':(rdata.msg.mail? 'Already set':'Not set')) + }) })() function get_three_channel(callback){ @@ -243,6 +247,21 @@ function get_three_channel(callback){ if(callback) callback(res); }); } +function get_login_send(callback){ + var loadS = bt.load('Getting login information, please wait...') + $.post('/config?action=get_login_send',function(res){ + loadS.close() + if(callback) callback(res); + }); +} +function login_ipwhite(obj,callback){ + var loadY = bt.load('Getting IP lists, please wait...') + $.post('/config?action=login_ipwhite',obj,function(res){ + loadY.close() + if(!res.status) return layer.msg(res.msg,{icon:res.status?1:2}) + if(callback) callback(res); + }); +} function check_two_step(callback){ $.post('/config?action=check_two_step',function(res){ @@ -360,6 +379,7 @@ function bindBTName(a,type){ p2 = $("#p2").val(); var loadT = layer.msg(lan.config.token_get,{icon:16,time:0,shade: [0.3, '#000']}); $.post(" /ssl?action=GetToken", "username=" + p1 + "&password=" + p2, function(b){ + bt.clear_cookie('bt_user_info') layer.close(loadT); layer.msg(b.msg, {icon: b.status?1:2}); if(b.status) { @@ -385,6 +405,7 @@ function UnboundBt(){ layer.confirm(lan.config.binding_un_msg,{closeBtn:2,icon:3,title:lan.config.binding_un},function(){ $.get("/ssl?action=DelToken",function(b){ layer.msg(b.msg,{icon:b.status? 1:2}) + bt.clear_cookie('bt_user_info') if(b.status){ window.location.reload(); $("input[name='btusername']").val(''); @@ -918,7 +939,177 @@ function modify_basic_auth_to() { }); } - +function set_panel_report(){ + if(!three_channel_status.user_mail.user_name) return layer.msg('Please set up the [ Notification ] first',{icon:2}) + get_login_send(function(rdata){ + layer.open({ + type: 1, + area:'700px', + title: "Login panel alarm", + closeBtn: 2, + shift: 5, + shadeClose: false, + content: '
\ +
\ +
\ +

Alarm settings

\ +

IP whitelist

\ +
\ +
\ +
\ +
\ +
\ +
\ + Send to mailbox\ +
\ + \ + \ +
\ +
\ +
\ +
\ + \ + \ +
login infotime
\ +
\ +
\ +
\ +
\ +
    \ +
  • xxxxxxxxxxxxxxxxxxx
  • \ +
\ +
\ + \ +
\ +
\ +
\ +
', + success:function(index,layers){ + get_log_table(); + get_ip_write_table() + $(".bt-w-menu p").click(function () { + var index = $(this).index(); + $(this).addClass('bgw').siblings().removeClass('bgw'); + console.log(index,'111'); + switch(index){ + case 0: + get_log_table(); + break; + case 1: + get_ip_write_table() + break; + } + $('.conter_box').eq(index).show().siblings().hide(); + }); + //设置告警 + $('#mail').on('click',function(){ + var _checked = $(this).prop('checked'); + if(_checked){ + $.post('/config?action=set_login_send',{type:'mail'},function(res){ + layer.msg(res.msg,{icon:res.status?1:2}); + }); + }else{ + $.post('/config?action=clear_login_send',{type:'mail'},function(res){ + layer.msg(res.msg,{icon:res.status?1:2}); + }); + } + }); + //添加 + $('.add_ip_write').on('click',function(){ + var _ip = $('[name="ip_write"]').val(); + if(!bt.check_ip(_ip)) return layer.msg('Please enter the correct IP',{icon:2}) + login_ipwhite({ip:_ip,type:'add'},function(res){ + if(res.status) get_ip_write_table() + layer.msg(res.msg,{icon:res.status?1:2}); + }) + }) + //删除ip白名单 + $('#ip_write_table').on('click','.del_ip_write',function(){ + var _ip = $(this).parents('tr').data().data; + login_ipwhite({ip:_ip,type:'del'},function(res){ + if(res.status) get_ip_write_table() + layer.msg(res.msg,{icon:res.status?1:2}); + }) + }); + //清空全部 + $('.clear_all').on('click',function(){ + layer.confirm('Whether to clear the IP whitelist', {title:'Tips',btn: ['Confirm','Cancel'],icon:0,closeBtn:2}, function() { + login_ipwhite({type:'clear'},function(res){ + if(res.status) get_ip_write_table() + layer.msg(res.msg,{icon:res.status?1:2}); + }) + }) + }) + //分页操作 + $('#server_table_page').on('click','a',function(e){ + e.stopPropagation(); + e.preventDefault(); + var _p = $(this).attr('href').match(/p=([0-9]*)/)[1]; + get_log_table({p:_p}); + }) + }, + cancel:function(){ + $('#panel_report').val( $('#mail').prop('checked') ? 'Already set' : 'Not set'); + } + }) + }) +} +function get_log_table(obj){ + if(!obj) obj = {p:1} + var loadT = bt.load('Getting Logs list, please wait') + $.post('/config?action=get_login_log',obj,function(res){ + loadT.close() + $('#server_table').empty() + if(res.data.length > 0){ + $.each(res.data,function(index,item){ + $('#server_table').append($('\ + '+ item.log +'\ + '+ item.addtime +'\ + ').data({data:item,index:index})) + }); + }else{ + $('#server_table').html('None Data') + } + $('#server_table_page').html(res.page) + }); +} +function get_ip_write_table(){ + $('#ip_write_table').empty() + login_ipwhite({type:'get'},function(res){ + if(res.msg.length > 0){ + $.each(res.msg,function(index,item){ + $('#ip_write_table').append($('\ + '+ item +'\ + \ + Del\ + \ + ').data({data:item,index:index})) + }); + }else{ + $('#ip_write_table').html('None Data') + } + }) +} function modify_basic_auth() { var loadT = layer.msg(lan.config.setting_basicauth, { icon: 16, time: 0, shade: [0.3, '#000'] }); $.post('/config?action=get_basic_auth_stat', {}, function (rdata) { @@ -958,7 +1149,7 @@ function open_three_channel_auth(){ layer.open({ type: 1, area: "600px", - title: "Setting up a message channel", + title: "Setting up notification", closeBtn: 2, shift: 5, shadeClose: false, @@ -1096,15 +1287,15 @@ function sender_info_edit(){ _port = $('#port_select').val() } if(_email == ''){ - return layer.msg('Email address cannot be empty!',{icon:2}); + return layer.msg('Email address cannot be empty!',{icon:2}); }else if(_passW == ''){ - return layer.msg('STMP password cannot be empty!',{icon:2}); + return layer.msg('STMP password cannot be empty!',{icon:2}); }else if(_server == ''){ - return layer.msg('STMP server address cannot be empty!',{icon:2}); + return layer.msg('STMP server address cannot be empty!',{icon:2}); }else if(_port == ''){ - return layer.msg('STMP server port cannot be empty!',{icon:2}); + return layer.msg('STMP server port cannot be empty!',{icon:2}); } - var loadT = layer.msg('Please wait while generating mailbox channel...', { icon: 16, time: 0, shade: [0.3, '#000'] }); + var loadT = layer.msg('The notification is being generated, please wait...', { icon: 16, time: 0, shade: [0.3, '#000'] }); layer.close(index) $.post('/config?action=user_mail_send',{email:_email,stmp_pwd:_passW,hosts:_server,port:_port},function(rdata){ layer.close(loadT); diff --git a/BTPanel/static/js/crontab.js b/BTPanel/static/js/crontab.js index 22625078..dbb53945 100644 --- a/BTPanel/static/js/crontab.js +++ b/BTPanel/static/js/crontab.js @@ -1,1034 +1,1158 @@ var num = 0; //查看任务日志 function GetLogs(id){ - layer.msg(lan.public.the_get,{icon:16,time:0,shade: [0.3, '#000']}); - var data='&id='+id - $.post('/crontab?action=GetLogs',data,function(rdata){ - layer.closeAll(); - if(!rdata.status) { - layer.msg(rdata.msg,{icon:2}); - return; - }; - layer.open({ - type:1, - title:lan.crontab.task_log_title, - area: ['700px','490px'], - shadeClose:false, - closeBtn:2, - content:'
' - +'
'+ (rdata.msg == '' ? lan.crontab.log_empty:rdata.msg) +'
' - +'
' - +'' - +'' - +'
' - +'
' - }); - setTimeout(function(){ - $("#crontab-log").text(rdata.msg); - var div = document.getElementsByClassName('crontab-log')[0] - div.scrollTop = div.scrollHeight; - },200) - }); + layer.msg(lan.public.the_get,{icon:16,time:0,shade: [0.3, '#000']}); + var data='&id='+id + $.post('/crontab?action=GetLogs',data,function(rdata){ + layer.closeAll(); + if(!rdata.status) { + layer.msg(rdata.msg,{icon:2}); + return; + }; + layer.open({ + type:1, + title:lan.crontab.task_log_title, + area: ['700px','490px'], + shadeClose:false, + closeBtn:2, + content:'
' + +'
'+ (rdata.msg == '' ? lan.crontab.log_empty:rdata.msg) +'
' + +'
' + +'' + +'' + +'
' + +'
' + }); + setTimeout(function(){ + $("#crontab-log").text(rdata.msg); + var div = document.getElementsByClassName('crontab-log')[0] + div.scrollTop = div.scrollHeight; + },200) + }); } function getCronData(){ - var laid=layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/crontab?action=GetCrontab',"",function(rdata){ - layer.close(laid); - var cbody=""; - if(rdata == []){ - layer.close(laid); - cbody=""+lan.crontab.task_empty+"" - } - else{ - $.post('/crontab?action=GetDataList',{type:'sites'},function(res){ - layer.close(laid); - for (var i = 0; i < rdata.length; i++){ - var s_status = ''+lan.crontab.normal+' '; - var optName = ''; - if(rdata[i].status!=1) s_status = ''+lan.crontab.disable+' '; - for(var j = 0; j < res.orderOpt.length;j++){ - if(rdata[i].backupTo == 'localhost'){ - optName = lan.crontab.local_disk; - }else if(rdata[i].backupTo == res.orderOpt[j].value){ - optName = res.orderOpt[j].name; - }else if(rdata[i].backupTo == ''){ - optName = '' - } + var laid=layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); + $.post('/crontab?action=GetCrontab',"",function(rdata){ + layer.close(laid); + var cbody=""; + if(rdata == []){ + layer.close(laid); + cbody=""+lan.crontab.task_empty+"" + } + else{ + $.post('/crontab?action=GetDataList',{type:'sites'},function(res){ + layer.close(laid); + for (var i = 0; i < rdata.length; i++){ + var s_status = ''+lan.crontab.normal+' '; + var optName = ''; + if(rdata[i].status!=1) s_status = ''+lan.crontab.disable+' '; + for(var j = 0; j < res.orderOpt.length;j++){ + if(rdata[i].backupTo == 'localhost'){ + optName = lan.crontab.local_disk; + }else if(rdata[i].backupTo == res.orderOpt[j].value){ + optName = res.orderOpt[j].name; + }else if(rdata[i].backupTo == ''){ + optName = '' + } } - var arrs = ['site','database','path']; + var arrs = ['site','database','path']; if ($.inArray(rdata[i].sType, arrs) == -1) optName = "--"; - cbody += "\ - \ - "+rdata[i].name+"\ - "+s_status+"\ - "+rdata[i].type+"\ - "+rdata[i].cycle+"\ - "+(rdata[i].save?rdata[i].save:'-')+"\ - "+optName+"\ - "+rdata[i].addtime+"\ - \ - "+lan.public.exec+" | \ - "+lan.files.file_menu_edit+" | \ - "+lan.public.log+" | \ - "+lan.public.del+"\ - \ - " - } - $('#cronbody').html(cbody); - }); - } - }); + cbody += "\ + \ + "+rdata[i].name+"\ + "+s_status+"\ + "+rdata[i].type+"\ + "+rdata[i].cycle+"\ + "+(rdata[i].save?rdata[i].save:'-')+"\ + "+optName+"\ + "+rdata[i].addtime+"\ + \ + "+lan.public.exec+" | \ + "+lan.files.file_menu_edit+" | \ + "+lan.public.log+" | \ + "+lan.public.del+"\ + \ + " + } + $('#cronbody').html(cbody); + }); + } + }); } // 编辑计划任务 function edit_task_info(id){ - // var obj = {}; - layer.msg(lan.public.the_get,{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/crontab?action=get_crond_find',{id:id},function(rdata){ - layer.closeAll(); - var sTypeName = '',sTypeDom = '',cycleName = '',cycleDom = '',weekName = '',weekDom = '',sNameName ='',sNameDom = '',backupsName = '',backupsDom =''; - obj = { - from:{ - id:rdata.id, - name: rdata.name, - type: rdata.type, - where1: rdata.where1, - hour: rdata.where_hour, - minute: rdata.where_minute, - week: rdata.where1, - sType: rdata.sType, - sBody: rdata.sBody == 'undefined' ? '' : rdata.sBody, - sName: rdata.sName, - backupTo: rdata.backupTo, - save: rdata.save, - urladdress: rdata.urladdress, - }, - sTypeArray:[['toShell',lan.crontab.shell],['site',lan.crontab.site_bak],['database',lan.crontab.db_bak],['logs',lan.crontab.log_split],['path',lan.crontab.dir_bak],['rememory',lan.crontab.mem_release],['toUrl',lan.crontab.get_url]], - cycleArray:[['day',lan.crontab.daily],['day-n',lan.crontab.n_day],['hour',lan.crontab.hourly],['hour-n',lan.crontab.n_hour],['minute-n',lan.crontab.n_min],['week',lan.crontab.weekly],['month',lan.crontab.monthly]], - weekArray:[[1,lan.crontab.TZZ1],[2,lan.crontab.TZZ2],[3,lan.crontab.TZZ3],[4,lan.crontab.TZZ4],[5,lan.crontab.TZZ5],[6,lan.crontab.TZZ6],[7,lan.crontab.TZZ7]], - sNameArray:[], - backupsArray:[], - create:function(callback){ - for(var i = 0; i '+ obj['sTypeArray'][i][1] +''; - } - for(var i = 0; i '+ obj['cycleArray'][i][1] +''; - } - for(var i = 0; i '+ obj['weekArray'][i][1] +''; - } - 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 == 'database'?'databases':'sites'},function(rdata){ - obj.sNameArray = rdata.data; - obj.sNameArray.unshift({name:'ALL',ps:lan.crontab.all}); - obj.backupsArray = rdata.orderOpt; - obj.backupsArray.unshift({name:lan.crontab.server_disk,value:'localhost'}); - for(var i = 0; i '+ obj['sNameArray'][i]['ps'] +''; - } - for(var i = 0; i '+ obj['backupsArray'][i]['name'] +''; - } - if(obj.from.sType == 'webshell'){ - edit_message_channel(obj.from.urladdress) - } - callback(); - }); - }else{ - callback(); - } - } - }; - obj.create(function(){ - layer.open({ - type:1, - title:lan.crontab.crontab_edit+'-['+rdata.name+']', - area: ['866px','500px'], - skin:'layer-create-content', - shadeClose:false, - closeBtn:2, - content:'
\ -
\ - '+lan.crontab.task_type+'\ - \ -
\ -
\ - '+lan.crontab.task_name+'\ -
\ -
\ -
\ - '+lan.crontab.exec_cycle+'\ - \ -
\ - \ -
'+lan.crontab.sun+'
\ -
'+lan.crontab.hour1+'
\ -
'+lan.crontab.minute1+'
\ -
\ -
\ - \ -
\ - '+ (obj.from.sType == "toShell" ?'Script content':'Exclusion rule')+'\ -
\ -
\ -
\ - '+lan.crontab.tips+'\ -
'+lan.crontab.tips_content+'
\ -
\ -
\ - '+lan.crontab.url_address+'\ -
\ -
\ -
\ -
'+lan.crontab.edit_save+'
\ -
\ -
\ -
\ - Scan site\ - \ -

\ -

Message channel
\ - \ -

\ -
\ -
'+lan.crontab.edit_save+'
\ -
\ -
' - }); - setTimeout(function(){ - if(obj.from.sType == 'toShell'){ - $('.site_list').hide(); - }else if(obj.from.sType == 'rememory'){ - $('.site_list').hide(); - }else if( obj.from.sType == 'toUrl'){ - $('.site_list').hide(); - }else if( obj.from.sType == 'webshell'){ - $('.site_list').hide(); - }else{ - $('.site_list').show(); - } + layer.msg(lan.public.the_get,{icon:16,time:0,shade: [0.3, '#000']}); + $.post('/crontab?action=get_crond_find',{id:id},function(rdata){ + layer.closeAll(); + var sTypeName = '',sTypeDom = '',cycleName = '',cycleDom = '',weekName = '',weekDom = '',sNameName ='',sNameDom = '',backupsName = '',backupsDom =''; + obj = { + sBody: { + messageChannelBtnText: '', + channelInitVal: '', + messageChannelDom: '' + }, + from:{ + id:rdata.id, + name: rdata.name, + type: rdata.type, + where1: rdata.where1, + hour: rdata.where_hour, + minute: rdata.where_minute, + week: rdata.where1, + sType: rdata.sType, + sBody: rdata.sBody == 'undefined' ? '' : rdata.sBody, + sName: rdata.sName, + backupTo: rdata.backupTo, + save: rdata.save, + urladdress: rdata.urladdress, + save_local: rdata.save_local, + notice: rdata.notice, + notice_channel: rdata.notice_channel + }, + sTypeArray:[['toShell',lan.crontab.shell],['site',lan.crontab.site_bak],['database',lan.crontab.db_bak],['logs',lan.crontab.log_split],['path',lan.crontab.dir_bak],['rememory',lan.crontab.mem_release],['toUrl',lan.crontab.get_url]], + cycleArray:[['day',lan.crontab.daily],['day-n',lan.crontab.n_day],['hour',lan.crontab.hourly],['hour-n',lan.crontab.n_hour],['minute-n',lan.crontab.n_min],['week',lan.crontab.weekly],['month',lan.crontab.monthly]], + weekArray:[[1,lan.crontab.TZZ1],[2,lan.crontab.TZZ2],[3,lan.crontab.TZZ3],[4,lan.crontab.TZZ4],[5,lan.crontab.TZZ5],[6,lan.crontab.TZZ6],[7,lan.crontab.TZZ7]], + sNameArray:[], + backupsArray:[], + create:function(callback){ + for(var i = 0; i '+ obj['sTypeArray'][i][1] +''; + } + for(var i = 0; i '+ obj['cycleArray'][i][1] +''; + } + for(var i = 0; i '+ obj['weekArray'][i][1] +''; + } + 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 == 'database'?'databases':'sites'},function(rdata){ + obj.sNameArray = rdata.data; + obj.sNameArray.unshift({name:'ALL',ps:lan.crontab.all}); + obj.backupsArray = rdata.orderOpt; + obj.backupsArray.unshift({name:lan.crontab.server_disk,value:'localhost'}); + for(var i = 0; i '+ obj['sNameArray'][i]['ps'] +''; + } + for(var i = 0; i '+ obj['backupsArray'][i]['name'] +''; + } + if(obj.from.sType == 'webshell'){ + edit_message_channel(obj.from.urladdress) + } + }); + } + if(obj.from.notice_channel == 'dingding') { + obj.sBody.title = '钉钉' + }else if(obj.from.notice_channel == 'mail') { + obj.sBody.title = 'Email' + }else if(obj.from.notice_channel == 'dingding,mail') { + obj.sBody.title = 'All' + } else { + obj.sBody.title = 'No Data' + } + if(obj.from.sType == 'site' || obj.from.sType == 'database' || obj.from.sType == 'path') { + $.post('/config?action=get_settings',{type: 'sites'},function(rdata){ + if(rdata.user_mail.user_name && rdata.dingding.dingding) { + obj.sBody.messageChannelBtnText = 'All' + obj.sBody.channelInitVal= 'user_name,dingding' + obj.sBody.messageChannelDom = '
  • All
  • 钉钉
  • 邮箱
  • ' + } else if(!rdata.user_mail.user_name && !rdata.dingding.dingding){ + obj.sBody.messageChannelBtnText = 'No Data' + obj.sBody.channelInitVal= '' + obj.sBody.messageChannelDom += '
  • No Data
  • ' + } else if(rdata.dingding.dingding) { + obj.sBody.messageChannelBtnText = '钉钉' + obj.sBody.channelInitVal= 'dingding' + obj.sBody.messageChannelDom += '
  • 钉钉
  • ' + } else if(rdata.user_mail.user_name) { + obj.sBody.messageChannelBtnText = 'Email' + obj.sBody.channelInitVal= 'mail' + obj.sBody.messageChannelDom += '
  • Email
  • ' + } + // callback(); + }) + } + setTimeout(function() { + callback(); + },200) + } + }; + obj.create(function(){ + layer.open({ + type:1, + title:lan.crontab.crontab_edit+'-['+rdata.name+']', + area: '866px', + skin:'layer-create-content', + shadeClose:false, + closeBtn:2, + content:'
    \ +
    \ + '+lan.crontab.task_type+'\ + \ +
    \ +
    \ + '+lan.crontab.task_name+'\ +
    \ +
    \ +
    \ + '+lan.crontab.exec_cycle+'\ + \ +
    \ + \ +
    '+lan.crontab.sun+'
    \ +
    '+lan.crontab.hour1+'
    \ +
    '+lan.crontab.minute1+'
    \ +
    \ +
    \ +
    \ + '+ sTypeName +'\ +
    \ +
    \ +
    \ +
    \ +
    '+lan.crontab.bakup_to+'
    \ + \ +
    '+lan.crontab.keep_update+'
    \ +
    \ + '+lan.crontab.copies+'\ +
    \ +
    \ +
    \ +
    \ + Backup reminder\ +
    \ +
    notification
    \ + \ +
    \ + Keep local backup\ +
    \ +
    \ +
    \ +
    \ + '+ (obj.from.sType == "toShell" ?'Script content':'Exclusion rule')+'\ +
    \ +
    \ +
    \ + '+lan.crontab.tips+'\ +
    '+lan.crontab.tips_content+'
    \ +
    \ +
    \ + '+lan.crontab.url_address+'\ +
    \ +
    \ +
    \ +
    '+lan.crontab.edit_save+'
    \ +
    \ +
    \ + Scan site\ + \ +

    \ +

    Message channel
    \ + \ +

    \ +
    \ +
    '+lan.crontab.edit_save+'
    \ +
    \ +
    \ +
    ' + }); + getselectnoticename(); + setTimeout(function(){ + if(obj.from.sType == 'toShell'){ + $('.site_list').hide(); + }else if(obj.from.sType == 'rememory'){ + $('.site_list').hide(); + }else if( obj.from.sType == 'toUrl'){ + $('.site_list').hide(); + }else if( obj.from.sType == 'webshell'){ + $('.site_list').hide(); + }else{ + $('.site_list').show(); + } - $('.sName_create').blur(function () { - obj.from.name = $(this).val(); - }); - $('.where1_create').blur(function () { - obj.from.where1 = $(this).val(); - }); - - $('.hour_create').blur(function () { - obj.from.hour = $(this).val(); - }); - - $('.minute_create').blur(function () { - obj.from.minute = $(this).val(); - }); - - $('.save_create').blur(function () { - obj.from.save = $(this).val(); - }); - - $('.sBody_create').blur(function () { - obj.from.sBody = $(this).val(); - }); - $('.url_create').blur(function () { - obj.from.urladdress = $(this).val(); - }); - - $('[aria-labelledby="cycle"] a').unbind().click(function () { - $('.cycle_btn').find('b').attr('val',$(this).attr('value')).html($(this).html()); - var type = $(this).attr('value'); - switch(type){ - case 'day': - $('.week_btn').hide(); - $('.where1_input').hide(); - $('.hour_input').show().find('input').val('1'); - $('.minute_input').show().find('input').val('30'); - obj.from.week = ''; - obj.from.type = ''; - obj.from.hour = 1; - obj.from.minute = 30; - break; - case 'day-n': - $('.week_btn').hide(); - $('.where1_input').show().find('input').val('1'); - $('.hour_input').show().find('input').val('1'); - $('.minute_input').show().find('input').val('30'); - obj.from.week = ''; - obj.from.where1 = 1; - obj.from.hour = 1; - obj.from.minute = 30; - break; - case 'hour': - $('.week_btn').hide(); - $('.where1_input').hide(); - $('.hour_input').hide(); - $('.minute_input').show().find('input').val('30'); - obj.from.week = ''; - obj.from.where1 = ''; - obj.from.hour = ''; - obj.from.minute = 30; - break; - case 'hour-n': - $('.week_btn').hide(); - $('.where1_input').hide(); - $('.hour_input').show().find('input').val('1'); - $('.minute_input').show().find('input').val('30'); - obj.from.week = ''; - obj.from.where1 = ''; - obj.from.hour = 1; - obj.from.minute = 30; - break; - case 'minute-n': - $('.week_btn').hide(); - $('.where1_input').hide(); - $('.hour_input').hide(); - $('.minute_input').show(); - obj.from.week = ''; - obj.from.where1 = ''; - obj.from.hour = ''; - obj.from.minute = 30; - break; - case 'week': - $('.week_btn').show(); - $('.where1_input').hide(); - $('.hour_input').show(); - $('.minute_input').show(); - obj.from.week = 1; - obj.from.where1 = ''; - obj.from.hour = 1; - obj.from.minute = 30; - break; - case 'month': - $('.week_btn').hide(); - $('.where1_input').show(); - $('.hour_input').show(); - $('.minute_input').show(); - obj.from.week = ''; - obj.from.where1 = 1; - obj.from.hour = 1; - obj.from.minute = 30; - break; - } - obj.from.type = $(this).attr('value'); - }); - - $('[aria-labelledby="week"] a').unbind().click(function () { - $('.week_btn').find('b').attr('val',$(this).attr('value')).html($(this).html()); - obj.from.week = $(this).attr('value'); - }); - - $('[aria-labelledby="backupTo"] a').unbind().click(function () { - $('.backup_btn').find('b').attr('val',$(this).attr('value')).html($(this).html()); - obj.from.backupTo = $(this).attr('value'); - }); - $('.plan-submits').unbind().click(function(){ - if(obj.from.type == 'hour-n'){ - obj.from.where1 = obj.from.hour; - obj.from.hour = ''; - }else if(obj.from.type == 'minute-n'){ - obj.from.where1 = obj.from.minute; - obj.from.minute = ''; - }else if(obj.from.sType == 'webshell'){ - obj.from.urladdress = $(".message_start input:checked").val() - } - layer.msg(lan.crontab.saving,{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/crontab?action=modify_crond',obj.from,function(rdata){ - layer.closeAll(); - getCronData(); - layer.msg(rdata.msg,{icon:rdata.status?1:2}); - }); - }); - },100); - }); - }); + $('.sName_create').blur(function () { + obj.from.name = $(this).val(); + }); + $('.where1_create').blur(function () { + obj.from.where1 = $(this).val(); + }); + + $('.hour_create').blur(function () { + obj.from.hour = $(this).val(); + }); + + $('.minute_create').blur(function () { + obj.from.minute = $(this).val(); + }); + + $('.save_create').blur(function () { + obj.from.save = $(this).val(); + }); + + $('.sBody_create').blur(function () { + obj.from.sBody = $(this).val(); + }); + $('.url_create').blur(function () { + obj.from.urladdress = $(this).val(); + }); + + $('[aria-labelledby="cycle"] a').unbind().click(function () { + $('.cycle_btn').find('b').attr('val',$(this).attr('value')).html($(this).html()); + var type = $(this).attr('value'); + switch(type){ + case 'day': + $('.week_btn').hide(); + $('.where1_input').hide(); + $('.hour_input').show().find('input').val('1'); + $('.minute_input').show().find('input').val('30'); + obj.from.week = ''; + obj.from.type = ''; + obj.from.hour = 1; + obj.from.minute = 30; + break; + case 'day-n': + $('.week_btn').hide(); + $('.where1_input').show().find('input').val('1'); + $('.hour_input').show().find('input').val('1'); + $('.minute_input').show().find('input').val('30'); + obj.from.week = ''; + obj.from.where1 = 1; + obj.from.hour = 1; + obj.from.minute = 30; + break; + case 'hour': + $('.week_btn').hide(); + $('.where1_input').hide(); + $('.hour_input').hide(); + $('.minute_input').show().find('input').val('30'); + obj.from.week = ''; + obj.from.where1 = ''; + obj.from.hour = ''; + obj.from.minute = 30; + break; + case 'hour-n': + $('.week_btn').hide(); + $('.where1_input').hide(); + $('.hour_input').show().find('input').val('1'); + $('.minute_input').show().find('input').val('30'); + obj.from.week = ''; + obj.from.where1 = ''; + obj.from.hour = 1; + obj.from.minute = 30; + break; + case 'minute-n': + $('.week_btn').hide(); + $('.where1_input').hide(); + $('.hour_input').hide(); + $('.minute_input').show(); + obj.from.week = ''; + obj.from.where1 = ''; + obj.from.hour = ''; + obj.from.minute = 30; + break; + case 'week': + $('.week_btn').show(); + $('.where1_input').hide(); + $('.hour_input').show(); + $('.minute_input').show(); + obj.from.week = 1; + obj.from.where1 = ''; + obj.from.hour = 1; + obj.from.minute = 30; + break; + case 'month': + $('.week_btn').hide(); + $('.where1_input').show(); + $('.hour_input').show(); + $('.minute_input').show(); + obj.from.week = ''; + obj.from.where1 = 1; + obj.from.hour = 1; + obj.from.minute = 30; + break; + } + obj.from.type = $(this).attr('value'); + }); + + $('[aria-labelledby="week"] a').unbind().click(function () { + $('.week_btn').find('b').attr('val',$(this).attr('value')).html($(this).html()); + obj.from.week = $(this).attr('value'); + }); + + $('[aria-labelledby="backupTo"] a').unbind().click(function () { + $('.backup_btn').find('b').attr('val',$(this).attr('value')).html($(this).html()); + obj.from.backupTo = $(this).attr('value'); + }); + $('.plan-submits').unbind().click(function(){ + if(obj.from.type == 'hour-n'){ + obj.from.where1 = obj.from.hour; + obj.from.hour = ''; + }else if(obj.from.type == 'minute-n'){ + obj.from.where1 = obj.from.minute; + obj.from.minute = ''; + }else if(obj.from.sType == 'webshell'){ + obj.from.urladdress = $(".message_start input:checked").val() + } + obj.from.save_local = $('#modSave_local').val() + obj.from.notice = $("#modNotice").find("button b").attr("val") + obj.from.notice_channel = $("#modNotice_channelValue").attr("val") + layer.msg(lan.crontab.saving,{icon:16,time:0,shade: [0.3, '#000']}); + $.post('/crontab?action=modify_crond',obj.from,function(rdata){ + layer.closeAll(); + getCronData(); + layer.msg(rdata.msg,{icon:rdata.status?1:2}); + }); + }); + },100); + }); + }); } // 修改木马查杀 消息通道 function edit_message_channel(type){ - $.post('/config?action=get_settings',function(res){ - var tMess = ""; - if(res.user_mail.user_name && !res.dingding.dingding){ - tMess = '
    \ - \ - \ -
    ' - }else if(!res.user_mail.user_name && res.dingding.dingding){ - tMess = '
    \ - \ - \ -
    ' - }else{ - tMess ='
    \ - \ - \ -
    \ -
    \ - \ - \ -
    ' - } - $(".message_start").html(tMess); - }) + $.post('/config?action=get_settings',function(res){ + var tMess = ""; + if(res.user_mail.user_name && !res.dingding.dingding){ + tMess = '
    \ + \ + \ +
    ' + }else if(!res.user_mail.user_name && res.dingding.dingding){ + tMess = '
    \ + \ + \ +
    ' + }else{ + tMess ='
    \ + \ + \ +
    \ +
    \ + \ + \ +
    ' + } + $(".message_start").html(tMess); + }) } // 设置计划任务状态 function set_task_status(id,status){ - var confirm = layer.confirm(status == '0'?lan.crontab.crontab_stop_will:lan.crontab.disable_change_crontab_start, {title:lan.crontab.tips,icon:3,closeBtn:2},function(index) { - if (index > 0) { - $.post('/crontab?action=set_cron_status',{id:id},function(rdata){ - layer.closeAll(); - layer.close(confirm); - layer.msg(rdata.data,{icon:rdata.status?1:2}); - if(rdata.status) getCronData(); - }); - } - }); + var confirm = layer.confirm(status == '0'?lan.crontab.crontab_stop_will:lan.crontab.disable_change_crontab_start, {title:lan.crontab.tips,icon:3,closeBtn:2},function(index) { + if (index > 0) { + $.post('/crontab?action=set_cron_status',{id:id},function(rdata){ + layer.closeAll(); + layer.close(confirm); + layer.msg(rdata.data,{icon:rdata.status?1:2}); + if(rdata.status) getCronData(); + }); + } + }); } //执行任务脚本 function StartTask(id){ - layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); - var data='id='+id; - $.post('/crontab?action=StartTask',data,function(rdata){ - layer.closeAll(); - layer.msg(rdata.msg,{icon:rdata.status?1:2}); - }); + layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); + var data='id='+id; + $.post('/crontab?action=StartTask',data,function(rdata){ + layer.closeAll(); + layer.msg(rdata.msg,{icon:rdata.status?1:2}); + }); } //清空日志 function CloseLogs(id){ - layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); - var data='id='+id; - $.post('/crontab?action=DelLogs',data,function(rdata){ - layer.closeAll(); - layer.msg(rdata.msg,{icon:rdata.status?1:2}); - }); + layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); + var data='id='+id; + $.post('/crontab?action=DelLogs',data,function(rdata){ + layer.closeAll(); + layer.msg(rdata.msg,{icon:rdata.status?1:2}); + }); } //删除 function planDel(id,name){ - SafeMessage(lan.get('del',[name]),lan.crontab.del_task,function(){ - layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); - var data='id='+id; - $.post('/crontab?action=DelCrontab',data,function(rdata){ - layer.closeAll(); + SafeMessage(lan.get('del',[name]),lan.crontab.del_task,function(){ + layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']}); + var data='id='+id; + $.post('/crontab?action=DelCrontab',data,function(rdata){ + layer.closeAll(); getCronData(); setTimeout(function () { layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });},1000) - }); - }); + }); + }); } //批量删除 function allDeleteCron(){ - var checkList = $("input[name=id]"); - var dataList = new Array(); - for(var i=0;i"+lan.get('del_all_task',[dataList.length])+"",function(){ - layer.closeAll(); - syncDeleteCron(dataList,0,''); - }); + var checkList = $("input[name=id]"); + var dataList = new Array(); + for(var i=0;i"+lan.get('del_all_task',[dataList.length])+"",function(){ + layer.closeAll(); + syncDeleteCron(dataList,0,''); + }); } //批量执行和批量清除日志 function allCron(type){ - var message = type=='log' ? 'Confirm to delete the logs of the selected task?' : 'Confirm to execute the selected task?', - tit = type=='log' ? 'Confirm Delete' : 'Confirm Execute', - url = type=='log' ? '/crontab?action=DelLogs' : '/crontab?action=StartTask', - confirm = layer.confirm(message, {title:tit,icon:3,closeBtn:2},function() { - var checkList = $("input[name=id]"); - for(var i=0;i'; - } - errorMsg += '
  • '+dataList[0].name+' -> '+frdata.msg+'
  • ' - } - - dataList.splice(0,1); - syncDeleteCron(dataList,successCount,errorMsg); - } - }); + if(dataList.length < 1) { + layer.msg(lan.get('del_all_task_ok',[successCount]),{icon:1}); + return; + } + var loadT = layer.msg(lan.get('del_all_task_the',[dataList[0].name]),{icon:16,time:0,shade: [0.3, '#000']}); + $.ajax({ + type:'POST', + url:'/crontab?action=DelCrontab', + data:'id='+dataList[0].id+'&name='+dataList[0].name, + async: true, + success:function(frdata){ + layer.close(loadT); + if(frdata.status){ + successCount++; + $("input[title='"+dataList[0].name+"']").parents("tr").remove(); + }else{ + if(!errorMsg){ + errorMsg = '

    '+lan.crontab.del_task_err+'

    '; + } + errorMsg += '
  • '+dataList[0].name+' -> '+frdata.msg+'
  • ' + } + + dataList.splice(0,1); + syncDeleteCron(dataList,successCount,errorMsg); + } + }); } - + function IsURL(str_url){ - var strRegex = '^(https|http|ftp|rtsp|mms)?://.+'; - var re=new RegExp(strRegex); - if (re.test(str_url)){ - return (true); - }else{ - return (false); - } + var strRegex = '^(https|http|ftp|rtsp|mms)?://.+'; + var re=new RegExp(strRegex); + if (re.test(str_url)){ + return (true); + }else{ + return (false); + } } //提交 function planAdd(){ - var name = $(".planname input[name='name']").val(); - if(name == ''){ - $(".planname input[name='name']").focus(); - layer.msg(lan.crontab.add_task_empty,{icon:2}); - return; - } - $("#set-Config input[name='name']").val(name); - - var type = $(".plancycle").find("b").attr("val"); - $("#set-Config input[name='type']").val(type); - - var where1 = $("#ptime input[name='where1']").val(); - var is1; - var is2 = 1; - switch(type){ - case 'day-n': - is1=31; - break; - case 'hour-n': - is1=23; - break; - case 'minute-n': - is1=59; - break; - case 'month': - is1=31; - break; - - } - - if(where1 > is1 || where1 < is2){ - $("#ptime input[name='where1']").focus(); - layer.msg(lan.public.input_err,{icon:2}); - return; - } - - $("#set-Config input[name='where1']").val(where1); - - var hour = $("#ptime input[name='hour']").val(); - if(hour > 23 || hour < 0){ - $("#ptime input[name='hour']").focus(); - layer.msg(lan.crontab.input_hour_err,{icon:2}); - return; - } - $("#set-Config input[name='hour']").val(hour); - var minute = $("#ptime input[name='minute']").val(); - if(minute > 59 || minute < 0){ - $("#ptime input[name='minute']").focus(); - layer.msg(lan.crontab.input_minute_err,{icon:2}); - return; - } - $("#set-Config input[name='minute']").val(minute); - - var save = $("#save").val(); - - if(save < 0){ - layer.msg(lan.crontab.input_number_err,{icon:2}); - return; - } - - $("#set-Config input[name='save']").val(save); - - - $("#set-Config input[name='week']").val($(".planweek").find("b").attr("val")); - var sType = $(".planjs").find("b").attr("val"); - var sBody = encodeURIComponent($("#implement textarea[name='sBody']").val()); - - if(sType == 'toFile'){ - if($("#viewfile").val() == ''){ - layer.msg(lan.crontab.input_file_err,{icon:2}); - return; - } - }else{ - if(sBody == '' && sType=='toShell'){ - $("#implement textarea[name='sBody']").focus(); - layer.msg(lan.crontab.input_script_err,{icon:2}); - return; - } - } - var urladdress_1 = $("#urladdress_1").val(); - if(sType == 'toUrl'){ - if(!IsURL(urladdress_1)){ - layer.msg(lan.crontab.input_url_err,{icon:2}); - $("implement textarea[name='urladdress_1']").focus(); - return; - } - } - urladdress_1 = encodeURIComponent(urladdress_1); - $("#set-Config input[name='sType']").val(sType); - $("#set-Config textarea[name='sBody']").val(decodeURIComponent(sBody)); - - if(sType == 'site' || sType == 'database' || sType == 'path'){ - var backupTo = $(".planBackupTo").find("b").attr("val"); - $("#backupTo").val(backupTo); - } - - - var sName = $("#sName").attr("val"); - - /*if(sName == 'backupAll'){ - var alist = $("ul[aria-labelledby='backdata'] li a"); - var dataList = new Array(); - for(var i=1;i -1){ - data = data.replace('&sName=&','&sName='+ encodeURIComponent($('#inputPath').val()) +'&') - }else if(data.indexOf('sType=webshell') > -1){ - data = $("#set-Config").serialize() + '&urladdress=' + _radiox; - data = data.replace('&sName=&','&sName='+ encodeURIComponent($('#filePath').val()) +'&') - } + var name = $(".planname input[name='name']").val(); + if(name == ''){ + $(".planname input[name='name']").focus(); + layer.msg(lan.crontab.add_task_empty,{icon:2}); + return; + } + $("#set-Config input[name='name']").val(name); - $.post('/crontab?action=AddCrontab',data,function(rdata){ - layer.closeAll(); + var type = $(".plancycle").find("b").attr("val"); + $("#set-Config input[name='type']").val(type); + + var where1 = $("#ptime input[name='where1']").val(); + var is1; + var is2 = 1; + switch(type){ + case 'day-n': + is1=31; + break; + case 'hour-n': + is1=23; + break; + case 'minute-n': + is1=59; + break; + case 'month': + is1=31; + break; + + } + + if(where1 > is1 || where1 < is2){ + $("#ptime input[name='where1']").focus(); + layer.msg(lan.public.input_err,{icon:2}); + return; + } + + $("#set-Config input[name='where1']").val(where1); + + var hour = $("#ptime input[name='hour']").val(); + if(hour > 23 || hour < 0){ + $("#ptime input[name='hour']").focus(); + layer.msg(lan.crontab.input_hour_err,{icon:2}); + return; + } + $("#set-Config input[name='hour']").val(hour); + var minute = $("#ptime input[name='minute']").val(); + if(minute > 59 || minute < 0){ + $("#ptime input[name='minute']").focus(); + layer.msg(lan.crontab.input_minute_err,{icon:2}); + return; + } + $("#set-Config input[name='minute']").val(minute); + + var save = $("#save").val(); + + if(save < 0){ + layer.msg(lan.crontab.input_number_err,{icon:2}); + return; + } + + $("#set-Config input[name='save']").val(save); + + + $("#set-Config input[name='week']").val($(".planweek").find("b").attr("val")); + var sType = $(".planjs").find("b").attr("val"); + var sBody = encodeURIComponent($("#implement textarea[name='sBody']").val()); + + if(sType == 'toFile'){ + if($("#viewfile").val() == ''){ + layer.msg(lan.crontab.input_file_err,{icon:2}); + return; + } + }else{ + if(sBody == '' && sType=='toShell'){ + $("#implement textarea[name='sBody']").focus(); + layer.msg(lan.crontab.input_script_err,{icon:2}); + return; + } + } + var urladdress_1 = $("#urladdress_1").val(); + if(sType == 'toUrl'){ + if(!IsURL(urladdress_1)){ + layer.msg(lan.crontab.input_url_err,{icon:2}); + $("implement textarea[name='urladdress_1']").focus(); + return; + } + } + urladdress_1 = encodeURIComponent(urladdress_1); + $("#set-Config input[name='sType']").val(sType); + $("#set-Config textarea[name='sBody']").val(decodeURIComponent(sBody)); + + if(sType == 'site' || sType == 'database' || sType == 'path'){ + var backupTo = $(".planBackupTo").find("b").attr("val"); + $("#backupTo").val(backupTo); + } + + + var sName = $("#sName").attr("val"); + + /*if(sName == 'backupAll'){ + var alist = $("ul[aria-labelledby='backdata'] li a"); + var dataList = new Array(); + for(var i=1;i -1){ + data = data.replace('&sName=&','&sName='+ encodeURIComponent($('#inputPath').val()) +'&') + }else if(data.indexOf('sType=webshell') > -1){ + data = $("#set-Config").serialize() + '&urladdress=' + _radiox; + data = data.replace('&sName=&','&sName='+ encodeURIComponent($('#filePath').val()) +'&') + } + if(data.indexOf('&save_local=') == -1) { + data = data + '&save_local='+ $('#save_local').val() +'¬ice='+ $("#notice").find("b").attr("val") +'¬ice_channel='+ $("#notice_channel").find("b").attr("val") +'' + } + $.post('/crontab?action=AddCrontab',data,function(rdata){ + layer.closeAll(); getCronData(); setTimeout(function () { layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); }, 1000) - }); + }); } //批量添加任务 function allAddCrontab(dataList,successCount,errorMsg){ - if(dataList.length < 1) { - layer.msg(lan.get('add_all_task_ok',[successCount]),{icon:1}); - return; - } - var loadT = layer.msg(lan.get('add',[dataList[0]]),{icon:16,time:0,shade: [0.3, '#000']}); - var sType = $(".planjs").find("b").attr("val"); - var minute = parseInt($("#set-Config input[name='minute']").val()); - var hour = parseInt($("#set-Config input[name='hour']").val()); - var sTitle = (sType == 'site')?lan.crontab.backup_site:lan.crontab.backup_database; - if(sType == 'logs') sTitle = lan.crontab.backup_log; - minute += 5; - if(hour !== '' && minute > 59){ - if(hour >= 23) hour = 0; - $("#set-Config input[name='hour']").val(hour+1); - minute = 5; - } - $("#set-Config input[name='minute']").val(minute); - $("#set-Config input[name='name']").val(sTitle + '['+dataList[0]+']'); - $("#set-Config input[name='sName']").val(dataList[0]); - var pdata = $("#set-Config").serialize() + '&sBody=&urladdress_1='; - $.ajax({ - type:'POST', - url:'/crontab?action=AddCrontab', - data:pdata, - async: true, - success:function(frdata){ - layer.close(loadT); - if(frdata.status){ - successCount++; - getCronData(); - }else{ - if(!errorMsg){ - errorMsg = '

    '+lan.crontab.backup_all_err+'

    '; - } - errorMsg += '
  • '+dataList[0]+' -> '+frdata.msg+'
  • ' - } - - dataList.splice(0,1); - allAddCrontab(dataList,successCount,errorMsg); - } - }); + if(dataList.length < 1) { + layer.msg(lan.get('add_all_task_ok',[successCount]),{icon:1}); + return; + } + var loadT = layer.msg(lan.get('add',[dataList[0]]),{icon:16,time:0,shade: [0.3, '#000']}); + var sType = $(".planjs").find("b").attr("val"); + var minute = parseInt($("#set-Config input[name='minute']").val()); + var hour = parseInt($("#set-Config input[name='hour']").val()); + var sTitle = (sType == 'site')?lan.crontab.backup_site:lan.crontab.backup_database; + if(sType == 'logs') sTitle = lan.crontab.backup_log; + minute += 5; + if(hour !== '' && minute > 59){ + if(hour >= 23) hour = 0; + $("#set-Config input[name='hour']").val(hour+1); + minute = 5; + } + $("#set-Config input[name='minute']").val(minute); + $("#set-Config input[name='name']").val(sTitle + '['+dataList[0]+']'); + $("#set-Config input[name='sName']").val(dataList[0]); + var pdata = $("#set-Config").serialize() + '&sBody=&urladdress_1='; + $.ajax({ + type:'POST', + url:'/crontab?action=AddCrontab', + data:pdata, + async: true, + success:function(frdata){ + layer.close(loadT); + if(frdata.status){ + successCount++; + getCronData(); + }else{ + if(!errorMsg){ + errorMsg = '

    '+lan.crontab.backup_all_err+'

    '; + } + errorMsg += '
  • '+dataList[0]+' -> '+frdata.msg+'
  • ' + } + + dataList.splice(0,1); + allAddCrontab(dataList,successCount,errorMsg); + } + }); } $(".dropdown ul li a").click(function(){ - var txt = $(this).text(); - var type = $(this).attr("value"); - $(this).parents(".dropdown").find("button b").text(txt).attr("val",type); - switch(type){ - case 'day': - closeOpt(); - toHour(); - toMinute(); - break; - case 'day-n': - closeOpt(); - toWhere1(lan.crontab.day); - toHour(); - toMinute(); - break; - case 'hour': - closeOpt(); - toMinute(); - break; - case 'hour-n': - closeOpt(); - toWhere1(lan.crontab.hour); - toMinute(); - break; - case 'minute-n': - closeOpt(); - toWhere1(lan.crontab.minute); - break; - case 'week': - closeOpt(); - toWeek(); - toHour(); - toMinute(); - break; - case 'month': - closeOpt(); - toWhere1(lan.crontab.sun); - toHour(); - toMinute(); - break; - case 'toFile': - toFile(); - break; - case 'toShell': - toShell(); - $(".controls").html(lan.crontab.sbody); - break; - case 'path': - toBackup('path'); - $(".controls").html(lan.crontab.dir_bak); - break; - case 'rememory': - rememory(); - $(".controls").html(lan.public.msg); - break; - case 'site': - toBackup('sites'); - $(".controls").html(lan.crontab.backup_site); - break; - case 'database': - toBackup('databases'); - $(".controls").html(lan.crontab.backup_database); - break; - case 'logs': - toBackup('logs'); - $(".controls").html(lan.crontab.log_site); - break; - case 'toUrl': - toUrl(); - $(".controls").html(lan.crontab.url_address); - break; - case 'webshell': - webShell(); - break; - } + var txt = $(this).text(); + var type = $(this).attr("value"); + $(this).parents(".dropdown").find("button b").text(txt).attr("val",type); + switch(type){ + case 'day': + closeOpt(); + toHour(); + toMinute(); + break; + case 'day-n': + closeOpt(); + toWhere1(lan.crontab.day); + toHour(); + toMinute(); + break; + case 'hour': + closeOpt(); + toMinute(); + break; + case 'hour-n': + closeOpt(); + toWhere1(lan.crontab.hour); + toMinute(); + break; + case 'minute-n': + closeOpt(); + toWhere1(lan.crontab.minute); + break; + case 'week': + closeOpt(); + toWeek(); + toHour(); + toMinute(); + break; + case 'month': + closeOpt(); + toWhere1(lan.crontab.sun); + toHour(); + toMinute(); + break; + case 'toFile': + toFile(); + break; + case 'toShell': + toShell(); + $(".controls").html(lan.crontab.sbody); + break; + case 'path': + toBackup('path'); + $(".controls").html(lan.crontab.dir_bak); + break; + case 'rememory': + rememory(); + $(".controls").html(lan.public.msg); + break; + case 'site': + toBackup('sites'); + $(".controls").html(lan.crontab.backup_site); + break; + case 'database': + toBackup('databases'); + $(".controls").html(lan.crontab.backup_database); + break; + case 'logs': + toBackup('logs'); + $(".controls").html(lan.crontab.log_site); + break; + case 'toUrl': + toUrl(); + $(".controls").html(lan.crontab.url_address); + break; + case 'webshell': + webShell(); + break; + } }) //备份 function toBackup(type){ - var sMsg = ""; - switch(type){ - case 'sites': - sMsg = lan.crontab.backup_site; - sType = "sites"; - break; - case 'databases': - sMsg = lan.crontab.backup_database; - sType = "databases"; - break; - case 'logs': - sMsg = lan.crontab.backup_log; - sType = "sites"; - break; - case 'path': - sMsg = lan.crontab.dir_bak; - sType = "sites"; - break; - } - var data='type='+sType - $.post('/crontab?action=GetDataList',data,function(rdata){ - $(".planname input[name='name']").attr('readonly','true').css({"background-color":"#f6f6f6","color":"#666"}); - if(type != 'path'){ - var sOpt = "",sOptBody = ''; - if(rdata.data.length == 0){ - $(".planname input[name='name']").val(''); - layer.msg(lan.public.list_empty,{icon:2}) - return - } - for(var i=0;i'+rdata.data[i].name+'['+rdata.data[i].ps+']'; - } - sOptBody ='' - }else{ - $(".planname input[name='name']").val(sMsg+'[/www/wwwroot/]'); - sOptBody = '
    ' - 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(lan.crontab.dir_bak+'['+getCookie('path_dir_change')+']'); - setCookie('default_dir_path',path_dir_change); - } - },500); - } - var orderOpt = '' - for (var i=0;i'+rdata.orderOpt[i].name+'' - } - - - - var sBody = sOptBody + '
    '+lan.crontab.backup_to+'
    \ - \ -
    '+lan.crontab.save_new+'
    \ - \ - '+lan.crontab.save_num+'\ -
    '; - if (sType == 'sites' && sMsg !== lan.crontab.backup_log) { - sBody += '

    \ -

    '+lan.crontab.exclusion_rule+'
    \ - \ -

    '; + var sMsg = ""; + switch(type){ + case 'sites': + sMsg = lan.crontab.backup_site; + sType = "sites"; + break; + case 'databases': + sMsg = lan.crontab.backup_database; + sType = "databases"; + break; + case 'logs': + sMsg = lan.crontab.backup_log; + sType = "sites"; + break; + case 'path': + sMsg = lan.crontab.dir_bak; + sType = "sites"; + break; + } + var data='type='+sType + $.post('/crontab?action=GetDataList',data,function(rdata){ + $(".planname input[name='name']").attr('readonly','true').css({"background-color":"#f6f6f6","color":"#666"}); + if(type != 'path'){ + var sOpt = "",sOptBody = ''; + if(rdata.data.length == 0){ + $(".planname input[name='name']").val(''); + layer.msg(lan.public.list_empty,{icon:2}) + return + } + for(var i=0;idata/config.php
    static/upload
    *.log
    '; - _this.attr('placeholder', ''); - var loadT = layer.tips(tipss, _this, { - tips: [1, '#20a53a'], - time: 0, - area: _this[0].clientWidth + 'px' - }); - $(this).one('blur', function () { - $(this).attr('placeholder', tips); - layer.close(loadT); - }); - }); - }); + sOpt += '
  • '+rdata.data[i].name+'['+rdata.data[i].ps+']
  • '; + } + sOptBody ='' + }else{ + $(".planname input[name='name']").val(sMsg+'[/www/wwwroot/]'); + sOptBody = '
    ' + 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(lan.crontab.dir_bak+'['+getCookie('path_dir_change')+']'); + setCookie('default_dir_path',path_dir_change); + } + },500); + } + var orderOpt = '' + for (var i=0;i'+rdata.orderOpt[i].name+'' + } + + + + var sBody = sOptBody + '
    '+lan.crontab.backup_to+'
    \ + \ +
    '+lan.crontab.save_new+'
    \ + \ + '+lan.crontab.copies+'\ +
    '; + if (type == 'sites' || type == 'path' || type == 'databases') { + $.post('/config?action=get_settings',data,function(rdata){ + var messageChannelDom = '', messageChannelBtnText = '', channelInitVal = '' + if(rdata.user_mail.user_name && rdata.dingding.dingding) { + messageChannelBtnText = 'All' + channelInitVal= 'user_name,dingding' + messageChannelDom = '
  • All
  • 钉钉
  • Email
  • ' + } else if(!rdata.user_mail.user_name && !rdata.dingding.dingding){ + messageChannelBtnText = 'No Data' + channelInitVal= '' + messageChannelDom += '
  • No Data
  • ' + } else if(rdata.dingding.dingding) { + messageChannelBtnText = '钉钉' + channelInitVal= 'dingding' + messageChannelDom += '
  • 钉钉
  • ' + } else if(rdata.user_mail.user_name) { + messageChannelBtnText = 'Email' + channelInitVal= 'mail' + messageChannelDom += '
  • Email
  • ' + } + sBody += '

    \ +

    Backup reminder
    \ + \ + \ + \ + \ + \ + Set notifications\ + Keep local backup\ +

    '; + if(type == 'sites' || type == "path") { + sBody += '

    \ +

    '+lan.crontab.exclusion_rule+'
    \ + \ +

    '; + } + $("#implement").html(sBody); + getselectname(); + }) + }else{ + $("#implement").html('
    '); + sBody += '

    \ +

    '+lan.crontab.exclusion_rule+'
    \ + \ +

    '; + $("#implement").html(sBody); + } + $("#implement").on('click','.dropdown ul li a',function(ev){ + var val = $(this).attr('value'); + console.log(val) + $("#sName").attr({'value':val}).text($(this).text()) + $(".planname input[name='name']").val(sMsg+'['+val+']'); + }); + if(type == "path"){ + $('.planname input').attr('readonly',false).removeAttr('style'); + } + $("#exclude").focus(function(){ + var _this = $(this), tips = _this.attr('placeholder'), + tipss = ''+lan.crontab.exclusion_rule_tips+'
    data/config.php
    static/upload
    *.log
    '; + _this.attr('placeholder', ''); + var loadT = layer.tips(tipss, _this, { + tips: [1, '#20a53a'], + time: 0, + area: _this[0].clientWidth + 'px' + }); + $(this).one('blur', function () { + $(this).attr('placeholder', tips); + layer.close(loadT); + }); + }); + }); } //下拉菜单名称 function getselectname(){ - $(".dropdown ul li a").click(function(){ - var txt = $(this).text(); - var type = $(this).attr("value"); - $(this).parents(".dropdown").find("button b").text(txt).attr("val",type); - }); + $(".dropdown ul li a").click(function(){ + var txt = $(this).text(); + var type = $(this).attr("value"); + $(this).parents(".dropdown").find("button b").text(txt).attr("val",type); + }); } //清理 function closeOpt(){ - $("#ptime").html(''); + $("#ptime").html(''); } //星期 function toWeek(){ - var mBody = ''; - $("#ptime").html(mBody); - getselectname() + var mBody = ''; + $("#ptime").html(mBody); + getselectname() } //指定1 function toWhere1(ix){ - var mBody ='
    \ - \ - '+ix+'\ -
    '; - $("#ptime").append(mBody); + var mBody ='
    \ + \ + '+ix+'\ +
    '; + $("#ptime").append(mBody); } //小时 function toHour(){ - var mBody = '
    \ - \ - '+lan.crontab.hour+'\ -
    '; - $("#ptime").append(mBody); + var mBody = '
    \ + \ + '+lan.crontab.hour+'\ +
    '; + $("#ptime").append(mBody); } //分钟 function toMinute(){ - var mBody = '
    \ - \ - '+lan.crontab.minute+'\ -
    '; - $("#ptime").append(mBody); - + var mBody = '
    \ + \ + '+lan.crontab.minute+'\ +
    '; + $("#ptime").append(mBody); + } //从文件 function toFile(){ - var tBody = '\ - '; - $("#implement").html(tBody); - $(".planname input[name='name']").removeAttr('readonly style').val(""); + var tBody = '\ + '; + $("#implement").html(tBody); + $(".planname input[name='name']").removeAttr('readonly style').val(""); } //从脚本 function toShell(){ - var shell_body = ''; - var shell_name = ''; - if($("b[val='toShell']").text() === 'synchronised time'){ - shell_name = 'Periodically synchronize server time'; - shell_body = 'echo "|-Trying to synchronize time from 0.pool.bt.cn..";\n\ + var shell_body = ''; + var shell_name = ''; + if($("b[val='toShell']").text() === 'synchronised time'){ + shell_name = 'Periodically synchronize server time'; + shell_body = 'echo "|-Trying to synchronize time from 0.pool.bt.cn..";\n\ ntpdate -u 0.pool.bt.cn\n\ if [ $? = 1 ];then\n\ - echo "|-Trying to synchronize time from 1.pool.bt.cn..";\n\ - ntpdate -u 1.pool.bt.cn\n\ + echo "|-Trying to synchronize time from 1.pool.bt.cn..";\n\ + ntpdate -u 1.pool.bt.cn\n\ fi\n\ if [ $? = 1 ];then\n\ - echo "|-Trying to sync time from 0.asia.pool.ntp.org..";\n\ - ntpdate -u 0.asia.pool.ntp.org\n\ + echo "|-Trying to sync time from 0.asia.pool.ntp.org..";\n\ + ntpdate -u 0.asia.pool.ntp.org\n\ fi\n\ if [ $? = 1 ];then\n\ - echo "|-Trying to sync time from www.bt.cn..";\n\ - getBtTime=$(curl -sS --connect-timeout 3 -m 60 http://www.bt.cn/api/index/get_time)\n\ - if [ "${getBtTime}" ];then \n\ - date -s "$(date -d @$getBtTime +"%Y-%m-%d %H:%M:%S")"\n\ - fi\n\ + echo "|-Trying to sync time from www.bt.cn..";\n\ + getBtTime=$(curl -sS --connect-timeout 3 -m 60 http://www.bt.cn/api/index/get_time)\n\ + if [ "${getBtTime}" ];then \n\ + date -s "$(date -d @$getBtTime +"%Y-%m-%d %H:%M:%S")"\n\ + fi\n\ fi\n\ echo "|-Trying to write current system time to hardware..";\n\ hwclock -w\n\ date\n\ echo "|-Time synchronization completed!";' - } - var tBody = ""; - $("#implement").html(tBody); - $(".planname input[name='name']").removeAttr('readonly style').val(shell_name); + } + var tBody = ""; + $("#implement").html(tBody); + $(".planname input[name='name']").removeAttr('readonly style').val(shell_name); } function toPath() { @@ -1036,99 +1160,411 @@ function toPath() { } //木马查杀 function webShell(){ - var sOpt = "",sOptBody = ''; - $.post('/crontab?action=GetDataList&type=sites',function(rdata){ - $(".planname input[name='name']").attr('readonly','true').css({"background-color":"#f6f6f6","color":"#666"}); - if(rdata.data.length == 0){ - layer.msg(lan.public.list_empty,{icon:2}) - return - } - for(var i=0;i'+rdata.data[i].name+'['+rdata.data[i].ps+']'; - } - sOptBody ='', - success:function(){ + success:function(layers){ $('#mask_layer').hide(); + layers.find('.layui-layer-btn2').css('margin', '0 300px 0 0'); $('.file_dir_uploads .layui-layer-max').hide(); $('.upload_btn_groud .upload_file_btn').click(function(){$('.upload_btn_groud .dropdown-menu [data-type=file]').click()}); $('.upload_btn_groud .dropdown-menu a').click(function(){ @@ -293,15 +294,17 @@ var bt_file = { layer.close(index); } }, - cancel:function(index, layero){ + btn3:function(index, layero){ if(that.uploading){ layer.confirm('Do you want to cancel the upload of files? It need to delete the uploaded files manually. Continue?',{title:'Cancel file upload',icon:0},function(indexs){ - layer.close(index); - layer.close(indexs); + $('.upload_file_body').addClass('active').html('Please drag the file here') + that.filesList.length = 0 }); return false; }else{ - layer.close(index); + $('.upload_file_body').addClass('active').html('Please drag the file here') + that.filesList.length = 0 + return false; } }, end:function (){ @@ -330,7 +333,7 @@ var bt_file = { }else{ $('.dropUpLoadFile').append('
  • '+ (config.path + '/' + config.name).replace('//','/') +''+ config.size +''+ that.is_upload_status(config.upload) +'
  • '); } - + } }, // 上传单文件状态 @@ -339,10 +342,10 @@ var bt_file = { switch(status){ case -1: return 'Fail'+ (val != ''?','+val:'') +''; - break; + break; case 0: return 'Waiting to upload'; - break; + break; case 1: return 'Uploaded'; break; @@ -395,7 +398,7 @@ var bt_file = { $('.file_upload_info').hide().prev().show(); })); } catch (e) { - + } } $('.layui-layer-btn0').removeAttr('style data-upload').text(lan.upload.upload); @@ -431,7 +434,7 @@ var bt_file = { var that = this; that.splitEndTime = new Date().getTime() that.get_timer_speed() - + that.splitStartTime = new Date().getTime() var item = this.filesList[index],fileEnd = ''; if(item == undefined) return false; @@ -461,9 +464,9 @@ var bt_file = { if(fileEnd != data){ that.uploadedSize += data; }else{ - that.uploadedSize += parseInt(fileEnd - fileStart); + that.uploadedSize += parseInt(fileEnd - fileStart); } - + that.upload_file(data,index); }else{ if(data.status){ @@ -476,7 +479,7 @@ var bt_file = { that.errorLength ++; } } - + }, error:function(e){ if(that.filesList[index].req_error === undefined) that.filesList[index].req_error = 1 @@ -488,11 +491,11 @@ var bt_file = { } that.filesList[index].req_error += 1; that.upload_file(fileStart,index) - - + + } }); - }, + }, // 获取上传速度 get_timer_speed:function(speed){ var done_time = new Date().getTime() @@ -503,7 +506,7 @@ var bt_file = { that.timerSpeed = (that.fileSize / s_time).toFixed(2) that.updateedSizeLast = that.uploadedSize if(that.timerSpeed < 2) return; - + $('.file_upload_info .uploadSpeed').text(that.to_size(isNaN(that.timerSpeed)?0:that.timerSpeed)+'/s'); var estimateTime = that.time(parseInt(((that.uploadAllSize - that.uploadedSize) / that.timerSpeed) * 1000)) if(!isNaN(that.timerSpeed)) $('.file_upload_info .uploadEstimate').text(estimateTime.indexOf('NaN') == -1?estimateTime:'0 '+lan.bt.s); @@ -534,7 +537,7 @@ var bt_file = { } return result }, - + to_size: function (a) { var d = [" B", " KB", " MB", " GB", " TB", " PB"]; var e = 1024; @@ -547,7 +550,7 @@ var bt_file = { } } }, - init:function(){ + init:function(){ if (bt.get_cookie('rank') == undefined || bt.get_cookie('rank') == null || bt.get_cookie('rank') == 'a' || bt.get_cookie('rank') == 'b') { bt.set_cookie('rank', 'list'); } @@ -731,11 +734,15 @@ var bt_file = { // 新建文件夹或文件 $('.file_nav_view .create_file_or_dir li').on('click',function(e){ + if($(this).index() > 1){ + that.file_groud_event({open:'soft_link'}); + return false; + } var type = $(this).data('type'),nav_down_list = $('.create_file_or_dir .nav_down_list'); nav_down_list.css({'display':function(){ setTimeout(function(){nav_down_list.removeAttr('style')},100) return 'none'; - }}); + }}); if(!that.is_editor){ that.is_editor = true; // 首位创建“新建文件夹、文件” @@ -811,7 +818,7 @@ var bt_file = { $('.terminal_view').on('click',function(){ web_shell(); }); - + // 分享列表 $('.share_file_list').on('click',function(){ that.open_share_view(); @@ -827,7 +834,7 @@ var bt_file = { disk_list.css({'display':function(){ setTimeout(function(){disk_list.removeAttr('style')},100) return 'none'; - }}); + }}); that.reader_file_list({path:path,is_operating:true}); }); @@ -934,7 +941,7 @@ var bt_file = { that.calculate_table_active(); e.stopPropagation(); }); - + // 文件列表滚动条事件 $('.file_list_content').scroll(function(e){ if($(this).scrollTop() == ($(this)[0].scrollHeight - $(this)[0].clientHeight)){ @@ -961,7 +968,7 @@ var bt_file = { // 打开文件的分享、收藏状态 $('.file_table_view .file_list_content').on('click','.file_name .iconfont',function(e){ var file_tr = $(this).parents('.file_tr'),index = file_tr.data('index'),data = that.file_list[index]; - data['index'] = index + data['index'] = index if($(this).hasClass('icon-share1')){that.info_file_share(data);} if($(this).hasClass('icon-favorites')){that.cancel_file_favorites(data);} e.stopPropagation(); @@ -995,7 +1002,7 @@ var bt_file = { } } e.stopPropagation(); - e.preventDefault(); + e.preventDefault(); }); // 打开文件夹或文件 --- 文件名单击 @@ -1052,7 +1059,7 @@ var bt_file = { bt.set_cookie('showRow',val) that.reader_file_list({showRow:val,p:1,is_operating:false}); }); - + // 页码跳转 $('.filePage').on('click','div:nth-child(2) a',function(e){ var num = $(this).attr('href').match(/p=([0-9]+)$/)[1]; @@ -1073,7 +1080,7 @@ var bt_file = { // 获取目录总大小 $('.filePage').on('click','#file_all_size',function(e){ if(that.file_path === '/'){ - layer.tips('The current directory is root directory (/),calculate size will occupymassive server IO,continue?',this,{tips:[1,'red'],time:5000}); + layer.tips('The current directory is document root (/),calculate size will occupymassive server IO,continue?',this,{tips:[1,'red'],time:5000}); return false; } that.get_dir_size({path:that.file_path}); @@ -1081,7 +1088,7 @@ var bt_file = { // 文件区域【鼠标按下】 $('.file_list_content').on('mousedown',function(ev){ if( - $(ev.target).hasClass('file_checkbox') || + $(ev.target).hasClass('file_checkbox') || $(ev.target).hasClass('file_check') || $(ev.target).hasClass('icon-share1') || $(ev.target).hasClass('icon-favorites') || @@ -1105,17 +1112,17 @@ var bt_file = { con_t = container.offset().top, //选区偏移上 con_l = container.offset().left //选区偏移左 var startPos = { //初始位置 - top: ev.clientY - $(this).offset().top, - left: ev.clientX - $(this).offset().left + top: ev.clientY - $(this).offset().top, + left: ev.clientX - $(this).offset().left }; // 鼠标按下后拖动 $(document).unbind('mousemove').mousemove(function(ev){ // 鼠标按下后移动到的位置 - var endPos = { - top: ev.clientY - con_t > 0 && ev.clientY - con_t < container.height() ? ev.clientY - con_t : (ev.clientY - (con_t+container.height()) > 1 ?container.height():0), + var endPos = { + top: ev.clientY - con_t > 0 && ev.clientY - con_t < container.height() ? ev.clientY - con_t : (ev.clientY - (con_t+container.height()) > 1 ?container.height():0), left: ev.clientX - con_l > 0 && ev.clientX - con_l < container.width() ? ev.clientX - con_l : (ev.clientX - (con_l+container.width()) > 1 ?container.width():0) - }; - var fixedPoint = { // 设置定点 + }; + var fixedPoint = { // 设置定点 top: endPos.top > startPos.top ? startPos.top : endPos.top, left: endPos.left > startPos.left ? startPos.left : endPos.left }; @@ -1123,7 +1130,7 @@ var bt_file = { fixedPoint.top = fixedPoint.top + 40 } // 拖拽范围的宽高 - var w = Math.min(Math.abs(endPos.left - startPos.left), con_l + container.width() - fixedPoint.left); + var w = Math.min(Math.abs(endPos.left - startPos.left), con_l + container.width() - fixedPoint.left); var h = Math.min(Math.abs(endPos.top - startPos.top), con_t + container.height() - fixedPoint.top); // 超出选区上时 @@ -1149,14 +1156,14 @@ var bt_file = { // 设置拖拽盒子位置 that.enter_files_box().show().css({ left: fixedPoint.left+'px', - top: fixedPoint.top+'px', + top: fixedPoint.top+'px', width: w+'px', height: h+'px' }); - - var box_offset_top = that.enter_files_box().offset().top; - var box_offset_left = that.enter_files_box().offset().left; - var box_offset_w = that.enter_files_box().offset().left + that.enter_files_box().width(); + + var box_offset_top = that.enter_files_box().offset().top; + var box_offset_left = that.enter_files_box().offset().left; + var box_offset_w = that.enter_files_box().offset().left + that.enter_files_box().width(); var box_offset_h = that.enter_files_box().offset().top + that.enter_files_box().height(); $(container).find('.file_tr').each(function(i,item){ var offset_top = $(item).offset().top; @@ -1170,7 +1177,7 @@ var bt_file = { $(item).removeClass('active') } }else{// 为List模式时 - if (offset_w >= box_offset_left && offset_h >= box_offset_top && offset_top <= box_offset_h ) { + if (offset_w >= box_offset_left && offset_h >= box_offset_top && offset_top <= box_offset_h ) { $(item).addClass('active') }else{ $(item).removeClass('active') @@ -1178,13 +1185,13 @@ var bt_file = { } }); }) - + // 鼠标抬起 $(document).on('mouseup',function(){ var _move_array = []; - var box_offset_top = that.enter_files_box().offset().top; - var box_offset_left = that.enter_files_box().offset().left; - var box_offset_w = that.enter_files_box().offset().left + that.enter_files_box().width(); + var box_offset_top = that.enter_files_box().offset().top; + var box_offset_left = that.enter_files_box().offset().left; + var box_offset_w = that.enter_files_box().offset().left + that.enter_files_box().width(); var box_offset_h = that.enter_files_box().offset().top + that.enter_files_box().height(); $(container).find('.file_tr').each(function(i,item){ var offset_top = $(item).offset().top; @@ -1197,7 +1204,7 @@ var bt_file = { _move_array.push($(item).data('index')) } }else{// 为List模式时 - if (offset_w >= box_offset_left && offset_h >= box_offset_top && offset_top <= box_offset_h ) { + if (offset_w >= box_offset_left && offset_h >= box_offset_top && offset_top <= box_offset_h ) { _move_array.push($(item).data('index')) } } @@ -1217,7 +1224,7 @@ var bt_file = { $(_this).data('value',nval); },{tips:'Set ps',tips:true}); }); - // 备注回车事件 + // 备注回车事件 $('.file_list_content').on('keyup','.set_file_ps',function(ev){ if(ev.keyCode == 13){ $(this).blur(); @@ -1265,10 +1272,10 @@ var bt_file = { 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;' + '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'); @@ -1395,7 +1402,7 @@ var bt_file = { } disk_list_width = parseInt(disk_list.attr('data-width')); batch_list_width = parseInt(batch_list.attr('data-width')); - $('.file_nav_view>.nav_group').not('.mount_disk_list').each(function(){ + $('.file_nav_view>.nav_group').not('.mount_disk_list').each(function(){ _width += $(this).innerWidth(); }); _width += $('.menu-header-foot').innerWidth(); @@ -1473,13 +1480,13 @@ var bt_file = { ', success:function(){ that.render_share_list(); - + // 分享列表详情操作 $('.download_url_list').on('click','.info_down',function(){ var indexs = $(this).attr('data-index'); that.file_share_view(that.file_share_list[indexs],'list'); }); - + // 分页 $('.download_table .download_url_page').on('click','a',function(e){ var _href = $(this).attr('href').match(/p=([0-9]+)$/)[1] @@ -1530,7 +1537,7 @@ var bt_file = { /** * @description 删除选中数据 * @param {Array} arry - * @param {*} value + * @param {*} value * @return void */ remove_check_file:function(arry,key,value){ @@ -1594,7 +1601,7 @@ var bt_file = { * @description 设置样式文件 * @param {String} type 表头类型 * @param {Number} width 宽度 - * @return void + * @return void */ set_style_width: function (type, width) { var _content = bt.get_cookie('formHeader') || $('#file_list_info').html(),_html = '',_reg = new RegExp("\\.file_" + type + "\\s?\\{width\\s?\\:\\s?(\\w+)\\s\\!important;\\}","g"),_defined_config = {name:150,type:80,size:80,mtime:150,accept:80,user:80,ps:150}; @@ -1611,7 +1618,7 @@ var bt_file = { set_file_table_width:function(){ var that = this,file_header_width = $('.file_table_view')[0].offsetWidth,auto_num = 0,width = 0,auto_all_width = 0,css = '',_width = 0,tr_heigth = 45,other = '',config ={}; $.each(this.file_header,function(key,item){ - if(item == 'auto'){ + if(item == 'auto'){ auto_num ++; config[key] = 0; }else{ @@ -1699,10 +1706,10 @@ var bt_file = { reader_file_list:function (data, callback){ var that = this,select_page_num = '',next_path = '',model = bt.get_cookie('rank'),isPaste = bt.get_cookie('record_paste_type'); if(isPaste != 'null' && isPaste != undefined){//判断是否显示粘贴 - $('.file_nav_view .file_all_paste').removeClass('hide'); + $('.file_nav_view .file_all_paste').removeClass('hide'); }else{ - $('.file_nav_view .file_all_paste').addClass('hide'); - } + $('.file_nav_view .file_all_paste').addClass('hide'); + } $('.file_table_view').removeClass('.list_view,.icon_view').addClass(model == 'list'?'list_view':'icon_view'); $('.cut_view_model:nth-child('+(model == 'list'?'2':'1')+')').addClass('active').siblings().removeClass('active'); this.file_images_list = []; @@ -1828,7 +1835,7 @@ var bt_file = { }) that.calculate_table_active(); }, - /** + /** * @descripttion 渲染收藏夹列表 * @return: 无返回值 */ @@ -1843,7 +1850,7 @@ var bt_file = { }) html+='
  • Management
  • ' }else{html = '
  • (Empty)
  • '} - + $('.favorites_file_path .nav_down_list').html(html) }, /** @@ -1870,7 +1877,7 @@ var bt_file = { setTimeout(function(){                 $(layers).css('top',($(window).height() - $(layers).height()) /2);             },50) - + }, cancel:function(){ that.reader_file_list({path:that.file_path}) @@ -1966,7 +1973,7 @@ var bt_file = { '
    '+ '
    '+ ''+ item.filename+item.soft_link +''+ (item.caret?'':'') + (item.down_id != 0?'':'') + - '
    '+ + ''+ '
    '+ (item.type == 'dir'?'directory':that.ext_type_tips(item.ext)) +'
    '+ '
    ' + item.user +' / '+item.root_level + '
    '+ '
    '+ (item.type == 'dir'?'Calculate':bt.format_size(item.size)) +'
    '+ @@ -1994,7 +2001,7 @@ var bt_file = { }); $('.file_list_content').html(_html); if(callback) callback({is_dir_num:is_dir_num}) - + that.clear_table_active(); // 清除表格选中内容 }, @@ -2022,65 +2029,78 @@ var bt_file = { * @param {Object} ev 事件event对象 * @param {Object} el 事件对象DOM * @return void - */ - render_file_groud_menu: function (ev,el){ - var that = this,index = $(el).data('index'),_openTitle = 'Open',data = that.file_list[index],config_group = [['open',_openTitle],['split',''],['download','Download'],['share','Share file/directory'],['cancel_share','Cancel share'],['favorites','Favorites file/directory'],['cancel_favorites','Cancel favorites'],['split',''],['dir_kill','目录查杀'],['authority','Permission'],['split',''],['copy','Copy'],['shear','Cut'],['rename','Rename'],['del','Del'],['split',''],['compress','Compress'],['unzip','Decompress']],compression = ['zip','rar','gz','war','tgz','bz2'],offsetNum = 0; - // 文件类型判断 - switch(that.determine_file_type(data.ext)){ - case 'images': - _openTitle = 'Preview'; + */ + render_file_groud_menu: function(ev, el) { + var that = this, + index = $(el).data('index'), + _openTitle = 'Open', + data = that.file_list[index], + compression = ['zip', 'rar', 'gz', 'war', 'tgz', 'bz2'], + offsetNum = 0, + config = { + open:_openTitle, + split_0:true, + download:'Download', + share:'Share file', + cancel_share:'Cancel share', + favorites:'Favorites file', + cancel_favorites:'Cancel favorites', + split_1:true, + // dir_kill:'目录查杀', + authority:'Permission', + split_2:true, + copy:'Copy', + shear:'Cut', + rename:'Rename', + del:'Delete', + split_3:true, + compress:'Compress', + unzip:'Unzip', + open_find_dir:'Open file location', + split_4:true, + property:'Properties' + }; + // 文件类型判断 + switch (that.determine_file_type(data.ext)) { + case 'images': + _openTitle = 'Preview'; break; - case 'video': - _openTitle = 'Play'; + case 'video': + _openTitle = 'Play'; break; - default: - _openTitle = 'Edit'; + default: + _openTitle = 'Edit'; break; - } - config_group[0][1] = (data.type == 'dir'?'Open':_openTitle); - if(data.type == 'dir'){ // 判断是否为目录,目录不可下载 - config_group.splice(2,1); - offsetNum ++; - } - if(data.open_type == 'compress'){ //判断是否为压缩类型,不可编辑 - config_group.splice(0,2); - offsetNum = offsetNum + 2; - } - if(data.down_id != 0){ //判断是否分享 - config_group.splice(3-offsetNum,1); - offsetNum ++; - }else{ - config_group.splice(4-offsetNum,1); - config_group[3-offsetNum][1] = (data.type == 'dir'?'Share directory':'Share file'); - offsetNum ++; - } - if(data.caret !== false){ // 判断是否收藏 - config_group.splice((5-offsetNum),1); - offsetNum ++; - }else{ - config_group.splice((6-offsetNum),1); - config_group[5-offsetNum][1] = (data.type == 'dir'?'Favorites directory':'Favorites file'); - offsetNum ++; - } - //if(data.ext == 'php') config_group[8-offsetNum][1] = '文件查杀'; - //if(data.ext != 'php' && data.type != 'dir'){ // 判断是否为php,非php文件(排除目录)无法扫描 - config_group.splice((8-offsetNum),1); - offsetNum ++; - //} - var num = 0; - $.each(compression,function(index,item){ - if(item == data.ext) num ++; - }); - if(num == 0){ - config_group.splice((17-offsetNum),1); - offsetNum ++; - } - if(data.filename.indexOf('/') == -1 || data.type != 'dir'){ - config_group.splice((18-offsetNum),1); - offsetNum ++; - } - that.file_selection_operating = config_group; - that.reader_menu_list({el:$('.selection_right_menu'),ev:ev,data:data,list:config_group}); + } + config['open'] = (data.type == 'dir' ? 'Open' : _openTitle); + if(data.type === 'dir') delete config['download']; // 判断是否文件或文件夹,禁用下载 + if(data.open_type == 'compress') delete config['open']; // 判断是否压缩文件,禁用操作 + if(data.down_id != 0){ + delete config['share']; //已分享 + }else{ + delete config['cancel_share']; //未分享 + config['share'] = (data.type == 'dir' ? 'Share dir' : 'Share file'); + } + if (data.caret !== false) { + delete config['favorites']; // 已分享 + }else{ + delete config['cancel_favorites']; // 未分享 + config['favorites'] = (data.type == 'dir' ? 'Favorites dir' : 'Favorites file'); + } + if (data.ext == 'php') config['dir_kill'] = '文件查杀'; + if (data.ext != 'php' && data.type != 'dir') delete config['dir_kill']; + var num = 0; + $.each(compression, function(index, item) { // 判断压缩文件 + if (item == data.ext) num++; + }); + if(num == 0) delete config['unzip']; + if(!data.is_search){ + delete config['open_find_dir']; // 判断是否为搜索文件,提供打开目录操作 + }else{ + config['open_find_dir'] = (data.type == 'dir' ? 'Open dir' : 'Open file location'); + } + that.file_selection_operating = config; + that.reader_menu_list({ el: $('.selection_right_menu'), ev: ev, data: data, list: config }); }, /** @@ -2088,14 +2108,29 @@ var bt_file = { * @param {Object} ev 事件event对象 * @param {Object} el 事件对象DOM * @return void - */ - render_file_all_menu:function (ev,el) { - var that = this,config_group = [['refresh','Refresh'],['split',''],['upload','Upload'],['create','New file/directory',[['create_dir','New directory'],['create_files','New file']]],['web_shell','Terminal'],['split',''],['paste','Paste']],offsetNum = 0,isPaste = bt.get_cookie('record_paste_type'); - if( isPaste == 'null' || isPaste == undefined){ - config_group.splice(5,2); - offsetNum ++; - } - that.reader_menu_list({el:$('.selection_right_menu'),ev:ev,data:{},list:config_group}); + */ + render_file_all_menu: function(ev, el) { + var that = this, + config = { + refresh:'Refresh', + split_0:true, + upload:'Upload', + create:['New file/folder',{ + create_dir:'New folder', + create_files:'New file', + soft_link:'Softlink' + }], + web_shell:'Terminal', + split_1:true, + paste:'Paste' + }, + offsetNum = 0, + isPaste = bt.get_cookie('record_paste_type'); + if (isPaste == 'null' || isPaste == undefined) { + delete config['split_1'] + delete config['paste'] + } + that.reader_menu_list({ el: $('.selection_right_menu'), ev: ev, data: {}, list: config }); }, /** * @descripttion 文件多选时菜单 @@ -2132,74 +2167,80 @@ var bt_file = { e.preventDefault(); }); }, - + /** - * @description 渲染菜单列表 - * @param {Object} el 菜单DOM - * @param {Object} config 菜单配置列表和数据 - * @returns void - */ - reader_menu_list:function(config){ - var that = this,el = config.el.find('ul'),el_height = 0,el_width = el.width(),left = config.ev.clientX - ((this.area[0] - config.ev.clientX) < el_width?el_width:0),top =0; - el.empty(); - $.each(config.list,function(index,item){ - var $children = null,$children_list = null; - if(item[0] == 'split'){ - el.append('
  • '); - }else{ - if(Array.isArray(item[2])){ - $children = $('
      '); - $children_list = $children.find('.set_group'); - $.each(item[2],function(indexs,items) { - $children_list.append($('
    • '+ items[1] +'
    • ').on('click',{type:items[0],data:config.data},function(ev){ - that.file_groud_event($.extend(ev.data.data,{ - open:ev.data.type, - index:parseInt($(config.ev.currentTarget).data('index')), - element:config.ev.currentTarget, - type_tips:config.data.type == 'dir'?'directory':'file' - })); - config.el.removeAttr('style'); - ev.stopPropagation(); - ev.preventDefault(); - })) - }); + * @description 渲染菜单列表 + * @param {Object} el 菜单DOM + * @param {Object} config 菜单配置列表和数据 + * @returns void + */ + reader_menu_list: function(config) { + var that = this, + el = config.el.find('ul'), + el_height = 0, + el_width = el.width(), + left = config.ev.clientX - ((this.area[0] - config.ev.clientX) < el_width ? el_width : 0), + top = 0; + el.empty(); + $.each(config.list, function(key, item){ + var $children = null, + $children_list = null; + if (typeof item == "boolean") { + el.append('
    • '); + } else { + if (Array.isArray(item)) { + $children = $('
        '); + $children_list = $children.find('.set_group'); + $.each(item[1], function(keys, items) { + $children_list.append($('
      • ' + items + '
      • ').on('click', { type: keys, data: config.data }, function(ev) { + that.file_groud_event($.extend(ev.data.data, { + open: ev.data.type, + index: parseInt($(config.ev.currentTarget).data('index')), + element: config.ev.currentTarget, + type_tips: config.data.type == 'dir' ? 'folder' : 'file' + })); + config.el.removeAttr('style'); + ev.stopPropagation(); + ev.preventDefault(); + })) + }); + } + el.append($('
      • '+ item[1] +'
      • ').append($children).on('click',{type:item[0],data:config.data},function(ev){ - that.file_groud_event($.extend(ev.data.data,{ - open:ev.data.type, - index:parseInt($(config.ev.currentTarget).data('index')), - element:config.ev.currentTarget, - type_tips:config.data.type == 'dir'?'directory':'file' - })); - // 有子级拉下时不删除样式,其余删除 - if(item[0] != 'compress' && item[0] != 'create'){config.el.removeAttr('style');} - ev.stopPropagation(); - ev.preventDefault(); - })); - } - }); - el_height = el.innerHeight(); - top = config.ev.clientY - ((this.area[1] - config.ev.clientY) < el_height?el_height:0); - var element = $(config.ev.target); - if(element.hasClass('foo_menu_title') || element.parents().hasClass('foo_menu_title')){ - left = config.ev.clientX - el_width; - top = ((this.area[1] - config.ev.clientY) < el_height)?(config.ev.clientY - el_height -20):(config.ev.clientY + 15); - } - config.el.css({ - left: (left+10), - top: top - }).removeClass('left_menu right_menu').addClass(this.area[0] - (left + el_width) < 230?'left_menu':'right_menu'); + return ''; + }(key)) + '">' + (Array.isArray(item)?item[0]:item) + '').append($children).on('click', { type: key, data: config.data }, function(ev) { + that.file_groud_event($.extend(ev.data.data, { + open: ev.data.type, + index: parseInt($(config.ev.currentTarget).data('index')), + element: config.ev.currentTarget, + type_tips: config.data.type == 'dir' ? 'folder' : 'file' + })); + // 有子级拉下时不删除样式,其余删除 + if (key != 'compress' && key != 'create') { config.el.removeAttr('style'); } + ev.stopPropagation(); + ev.preventDefault(); + })); + } + }); + el_height = el.innerHeight(); + top = config.ev.clientY - ((this.area[1] - config.ev.clientY) < el_height ? el_height : 0); + var element = $(config.ev.target); + if (element.hasClass('foo_menu_title') || element.parents().hasClass('foo_menu_title')) { + left = config.ev.clientX - el_width; + top = ((this.area[1] - config.ev.clientY) < el_height) ? (config.ev.clientY - el_height - 20) : (config.ev.clientY + 15); + } + config.el.css({ + left: (left + 10), + top: top + }).removeClass('left_menu right_menu').addClass(this.area[0] - (left + el_width) < 230 ? 'left_menu' : 'right_menu'); }, /** @@ -2211,10 +2252,10 @@ var bt_file = { var config = {ai:"Adobe Illustrator format",apk:"Android package",asp:"Dynamic web file",bat:"Shell File",bin:"Bin File",bas:"BASIC File",bak:"Backup File",css:'CSS',cad:"备份文件",cxx:"C++",crt:"Certificate file",cpp:"C++ File",conf:"Configuration file",dat:"",der:"Certification file",doc:"Microsoft Office Word 97-2003",docx:"Microsoft Office Word 2007",exe:"",gif:"Graphic file",go:"Golang source files",htm:"Hypertext document",html:"Hypertext document",ico:"",java:"Java source files",access:'Database file',jsp:"HTML Page",jpe:"Graphic file",jpeg:"Graphic file",jpg:"Graphic file",log:"Log file",link:"Shortcut file",js:"Javascript source files",mdb:"Microsoft Access database",mp3:"Audio file",ape:'CloudMusic.ape',mp4:"Video",avi:'Video',mkv:'Video',rm:'Video',mov:'Video',mpeg:'Video',mpg:'Video',rmvb:'Video',webm:'Video',wma:'Video',wmv:'Video',swf:'Shockwave Flash Object',mng:"Multi-image network graphics",msi:"Windows package",png:"Graphic file",py:"Python source file",pyc:"Python Bytecode file",pdf:"pdf",ppt:"Microsoft Powerpoint 97-2003",pptx:"Microsoft Powerpoint2007",psd:"Adobe photoshop",pl:"Perl Scripting language",rar:"RAR compressed package",reg:"Registry file",sys:"System Files",sql:"Database file",sh:"Shell script file",txt:"text format",vb:"Visual Basic",xml:"",xls:"Microsoft Office Excel 97-2003",xlsx:"Microsoft Office Excel 2007",gz:"Compressed file",zip:"ZIP compressed file",z:"","7z":"7Z Compressed file",json:'JSON',php:'PHP',mht:'MHTML',bmp:'BMP',webp:'WEBP',cdr:'CDR'}; return typeof config[ext] != "undefined"?config[ext]:('Unknown file'); }, - + /** * @description 文件类型判断,或返回格式类型(不传入type) - * @param {String} ext + * @param {String} ext * @param {String} type * @return {Boolean|Object} 返回类型或类型是否支持 */ @@ -2261,104 +2302,110 @@ var bt_file = { /** * @description 右键菜单事件组 - * @param {Object} data 当前文件或文件夹右键点击的数据和数组下标,以及Dom元素 - * @return void + * @param {Object} data 当前文件或文件夹右键点击的数据和数组下标,以及Dom元素 + * @return void */ - file_groud_event:function(data){ - var that = this; - switch(data.open){ - case 'open': // 打开目录、文件编辑、预览图片、播放视频 - if(data.type == 'dir'){ - this.reader_file_list({path:data.path}); - }else{ - switch(data.open_type){ - case 'text': - openEditorView(0,data.path) - break; - case 'video': - this.open_video_play(data); - break; - case 'images': - this.open_images_preview(data); - break; - } + file_groud_event:function(data){ + var that = this; + switch(data.open){ + case 'open': // 打开目录、文件编辑、预览图片、播放视频 + if(data.type == 'dir'){ + this.reader_file_list({path:data.path}); + }else{ + switch(data.open_type){ + case 'text': + openEditorView(0,data.path) + break; + case 'video': + this.open_video_play(data); + break; + case 'images': + this.open_images_preview(data); + break; + } + } + break; + case 'download': //下载 + this.down_file_req(data); + break; + case 'share': // 添加分享文件 + this.set_file_share(data); + break; + case 'cancel_share': // 取消分享文件 + this.info_file_share(data); + break; + case 'favorites': //添加收藏夹 + this.$http('add_files_store',{path:data.path},function(res){ + if(res.status){ + that.file_list[data.index] = $.extend(that.file_list[data.index],{caret:true}); + that.reader_file_list_content(that.file_list); + that.load_favorites_index_list(); } + layer.msg(res.msg,{icon:res.status?1:2}) + }) + break; + case 'cancel_favorites': //取消收藏 + this.cancel_file_favorites(data); + break; + case 'authority': // 权限 + this.set_file_authority(data); + break; + case 'dir_kill': //目录查杀 + this.set_dir_kill(data); + break; + case 'copy': // 复制内容 + this.copy_file_or_dir(data); + break; + case 'shear': // 剪切内容 + this.cut_file_or_dir(data); + break; + case 'rename': // 重命名 + this.rename_file_or_dir(data); + break; + case'compress': + data['open'] = 'tar_gz'; + this.compress_file_or_dir(data); + break; + case 'tar_gz': // 压缩gzip文件 + case 'rar': // 压缩rar文件 + case 'zip': // 压缩zip文件 + this.compress_file_or_dir(data); + break; + case 'unzip': + case 'folad': //解压到... + this.unpack_file_to_path(data) break; - case 'download': //下载 - this.down_file_req(data); - break; - case 'share': // 添加分享文件 - this.set_file_share(data); - break; - case 'cancel_share': // 取消分享文件 - this.info_file_share(data); - break; - case 'favorites': //添加收藏夹 - this.$http('add_files_store',{path:data.path},function(res){ - if(res.status){ - that.file_list[data.index] = $.extend(that.file_list[data.index],{caret:true}); - that.reader_file_list_content(that.file_list); - that.load_favorites_index_list(); - } - layer.msg(res.msg,{icon:res.status?1:2}) - }) - break; - case 'cancel_favorites': //取消收藏 - this.cancel_file_favorites(data); - break; - case 'authority': // 权限 - this.set_file_authority(data); - break; - case 'dir_kill': //目录查杀 - this.set_dir_kill(data); - break; - case 'copy': // 复制内容 - this.copy_file_or_dir(data); - break; - case 'shear': // 剪切内容 - this.cut_file_or_dir(data); - break; - case 'rename': // 重命名 - this.rename_file_or_dir(data); - break; - case'compress': - data['open'] = 'tar_gz'; - this.compress_file_or_dir(data); - break; - case 'tar_gz': // 压缩gzip文件 - case 'rar': // 压缩rar文件 - case 'zip': // 压缩zip文件 - this.compress_file_or_dir(data); - break; - case 'unzip': - case 'folad': //解压到... - this.unpack_file_to_path(data) - break; - case 'refresh': // 刷新文件列表 - $('.file_path_refresh').click(); - break; - case 'upload': //上传文件 - this.file_drop.dialog_view(); - break; - case 'create_dir': // 新建文件目录 - $('.file_nav_view .create_file_or_dir li').eq(0).click(); - break; - case 'create_files': // 新建文件列表 - $('.file_nav_view .create_file_or_dir li').eq(1).click(); - break; - case 'del': //删除 - this.del_file_or_dir(data); - break; - case 'paste': //粘贴 - this.paste_file_or_dir(); - break; - case 'web_shell': // 终端 - web_shell() - break; - case 'open_find_dir': // 打开文件所在目录 - this.reader_file_list({path: this.retrun_prev_path(data.path)}); - break; - } + case 'refresh': // 刷新文件列表 + $('.file_path_refresh').click(); + break; + case 'upload': //上传文件 + this.file_drop.dialog_view(); + break; + case 'soft_link': //软链接创建 + this.set_soft_link(); + break; + case 'create_dir': // 新建文件目录 + $('.file_nav_view .create_file_or_dir li').eq(0).click(); + break; + case 'create_files': // 新建文件列表 + $('.file_nav_view .create_file_or_dir li').eq(1).click(); + break; + case 'del': //删除 + this.del_file_or_dir(data); + break; + case 'paste': //粘贴 + this.paste_file_or_dir(); + break; + case 'web_shell': // 终端 + web_shell() + break; + case 'open_find_dir': // 打开文件所在目录 + this.reader_file_list({path: this.retrun_prev_path(data.path)}); + break; + case 'property': + this.open_property_view(data) + break; + } }, /** * @descripttion 列表批量处理 @@ -2406,7 +2453,7 @@ var bt_file = { that.clear_table_active(); $('.nav_group.multi').addClass('hide'); $('.file_menu_tips').removeClass('hide'); - $('.file_nav_view .file_all_paste').removeClass('hide'); + $('.file_nav_view .file_all_paste').removeClass('hide'); } layer.msg(res.msg,{icon:res.status?1:2}) }); @@ -2422,14 +2469,14 @@ var bt_file = { if(this.is_recycle){ layer.confirm(lan.files.del_to_recycle_bin,{title:lan.files.del_in_bulk,closeBtn:2,icon:3},function(){ that.$http('SetBatchData',obj,function(res){ - if(res.status) that.reader_file_list({path:that.file_path}) + if(res.status) that.reader_file_list({path:that.file_path}) layer.msg(res.msg,{icon:res.status?1:2}) }); }) }else{ bt.show_confirm(lan.files.del_in_bulk,''+lan.files.recycle_bin_warning+'',function(){ that.$http('SetBatchData',obj,function(res){ - if(res.status) that.reader_file_list({path:that.file_path}) + if(res.status) that.reader_file_list({path:that.file_path}) layer.msg(res.msg,{icon:res.status?1:2}) }); }) @@ -2468,7 +2515,7 @@ var bt_file = { layer.msg(rdata.msg,{icon:rdata.status?1:2}) }) } - + }) }, /** @@ -2488,8 +2535,8 @@ var bt_file = {
        \ '+ lan.files.recycle_bin_on + '\
        \ - \ - \ + \ + \
        \ '+ lan.files.recycle_bin_on_db + '\
        \ @@ -2557,15 +2604,15 @@ var bt_file = { if (shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "..."; if (shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "..."; body += '\ - ' + shortwebname + '\ - ' + shortpath + '\ - '+ ToSize(rdata.dirs[i].size) + '\ - '+ getLocalTime(rdata.dirs[i].time) + '\ - \ - ' + lan.files.recycle_bin_re + '\ - | ' + lan.files.recycle_bin_del + '\ - \ - '; + ' + shortwebname + '\ + ' + shortpath + '\ + '+ ToSize(rdata.dirs[i].size) + '\ + '+ getLocalTime(rdata.dirs[i].time) + '\ + \ + ' + lan.files.recycle_bin_re + '\ + | ' + lan.files.recycle_bin_del + '\ + \ + '; } for (var i = 0; i < rdata.files.length; i++) { if (rdata.files[i].name.indexOf('BTDB_') != -1) { @@ -2725,12 +2772,227 @@ var bt_file = { } return false; } - + $('#RecycleBody').html(body); }) }, + + /** + * @description 回收站视图 + * @return void + */ + recycle_bin_view: function() { + var that = this; + layer.open({ + title:lan.files.recycle_bin_title, + type:1, + skin:'recycle_view', + area:['80%','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 render_recycle = that.render_recycle_list(); + $(".re-con-menu").on('click', 'p', function() { + var _type = $(this).data('type'); + $(this).addClass("on").siblings().removeClass("on"); + render_recycle.$refresh_table_list(true); + }); + } + }) + }, + /** + * @description 回收站渲染列表 + * @return void + */ + render_recycle_list: function() { + var that = this; + $('#recycle_table').empty() + var recycle_list = bt_tools.table({ + el:'#recycle_table', + url:'/files?action=Get_Recycle_bin', + height:480, + dataFilter:function(res){ + var files = []; + switch($('.re-con-menu p.on').index()){ + case 0: + for (let i = 0; i < res.dirs.length; i++){ + const item = res.dirs[i]; + files.push($.extend(item,{type:'folder'})); + } + for (let j = 0; j < res.files.length; j++){ + const item = res.files[j],ext_list = item.dname.split('.') ,ext = that.determine_file_type(ext_list[ext_list.length - 1]); + if(item.name.indexOf('BTDB_') > -1) { + item.dname = item.dname.replace('BTDB_', ''); + item.name = item.name.replace('BTDB_', ''); + files.push($.extend(item,{type:'files'})); + }else if(ext == 'images'){ + files.push($.extend(item,{type:ext})); + }else{ + files.push($.extend(item,{type:'files'})); + } + } + break; + case 1: + for (let i = 0; i < res.dirs.length; i++){ + const item = res.dirs[i]; + files.push($.extend(item,{type:'files'})); + } + break; + case 2: + for (let j = 0; j < res.files.length; j++){ + const item = res.files[j],ext_list = item.dname.split('.') ,ext = that.determine_file_type(ext_list[ext_list.length - 1]); + if(item.name.indexOf('BTDB') == -1) files.push($.extend(item,{type:ext})); + } + break; + case 3: + for (let j = 0; j < res.files.length; j++){ + const item = res.files[j],ext_list = item.dname.split('.') ,ext = that.determine_file_type(ext_list[ext_list.length - 1]); + if(ext == 'images') files.push($.extend(item,{type:ext})); + } + + break; + case 4: + for (let j = 0; j < res.files.length; j++){ + const item = res.files[j],ext_list = item.dname.split('.') ,ext = that.determine_file_type(ext_list[ext_list.length - 1]); + if(ext != 'images' && ext != 'compress' && ext != 'video' && item.name.indexOf('BTDB') == -1) files.push($.extend(item,{type:ext})); + } + break; + case 5: + for (let j = 0; j < res.files.length; j++){ + const item = res.files[j]; + if(item.name.indexOf('BTDB_') > -1){ + item.dname = item.dname.replace('BTDB_',''); + item.name = item.name.replace('BTDB_',''); + console.log() + files.push($.extend(item,{type:'files'})); + } + } + break; + } + $('#Set_Recycle_bin').attr('checked', res.status); + $('#Set_Recycle_bin_db').attr('checked', res.status_db); + return {data:files} + }, + column:[ + {type:'checkbox',class:'',width:18}, + {fid:'name',title:lan.files.recycle_bin_th1,width:155,template:function(row){ + return '
        '+ row.name +'
        '; + }}, + {fid:'dname',title:lan.files.recycle_bin_th2,template:function(row){ + return ''+ row.dname +''; + }}, + {fid:'size',title:lan.files.recycle_bin_th3,width:85,template:function(row){ + return ''+ bt.format_size(row.size) +''; + }}, + {fid:'time',title:lan.files.recycle_bin_th4,width:180,template:function(row, index){ + return ''+ bt.format_data(row.time) + '' + }}, + {type:'group',align:'right',width:250,title:lan.files.recycle_bin_th5,group:[{ + title:lan.files.recycle_bin_re, + event:function(row, index, ev, key, that){ + bt_file.ReRecycleBin(row.rname,function(){ + that.$delete_table_row(index); + }); + } + },{ + title:lan.files.recycle_bin_del, + event:function(row, index, ev, key, that){ + bt_file.DelRecycleBin(row.rname,function(){ + that.$delete_table_row(index); + }); + } + }]} + ], + tootls: [{ // 批量操作 + type: 'batch',//batch_btn + positon: ['left', 'bottom'], + placeholder: 'Please Choose', + buttonValue: 'Execute', + disabledSelectValue: 'Please select the port that needs batch operation!', + selectList:[{ + title:"Restore", + url:'/files?action=Re_Recycle_bin', + load:true, + param:function(row){ + return {path:row.rname}; + }, + callback:function(that){ + bt.confirm({title:'Restore files',msg:'Batch restore selected files, do you want to continue?',icon:0},function(index){ + layer.close(index); + that.start_batch({},function(list){ + var html = ''; + for(var i=0;i
        '+ (item.request.status?'Successful recovery':'Recovery failed') +'
        '; + } + recycle_list.$batch_success_table({title:'Restore files',th:'File name',html:html}); + recycle_list.$refresh_table_list(true); + }); + }); + } + },{ + title:"Delete files permanently", + url:'/files?action=Del_Recycle_bin', + load:true, + param:function(row){ + return {path:row.rname}; + }, + callback:function(that){ + bt.confirm({title:'Delete selected files',msg:'Delete the selected file. The file will be completely deleted and cannot be recovered. Do you want to continue?',icon:0},function(index){ + layer.close(index); + that.start_batch({},function(list){ + var html = ''; + for(var i=0;i
        '+ (item.request.status?'Successfully deleted':'Failed to delete') +'
        '; + } + recycle_list.$batch_success_table({title:'Delete multiple files',th:'File name',html:html}); + recycle_list.$refresh_table_list(true); + }); + }); + } + }] + }] + }); + bt_tools.$fixed_table_thead('#recycle_table .divtable'); + return recycle_list; + }, // 回收站开关 Set_Recycle_bin:function(db) { var loadT = layer.msg(lan.public.the, { icon: 16, time: 0, shade: [0.3, '#000'] }); @@ -2770,17 +3032,167 @@ var bt_file = { }, //清空回收站 CloseRecycleBin:function(){ - layer.confirm(lan.files.recycle_bin_close_msg, { title: lan.files.recycle_bin_close, closeBtn: 2, icon: 3 }, function () { - var loadT = 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 (rdata) { - layer.close(loadT); - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 }); - $("#RecycleBody").html(''); - }); + var _this = this; + layer.confirm(lan.files.recycle_bin_close_msg, { title: lan.files.recycle_bin_close, closeBtn: 2, icon: 3 }, function () { + var loadT = 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 (rdata) { + layer.close(loadT); + layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 }); + _this.render_recycle_list() }); + }); + }, + /** + * @description 打开属性视图 + * @param {Object} data 当前文件的数据对象 + * @return void + */ + open_property_view:function (data) { + console.log(data) + var _this = this; + _this.$http('get_file_attribute',{filename:data.path},function (res) { + layer.open({ + type: 1, + closeBtn: 2, + title: '[ ' + data.filename +' ] - '+ (data.is_dir?'Folder':'File') +' properties', + area: ["580px", "500px"], + shadeClose: false, + // btn:['确认','取消'], + content:'
        \ +
        \ + General\ + Detail\ + History\ +
        \ +
        \ +
        \ +
        \ +
        \ +
        \ +
        \ +
        \ +
        \ +
        Type:
        \ +
        '+ ((res.is_dir || res.is_link)?res.st_type:_this.ext_type_tips(res.st_type)) +'
        \ +
        \ +
        \ +
        Location:
        \ +
        '+ res.path +'
        \ +
        \ +
        \ +
        Size:
        \ +
        '+ bt.format_size(res.st_size) +' ('+(_this.font_thousandth(res.st_size) + ' byte')+')'+'
        \ +
        \ +
        \ +
        \ +
        Permissions:
        \ +
        '+ res.mode +'
        \ +
        \ +
        \ +
        Group:
        \ +
        '+ res.group +'
        \ +
        \ +
        \ +
        User:
        \ +
        '+ res.user +'
        \ +
        \ +
        \ +
        \ +
        Visit time:
        \ +
        '+ bt.format_data(res.st_atime) +'
        \ +
        \ +
        \ +
        Modified time:
        \ +
        '+ bt.format_data(res.st_mtime) +'
        \ +
        \ +
        \ +
        \ + \ + \ + \ +
        Properties
        Value
        \ +
        \ +
        \ + \ + \ + \ +
        Modified time
        Size
        MD5
        OPT
        \ +
        \ +
        \ +
        ', + success:function(layero,index){ + $('.bt-property-setting .tab-nav span').click(function () { + var index = $(this).index(); + $(this).addClass('on').siblings().removeClass('on'); + $('.property-box:eq('+index +')').addClass('active').siblings().removeClass('active'); + }) + $('.history_box_view').on('click','.open_history_file',function(){ + var _history = $(this).attr('data-time'); + openEditorView(0,data.path) + setTimeout(function () { + aceEditor.openHistoryEditorView({filename:data.path,history:_history},function(){ + layer.close(index) + $('.ace_conter_tips').show(); + $('.ace_conter_tips .tips').html('Read-only file, the file is '+ _item.path +', historic version [ '+ bt.format_data(new Number(_history)) +' ]Click to restore'); + }); + },500) + }); + $('.history_box_view').on('click','.recovery_file_historys',function(){ + aceEditor.event_ecovery_file(this); + }); + var config = { + filename:['Name',data.filename], + type:['Type',(res.is_dir || res.is_link)?res.st_type:_this.ext_type_tips(res.st_type)], + path:'Location', + st_size:['Size',bt.format_size(res.st_size) +' ('+(_this.font_thousandth(res.st_size) + ' byte')+')'], + st_atime:['Visit time',bt.format_data(res.st_atime)],st_mtime:['Modified time',bt.format_data(res.st_mtime)],st_ctime:['Metadata modification time',bt.format_data(res.st_ctime)], + md5:'MD5',sha1:'sha1', + user:'User',group:'Group',mode:'Permissions', + st_uid:'UID',st_gid:'GID', + st_nlink:'Num of inode links',st_ino:'inode node num',st_mode:'inode protection mode',st_dev:'inode resident device', + },html = '',html2= ''; + for (var key in config) { + if (Object.hasOwnProperty.call(config, key)) { + var element = config[key],value = ($.isArray(element)?element[1]:res[key]); + html += '
        '+ ($.isArray(element)?element[0]:element) +'
        '+ value +'
        '; + } + } + for (let i = 0; i < res.history.length; i++) { + const item = res.history[i]; + html2 += '
        '+ bt.format_data(item.st_mtime) +'
        '+ bt.format_size(item.st_size) +'
        '+ item.md5 +'
        view  |  restore
        ' + } + if(html2 === '') html2 += '
        No historical version
        ' + $('.details_list').html(html); + $('.history_list ').html(html2); + _this.fixed_table_thead('.details_box_view'); + _this.fixed_table_thead('.history_box_view '); + } + }) + }) + }, + /** + * @description 固定表头 + * @param {string} el DOM选择器 + * @return void + */ + fixed_table_thead:function(el) { + $(el).scroll(function () { + var scrollTop = this.scrollTop; + this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)'; + }) + }, + /** + * @description 字符千分隔符 + * @param {string} el DOM选择器 + * @return void + */ + font_thousandth:function(num) { + var source = String(num).split(".");//按小数点分成2部分 + source[0] = source[0].replace(new RegExp('(\\d)(?=(\\d{3})+$)','ig'),"$1,");//只将整数部分进行都好分割 + return source.join(".");//再将小数部分合并进来 }, /** * @description 打开图片预览 @@ -3045,14 +3457,14 @@ var bt_file = { }, /** * @description 切换播放 - * @param {String} obj + * @param {String} obj * @param {String} filename 文件名 * @return void */ play_file:function(obj,filename) { if($('#btvideo video').attr('data-filename')== filename) return false; var imgUrl = '/download?filename=' + filename + '&play=true'; - var v = '' + var v = '' $("#btvideo").html(v); var p_tmp = filename.split('/') $(".btvideo-title").html(p_tmp[p_tmp.length-1]); @@ -3070,7 +3482,7 @@ var bt_file = { $('.file_all_paste').removeClass('hide'); layer.msg('Copy successfully. Please click [Paste] or Ctrl + V to paste'); }, - + /** * @description 剪切文件和目录 * @param {Object} data 当前文件的数据对象 @@ -3346,7 +3758,7 @@ var bt_file = { }); }) } - + }, /** @@ -3368,7 +3780,64 @@ var bt_file = { }) }); }, - + /** + * @description 创建软链接 + * @param {Object} data 当前文件的数据对象 + */ + set_soft_link:function(data){ + var that = this; + bt_tools.open({ + title:'Create Softlink', + area:'520px', + content:{ + class:'pd20', + formLabelWidth:'110px', + form:[{ + label:'Source file', + group:{ + type:'text', + name:'sfile', + width:'280px', + placeholder:'Please select the folder and file to be linked', + icon:{type:'glyphicon-folder-open',event:function(ev){},select:'all'}, + value:'', + input:function(ev){} + } + },{ + label: "Softlink name", + group: { + type: "text", + name: "name", + width: "280px", + placeholder: "Please enter the name of the softlink", + value: "" + } + }] + }, + init: function() { + var e = null, t = setInterval(function() { + if ($('input[name="sfile"]').length < 1 && clearInterval(t),e != $('input[name="sfile"]').val()){ + e = $('input[name="sfile"]').val(); + var i = e.split("/"); + i.length > 1 && $('[name="name"]').val(i[i.length - 1]) + } + }, 100) + }, + yes:function(e, i, a){ + e = $.extend(e, {dfile: that.file_path + "/" + e.name}), + delete e.name, + bt_tools.send("files/CreateLink", e, function(e) { + e.status && (layer.close(i), + bt.msg(e), + that.reader_file_list()) + }, { + tips: "Create Softlink" + }) + } + }); + }, + + /** * @description 设置文件权限 - ok * @param {Object} data 当前文件的数据对象 @@ -3782,7 +4251,7 @@ var bt_file = { get_present_task_view:function(){ this.file_present_task = layer.open({ type: 1, - title: "实时任务队列", + title: "Real-time task queue", area: '500px', closeBtn: 2, skin:'present_task_list', diff --git a/BTPanel/static/js/files.min.js b/BTPanel/static/js/files.min.js index 46405c0b..879c390a 100644 --- a/BTPanel/static/js/files.min.js +++ b/BTPanel/static/js/files.min.js @@ -1 +1,5 @@ -var bt_file={area:[],loadT:null,loadY:null,vscode:null,file_table_arry:[],timerM:null,is_update_down_list:!0,is_recycle:!1,is_editor:!1,file_header:{file_checkbox:40,file_name:"auto",file_accept:130,file_size:90,file_mtime:155,file_ps:"auto",file_operation:350,file_tr:0,file_list_header:0},file_operating:[],file_pointer:-1,file_path:"C:/",file_page_num:bt.get_storage("local","showRow")||100,file_list:[],file_store_list:[],file_store_current:0,file_images_list:[],file_drop:null,file_present_task:null,file_selection_operating:[],file_share_list:[],scroll_width:function(){var noScroll,scroll,oDiv=document.createElement("DIV");return oDiv.style.cssText="position:absolute; top:-1000px; width:100px; height:100px; overflow:hidden;",noScroll=document.body.appendChild(oDiv).clientWidth,oDiv.style.overflowY="scroll",scroll=oDiv.clientWidth,document.body.removeChild(oDiv),noScroll-scroll}(),is_mobile:function(){return!(!navigator.userAgent.match(/mobile/i)&&!/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent))&&(layer.msg(navigator.userAgent.match(/mobile/i),{icon:2,time:0}),!0)},method_list:{GetFileBody:lan.public.get_file_contents,DeleteDir:lan.public.deleting,DeleteFile:lan.public.deleting,GetDiskInfo:["system",lan.public.getting_disk_list],CheckExistsFiles:lan.files.check_same_name_file,GetFileAccess:lan.files.getting_permission_list,SetFileAccess:lan.public.config,DelFileAccess:lan.files.deleting_user,get_path_size:lan.files.getting_dir_size,add_files_store_types:lan.files.create_favorite,get_files_store:lan.files.getting_favorite,del_files_store:lan.files.unfavorite,dir_webshell_check:"目录查杀",file_webshell_check:"查杀文件",get_download_url_list:lan.files.getting_share_list,get_download_url_find:lan.files.getting_s_share_info,create_download_url:lan.files.create_share,remove_download_url:lan.files.cancel_share,add_files_store:lan.files.adding_favorite,CopyFile:lan.files.copy_the,MvFile:lan.files.mv_the,SetBatchData:lan.files.performing_bulk_opt,Get_Recycle_bin:lan.files.getting_recycle_list,get_path_premissions:lan.files.getting_permission_list,back_path_permissions:lan.files.setting_permission_list,get_all_back:lan.files.getting_permission_list,fix_permissions:lan.files.fix_permission,del_path_premissions:lan.files.deleting_permission},file_drop:{f_path:null,startTime:0,endTime:0,uploadLength:0,splitSize:2097152,splitEndTime:0,splitStartTime:0,fileSize:0,speedLastTime:0,filesList:[],errorLength:0,isUpload:!0,uploadSuspend:[],isUploadNumber:800,uploadAllSize:0,uploadedSize:0,updateedSizeLast:0,topUploadedSize:0,uploadExpectTime:0,initTimer:0,speedInterval:null,timerSpeed:0,isLayuiDrop:!1,uploading:!1,is_webkit:navigator.userAgent.indexOf("WebKit")>-1,init:function(){0==$("#mask_layer").length&&(window.UploadFiles=function(){bt_file.file_drop.dialog_view()},$("body").append($('")),this.event_relation(document.querySelector("#container"),document,document.querySelector("#mask_layer")))},event_relation:function(enter,leave,drop){var that=this,obj=Object.keys(arguments);for(var item in arguments)"object"==typeof arguments[item]&&void 0!==arguments[item].nodeType&&(arguments[item]={el:arguments[item],callback:null});leave.el.addEventListener("dragleave",null!=leave.callback?leave.callback:function(e){0==e.x&&0==e.y&&$("#mask_layer").hide(),e.preventDefault()},!1),enter.el.addEventListener("dragenter",null!=enter.callback?enter.callback:function(e){if("string"==e.dataTransfer.items[0].kind)return!1;$("#mask_layer").show(),that.isLayuiDrop=!1,e.preventDefault()},!1),drop.el.addEventListener("dragover",(function(e){e.preventDefault()}),!1),drop.el.addEventListener("drop",null!=enter.callback?drop.callback:that.ev_drop,!1)},ev_drop:function(e){if("string"==e.dataTransfer.items[0].kind)return!1;if(!bt_file.file_drop.is_webkit)return $("#mask_layer").hide(),!1;if(e.preventDefault(),bt_file.file_drop.uploading)return layer.msg("Uploading files, please wait..."),!1;var items=e.dataTransfer.items,time,num=0;if(loadT=layer.msg("Getting upload files details, please wait...",{icon:16,time:0,shade:.3}),bt_file.file_drop.isUpload=!0,items&&items.length&&null!=items[0].webkitGetAsEntry&&"file"!=items[0].kind)return!1;null==bt_file.file_drop.filesList&&(bt_file.file_drop.filesList=[]);for(var i=bt_file.file_drop.filesList.length-1;i>=0;i--)bt_file.file_drop.filesList[i].is_upload&&bt_file.file_drop.filesList.splice(-i,1);function update_sync(s){s.getFilesAndDirectories().then((function(subFilesAndDirs){return iterateFilesAndDirs(subFilesAndDirs,s.path)}))}$("#mask_layer").hide();var iterateFilesAndDirs=function(filesAndDirs,path){if(!bt_file.file_drop.isUpload)return!1;for(var i=0;ibt_file.file_drop.isUploadNumber)return bt_file.file_drop.isUpload=!1,layer.msg(" "+bt_file.file_drop.isUploadNumber+" items cannot upload, please compress first!。",{icon:2,area:"405px"}),bt_file.file_drop.filesList=[],clearTimeout(time),!1;bt_file.file_drop.filesList.push({file:filesAndDirs[i],path:bt.get_file_path(path+"/"+filesAndDirs[i].name).replace("//","/"),name:filesAndDirs[i].name.replace("//","/"),icon:bt_file.get_ext_name(filesAndDirs[i].name),size:bt_file.file_drop.to_size(filesAndDirs[i].size),upload:0,is_upload:!1}),bt_file.file_drop.uploadAllSize+=filesAndDirs[i].size,clearTimeout(time),time=setTimeout((function(){layer.close(loadT),bt_file.file_drop.dialog_view()}),100),num++}};"getFilesAndDirectories"in e.dataTransfer&&e.dataTransfer.getFilesAndDirectories().then((function(filesAndDirs){return iterateFilesAndDirs(filesAndDirs,"/")}))},dialog_view:function(config){var that=this,html="";if(this.f_path=bt_file.file_path,!$(".file_dir_uploads").length>0){null==that.filesList&&(that.filesList=[]);for(var i=0;i'+(item.path+"/"+item.name).replace("//","/")+''+item.size+''+that.is_upload_status(item.upload)+'
        '}var is_show=that.filesList.length>11;layer.open({type:1,closeBtn:1,maxmin:!0,area:["550px","505px"],btn:["Upload","Cancel"],title:"Upload files to【"+bt.get_cookie("Path")+"】--- Support breakpoint renewal",skin:"file_dir_uploads",content:'
        '+(""!=html?'
        • File nameFile sizeFile status
          '+html+"
        ":"Please drag the file here"+(that.is_webkit?"":'The current browser does not support drag upload. Commend to use Chrome browser or WebKit kernel for browsing')+"")+"
        ",success:function(){$("#mask_layer").hide(),$(".file_dir_uploads .layui-layer-max").hide(),$(".upload_btn_groud .upload_file_btn").click((function(){$(".upload_btn_groud .dropdown-menu [data-type=file]").click()})),$(".upload_btn_groud .dropdown-menu a").click((function(){var type=$(this).attr("data-type");$('").change((function(e){for(var files=e.target.files,arry=[],i=0;i
      • File nameFile sizeFile status
        • ').removeClass("active"),Array.isArray(config)){for(var i=0;i'+(item.path+"/"+item.name).replace("//","/")+''+item.size+''+that.is_upload_status(item.upload)+'
          '}$(".dropUpLoadFile").append(html)}else $(".dropUpLoadFile").append('
        • '+(config.path+"/"+config.name).replace("//","/")+''+config.size+''+that.is_upload_status(config.upload)+'
        • ')}},is_upload_status:function(status,val){switch(void 0===val&&(val=""),status){case-1:return'Fail'+(""!=val?","+val:"")+"";case 0:return'Waiting to upload';case 1:return'Uploaded';case 2:return'Uploading '+val+"";case 3:return'Stoped'}},set_upload_view:function(index,config){var item=$(".dropUpLoadFile li:eq("+index+")"),that=this,file_info=$(".file_upload_info");0==$(".file_upload_info .uploadProgress").length&&$(".file_upload_info").html('Total process ,Uploading ,Fail Speed Getting,Expect time Getting'),file_info.show().prev().hide().parent().css("paddingRight",0),this.errorLength>0&&file_info.find(".uploadError").text("("+this.errorLength+"份)").parent().show(),file_info.find(".uploadNumber").html("("+this.uploadLength+"/"+this.filesList.length+")"),file_info.find(".uploadProgress").html((this.uploadedSize/this.uploadAllSize*100).toFixed(2)+"%"),1===config.upload||-1===config.upload?(this.filesList[index].is_upload=!0,this.uploadLength+=1,item.find(".fileLoading").css({width:"100%",opacity:".5",background:-1==config.upload?"#ffadad":"#20a53a21"}),item.find(".filesize").text(config.size),item.find(".fileStatus").html(this.is_upload_status(config.upload,1===config.upload?"(Time:"+this.diff_time(this.startTime,this.endTime)+")":config.errorMsg)),item.find(".fileLoading").fadeOut(500,(function(){$(this).remove();var uploadHeight=$(".dropUpLoadFile");if(0==uploadHeight.length)return!1;uploadHeight[0].scrollHeight>uploadHeight.height()&&uploadHeight.scrollTop(uploadHeight.scrollTop()+40)}))):(item.find(".fileLoading").css("width",config.percent),item.find(".filesize").text(config.upload_size+"/"+config.size),item.find(".fileStatus").html(this.is_upload_status(config.upload,"("+config.percent+")")))},clear_drop_stauts:function(status){var time=new Date,that=this;if(!status)try{var s_peed=bt_file.file_drop.to_size(bt_file.file_drop.uploadedSize/((time.getTime()-bt_file.file_drop.initTimer.getTime())/1e3));$(".file_upload_info").html(""+this.uploadLength+" uploaded,"+(this.errorLength>0?this.errorLength+"failures, ":"")+"time"+this.diff_time(this.initTimer,time)+",speed "+s_peed+"/s").append($('').click((function(){$(".file_upload_info").hide().prev().show()})))}catch(e){}$(".layui-layer-btn0").removeAttr("style data-upload").text(lan.upload.upload),$.extend(bt_file.file_drop,{startTime:0,endTime:0,uploadLength:0,splitSize:2097152,filesList:[],errorLength:0,isUpload:!1,isUploadNumber:800,uploadAllSize:0,uploadedSize:0,topUploadedSize:0,uploadExpectTime:0,initTimer:0,speedInterval:null,timerSpeed:0,uploading:!1}),clearInterval(this.speedInterval)},upload_file:function(fileStart,index){if(null==fileStart&&0==this.uploadSuspend.length&&(fileStart=0,index=0),this.filesList.length===index)return clearInterval(this.speedInterval),this.clear_drop_stauts(),bt_file.reader_file_list({path:bt_file.file_path,is_operating:!1}),!1;var that=this;that.splitEndTime=(new Date).getTime(),that.get_timer_speed(),that.splitStartTime=(new Date).getTime();var item=this.filesList[index],fileEnd="";if(null==item)return!1;fileEnd=Math.min(item.file.size,fileStart+this.splitSize),that.fileSize=fileEnd-fileStart,form=new FormData,0==fileStart&&(that.startTime=new Date,item=$.extend(item,{percent:"0%",upload:2,upload_size:"0B"})),form.append("f_path",this.f_path+item.path),form.append("f_name",item.name),form.append("f_size",item.file.size),form.append("f_start",fileStart),form.append("blob",item.file.slice(fileStart,fileEnd)),that.set_upload_view(index,item),$.ajax({url:"/files?action=upload",type:"POST",data:form,async:!0,processData:!1,contentType:!1,success:function(data){"number"==typeof data?(that.set_upload_view(index,$.extend(item,{percent:(data/item.file.size*100).toFixed(2)+"%",upload:2,upload_size:that.to_size(data)})),that.uploadedSize+=fileEnd!=data?data:parseInt(fileEnd-fileStart),that.upload_file(data,index)):data.status?(that.endTime=new Date,that.uploadedSize+=parseInt(fileEnd-fileStart),that.set_upload_view(index,$.extend(item,{upload:1,upload_size:item.size})),that.upload_file(0,index+=1)):(that.set_upload_view(index,$.extend(item,{upload:-1,errorMsg:data.msg})),that.errorLength++)},error:function(e){if(void 0===that.filesList[index].req_error&&(that.filesList[index].req_error=1),that.filesList[index].req_error>2)return that.set_upload_view(index,$.extend(that.filesList[index],{upload:-1,errorMsg:"error"==e.statusText?lan.public.network_err:e.statusText})),that.errorLength++,that.upload_file(fileStart,index+=1),!1;that.filesList[index].req_error+=1,that.upload_file(fileStart,index)}})},get_timer_speed:function(speed){var done_time=(new Date).getTime();if(done_time-this.speedLastTime>1e3){var that=this,num=0;null==speed&&(speed=200);var s_time=(this.splitEndTime-this.splitStartTime)/1e3;if(this.timerSpeed=(this.fileSize/s_time).toFixed(2),this.updateedSizeLast=this.uploadedSize,this.timerSpeed<2)return;$(".file_upload_info .uploadSpeed").text(this.to_size(isNaN(this.timerSpeed)?0:this.timerSpeed)+"/s");var estimateTime=this.time(parseInt((this.uploadAllSize-this.uploadedSize)/this.timerSpeed*1e3));isNaN(this.timerSpeed)||$(".file_upload_info .uploadEstimate").text(-1==estimateTime.indexOf("NaN")?estimateTime:"0 "+lan.bt.s),this.speedLastTime=done_time}},time:function(date){var hours=Math.floor(date/36e5),minutes=Math.floor(date/6e4),seconds=parseInt(date%6e4/1e3),result=seconds+"sec";return minutes>0&&(result=minutes+"min"+seconds+"sec"),hours>0&&(result=hours+"hour"+Math.floor((date-36e5*hours)/6e4)+"min"),result},diff_time:function(start_date,end_date){var diff=end_date.getTime()-start_date.getTime(),minutes=Math.floor(diff/6e4),leave3,seconds=diff%6e4/1e3,result=seconds.toFixed(minutes>0?0:2)+lan.bt.s;return minutes>0&&(result=minutes+"min"+seconds.toFixed(0)+lan.bt.s),result},to_size:function(a){for(var d=[" B"," KB"," MB"," GB"," TB"," PB"],e=1024,b=0;b
          '+("icon"==bt.get_cookie("rank")?'":'')+"
          "),$(("icon"==bt.get_cookie("rank")?"textarea":"input")+"[name=createArea]").on("input",(function(){"icon"==bt.get_cookie("rank")&&(this.style.height="auto",this.style.height=this.scrollHeight+"px")})).keyup((function(e){13==e.keyCode&&$(this).blur()})).blur((function(e){var _val=$(this).val().replace(/[\r\n]/g,"");if(that.match_unqualified_string(_val))return layer.msg('Name cannot contain /\\:*?"<>| symbol',{icon:2});""==_val&&(_val="newBlankDir"==type?"New directory":"New blank file"),setTimeout((function(){that.create_file_req({type:"newBlankDir"==type?"folder":"file",path:that.file_path+"/"+_val},(function(res){res.status&&that.reader_file_list({path:that.file_path}),layer.msg(res.msg,{icon:res.status?1:2})})),$(".createModel").remove(),that.is_editor=!1}),300),e.preventDefault()})).focus(),e.stopPropagation(),e.preventDefault()})),$(".file_nav_view .favorites_file_path ul").on("click","li",(function(e){var _href=$(this).data("path"),_type=$(this).data("type"),nav_down_list=$(".favorites_file_path .nav_down_list");if("dir"==_type)that.reader_file_list({path:_href,is_operating:!0});else{if(null!=$(this).data("null"))return!1;var _file=$(this).attr("title").split("."),_fileT=_file[_file.length-1],_fileE;switch(that.determine_file_type(_fileT)){case"text":openEditorView(0,_href);break;case"video":that.open_video_play(_href);break;case"images":that.open_images_preview({filename:$(this).attr("title"),path:_href});break;default:that.reader_file_list({path:that.retrun_prev_path(_href),is_operating:!0})}}nav_down_list.css({display:function(){return setTimeout((function(){nav_down_list.removeAttr("style")}),100),"none"}}),e.stopPropagation(),e.preventDefault()})),$(".terminal_view").on("click",(function(){web_shell()})),$(".share_file_list").on("click",(function(){that.open_share_view()})),$(".mount_disk_list").on("click",".nav_btn",(function(){var path=$(this).data("menu");that.reader_file_list({path:path,is_operating:!0})})),$(".mount_disk_list").on("click",".nav_down_list li",(function(){var path=$(this).data("disk"),disk_list=$(".mount_disk_list.thezoom .nav_down_list");disk_list.css({display:function(){return setTimeout((function(){disk_list.removeAttr("style")}),100),"none"}}),that.reader_file_list({path:path,is_operating:!0})})),$(".file_nav_view").on("click",".manage_backup",(function(ev){that.manage_backup(),ev.stopPropagation(),ev.preventDefault()})),$(".file_nav_view").on("click",".recycle_bin",(function(ev){that.recycle_bin_view(),ev.stopPropagation(),ev.preventDefault()})),$(".file_nav_view .multi").on("click",".nav_btn_group",(function(ev){var batch_type=$(this).data("type");void 0!==batch_type&&that.batch_file_manage(batch_type),ev.stopPropagation(),ev.preventDefault()})),$(".file_nav_view .multi").on("click",".nav_btn_group li",(function(ev){var batch_type=$(this).data("type");that.batch_file_manage(batch_type),ev.stopPropagation(),ev.preventDefault()})),$(".file_nav_view").on("click",".file_all_paste",(function(){that.paste_file_or_dir()})),$(".file_list_header").on("click",".file_name,.file_size,.file_mtime,.file_accept,.file_user",(function(e){var _tid=$(this).attr("data-tid"),_reverse=$(this).find(".icon_sort").hasClass("active"),_active=$(this).hasClass("active");return!$(this).find(".icon_sort").hasClass("active")&&$(this).hasClass("active")?$(this).find(".icon_sort").addClass("active"):$(this).find(".icon_sort").removeClass("active"),$(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty(),$(this).find(".icon_sort").html(''),_active||(_reverse=!0),bt.set_cookie("files_sort",_tid),bt.set_cookie("name_reverse",_reverse?"True":"False"),that.reader_file_list({reverse:_reverse?"True":"False",sort:_tid}),!1})),$(".file_list_header .file_th").each((function(index,item){var files_sort=bt.get_cookie("files_sort"),name_reverse=bt.get_cookie("name_reverse");$(this).attr("data-tid")===files_sort&&($(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty(),$(this).find(".icon_sort").html(''),"False"===name_reverse&&$(this).find(".icon_sort").addClass("active"))})),$(".file_list_header .file_check").on("click",(function(e){var checkbox;switch(parseInt($(this).data("checkbox"))){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"),that.file_table_arry=that.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"),that.file_table_arry=that.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"),that.file_table_arry=[]}that.calculate_table_active()})),$(".file_list_content").on("click",".file_checkbox",(function(e){var _tr=$(this).parents(".file_tr"),index=_tr.data("index"),filename=_tr.data("filename");_tr.hasClass("active")?(_tr.removeClass("active"),that.remove_check_file(that.file_table_arry,"filename",filename)):(_tr.addClass("active"),_tr.attr("data-filename",that.file_list[index].filename),that.file_table_arry.push(that.file_list[index])),that.calculate_table_active(),e.stopPropagation()})),$(".file_list_content").scroll((function(e){$(this).scrollTop()==$(this)[0].scrollHeight-$(this)[0].clientHeight?($(this).prev().css("opacity",1),$(this).next().css("opacity",0)):$(this).scrollTop()>0?$(this).prev().css("opacity",1):0==$(this).scrollTop()&&($(this).prev().css("opacity",0),$(this).next().css("opacity",1))})),$(".file_table_view .file_list_content").on("click",".file_tr",(function(e){if($(e.target).hasClass("foo_menu_title")||$(e.target).parents().hasClass("foo_menu_title"))return!0;$(this).addClass("active").siblings().removeClass("active"),that.file_table_arry=[that.file_list[$(this).data("index")]],that.calculate_table_active(),e.stopPropagation(),e.preventDefault()})),$(".file_table_view .file_list_content").on("click",".file_name .iconfont",(function(e){var file_tr,index=$(this).parents(".file_tr").data("index"),data=that.file_list[index];data.index=index,$(this).hasClass("icon-share1")&&that.info_file_share(data),$(this).hasClass("icon-favorites")&&that.cancel_file_favorites(data),e.stopPropagation()})),$(".file_table_view .file_list_content").on("dblclick",".file_tr",(function(e){var index=$(this).data("index"),data=that.file_list[index];if($(e.target).hasClass("file_check")||$(e.target).parents(".foo_menu").length>0||$(e.target).hasClass("set_file_ps")||that.is_editor)return!1;if("dir"==data.type){if("Recycle_bin"==data.filename)return that.recycle_bin_view();that.reader_file_list({path:that.file_path+"/"+data.filename,is_operating:!0})}else switch(data.open_type){case"text":openEditorView(0,data.path);break;case"video":that.open_video_play(data);break;case"images":that.open_images_preview(data);break;case"compress":that.unpack_file_to_path(data)}e.stopPropagation(),e.preventDefault()})),$(".file_table_view .file_list_content").on("click",".file_title i,.file_ico_type .file_icon",(function(e){var file_tr,index=$(this).parents(".file_tr").data("index"),data=that.file_list[index];if("dir"==data.type){if("Recycle_bin"==data.filename)return that.recycle_bin_view();that.reader_file_list({path:that.file_path+"/"+data.filename,is_operating:!0})}else layer.msg("compress"==data.open_type?"Double click to unzip the file":"Double click to edit the file");e.stopPropagation(),e.preventDefault()})),$(".file_list_content").on("contextmenu",(function(ev){return"createArea"==$(ev.target).attr("name")||"rename_file_input"==$(ev.target).attr("name")})),$(".selection_right_menu").on("contextmenu",(function(ev){return!1})),$(".file_list_content").on("mousedown",".file_tr",(function(ev){if(1===ev.which&&($(ev.target).hasClass("foo_menu_title")||$(ev.target).parents().hasClass("foo_menu_title")))that.render_file_groud_menu(ev,this),$(ev.target).parent().addClass("foo_menu_click"),$(this).siblings().find(".foo_menu").removeClass("foo_menu_click"),$(this).addClass("active").siblings().removeClass("active");else{if(3!==ev.which||that.is_editor)return!0;that.file_table_arry.length>1?that.render_files_multi_menu(ev):(that.render_file_groud_menu(ev,this),$(".content_right_menu").removeAttr("style"),$(this).addClass("active").siblings().removeClass("active"))}ev.stopPropagation(),ev.preventDefault()})),$(".filePage").on("change",".showRow",(function(){var val=$(this).val();bt.set_cookie("showRow",val),that.reader_file_list({showRow:val,p:1,is_operating:!1})})),$(".filePage").on("click","div:nth-child(2) a",(function(e){var num=$(this).attr("href").match(/p=([0-9]+)$/)[1];that.reader_file_list({path:that.path,p:num}),e.stopPropagation(),e.preventDefault()})),$(".file_list_content").on("click",".folder_size",(function(e){var data=that.file_list[$(this).parents(".file_tr").data("index")],_this=this;that.get_file_size({path:data.path},(function(res){$(_this).text(bt.format_size(res.size))})),e.stopPropagation(),e.preventDefault()})),$(".filePage").on("click","#file_all_size",(function(e){if("/"===that.file_path)return layer.tips('The current directory is the system root directory (/), the execution of the file size will take up a lot of disk IO, which will cause the server to run slowly.',this,{tips:[1,"red"],time:5e3}),!1;that.get_dir_size({path:that.file_path})})),$(".file_list_content").on("mousedown",(function(ev){if($(ev.target).hasClass("file_checkbox")||$(ev.target).hasClass("file_check")||$(ev.target).hasClass("icon-share1")||$(ev.target).hasClass("icon-favorites")||"i"==ev.target.localName||$(ev.target).parents(".app_menu_group").length>0||$(ev.target).hasClass("createModel")||$(ev.target).hasClass("editr_tr")||"createArea"==$(ev.target).attr("name")||"rename_file_input"==$(ev.target).attr("name")||$(ev.target).hasClass("set_file_ps")||that.is_editor)return!0;if(3==ev.which&&!that.is_editor)return $(".selection_right_menu").removeAttr("style"),that.render_file_all_menu(ev,this),!0;$(".file_list_content").bind("mousewheel",(function(){return!1}));var container=$(this),scroll_h=0,con_t=container.offset().top,con_l=container.offset().left,startPos={top:ev.clientY-$(this).offset().top,left:ev.clientX-$(this).offset().left};$(document).unbind("mousemove").mousemove((function(ev){var endPos={top:ev.clientY-con_t>0&&ev.clientY-con_t1?container.height():0,left:ev.clientX-con_l>0&&ev.clientX-con_l1?container.width():0},fixedPoint={top:endPos.top>startPos.top?startPos.top:endPos.top,left:endPos.left>startPos.left?startPos.left:endPos.left};"list"==bt.get_cookie("rank")&&(fixedPoint.top=fixedPoint.top+40);var w=Math.min(Math.abs(endPos.left-startPos.left),con_l+container.width()-fixedPoint.left),h=Math.min(Math.abs(endPos.top-startPos.top),con_t+container.height()-fixedPoint.top);if(ev.clientY-con_t<0){var beyond_t=Math.abs(ev.clientY-con_t);container.scrollTop(container.scrollTop()-beyond_t),0!=container.scrollTop()&&(scroll_h+=beyond_t),h+=scroll_h}if(ev.clientY-(con_t+container.height())>1){var beyond_b=ev.clientY-(con_t+container.height());container.scrollTop(container.scrollTop()+beyond_b),container[0].scrollHeight-container[0].scrollTop!==container[0].clientHeight&&(scroll_h+=beyond_b),h+=scroll_h,fixedPoint.top=fixedPoint.top-scroll_h}if(startPos.top==endPos.top||startPos.left==endPos.left)return!0;that.enter_files_box().show().css({left:fixedPoint.left+"px",top:fixedPoint.top+"px",width:w+"px",height:h+"px"});var box_offset_top=that.enter_files_box().offset().top,box_offset_left=that.enter_files_box().offset().left,box_offset_w=that.enter_files_box().offset().left+that.enter_files_box().width(),box_offset_h=that.enter_files_box().offset().top+that.enter_files_box().height();$(container).find(".file_tr").each((function(i,item){var offset_top=$(item).offset().top,offset_left=$(item).offset().left,offset_h=$(item).offset().top+$(item).height(),offset_w=$(item).offset().left+$(item).width();"icon"==bt.get_cookie("rank")?offset_w>=box_offset_left&&offset_left<=box_offset_w&&offset_h>=box_offset_top&&offset_top<=box_offset_h?$(item).addClass("active"):$(item).removeClass("active"):offset_w>=box_offset_left&&offset_h>=box_offset_top&&offset_top<=box_offset_h?$(item).addClass("active"):$(item).removeClass("active")}))})),$(document).on("mouseup",(function(){var _move_array=[],box_offset_top=that.enter_files_box().offset().top,box_offset_left=that.enter_files_box().offset().left,box_offset_w=that.enter_files_box().offset().left+that.enter_files_box().width(),box_offset_h=that.enter_files_box().offset().top+that.enter_files_box().height();$(container).find(".file_tr").each((function(i,item){var offset_top=$(item).offset().top,offset_left=$(item).offset().left,offset_h=$(item).offset().top+$(item).height(),offset_w=$(item).offset().left+$(item).width();"icon"==bt.get_cookie("rank")?offset_w>=box_offset_left&&offset_left<=box_offset_w&&offset_h>=box_offset_top&&offset_top<=box_offset_h&&_move_array.push($(item).data("index")):offset_w>=box_offset_left&&offset_h>=box_offset_top&&offset_top<=box_offset_h&&_move_array.push($(item).data("index"))})),that.render_file_selected(_move_array),that.enter_files_box().remove(),$(".file_list_content").unbind("mousewheel")})),ev.stopPropagation(),ev.preventDefault()})),$(".file_list_content").on("blur",".set_file_ps",(function(ev){var tr_index=$(this).parents(".file_tr").data("index"),item=that.file_list[tr_index],nval=$(this).val(),oval=$(this).data("value"),_this=this;if(nval==oval)return!1;bt_tools.send("files/set_file_ps",{filename:item.path,ps_type:0,ps_body:nval},(function(rdata){$(_this).data("value",nval)}),{tips:"Set ps",tips:!0})})),$(".file_list_content").on("keyup",".set_file_ps",(function(ev){13==ev.keyCode&&$(this).blur(),ev.stopPropagation()})),$(".file_list_header").on("mousedown",".file_width_resize",(function(ev){return!1;var th,Minus_v,_header,maxlen})),$(".cut_view_model").on("click",(function(){var type=$(this).data("type");$(".file_table_view").addClass("icon"==type?"icon_view":"list_view").removeClass("icon"!=type?"icon_view":"list_view").scrollLeft(0),bt.set_cookie("rank",type),$(this).addClass("active").siblings().removeClass("active")})),$(".file_list_content").on("click",".set_operation_group a",(function(ev){var data=$(this).parents(".file_tr").data(),type=$(this).data("type"),item=that.file_list[data.index];if("more"==type)return!0;item.open=type,item.index=data.index,item.type_tips="file"==item.type?"File":"Directory",that.file_groud_event(item)}))},enter_files_box:function(){return 0==$("#web_mouseDrag").length&&$("
          ",{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"),$("#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 that=this,header_check=$(".file_list_header .file_check");0==this.file_table_arry.length?header_check.removeClass("active active_2").data("checkbox",0):this.file_table_arry.length==this.file_list.length?header_check.addClass("active").removeClass("active_2").data("checkbox",1):header_check.addClass("active_2").removeClass("active").data("checkbox",2),this.file_table_arry.length>0?($(document).unbind("keydown").on("keydown",(function(e){var keyCode=e.keyCode,tagName=e.target.localName.toLowerCase(),is_mac=window.navigator.userAgent.indexOf("Mac")>-1;if("input"==tagName||"textarea"==tagName)return!0;e.ctrlKey&&67==keyCode&&(1==that.file_table_arry.length?(that.file_groud_event($.extend(that.file_table_arry[0],{open:"copy"})),$(".file_all_paste").removeClass("hide")):that.file_table_arry.length>1&&that.batch_file_manage("copy")),e.ctrlKey&&88==keyCode&&(1==that.file_table_arry.length?(that.file_groud_event($.extend(that.file_table_arry[0],{open:"shear"})),$(".file_all_paste").removeClass("hide")):that.file_table_arry.length>1&&that.batch_file_manage("shear"))})),this.file_table_arry.length>1?($(".nav_group.multi").removeClass("hide"),$(".file_menu_tips").addClass("hide")):($(".nav_group.multi").addClass("hide"),$(".file_menu_tips").removeClass("hide"))):($(".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"),that.set_menu_line_view_resize()},set_dir_view_resize:function(){var file_path_input=$(".file_path_input"),file_dir_view=$(".file_path_input .file_dir_view"),_path_width=file_dir_view.attr("data-width"),file_item_hide=null;if(_path_width?parseInt(_path_width):(_path_width=file_dir_view.width(),file_dir_view.attr("data-width",_path_width)),file_dir_view.width()-_path_width<90){var width=0;$($(".file_path_input .file_dir_view .file_dir_item").toArray().reverse()).each((function(){var item_width=0;$(this).attr("data-width")?item_width=parseInt($(this).attr("data-width")):($(this).attr("data-width",$(this).width()),item_width=$(this).width()),width+=item_width,file_path_input.width()-width<=90?$(this).addClass("hide"):$(this).removeClass("hide")}))}var file_item_hide=file_dir_view.children(".file_dir_item.hide").clone(!0);0==file_dir_view.children(".file_dir_item.hide").length?file_path_input.removeClass("active").find(".file_dir_omit").addClass("hide"):(file_item_hide.each((function(){0==$(this).find(".glyphicon-hdd").length&&$(this).find(".file_dir").before('')})),file_path_input.addClass("active").find(".file_dir_omit").removeClass("hide"),file_path_input.find(".file_dir_omit .nav_down_list").empty().append(file_item_hide),file_path_input.find(".file_dir_omit .nav_down_list .file_dir_item").removeClass("hide"))},set_menu_line_view_resize:function(){var menu_width=$(".file_nav_view").width(),disk_list_width=0,batch_list_width=0,_width=0,disk_list=$(".mount_disk_list"),batch_list=$(".nav_group.multi");disk_list.attr("data-width")||disk_list.attr("data-width",disk_list.innerWidth()),batch_list.attr("data-width")||0==batch_list.innerWidth()||-1==batch_list.innerWidth()||batch_list.attr("data-width",batch_list.innerWidth()),disk_list_width=parseInt(disk_list.attr("data-width")),batch_list_width=parseInt(batch_list.attr("data-width")),$(".file_nav_view>.nav_group").not(".mount_disk_list").each((function(){_width+=$(this).innerWidth()})),menu_width-(_width+=$(".menu-header-foot").innerWidth()).nav_btn_group").each((function(index){index>=$(".batch_group_list>.nav_btn_group").length-(indexs+2)?$(this).hide():$(this).show()})),$(".batch_group_list>.nav_btn_group:last-child").removeClass("hide").show()):($(".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 that=this,forward_path=$(".forward_path span");1==this.file_operating.length?forward_path.addClass("active"):this.file_pointer==this.file_operating.length-1?(forward_path.eq(0).removeClass("active"),forward_path.eq(1).addClass("active")):0==this.file_pointer?(forward_path.eq(0).addClass("active"),forward_path.eq(1).removeClass("active")):forward_path.removeClass("active")},set_file_view:function(){var file_list_content=$(".file_list_content"),height=this.area[1]-$(".file_table_view")[0].offsetTop-170;$(".file_bodys").height(this.area[1]-100),50*this.file_list.length>height?(file_list_content.attr("data-height",file_list_content.data("height")||file_list_content.height()).css({overflow:"hidden","overflow-y":"auto",height:height+"px"}),$(".file_shadow_bottom").css("opacity",1)):(file_list_content.css({overflow:"hidden","overflow-y":"auto",height:height+"px"}),$(".file_shadow_top,.file_shadow_bottom").css("opacity",0))},open_share_view:function(){var that=this;layer.open({type:1,shift:5,closeBtn:2,area:["850px","580px"],title:"Share list",content:'
          Share nameShare addressExpiration dateOpt
          ',success:function(){that.render_share_list(),$(".download_url_list").on("click",".info_down",(function(){var indexs=$(this).attr("data-index");that.file_share_view(that.file_share_list[indexs],"list")})),$(".download_table .download_url_page").on("click","a",(function(e){var _href=$(this).attr("href").match(/p=([0-9]+)$/)[1];that.render_share_list({p:_href}),e.stopPropagation(),e.preventDefault()}))}})},render_share_list:function(param){var that=this,_list="";void 0===param&&(param={p:1}),bt_tools.send("files/get_download_url_list",param,(function(res){that.file_share_list=res.data,res.data.length>0?$.each(res.data,(function(index,item){_list+=''+item.ps+''+item.filename+""+bt.format_data(item.expire)+'Details | Close'})):_list='No share data',$(".download_url_list").html(_list),$(".download_url_page").html(res.page),$(".download_table").on("click",".del_down",(function(){var id=$(this).attr("data-id"),_ps=$(this).attr("data-ps");that.remove_download_url({id:id,fileName:_ps},(function(res){res.status&&that.render_share_list(param),layer.msg(res.msg,{icon:res.status?1:2})}))}))}),"Share list")},remove_check_file:function(arry,key,value){for(var len=arry.length;len--;)arry[len][key]==value&&arry.splice(len,1)},open_download_view:function(){var that=this;that.reader_form_line({url:"DownloadFile",beforeSend:function(data){return{url:data.url,path:data.path,filename:data.filename}},overall:{width:"310px"},data:[{label:"URL address:",name:"url",placeholder:"URL address",value:"http://",eventType:["input","focus"],input:function(){var value,url_list=$(this).val().split("/");$('[name="filename"]').val(url_list[url_list.length-1])}},{label:"Download to:",name:"path",placeholder:"Download to",value:that.file_path},{label:"File name:",name:"filename",placeholder:"Save file name",value:"",eventType:"enter",enter:function(){$(".download_file_view .layui-layer-btn0").click()}}]},(function(form,html){var loadT=bt.open({type:1,title:"Download file",area:"500px",shadeClose:!1,skin:"download_file_view",content:html[0].outerHTML,btn:["Comfirm","Close"],success:function(){form.setEvent()},yes:function(indexo,layero){var ress=form.getVal();if(!bt.check_url(ress.url))return layer.msg("Please enter valid URL address..",{icon:2}),!1;form.submitForm((function(res){that.render_present_task_list(),layer.msg(res.msg,{icon:res.status?1:2}),loadT.close()}))}})}))},set_style_width:function(type,width){var _content=bt.get_cookie("formHeader")||$("#file_list_info").html(),_html="",_reg=new RegExp("\\.file_"+type+"\\s?\\{width\\s?\\:\\s?(\\w+)\\s\\!important;\\}","g"),_defined_config={name:150,type:80,size:80,mtime:150,accept:80,user:80,ps:150};_html=_content.replace(_reg,(function(match,$1,$2,$3){return".file_"+type+"{width:"+(width<80?_defined_config[type]+"px":width+"px")+" !important;}"})),$("#file_list_info").html(_html)},set_file_table_width:function(){var that=this,file_header_width=$(".file_table_view")[0].offsetWidth,auto_num=0,width=0,auto_all_width=0,css="",_width=0,tr_heigth=45,other="",config={};$.each(this.file_header,(function(key,item){"auto"==item?(auto_num++,config[key]=0):(width+=item,css+="."+key+"{width:"+("file_operation"!=key?item:item-16)+"px !important;}")})),this.is_mobile&&$(".file_operation.file_th").attr("style","margin-right:-10px !important;"),45*this.file_list.length>$(".file_list_content").height()?(config.file_tr=file_header_width-(this.is_mobile?0:this.scroll_width),file_header_width=file_header_width,other+=".file_td.file_operation{width:"+(this.file_header.file_operation-(this.is_mobile?0:this.scroll_width)-10)+"px !important;}",other+=".file_th.file_operation{padding-right:"+(10+(this.is_mobile?0:this.scroll_width))+"px !important}"):(file_header_width=file_header_width,config.file_tr=file_header_width,this.is_mobile&&(other+=".file_td.file_operation{width:"+(this.file_header.file_operation-20)+"px !important;}")),config.file_list_header=file_header_width,_width=(auto_all_width=file_header_width-width)/auto_num,$.each(config,(function(key,item){css+="."+key+"{width:"+(0==item?_width:item)+"px !important;}"})),$("#file_list_info").html(css+other)},render_path_list:function(callback){var that=this,html='
          ',path_before="",dir_list=this.file_path.split("/").splice(1),first_dir=this.file_path.split("/")[0];"Windows"===bt.os?(0==dir_list.length&&(dir_list=[]),dir_list.unshift('Local disk ('+first_dir+")")):("/"==this.file_path&&(dir_list=[]),dir_list.unshift("Root dir"));for(var i=0;i '+dir_list[i]+' ';$(".path_input").val("").attr("data-path",this.file_path);var file_dir_view=$(".file_path_input .file_dir_view");file_dir_view.html(html),file_dir_view.attr("data-width",file_dir_view.width()),this.set_dir_view_resize.delay(this,100)},render_path_down_list:function(el,path,callback){var that=this,_html="",next_path=$(el).parent().next().find(".file_dir").attr("title");this.get_dir_list({path:path},(function(res){$.each(that.data_reconstruction(res.DIR),(function(index,item){var _path=("/"!=path?path:"")+"/"+item.filename;_html+='
        • '+item.filename+"
        • "})),$(el).html(_html)}))},reader_file_list:function(data,callback){var that=this,select_page_num="",next_path="",model=bt.get_cookie("rank"),isPaste=bt.get_cookie("record_paste_type");"null"!=isPaste&&null!=isPaste?$(".file_nav_view .file_all_paste").removeClass("hide"):$(".file_nav_view .file_all_paste").addClass("hide"),$(".file_table_view").removeClass(".list_view,.icon_view").addClass("list"==model?"list_view":"icon_view"),$(".cut_view_model:nth-child("+("list"==model?"2":"1")+")").addClass("active").siblings().removeClass("active"),this.file_images_list=[],this.get_dir_list(data,(function(res){if(!1===res.status&&res.msg.indexOf("The specified directory does not exist!")>-1)return that.reader_file_list({path:"/www"});that.file_path=that.path_check(res.PATH),that.file_list=$.merge(that.data_reconstruction(res.DIR,"DIR"),that.data_reconstruction(res.FILES)),that.is_recycle=res.FILE_RECYCLE,that.file_store_list=res.STORE,bt.set_cookie("Path",that.path_check(res.PATH)),that.reader_file_list_content(that.file_list,(function(rdata){$(".path_input").attr("data-path",that.file_path),$(".file_nav_view .multi").addClass("hide"),$(".selection_right_menu").removeAttr("style"),$.each(["100","200","500","1000","2000"],(function(index,item){select_page_num+='"}));var page=$(res.PAGE);page.append('per pageitem(s)"),$(".filePage").html('
          Total '+rdata.is_dir_num+" directory, "+(that.file_list.length-rdata.is_dir_num)+'file(s), size:Click to calculate
          '+page[0].outerHTML),data.is_operating&&that.file_operating[that.file_pointer]!=res.PATH&&(void 0!==(next_path=that.file_operating[that.file_pointer+1])&&next_path!=res.PATH&&that.file_operating.splice(that.file_pointer+1),that.file_operating.push(res.PATH),that.file_pointer=that.file_operating.length-1),that.render_path_list(),that.set_file_forward(),that.render_favorites_list(),that.set_file_view(),that.set_file_table_width(),callback&&callback(res)}))}))},data_reconstruction:function(data,type,callback){var that=this,arry=[],info_ps=[["/etc","PS: System files directory"],["/home","PS: Home directory"],["/tmp","PS: Common temporary files directory"],["/root","PS: Main directory of system admin"],["/usr","PS: System application directory"],["/boot","PS: System run directory"],["/lib","PS: System source file directory"],["/mnt","PS: Store temporary mapped file system"],["/www","PS: Aapanel program directory"],["/bin","PS: Store binary executable file directory"],["/dev","PS: Storage device file directory"],["/www/wwwlogs","PS: Default site logs directory"],["/www/server","PS: Aapanel soft installed directory"],["/www/wwwlogs","PS: Site logs directory"],["/www/Recycle_bin",lan.files.recycle_bin_dir],["/www/server/panel","PS: Aapanel main program directory, do not move"],["/www/server/panel/plugin","PS: Aapanel plugin directory"],["/www/server/panel/BTPanel","PS: Aapanel directory"],["/www/server/panel/BTPanel/static","PS: Aapanel static directory"],["/www/server/panel/BTPanel/templates","PS: Aapanel templates directory"],[bt.get_cookie("backup_path"),"PS: Default backup directory"],[bt.get_cookie("sites_path"),"PS: Default site directory"]];return data.length<1?[]:($.each(data,(function(index,item){var itemD=item.split(";"),fileMsg="",fileN=itemD[0].split("."),extName=fileN[fileN.length-1];switch(itemD[0]){case".user.ini":fileMsg=lan.files.php_profile;break;case".htaccess":fileMsg=lan.files.apache_profile;break;case"swap":fileMsg=lan.files.swap_file}-1!=itemD[0].indexOf("Recycle_bin")&&(fileMsg=lan.files.swap_file),-1!=itemD[0].indexOf(".upload.tmp")&&(fileMsg=lan.files.recycle_bin_dir);for(var i=0;i0?($.each(this.file_store_list,(function(index,item){html+='
        • '+item.name+"
        • "})),html+='
        • Management
        • '):html='
        • (Empty)
        • ',$(".favorites_file_path .nav_down_list").html(html)},set_favorites_manage:function(){var that=this;layer.open({type:1,title:"Manage Favorites",area:["850px","580px"],closeBtn:2,shift:5,shadeClose:!1,content:"
          PathOpt
          ",success:function(layers){that.render_favorites_type_list(),setTimeout((function(){$(layers).css("top",($(window).height()-$(layers).height())/2)}),50)},cancel:function(){that.reader_file_list({path:that.file_path})}})},render_favorites_type_list:function(){var _detail="";this.$http("get_files_store",(function(rdata){rdata.length>0?$.each(rdata,(function(ind,item){_detail+=''+item.path+'Del"})):_detail='No favorites',$(".favorites_body").html(_detail),jQuery.prototype.fixedThead?$(".stroe_tab_list .divtable").fixedThead({resize:!1}):$(".stroe_tab_list .divtable").css({overflow:"auto"})}))},load_favorites_index_list:function(){var that=this;this.$http("get_files_store",(function(rdata){that.file_store_list=rdata,that.render_favorites_list()}))},del_favorites:function(path){var that=this;layer.confirm("Comfirm delete path【"+path+"】?",{title:"Delete favorites",closeBtn:2,icon:3},(function(index){that.$http("del_files_store",{path:path},(function(res){res.status&&that.render_favorites_type_list(),layer.msg(res.msg,{icon:res.status?1:2})}))}))},reader_file_list_content:function(data,callback){var _html="",that=this,is_dir_num=0,images_num=0;$.each(data,(function(index,item){var _title=item.filename,only_id=bt.get_random(10),path=(that.file_path+"/"+item.filename).replace("//","/"),is_compress=that.determine_file_type(item.ext,"compress"),is_editor_tips=function(){var _openTitle="open";switch(that.determine_file_type(item.ext)){case"images":_openTitle="Preview";break;case"video":_openTitle="Play";break;default:_openTitle="compress"==that.determine_file_type(item.ext)?"":"Edit"}return"dir"==item.type&&(_openTitle="Open"),_openTitle}(item);that.file_list[index].only_id=only_id,_html+='
          "+item.filename+item.soft_link+""+(item.caret?'':"")+(0!=item.down_id?'':"")+'
          '+("dir"==item.type?"directory":that.ext_type_tips(item.ext))+'
          '+item.user+" / "+item.root_level+'
          '+("dir"==item.type?'Calculate':bt.format_size(item.size))+'
          '+bt.format_data(item.mtime)+'
          '+(item.is_os_ps?item.ps:'')+'
          ',"dir"==item.type&&is_dir_num++,item.path=path,item.open_type=that.determine_file_type(item.ext),"images"==item.open_type&&(item.images_id=images_num,that.file_images_list.push(item.path),images_num++)})),$(".file_list_content").html(_html),callback&&callback({is_dir_num:is_dir_num}),that.clear_table_active()},render_file_disk_list:function(){var that=this,html="",_li="";that.get_disk_list((function(res){$.each(res,(function(index,item){html+='",_li+='
        • '+("/"==item.path?"Root dir":item.path)+" ("+item.size[2]+")
        • "})),$(".mount_disk_list").html('
          '+lan.files.mounted_disk+'
          '+html+"
          "),that.set_menu_line_view_resize()}))},render_file_groud_menu:function(ev,el){var that=this,index=$(el).data("index"),_openTitle="Open",data=this.file_list[index],config_group=[["open",_openTitle],["split",""],["download","Download"],["share","Share file/directory"],["cancel_share","Cancel share"],["favorites","Favorites file/directory"],["cancel_favorites","Cancel favorites"],["split",""],["dir_kill","目录查杀"],["authority","Permission"],["split",""],["copy","Copy"],["shear","Cut"],["rename","Rename"],["del","Del"],["split",""],["compress","Compress"],["unzip","Decompress"]],compression=["zip","rar","gz","war","tgz","bz2"],offsetNum=0;switch(this.determine_file_type(data.ext)){case"images":_openTitle="Preview";break;case"video":_openTitle="Play";break;default:_openTitle="Edit"}config_group[0][1]="dir"==data.type?"Open":_openTitle,"dir"==data.type&&(config_group.splice(2,1),offsetNum++),"compress"==data.open_type&&(config_group.splice(0,2),offsetNum+=2),0!=data.down_id?(config_group.splice(3-offsetNum,1),offsetNum++):(config_group.splice(4-offsetNum,1),config_group[3-offsetNum][1]="dir"==data.type?"Share directory":"Share file",offsetNum++),!1!==data.caret?(config_group.splice(5-offsetNum,1),offsetNum++):(config_group.splice(6-offsetNum,1),config_group[5-offsetNum][1]="dir"==data.type?"Favorites directory":"Favorites file",offsetNum++),config_group.splice(8-offsetNum,1),offsetNum++;var num=0;$.each(compression,(function(index,item){item==data.ext&&num++})),0==num&&(config_group.splice(17-offsetNum,1),offsetNum++),-1!=data.filename.indexOf("/")&&"dir"==data.type||(config_group.splice(18-offsetNum,1),offsetNum++),this.file_selection_operating=config_group,this.reader_menu_list({el:$(".selection_right_menu"),ev:ev,data:data,list:config_group})},render_file_all_menu:function(ev,el){var that=this,config_group=[["refresh","Refresh"],["split",""],["upload","Upload"],["create","New file/directory",[["create_dir","New directory"],["create_files","New file"]]],["web_shell","Terminal"],["split",""],["paste","Paste"]],offsetNum=0,isPaste=bt.get_cookie("record_paste_type");"null"!=isPaste&&null!=isPaste||(config_group.splice(5,2),offsetNum++),this.reader_menu_list({el:$(".selection_right_menu"),ev:ev,data:{},list:config_group})},render_files_multi_menu:function(ev){var that=this,config_group=[["copy","Copy"],["shear","cut"],["authority","Permission"],["compress","Compress"],["del","Delete"]],el=$(".selection_right_menu").find("ul"),el_height=el.height(),el_width=el.width(),left=ev.clientX-(this.area[0]-ev.clientX'):el.append($('
        • '+mitem[1]+"
        • ").append(null).on("click",{type:mitem[0],data:that.file_table_arry},(function(ev){$(".selection_right_menu").removeAttr("style"),that.batch_file_manage(ev.data.type),ev.stopPropagation(),ev.preventDefault()})))})),$(".selection_right_menu").css({left:left,top:ev.clientY-(this.area[1]-ev.clientY'):(Array.isArray(item[2])&&($children=$('
            '),$children_list=$children.find(".set_group"),$.each(item[2],(function(indexs,items){$children_list.append($('
          • '+items[1]+"
          • ").on("click",{type:items[0],data:config.data},(function(ev){that.file_groud_event($.extend(ev.data.data,{open:ev.data.type,index:parseInt($(config.ev.currentTarget).data("index")),element:config.ev.currentTarget,type_tips:"dir"==config.data.type?"directory":"file"})),config.el.removeAttr("style"),ev.stopPropagation(),ev.preventDefault()})))}))),el.append($('
          • '+item[1]+"
          • ").append($children).on("click",{type:item[0],data:config.data},(function(ev){that.file_groud_event($.extend(ev.data.data,{open:ev.data.type,index:parseInt($(config.ev.currentTarget).data("index")),element:config.ev.currentTarget,type_tips:"dir"==config.data.type?"directory":"file"})),"compress"!=item[0]&&"create"!=item[0]&&config.el.removeAttr("style"),ev.stopPropagation(),ev.preventDefault()}))))})),el_height=el.innerHeight(),top=config.ev.clientY-(this.area[1]-config.ev.clientY'+lan.files.recycle_bin_warning+"",(function(){that.$http("SetBatchData",obj,(function(res){res.status&&that.reader_file_list({path:that.file_path}),layer.msg(res.msg,{icon:res.status?1:2})}))}))},batch_file_paste:function(){var that=this,_pCookie=bt.get_cookie("record_paste_type");this.check_exists_files_req({dfile:this.file_path},(function(result){if(result.length>0){for(var tbody="",i=0;i'+result[i].filename+""+ToSize(result[i].size)+""+getLocalTime(result[i].mtime)+"";var mbody;SafeMessage("The following files will be overwritten",'
            '+tbody+"
            File nameSizeLast edit time
            ",(function(){that.$http("BatchPaste",{type:_pCookie,path:that.file_path},(function(rdata){rdata.status&&(bt.set_cookie("record_paste_type",null),that.reader_file_list({path:that.file_path})),layer.msg(rdata.msg,{icon:rdata.status?1:2})}))}))}else that.$http("BatchPaste",{type:_pCookie,path:that.file_path},(function(rdata){rdata.status&&(bt.set_cookie("record_paste_type",null),that.reader_file_list({path:that.file_path})),layer.msg(rdata.msg,{icon:rdata.status?1:2})}))}))},recycle_bin_view:function(){var that=this;layer.open({type:1,shift:5,closeBtn:2,area:["80%","606px"],title:lan.files.recycle_bin_title,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+'

            '+lan.files.recycle_bin_th1+" "+lan.files.recycle_bin_th2+" "+lan.files.recycle_bin_th3+' '+lan.files.recycle_bin_th4+' '+lan.files.recycle_bin_th5+'
            ',success:function(){-1!=window.location.href.indexOf("database")?($(".re-con-menu p:last-child").addClass("on").siblings().removeClass("on"),that.render_recycle_list(6)):that.render_recycle_list(1),$(".re-con-menu").on("click","p",(function(){var _type=$(this).data("type");$(this).addClass("on").siblings().removeClass("on"),that.render_recycle_list(_type)}))}})},render_recycle_list:function(num){var that=this;this.$http("Get_Recycle_bin",(function(rdata){var body="";switch($("#Set_Recycle_bin").attr("checked",rdata.status),$("#Set_Recycle_bin_db").attr("checked",rdata.status_db),num){case 1:for(var i=0;i20&&(shortwebname=shortwebname.substring(0,20)+"..."),shortpath.length>20&&(shortpath=shortpath.substring(0,20)+"..."),body+=' '+shortwebname+' '+shortpath+" "+ToSize(rdata.dirs[i].size)+" "+getLocalTime(rdata.dirs[i].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}for(var i=0;i20&&(shortwebname=shortwebname.substring(0,20)+"..."),shortpath.length>20&&(shortpath=shortpath.substring(0,20)+"..."),body+=' '+shortwebname+' '+shortpath+" "+ToSize(rdata.files[i].size)+" "+getLocalTime(rdata.files[i].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}else{var shortwebname=rdata.files[i].name.replace(/'/,"\\'"),shortpath=rdata.files[i].dname;shortwebname.length>20&&(shortwebname=shortwebname.substring(0,20)+"..."),shortpath.length>20&&(shortpath=shortpath.substring(0,20)+"..."),body+=' '+shortwebname.replace("BTDB_","")+' mysql://'+shortpath.replace("BTDB_","")+" - "+getLocalTime(rdata.files[i].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(body);case 2:for(var i=0;i20&&(shortwebname=shortwebname.substring(0,20)+"..."),shortpath.length>20&&(shortpath=shortpath.substring(0,20)+"..."),body+=' '+shortwebname+' '+shortpath+" "+ToSize(rdata.dirs[i].size)+" "+getLocalTime(rdata.dirs[i].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(body);case 3:for(var i=0;i20&&(shortwebname=shortwebname.substring(0,20)+"..."),shortpath.length>20&&(shortpath=shortpath.substring(0,20)+"..."),body+=' '+shortwebname+' '+shortpath+" "+ToSize(rdata.files[i].size)+" "+getLocalTime(rdata.files[i].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(body);case 4:for(var i=0;i20&&(shortwebname=shortwebname.substring(0,20)+"..."),shortpath.length>20&&(shortpath=shortpath.substring(0,20)+"..."),body+=' '+shortwebname+' '+shortpath+" "+ToSize(rdata.files[i].size)+" "+getLocalTime(rdata.files[i].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(body);case 5:for(var i=0;i20&&(shortwebname=shortwebname.substring(0,20)+"..."),shortpath.length>20&&(shortpath=shortpath.substring(0,20)+"..."),body+=' '+shortwebname+' '+shortpath+" "+ToSize(rdata.files[i].size)+" "+getLocalTime(rdata.files[i].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(body);case 6:for(var i=0;i20&&(shortwebname=shortwebname.substring(0,20)+"..."),shortpath.length>20&&(shortpath=shortpath.substring(0,20)+"..."),body+=' '+shortwebname.replace("BTDB_","")+' mysql://'+shortpath.replace("BTDB_","")+" - "+getLocalTime(rdata.files[i].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(body)}function getFileName(name){var text=name.split("."),n;return text=text[text.length-1]}function ReisImage(fileName){for(var exts=["jpg","jpeg","png","bmp","gif","tiff","ico"],i=0;i"+lan.files.recycle_bin_close_the+"",{icon:16,time:0,shade:[.3,"#000"]});setTimeout((function(){getSpeed(".myspeed")}),1e3),$.post("/files?action=Close_Recycle_bin","",(function(rdata){layer.close(loadT),layer.msg(rdata.msg,{icon:rdata.status?1:5}),$("#RecycleBody").html("")}))}))},open_images_preview:function(data){var that=this,mask=$('
            '+data.filename+'
            '),images_config={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:!1};if($(".preview_images_mask").length>0)return $("#preview_images").attr("src","/download?filename="+data.path),!1;function auto_images_size(transition){var rotate=Math.abs(images_config.rotate/90),preview_width=rotate%2==0?images_config.preview_width:images_config.preview_height,preview_height=rotate%2==0?images_config.preview_height:images_config.preview_width,preview_images=$("#preview_images"),css_config={};images_config.init_width=images_config.natural_width,images_config.init_height=images_config.natural_height,images_config.init_width>preview_width&&(images_config.init_width=preview_width,images_config.init_height=parseFloat((preview_width/images_config.natural_width*images_config.init_height).toFixed(2))),images_config.init_height>preview_height&&(images_config.init_width=parseFloat((preview_height/images_config.natural_height*images_config.init_width).toFixed(2)),images_config.init_height=preview_height),images_config.current_width=parseFloat(images_config.init_width*images_config.scale),images_config.current_height=parseFloat(images_config.init_height*images_config.scale),images_config.current_left=parseFloat(((images_config.preview_width-images_config.current_width)/2).toFixed(2)),images_config.current_top=parseFloat(((images_config.preview_height-images_config.current_height)/2).toFixed(2)),css_config={width:images_config.current_width,height:images_config.current_height,top:images_config.current_top,left:images_config.current_left,display:"inline",transform:"rotate("+images_config.rotate+"deg)",opacity:1,transition:"all 100ms"},!1===transition&&delete css_config.transition,preview_images.css(css_config)}$("body").css("overflow","hidden").append(mask),images_config.preview_width=mask[0].clientWidth,images_config.preview_height=mask[0].clientHeight,$(".preview_body img").load((function(){var img=$(this)[0];$(this).attr("data-index")||$(this).attr("data-index",data.images_id),images_config.natural_width=img.naturalWidth,images_config.natural_height=img.naturalHeight,auto_images_size(!1)})),$(".preview_images_mask .preview_head").on("mousedown",(function(e){e=e||window.event;var drag=$(this).parent();if($("body").addClass("select"),$(this).onselectstart=$(this).ondrag=function(){return!1},!$(e.target).hasClass("preview_close")){var diffX=e.clientX-drag.offset().left,diffY=e.clientY-drag.offset().top;$(document).on("mousemove",(function(e){var left=(e=e||window.event).clientX-diffX,top=e.clientY-diffY;left<0?left=0:left>window.innerWidth-drag.width()&&(left=window.innerWidth-drag.width()),top<0?top=0:top>window.innerHeight-drag.height()&&(top=window.innerHeight-drag.height()),drag.css({left:left,top:top,margin:0})})).on("mouseup",(function(){$(this).unbind("mousemove mouseup")}))}})),$(".preview_images_mask #preview_images").on("mousedown",(function(e){e=e||window.event,$(this).onselectstart=$(this).ondrag=function(){return!1};var images=$(this),preview=$(".preview_images_mask").offset(),diffX=e.clientX-preview.left,diffY=e.clientY-preview.top;$(".preview_images_mask").on("mousemove",(function(e){var offsetX=(e=e||window.event).clientX-preview.left-diffX,offsetY=e.clientY-preview.top-diffY,rotate=Math.abs(images_config.rotate/90),preview_width=rotate%2==0?images_config.preview_width:images_config.preview_height,preview_height=rotate%2==0?images_config.preview_height:images_config.preview_width,left,top;if(images_config.current_width>preview_width){var max_left=preview_width-images_config.current_width;(left=images_config.current_left+offsetX)>0?left=0:leftpreview_height){var max_top=preview_height-images_config.current_height;(top=images_config.current_top+offsetY)>0?top=0:toppreview_height&&images_config.current_top<=0&&images_config.current_height-preview_height<=images_config.current_top&&(images_config.current_top-=offsetY),images.css({left:images_config.current_left,top:images_config.current_top})})).on("mouseup",(function(){$(this).unbind("mousemove mouseup")})).on("dragstart",(function(){e.preventDefault()}))})).on("dragstart",(function(){return!1})),$(".preview_close").click((function(e){$(".preview_images_mask").remove()})),$(".preview_toolbar a").click((function(){var index=$(this).index(),images=$("#preview_images");switch(index){case 0:case 1:images_config.rotate=index?images_config.rotate+90:images_config.rotate-90,auto_images_size();break;case 2:case 3:if(3==images_config.scale&&2==index||.2==images_config.scale&&3==index)return layer.msg(images_config.scale>=1?"The image is the maximum size":"The image is the minimum size"),!1;images_config.scale=(2==index?Math.round(10*(images_config.scale+.4)):Math.round(10*(images_config.scale-.4)))/10,auto_images_size();break;case 4:var scale_offset=images_config.rotate%360;scale_offset>=180?images_config.rotate+=360-scale_offset:images_config.rotate-=scale_offset,images_config.scale=1,auto_images_size()}})),$(".preview_full,.preview_small").click((function(){$(this).hasClass("preview_full")?($(this).addClass("hidden").prev().removeClass("hidden"),images_config.preview_width=that.area[0],images_config.preview_height=that.area[1],mask.css({width:that.area[0],height:that.area[1],top:0,left:0,margin:0}).data("type","full"),auto_images_size()):($(this).addClass("hidden").next().removeClass("hidden"),$(".preview_images_mask").removeAttr("style"),images_config.preview_width=750,images_config.preview_height=650,auto_images_size())})),$(".preview_cut_view a").click((function(){var images_src="",preview_images=$("#preview_images"),images_id=parseInt(preview_images.attr("data-index"));$(this).index()?(images_id=images_id==that.file_images_list.length-1?0:images_id+1,images_src=that.file_images_list[images_id]):(images_id=0===images_id?that.file_images_list.length-1:images_id-1,images_src=that.file_images_list[images_id]),preview_images.attr("data-index",images_id).attr("src","/download?filename="+images_src),$(".preview_title").html(that.get_path_filename(images_src))}))},open_video_play:function(data){var old_filename=data.path,imgUrl="/download?filename="+data.path,p_tmp=data.path.split("/"),path=p_tmp.slice(0,p_tmp.length-1).join("/");layer.open({type:1,closeBtn:2,title:'Playing ['+p_tmp[p_tmp.length-1]+"]",area:["890px","402px"],shadeClose:!1,skin:"movie_pay",content:'
            ',success:function(){$.post("/files?action=get_videos",{path:path},(function(rdata){for(var video_list='',index=0,i=0;i"}video_list+="
            File nameSize
            '+rdata[i].name+''+ToSize(rdata[i].size)+"
            ",$(".video-list").html(video_list).scrollTop(34*index)}))}})},play_file:function(obj,filename){if($("#btvideo video").attr("data-filename")==filename)return!1;var imgUrl,v='';$("#btvideo").html(v);var p_tmp=filename.split("/");$(".btvideo-title").html(p_tmp[p_tmp.length-1]),$(".video-avt").removeClass("video-avt"),$(obj).parents("tr").addClass("video-avt")},copy_file_or_dir:function(data){bt.set_cookie("record_paste",data.path),bt.set_cookie("record_paste_type","copy"),$(".file_all_paste").removeClass("hide"),layer.msg("Copy successfully. Please click [Paste] or Ctrl + V to paste")},cut_file_or_dir:function(data){bt.set_cookie("record_paste",data.path),bt.set_cookie("record_paste_type","cut"),$(".file_all_paste").removeClass("hide"),layer.msg("Cut successfully. Please click [Paste] or Ctrl + V to paste")},paste_file_or_dir:function(){var that=this,_isPaste=bt.get_cookie("record_paste_type"),_paste=bt.get_cookie("record_paste"),_filename="";if("null"!=_paste&&null!=_paste&&(_filename=_paste.split("/").pop()),that.file_path.indexOf(_paste)>-1)return layer.msg("Can not paste ["+_filename+"] here, Because the item cannot be pasted into itself.",{icon:0}),!1;if("null"!=_isPaste&&null!=_isPaste)switch(_isPaste){case"cut":case"copy":this.check_exists_files_req({dfile:this.file_path,filename:_filename},(function(result){if(result.length>0){for(var tbody="",i=0;i'+result[i].filename+""+ToSize(result[i].size)+""+getLocalTime(result[i].mtime)+"";var mbody;SafeMessage("This files will be overwritten",'
            '+tbody+"
            File nameSizeLast edit time
            ",(function(){that.config_paste_to(_paste,_filename)}))}else that.config_paste_to(_paste,_filename)}));break;case"1":case"2":that.batch_file_paste()}},config_paste_to:function(path,_filename){var that=this,_type=bt.get_cookie("record_paste_type");this.$http("copy"==_type?"CopyFile":"MvFile",{sfile:path,dfile:this.file_path+"/"+_filename},(function(rdata){rdata.status&&(bt.set_cookie("record_paste",null),bt.set_cookie("record_paste_type",null),that.reader_file_list({path:that.file_path})),layer.msg(rdata.msg,{icon:rdata.status?1:2})}))},rename_file_or_dir:function(data){var that=this;that.is_editor=!0,$(".file_list_content .file_tr:nth-child("+(data.index+1)+")").addClass("editr_tr").find(".file_title").empty().append($("icon"==bt.get_cookie("rank")?'":'')),"icon"==bt.get_cookie("rank")&&$("textarea[name=rename_file_input]").css({height:$("textarea[name=rename_file_input]")[0].scrollHeight}),$(("icon"==bt.get_cookie("rank")?"textarea":"input")+"[name=rename_file_input]").on("input",(function(){if("icon"==bt.get_cookie("rank")&&(this.style.height="auto",this.style.height=this.scrollHeight+"px"),"file"==data.type){var ext_arry=$(this).val().split("."),ext=ext_arry[ext_arry.length-1];$(this).parent().prev().find(".file_icon").removeAttr("class").addClass("file_icon file_"+ext)}})).keyup((function(e){13==e.keyCode&&$(this).blur(),e.stopPropagation(),e.preventDefault()})).blur((function(){var _val=$(this).val().replace(/[\r\n]/g,""),config={sfile:data.path,dfile:that.path_resolve(that.file_path,_val)};return data.filename==_val||""==_val?($(".file_list_content .file_tr:nth-child("+(data.index+1)+")").removeClass("editr_tr").find(".file_title").empty().append($(""+data.filename+"")),that.is_editor=!1,!1):that.match_unqualified_string(_val)?layer.msg('The name cannot have /\\:*?"<>| symbol',{icon:2}):(that.rename_file_req(config,(function(res){that.reader_file_list({path:that.file_path},(function(){layer.msg(res.msg,{icon:res.status?1:2})}))})),void(that.is_editor=!1))})).focus()},set_file_share:function(data){var that=this;this.loadY=bt.open({type:1,shift:5,closeBtn:2,area:"450px",title:"Set share "+data.type_tips+"-["+data.filename+"]",btn:["Create","Cancel"],content:'
            Share name
            Expiration date
            Extraction code
            ',yes:function(indexs,layers){var ps=$("[name=ps]").val(),expire=$("[name=expire]:checked").val(),password=$("[name=password]").val();if(""===ps)return layer.msg("No sharing name!",{icon:2}),!1;that.create_download_url({filename:data.path,ps:ps,password:password,expire:expire},(function(res){if(!res.status)return layer.msg(res.msg,{icon:res.status?1:2}),!1;var rdata=res.msg;that.file_list[data.index]=$.extend(that.file_list[data.index],{down_id:rdata.id,down_info:rdata}),that.loadY.close(),that.info_file_share(data),that.reader_file_list_content(that.file_list)}))},success:function(layers,index){$("#random_paw").click((function(){$(this).prev().val(bt.get_random(6))}))}})},info_file_share:function(data){var that=this;if(void 0===data.down_info)return this.get_download_url_find({id:data.down_id},(function(res){that.file_list[data.index]=$.extend(that.file_list[data.index],{down_info:res}),that.file_share_view(that.file_list[data.index],"fonticon")})),!1;this.file_share_view(data,"fonticon")},file_share_view:function(datas,type){var data=datas;"fonticon"==type&&(data=datas.down_info);var that=this,download_url=location.origin+"/down/"+data.token;this.loadY=bt.open({type:1,shift:5,closeBtn:2,area:"550px",title:"Share details-["+data.filename+"]",content:'
            Share name
            Expiration date
            '+(data.expire>new Date("2099-01-01 00:00:00").getTime()/1e3?'Permanent':bt.format_data(data.expire))+'
            ',success:function(layers,index){var copy_url=new ClipboardJS(".copy_url"),copy_paw=new ClipboardJS(".copy_paw");copy_url.on("success",(function(e){layer.msg("Copy link succeeded!",{icon:1}),e.clearSelection()})),copy_paw.on("success",(function(e){layer.msg("Copy link and extraction code succeeded!",{icon:1}),e.clearSelection()})),$(".layer_close").click((function(){layer.close(index)})),$(".QR_code").click((function(){layer.closeAll("tips"),layer.tips('
            ',".QR_code",{area:["150px","150px"],tips:[1,"#ececec"],time:0,shade:[.05,"#000"],shadeClose:!0,success:function(){jQuery("#QR_code").qrcode({render:"canvas",text:download_url,height:130,width:130})}})})),$(".close_down").click((function(){that.remove_download_url({id:data.id,fileName:data.filename},(function(res){that.loadY.close(),"fonticon"==type&&(that.file_list[datas.index].down_id=0,that.reader_file_list_content(that.file_list)),"list"==type&&that.render_share_list(),layer.msg(res.msg,{icon:res.status?1:2})}))}))}})},del_file_or_dir:function(data){var that=this;that.is_recycle?bt.confirm({title:"Delete "+data.type_tips+"[ "+data.filename+" ]",msg:"Comfirm delete "+data.type_tips+"[ "+data.path+" ],it will move to recycle bin after delete, continue?"},(function(){that.del_file_req(data,(function(res){that.reader_file_list({path:that.file_path}),layer.msg(res.msg,{icon:res.status?1:2})}))})):bt.show_confirm("Delete "+data.type_tips+"[ "+data.filename+" ]",'Recycle bin is not currently open, delete '+("dir"==data.type?"directory":"file")+" cannot be restored after, continue?
            ",(function(){that.del_file_req(data,(function(res){that.reader_file_list({path:that.file_path}),layer.msg(res.msg,{icon:res.status?1:2})}))}))},cancel_file_favorites:function(data){var that=this,index=data.index;this.loadY=bt.confirm({title:data.filename+lan.files.unfavorite1,msg:lan.files.unfavorite1+" ["+data.path+"] "+lan.files.continue},(function(){that.$http("del_files_store",{path:data.path},(function(res){res.status&&(that.file_list[index].caret=!1,that.reader_file_list_content(that.file_list),that.load_favorites_index_list()),layer.msg(res.msg,{icon:res.status?1:2})}))}))},set_file_authority:function(data,isPatch){var that=this;that.get_file_authority({path:data.path},(function(rdata){var tex='
            ';that.loadY=layer.open({type:1,closeBtn:2,title:lan.files.set_auth+"["+data.filename+"]",area:"465px",shadeClose:!1,content:'
            Set permission
            Backups list
            '+tex+"
            "+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(index,layers){that.edit_access_authority(),$("#access").keyup((function(){that.edit_access_authority()})),$("input[type=checkbox]").change((function(){for(var idName=["owner","group","public"],onacc="",n=0;n

            Please enter the current backup name

            Remarks
            ',yes:function(layerss,index){$(".layer_close").click((function(){layer.close(index)})),that.$http("back_path_permissions",{back_sub_dir:sub_type,path:file,remark:$("input.form-control").val()},(function(edata){if(layer.close(layerss),!edata.status)return layer.msg(edata.msg,{time:1900,icon:2}),!1;if(0==type){var new_back=that.backup_list();$(".buplist").html(new_back)}else if(3==type){var chmod=$("#access").val(),chown=$("#chown").val(),all=$("#accept_all").prop("checked")?"True":"False",data="filename="+encodeURIComponent(file)+"&user="+chown+"&access="+chmod+"&all="+all;Oksend(data),layer.closeAll()}layer.msg(edata.msg,{time:1900,icon:1})}))},btn2:function(){layer.close(layerss)},cancel:function(){layer.close(layerss)}})},backup_list:function(){var all_back="",that=this;this.$http("get_all_back",(function(edata){for(var i=0;i '+date+' "+edata[i][3]+' '+edata[i][1]+' Del '}$(".allback .buplist").html(all_back)}))},manage_backup:function(){var that=this,layerss=layer.open({type:1,closeBtn:2,title:"Manage Backups",area:["630px","500px"],shadeClose:!1,content:'
            Backup time Backup path Name Delect
            ',cancel:function(){layer.close(layerss)},success:function(){that.backup_list(),$("#btn-backup").click((function(e){var backup_path=$("#server_path").val();that.backup_files_permission(backup_path,0)})),$(".allback").on("click",".del_back",(function(){var _id=$(this).parents("tr").attr("data-id");that.del_backup(_id)}))}})},del_backup:function(id){var that=this;layer.confirm("The backup cannot be restored after deletion.
            Continue to delete?",{title:"Confirm delete?",btn:["Yes","No"],closeBtn:2},(function(index,layero){that.$http("del_path_premissions",{id:id},(function(edata){var file=$(".layui-layer-title:eq(0)").text();"Manage Backups"!==file?(file=$(".backup_list").attr("data-path"),that.backup_files_list(file)):$(".allback tbody tr[data-id="+id+"]").remove(),layer.msg(edata.msg,{icon:edata.status?1:2})}))}))},backup_files_list:function(fileName){var that=this;that.$http("get_path_premissions",{path:fileName},(function(edata){var tbody="",cont="";if(0==edata.length)tbody='No data';else for(var i=0;i '+edata[i][4]+" "+edata[i][2]+" "+edata[i][1]+" "+date+' Restore | Del '}cont='
            Fix all permissions to [ Folder: 755, File: 644 ]
            '+tbody+"
            Name permission Owner Backup Time Opt
            ",$(".chmodset").hide(),$(".backup_lists").html(cont),$(".fixper").click((function(){layer.confirm("Note: Under the file or folder all permissions will be fixed to [ Folder: 755, File: 644 ]",{title:"Fix Permissions?",btn:["Confirm","Cancel"],closeBtn:2},(function(index,layero){that.$http("fix_permissions",{path:fileName},(function(res){layer.closeAll(),that.reader_file_list({path:that.file_path,is_operating:!1}),layer.msg(res.msg,{icon:res.status?1:2})}))}))})),$(".restore_backup").click((function(){that.restore_file_permission($(this).attr("data-time"),fileName)})),$(".backup_list").on("click",".del_back",(function(){var _id=$(this).attr("data-id");that.del_backup(_id)}))}))},restore_file_permission:function(restore_time,fileName){var that=this,sub_type=$("#accept_all").prop("checked")?1:0,layerss=layer.open({type:1,closeBtn:2,title:"Confirm restore",area:"330px",shadeClose:!1,btn:["Yes","No"],content:'
            Restore would overwrite the current settings, continue?
            ',yes:function(layerss,index){that.$http("restore_path_permissions",{restore_sub_dir:sub_type,date:restore_time,path:fileName},(function(edata){layer.closeAll(),layer.msg(edata.msg,{icon:1,time:1900})}))},btn2:function(){layer.close(layerss)},cancel:function(){layer.close(layerss)}})},get_present_task_view:function(){this.file_present_task=layer.open({type:1,title:"实时任务队列",area:"500px",closeBtn:2,skin:"present_task_list",shadeClose:!1,shade:!1,offset:"auto",content:'
            '})},render_present_task_list:function(){var that=this;this.get_task_req({status:-3},(function(lists){if(0==lists.length)return layer.close(that.file_present_task),that.file_present_task=null,void that.reader_file_list({path:that.file_path,is_operating:!1});var task_body="",is_add=!1;$.each(lists,(function(index,item){-1==item.status?(that.file_present_task||that.get_present_task_view(),"1"==item.type?task_body+='
            • '+lan.layout.download+item.shell+''+item.log.pre+'%'+lan.public.cancel+'
              '+item.log.used+"/"+ToSize(item.log.total)+''+(0==item.log.speed?lan.layout.connect:item.log.speed)+'/s'+lan.files.expected_to_be+": "+item.log.time+"
            ":task_body+='
            '+item.name+": "+item.shell+''+lan.public.cancel+'
            '+item.log+"
            "):(is_add||(task_body+='
            '+lan.layout.wait_task+'
              ',is_add=!0),task_body+='
            • '+item.name+": "+item.shell+'X
            • ')})),that.file_present_task&&(is_add&&(task_body+="
            "),$(".message-list").html(task_body)),setTimeout((function(){that.render_present_task_list()}),1e3)}))},remove_present_task:function(id){var that=this;layer.confirm("Do you want to cancel the upload of files? It need to delete the uploaded files manually. Continue?",{title:"Cancel file upload",icon:0},(function(indexs){bt.send("remove_task","task/remove_task",{id:id},(function(rdata){layer.msg(rdata.msg,{icon:1}),layer.close(that.file_present_task),that.file_present_task=null})),layer.close(indexs)}))},edit_access_authority:function(){for(var access=$("#access").val(),idName=["owner","group","public"],n=0;nidName.length))switch(onacc>7&&$("#access").val(access.substr(0,access.length-1)),onacc){case"1":$("#"+idName[i]+"_x").prop("checked",!0);break;case"2":$("#"+idName[i]+"_w").prop("checked",!0);break;case"3":$("#"+idName[i]+"_x").prop("checked",!0),$("#"+idName[i]+"_w").prop("checked",!0);break;case"4":$("#"+idName[i]+"_r").prop("checked",!0);break;case"5":$("#"+idName[i]+"_r").prop("checked",!0),$("#"+idName[i]+"_x").prop("checked",!0);break;case"6":$("#"+idName[i]+"_r").prop("checked",!0),$("#"+idName[i]+"_w").prop("checked",!0);break;case"7":$("#"+idName[i]+"_r").prop("checked",!0),$("#"+idName[i]+"_w").prop("checked",!0),$("#"+idName[i]+"_x").prop("checked",!0)}}},get_file_authority:function(data,callback){this.$http("GetFileAccess",{filename:data.path},(function(rdata){callback&&callback(rdata)}))},set_dir_kill:function(data){var that=this;"php"==data.ext?that.$http("file_webshell_check",{filename:data.path},(function(rdata){layer.msg(rdata.msg,{icon:rdata.status?1:2})})):layer.confirm("目录查杀将包含子目录中的php文件,是否操作?",{title:"目录查杀["+data.filename+"]",closeBtn:2,icon:3},(function(index){that.$http("dir_webshell_check",{path:data.path},(function(rdata){layer.msg(rdata.msg,{icon:rdata.status?1:2})}))}))},path_resolve:function(paths,param){var path="",split="";return Array.isArray(param)||(param=[param]),paths.replace(/([\/|\/]*)$/,(function($1){return split=$1,"www"})),$.each(param,(function(index,item){path+="/"+item})),(paths+path).replace("//","/")},get_ext_name:function(fileName){for(var extArr=fileName.split("."),exts=["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"],extLastName=extArr[extArr.length-1],i=0;i')},yes:function(){var ress;if(""==form.getVal().dfile)return layer.msg("Please select a valid address",{icon:2});form.submitForm((function(res,datas){setTimeout((function(){that.reader_file_list({path:datas.path})}),1e3),null!=res&&null!=res||layer.msg(lan.files.zip_ok,{icon:1}),res.status&&that.render_present_task_list(),layer.close(loadT)}))}})}))},unpack_file_to_path:function(data){var that=this,_type="zip",spath="";spath=data.path.substring(0,data.path.lastIndexOf("/")),this.reader_form_line({url:"UnZip",overall:{width:"310px"},data:[{label:"File name",name:"z_name",placeholder:"Compress file name",value:data.path},{label:"Compress path",name:"z_path",placeholder:"Compress path",value:spath},{label:"Encoding",name:"z_code",type:"select",value:"UTF-8",list:[["UTF-8","UTF-8"],["gb18030","GBK"]]}],beforeSend:function(updata){return{sfile:updata.z_name,dfile:updata.z_path,type:_type,coding:updata.z_code,password:updata.z_password}}},(function(form,html){var loadT=layer.open({type:1,title:"Decompress file",area:"520px",shadeClose:!1,closeBtn:2,skin:"unpack_file_view",btn:["Comfirm","Cancel"],content:html[0].outerHTML,success:function(){"gz"==data.ext&&(_type="tar"),"zip"==_type&&$(".unpack_file_view .line:nth-child(2)").append('
            Password
            ')},yes:function(){var ress=form.getVal();return""==ress.z_name?layer.msg("Please enter the file name path",{icon:2}):""==ress.z_path?layer.msg("Please enter the decompression address",{icon:2}):void form.submitForm((function(res,datas){layer.close(loadT),setTimeout((function(){that.reader_file_list({path:datas.path})}),1e3),res.status&&that.render_present_task_list(),layer.msg(res.msg,{icon:res.status?1:2})}))}})}))},match_unqualified_string:function(item){var containSpecial;return RegExp(/[(\ )(\*)(\|)(\\)(\:)(\")(\/)(\<)(\>)(\?)(\)]+/).test(item)},reader_form_line:function(config,callback){var that=this,random=bt.get_random(10),html=$('
            '),data=config,eventList=[],that=this;Array.isArray(config)||(data=config.data),$.each(data,(function(index,item){var labelWidth=item.labelWidth||config.overall.labelWidth||null,event_random=bt.get_random(10),width=item.labelWidth||config.overall.width||null,form_line=$('
            "+(item.label||"")+'
            '),form_el=$(function(){switch(item.type){case"select":return"";case"text":default:return"'}}(item));(item.eventType||item.event)&&(Array.isArray(item.eventType)||(item.eventType=[item.eventType]),$.each(item.eventType,(function(index,items){if(eventList.push({el:event_random,type:items||"click",event:item[items]||null}),config.el){var els=$('[data-event="'+item.el+'"]');if(item[items])"enter"==items?els.on("keyup",(function(e){13==e.keyCode&&item.event(e)})):els.on(item||"click",item.event);else if("focus"==items){var vals=els.val();""!=vals&&els.val("").focus().val(vals)}else els[items]()}}))),form_line.find(".info-r").append(form_el),html.append(form_line)})),config.el&&$(config.el).empty().append(html),callback&&callback({getVal:function(){return $("#"+random).serializeObject()},setEvent:function(){$.each(eventList,(function(index,item){var els=$('[data-event="'+item.el+'"]');if(null===item.event)if("focus"==item.type){var vals=els.val();""!=vals&&els.val("").focus().val(vals)}else els[item.type]();else"enter"==item.type?els.on("keyup",(function(e){13==e.keyCode&&item.event(e)})):els.on(item.type,item.event)}))},submitForm:function(callback){var data=this.getVal();config.beforeSend&&(data=config.beforeSend(data)),that.loadT=bt.load("submitting the form, please wait..."),bt.send(config.url,"files/"+config.url,data,(function(rdata){that.loadT.close(),callback&&callback(rdata,data)}))}},html)},$http:function(data,parem,callback){var that=this,loadT="";"string"==typeof data?("object"!=typeof parem&&(callback=parem,parem={}),Array.isArray(this.method_list[data])||(this.method_list[data]=["files",this.method_list[data]]),this.$http({method:data,tips:!!this.method_list[data][1]&&this.method_list[data][1],module:this.method_list[data][0],data:parem,msg:!0},callback)):(void 0!==data.tips&&data.tips&&(loadT=bt.load(data.tips)),bt.send(data.method,(data.module||"files")+"/"+data.method,data.data||{},(function(res){if(""!=loadT&&loadT.close(),"string"==typeof res&&(res=JSON.parse(res)),!1===res.status&&res.msg)return bt.msg(res),!1;parem&&parem(res)})))}};bt_file.init(),Function.prototype.delay=function(that,arry,time){return Array.isArray(arry)||(time=arry,arry=[]),void 0===time&&(time=0),setTimeout(this.apply(that,arry),time),this},jQuery.prototype.serializeObject=function(){var a,o,h,i,e;for(a=this.serializeArray(),h=(o={}).hasOwnProperty,i=0;i-1,init:function(){0==$("#mask_layer").length&&(window.UploadFiles=function(){bt_file.file_drop.dialog_view()},$("body").append($('")),this.event_relation(document.querySelector("#container"),document,document.querySelector("#mask_layer")))},event_relation:function(e,t,i){var a=this;Object.keys(arguments);for(var l in arguments)"object"==typeof arguments[l]&&void 0!==arguments[l].nodeType&&(arguments[l]={el:arguments[l],callback:null});t.el.addEventListener("dragleave",null!=t.callback?t.callback:function(e){0==e.x&&0==e.y&&$("#mask_layer").hide(),e.preventDefault()},!1),e.el.addEventListener("dragenter",null!=e.callback?e.callback:function(e){if("string"==e.dataTransfer.items[0].kind)return!1;$("#mask_layer").show(),a.isLayuiDrop=!1,e.preventDefault()},!1),i.el.addEventListener("dragover",function(e){e.preventDefault()},!1),i.el.addEventListener("drop",null!=e.callback?i.callback:a.ev_drop,!1)},ev_drop:function(e){function t(e){e.getFilesAndDirectories().then(function(t){return n(t,e.path)})}if("string"==e.dataTransfer.items[0].kind)return!1;if(!bt_file.file_drop.is_webkit)return $("#mask_layer").hide(),!1;if(e.preventDefault(),bt_file.file_drop.uploading)return layer.msg("Uploading files, please wait..."),!1;var i,a=e.dataTransfer.items,l=0;if(loadT=layer.msg("Getting upload files details, please wait...",{icon:16,time:0,shade:.3}),bt_file.file_drop.isUpload=!0,a&&a.length&&null!=a[0].webkitGetAsEntry&&"file"!=a[0].kind)return!1;null==bt_file.file_drop.filesList&&(bt_file.file_drop.filesList=[]);for(var s=bt_file.file_drop.filesList.length-1;s>=0;s--)bt_file.file_drop.filesList[s].is_upload&&bt_file.file_drop.filesList.splice(-s,1);$("#mask_layer").hide();var n=function(e,a){if(!bt_file.file_drop.isUpload)return!1;for(var s=0;sbt_file.file_drop.isUploadNumber)return bt_file.file_drop.isUpload=!1,layer.msg(" "+bt_file.file_drop.isUploadNumber+" items cannot upload, please compress first!。",{icon:2,area:"405px"}),bt_file.file_drop.filesList=[],clearTimeout(i),!1;bt_file.file_drop.filesList.push({file:e[s],path:bt.get_file_path(a+"/"+e[s].name).replace("//","/"),name:e[s].name.replace("//","/"),icon:bt_file.get_ext_name(e[s].name),size:bt_file.file_drop.to_size(e[s].size),upload:0,is_upload:!1}),bt_file.file_drop.uploadAllSize+=e[s].size,clearTimeout(i),i=setTimeout(function(){layer.close(loadT),bt_file.file_drop.dialog_view()},100),l++}};"getFilesAndDirectories"in e.dataTransfer&&e.dataTransfer.getFilesAndDirectories().then(function(e){return n(e,"/")})},dialog_view:function(e){var t=this,i="";if(this.f_path=bt_file.file_path,!$(".file_dir_uploads").length>0){null==t.filesList&&(t.filesList=[]);for(var a=0;a
            '+(l.path+"/"+l.name).replace("//","/")+''+l.size+''+t.is_upload_status(l.upload)+'
            '}var s=t.filesList.length>11;layer.open({type:1,closeBtn:1,maxmin:!0,area:["550px","505px"],btn:["Upload","Cancel","Clear"],title:"Upload files to【"+bt.get_cookie("Path")+"】--- Support breakpoint renewal",skin:"file_dir_uploads",content:'
            '+(""!=i?'
            • File nameFile sizeFile status
              '+i+"
            ":"Please drag the file here"+(t.is_webkit?"":'The current browser does not support drag upload. Commend to use Chrome browser or WebKit kernel for browsing')+"")+"
            ",success:function(layers){layers.find('.layui-layer-btn2').css('margin','0 300px 0 0');$("#mask_layer").hide(),$(".file_dir_uploads .layui-layer-max").hide(),$(".upload_btn_groud .upload_file_btn").click(function(){$(".upload_btn_groud .dropdown-menu [data-type=file]").click()}),$(".upload_btn_groud .dropdown-menu a").click(function(){var e=$(this).attr("data-type");$('").change(function(e){for(var i=e.target.files,a=0;aPlease drag the file here')});t.filesList.length=0;return !1;}else{$('.upload_file_body').addClass('active').html('Please drag the file here');t.filesList.length=0;return !1;}},end:function(){t.clear_drop_stauts(!0)},min:function(){$(".file_dir_uploads .layui-layer-max").show(),$("#layui-layer-shade"+$(".file_dir_uploads").attr("times")).fadeOut()},restore:function(){$(".file_dir_uploads .layui-layer-max").hide(),$("#layui-layer-shade"+$(".file_dir_uploads").attr("times")).fadeIn()}})}else{if(null==e&&!t.isLayuiDrop)return!1;if(t.isLayuiDrop&&(e=t.filesList),$(".upload_file_body").html('
            • File nameFile sizeFile status
              ').removeClass("active"),Array.isArray(e)){for(a=0;a
              '+(l.path+"/"+l.name).replace("//","/")+''+l.size+''+t.is_upload_status(l.upload)+'
              '}$(".dropUpLoadFile").append(i)}else $(".dropUpLoadFile").append('
            • '+(e.path+"/"+e.name).replace("//","/")+''+e.size+''+t.is_upload_status(e.upload)+'
            • ')}},is_upload_status:function(e,t){switch(void 0===t&&(t=""),e){case-1:return'Fail'+(""!=t?","+t:"")+"";case 0:return'Waiting to upload';case 1:return'Uploaded';case 2:return'Uploading '+t+"";case 3:return'Stoped'}},set_upload_view:function(e,t){var i=$(".dropUpLoadFile li:eq("+e+")"),a=this,l=$(".file_upload_info");0==$(".file_upload_info .uploadProgress").length&&$(".file_upload_info").html('Total process ,Uploading ,Fail Speed Getting,Expect time Getting'),l.show().prev().hide().parent().css("paddingRight",0),a.errorLength>0&&l.find(".uploadError").text("("+a.errorLength+"份)").parent().show(),l.find(".uploadNumber").html("("+a.uploadLength+"/"+a.filesList.length+")"),l.find(".uploadProgress").html((a.uploadedSize/a.uploadAllSize*100).toFixed(2)+"%"),1===t.upload||-1===t.upload?(a.filesList[e].is_upload=!0,a.uploadLength+=1,i.find(".fileLoading").css({width:"100%",opacity:".5",background:-1==t.upload?"#ffadad":"#20a53a21"}),i.find(".filesize").text(t.size),i.find(".fileStatus").html(a.is_upload_status(t.upload,1===t.upload?"(Time:"+a.diff_time(a.startTime,a.endTime)+")":t.errorMsg)),i.find(".fileLoading").fadeOut(500,function(){$(this).remove();var e=$(".dropUpLoadFile");if(0==e.length)return!1;e[0].scrollHeight>e.height()&&e.scrollTop(e.scrollTop()+40)})):(i.find(".fileLoading").css("width",t.percent),i.find(".filesize").text(t.upload_size+"/"+t.size),i.find(".fileStatus").html(a.is_upload_status(t.upload,"("+t.percent+")")))},clear_drop_stauts:function(e){var t=new Date,i=this;if(!e)try{var a=bt_file.file_drop.to_size(bt_file.file_drop.uploadedSize/((t.getTime()-bt_file.file_drop.initTimer.getTime())/1e3));$(".file_upload_info").html(""+this.uploadLength+" uploaded,"+(this.errorLength>0?this.errorLength+"failures, ":"")+"time"+this.diff_time(this.initTimer,t)+",speed "+a+"/s").append($('').click(function(){$(".file_upload_info").hide().prev().show()}))}catch(e){}$(".layui-layer-btn0").removeAttr("style data-upload").text(lan.upload.upload),$.extend(bt_file.file_drop,{startTime:0,endTime:0,uploadLength:0,splitSize:2097152,filesList:[],errorLength:0,isUpload:!1,isUploadNumber:800,uploadAllSize:0,uploadedSize:0,topUploadedSize:0,uploadExpectTime:0,initTimer:0,speedInterval:null,timerSpeed:0,uploading:!1}),clearInterval(i.speedInterval)},upload_file:function(e,t){if(null==e&&0==this.uploadSuspend.length&&(e=0,t=0),this.filesList.length===t)return clearInterval(this.speedInterval),this.clear_drop_stauts(),bt_file.reader_file_list({path:bt_file.file_path,is_operating:!1}),!1;var i=this;i.splitEndTime=(new Date).getTime(),i.get_timer_speed(),i.splitStartTime=(new Date).getTime();var a=this.filesList[t],l="";if(null==a)return!1;l=Math.min(a.file.size,e+this.splitSize),i.fileSize=l-e,form=new FormData,0==e&&(i.startTime=new Date,a=$.extend(a,{percent:"0%",upload:2,upload_size:"0B"})),form.append("f_path",this.f_path+a.path),form.append("f_name",a.name),form.append("f_size",a.file.size),form.append("f_start",e),form.append("blob",a.file.slice(e,l)),i.set_upload_view(t,a),$.ajax({url:"/files?action=upload",type:"POST",data:form,async:!0,processData:!1,contentType:!1,success:function(s){"number"==typeof s?(i.set_upload_view(t,$.extend(a,{percent:(s/a.file.size*100).toFixed(2)+"%",upload:2,upload_size:i.to_size(s)})),i.uploadedSize+=l!=s?s:parseInt(l-e),i.upload_file(s,t)):s.status?(i.endTime=new Date,i.uploadedSize+=parseInt(l-e),i.set_upload_view(t,$.extend(a,{upload:1,upload_size:a.size})),i.upload_file(0,t+=1)):(i.set_upload_view(t,$.extend(a,{upload:-1,errorMsg:s.msg})),i.errorLength++)},error:function(a){if(void 0===i.filesList[t].req_error&&(i.filesList[t].req_error=1),i.filesList[t].req_error>2)return i.set_upload_view(t,$.extend(i.filesList[t],{upload:-1,errorMsg:"error"==a.statusText?lan.public.network_err:a.statusText})),i.errorLength++,i.upload_file(e,t+=1),!1;i.filesList[t].req_error+=1,i.upload_file(e,t)}})},get_timer_speed:function(e){var t=(new Date).getTime();if(t-this.speedLastTime>1e3){var i=this;null==e&&(e=200);var a=(i.splitEndTime-i.splitStartTime)/1e3;if(i.timerSpeed=(i.fileSize/a).toFixed(2),i.updateedSizeLast=i.uploadedSize,i.timerSpeed<2)return;$(".file_upload_info .uploadSpeed").text(i.to_size(isNaN(i.timerSpeed)?0:i.timerSpeed)+"/s");var l=i.time(parseInt((i.uploadAllSize-i.uploadedSize)/i.timerSpeed*1e3));isNaN(i.timerSpeed)||$(".file_upload_info .uploadEstimate").text(-1==l.indexOf("NaN")?l:"0 "+lan.bt.s),this.speedLastTime=t}},time:function(e){var t=Math.floor(e/36e5),i=Math.floor(e/6e4),a=parseInt(e%6e4/1e3),l=a+"sec";return i>0&&(l=i+"min"+a+"sec"),t>0&&(l=t+"hour"+Math.floor((e-36e5*t)/6e4)+"min"),l},diff_time:function(e,t){var i=t.getTime()-e.getTime(),a=Math.floor(i/6e4),l=i%6e4,s=l/1e3,n=s.toFixed(a>0?0:2)+lan.bt.s;return a>0&&(n=a+"min"+s.toFixed(0)+lan.bt.s),n},to_size:function(e){for(var t=[" B"," KB"," MB"," GB"," TB"," PB"],i=1024,a=0;a1)return e.file_groud_event({open:"soft_link"}),!1;var i=$(this).data("type"),a=$(".create_file_or_dir .nav_down_list");if(a.css({display:function(){return setTimeout(function(){a.removeAttr("style")},100),"none"}}),e.is_editor)return!1;e.is_editor=!0,$(".file_list_content").prepend('
              '+("icon"==bt.get_cookie("rank")?'":'')+"
              "),$(("icon"==bt.get_cookie("rank")?"textarea":"input")+"[name=createArea]").on("input",function(){"icon"==bt.get_cookie("rank")&&(this.style.height="auto",this.style.height=this.scrollHeight+"px")}).keyup(function(e){13==e.keyCode&&$(this).blur()}).blur(function(t){var a=$(this).val().replace(/[\r\n]/g,"");if(e.match_unqualified_string(a))return layer.msg('Name cannot contain /\\:*?"<>| symbol',{icon:2});""==a&&(a="newBlankDir"==i?"New directory":"New blank file"),setTimeout(function(){e.create_file_req({type:"newBlankDir"==i?"folder":"file",path:e.file_path+"/"+a},function(t){t.status&&e.reader_file_list({path:e.file_path}),layer.msg(t.msg,{icon:t.status?1:2})}),$(".createModel").remove(),e.is_editor=!1},300),t.preventDefault()}).focus(),t.stopPropagation(),t.preventDefault()}),$(".file_nav_view .favorites_file_path ul").on("click","li",function(t){var i=$(this).data("path"),a=$(this).data("type"),l=$(".favorites_file_path .nav_down_list");if("dir"==a)e.reader_file_list({path:i,is_operating:!0});else{if(null!=$(this).data("null"))return!1;var s=$(this).attr("title").split("."),n=s[s.length-1],o=e.determine_file_type(n);switch(o){case"text":openEditorView(0,i);break;case"video":e.open_video_play(i);break;case"images":e.open_images_preview({filename:$(this).attr("title"),path:i});break;default:e.reader_file_list({path:e.retrun_prev_path(i),is_operating:!0})}}l.css({display:function(){return setTimeout(function(){l.removeAttr("style")},100),"none"}}),t.stopPropagation(),t.preventDefault()}),$(".terminal_view").on("click",function(){web_shell()}),$(".share_file_list").on("click",function(){e.open_share_view()}),$(".mount_disk_list").on("click",".nav_btn",function(){var t=$(this).data("menu");e.reader_file_list({path:t,is_operating:!0})}),$(".mount_disk_list").on("click",".nav_down_list li",function(){var t=$(this).data("disk"),i=$(".mount_disk_list.thezoom .nav_down_list");i.css({display:function(){return setTimeout(function(){i.removeAttr("style")},100),"none"}}),e.reader_file_list({path:t,is_operating:!0})}),$(".file_nav_view").on("click",".manage_backup",function(t){e.manage_backup(),t.stopPropagation(),t.preventDefault()}),$(".file_nav_view").on("click",".recycle_bin",function(t){e.recycle_bin_view(),t.stopPropagation(),t.preventDefault()}),$(".file_nav_view .multi").on("click",".nav_btn_group",function(t){var i=$(this).data("type");void 0!==i&&e.batch_file_manage(i),t.stopPropagation(),t.preventDefault()}),$(".file_nav_view .multi").on("click",".nav_btn_group li",function(t){var i=$(this).data("type");e.batch_file_manage(i),t.stopPropagation(),t.preventDefault()}),$(".file_nav_view").on("click",".file_all_paste",function(){e.paste_file_or_dir()}),$(".file_list_header").on("click",".file_name,.file_size,.file_mtime,.file_accept,.file_user",function(t){var i=$(this).attr("data-tid"),a=$(this).find(".icon_sort").hasClass("active"),l=$(this).hasClass("active");return!$(this).find(".icon_sort").hasClass("active")&&$(this).hasClass("active")?$(this).find(".icon_sort").addClass("active"):$(this).find(".icon_sort").removeClass("active"),$(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty(),$(this).find(".icon_sort").html(''),l||(a=!0),bt.set_cookie("files_sort",i),bt.set_cookie("name_reverse",a?"True":"False"),e.reader_file_list({reverse:a?"True":"False",sort:i}),!1}),$(".file_list_header .file_th").each(function(e,t){var i=bt.get_cookie("files_sort"),a=bt.get_cookie("name_reverse");$(this).attr("data-tid")===i&&($(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty(),$(this).find(".icon_sort").html(''),"False"===a&&$(this).find(".icon_sort").addClass("active"))}),$(".file_list_header .file_check").on("click",function(t){var i=parseInt($(this).data("checkbox"));switch(i){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"),e.file_table_arry=e.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"),e.file_table_arry=e.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"),e.file_table_arry=[]}e.calculate_table_active()}),$(".file_list_content").on("click",".file_checkbox",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),l=i.data("filename");i.hasClass("active")?(i.removeClass("active"),e.remove_check_file(e.file_table_arry,"filename",l)):(i.addClass("active"),i.attr("data-filename",e.file_list[a].filename),e.file_table_arry.push(e.file_list[a])),e.calculate_table_active(),t.stopPropagation()}),$(".file_list_content").scroll(function(e){$(this).scrollTop()==$(this)[0].scrollHeight-$(this)[0].clientHeight?($(this).prev().css("opacity",1),$(this).next().css("opacity",0)):$(this).scrollTop()>0?$(this).prev().css("opacity",1):0==$(this).scrollTop()&&($(this).prev().css("opacity",0),$(this).next().css("opacity",1))}),$(".file_table_view .file_list_content").on("click",".file_tr",function(t){if($(t.target).hasClass("foo_menu_title")||$(t.target).parents().hasClass("foo_menu_title"))return!0;$(this).addClass("active").siblings().removeClass("active"),e.file_table_arry=[e.file_list[$(this).data("index")]],e.calculate_table_active(),t.stopPropagation(),t.preventDefault()}),$(".file_table_view .file_list_content").on("click",".file_name .iconfont",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),l=e.file_list[a];l.index=a,$(this).hasClass("icon-share1")&&e.info_file_share(l),$(this).hasClass("icon-favorites")&&e.cancel_file_favorites(l),t.stopPropagation()}),$(".file_table_view .file_list_content").on("dblclick",".file_tr",function(t){var i=$(this).data("index"),a=e.file_list[i];if($(t.target).hasClass("file_check")||$(t.target).parents(".foo_menu").length>0||$(t.target).hasClass("set_file_ps")||e.is_editor)return!1;if("dir"==a.type){if("Recycle_bin"==a.filename)return e.recycle_bin_view();e.reader_file_list({path:e.file_path+"/"+a.filename,is_operating:!0})}else switch(a.open_type){case"text":openEditorView(0,a.path);break;case"video":e.open_video_play(a);break;case"images":e.open_images_preview(a);break;case"compress":e.unpack_file_to_path(a)}t.stopPropagation(),t.preventDefault()}),$(".file_table_view .file_list_content").on("click",".file_title i,.file_ico_type .file_icon",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),l=e.file_list[a];if("dir"==l.type){if("Recycle_bin"==l.filename)return e.recycle_bin_view();e.reader_file_list({path:e.file_path+"/"+l.filename,is_operating:!0})}else layer.msg("compress"==l.open_type?"Double click to unzip the file":"Double click to edit the file");t.stopPropagation(),t.preventDefault()}),$(".file_list_content").on("contextmenu",function(e){return"createArea"==$(e.target).attr("name")||"rename_file_input"==$(e.target).attr("name")}),$(".selection_right_menu").on("contextmenu",function(e){return!1}),$(".file_list_content").on("mousedown",".file_tr",function(t){if(1===t.which&&($(t.target).hasClass("foo_menu_title")||$(t.target).parents().hasClass("foo_menu_title")))e.render_file_groud_menu(t,this),$(t.target).parent().addClass("foo_menu_click"),$(this).siblings().find(".foo_menu").removeClass("foo_menu_click"),$(this).addClass("active").siblings().removeClass("active");else{if(3!==t.which||e.is_editor)return!0;e.file_table_arry.length>1?e.render_files_multi_menu(t):(e.render_file_groud_menu(t,this),$(".content_right_menu").removeAttr("style"),$(this).addClass("active").siblings().removeClass("active"))}t.stopPropagation(),t.preventDefault()}),$(".filePage").on("change",".showRow",function(){var t=$(this).val();bt.set_cookie("showRow",t),e.reader_file_list({showRow:t,p:1,is_operating:!1})}),$(".filePage").on("click","div:nth-child(2) a",function(t){var i=$(this).attr("href").match(/p=([0-9]+)$/)[1];e.reader_file_list({path:e.path,p:i}),t.stopPropagation(),t.preventDefault()}),$(".file_list_content").on("click",".folder_size",function(t){var i=e.file_list[$(this).parents(".file_tr").data("index")],a=this;e.get_file_size({path:i.path},function(e){$(a).text(bt.format_size(e.size))}),t.stopPropagation(),t.preventDefault()}),$(".filePage").on("click","#file_all_size",function(t){if("/"===e.file_path)return layer.tips('The current directory is document root (/),calculate size will occupymassive server IO,continue?',this,{tips:[1,"red"],time:5e3}),!1;e.get_dir_size({path:e.file_path})}),$(".file_list_content").on("mousedown",function(t){ +if($(t.target).hasClass("file_checkbox")||$(t.target).hasClass("file_check")||$(t.target).hasClass("icon-share1")||$(t.target).hasClass("icon-favorites")||"i"==t.target.localName||$(t.target).parents(".app_menu_group").length>0||$(t.target).hasClass("createModel")||$(t.target).hasClass("editr_tr")||"createArea"==$(t.target).attr("name")||"rename_file_input"==$(t.target).attr("name")||$(t.target).hasClass("set_file_ps")||e.is_editor)return!0;if(3==t.which&&!e.is_editor)return $(".selection_right_menu").removeAttr("style"),e.render_file_all_menu(t,this),!0;$(".file_list_content").bind("mousewheel",function(){return!1});var i=$(this),a=0,l=i.offset().top,s=i.offset().left,n={top:t.clientY-$(this).offset().top,left:t.clientX-$(this).offset().left};$(document).unbind("mousemove").mousemove(function(t){var o={top:t.clientY-l>0&&t.clientY-l1?i.height():0,left:t.clientX-s>0&&t.clientX-s1?i.width():0},r={top:o.top>n.top?n.top:o.top,left:o.left>n.left?n.left:o.left};"list"==bt.get_cookie("rank")&&(r.top=r.top+40);var c=Math.min(Math.abs(o.left-n.left),s+i.width()-r.left),d=Math.min(Math.abs(o.top-n.top),l+i.height()-r.top);if(t.clientY-l<0){var p=Math.abs(t.clientY-l);i.scrollTop(i.scrollTop()-p),0!=i.scrollTop()&&(a+=p),d+=a}if(t.clientY-(l+i.height())>1){var _=t.clientY-(l+i.height());i.scrollTop(i.scrollTop()+_),i[0].scrollHeight-i[0].scrollTop!==i[0].clientHeight&&(a+=_),d+=a,r.top=r.top-a}if(n.top==o.top||n.left==o.left)return!0;e.enter_files_box().show().css({left:r.left+"px",top:r.top+"px",width:c+"px",height:d+"px"});var f=e.enter_files_box().offset().top,h=e.enter_files_box().offset().left,u=e.enter_files_box().offset().left+e.enter_files_box().width(),m=e.enter_files_box().offset().top+e.enter_files_box().height();$(i).find(".file_tr").each(function(e,t){var i=$(t).offset().top,a=$(t).offset().left,l=$(t).offset().top+$(t).height(),s=$(t).offset().left+$(t).width();"icon"==bt.get_cookie("rank")?s>=h&&a<=u&&l>=f&&i<=m?$(t).addClass("active"):$(t).removeClass("active"):s>=h&&l>=f&&i<=m?$(t).addClass("active"):$(t).removeClass("active")})}),$(document).on("mouseup",function(){var t=[],a=e.enter_files_box().offset().top,l=e.enter_files_box().offset().left,s=e.enter_files_box().offset().left+e.enter_files_box().width(),n=e.enter_files_box().offset().top+e.enter_files_box().height();$(i).find(".file_tr").each(function(e,i){var o=$(i).offset().top,r=$(i).offset().left,c=$(i).offset().top+$(i).height(),d=$(i).offset().left+$(i).width();"icon"==bt.get_cookie("rank")?d>=l&&r<=s&&c>=a&&o<=n&&t.push($(i).data("index")):d>=l&&c>=a&&o<=n&&t.push($(i).data("index"))}),e.render_file_selected(t),e.enter_files_box().remove(),$(".file_list_content").unbind("mousewheel")}),t.stopPropagation(),t.preventDefault()}),$(".file_list_content").on("blur",".set_file_ps",function(t){var i=$(this).parents(".file_tr").data("index"),a=e.file_list[i],l=$(this).val(),s=$(this).data("value"),n=this;if(l==s)return!1;bt_tools.send("files/set_file_ps",{filename:a.path,ps_type:0,ps_body:l},function(e){$(n).data("value",l)},{tips:"Set ps",tips:!0})}),$(".file_list_content").on("keyup",".set_file_ps",function(e){13==e.keyCode&&$(this).blur(),e.stopPropagation()}),$(".file_list_header").on("mousedown",".file_width_resize",function(e){return!1}),$(".cut_view_model").on("click",function(){var e=$(this).data("type");$(".file_table_view").addClass("icon"==e?"icon_view":"list_view").removeClass("icon"!=e?"icon_view":"list_view").scrollLeft(0),bt.set_cookie("rank",e),$(this).addClass("active").siblings().removeClass("active")}),$(".file_list_content").on("click",".set_operation_group a",function(t){var i=$(this).parents(".file_tr").data(),a=$(this).data("type"),l=e.file_list[i.index];if("more"==a)return!0;l.open=a,l.index=i.index,l.type_tips="file"==l.type?"File":"Directory",e.file_groud_event(l)})},enter_files_box:function(){return 0==$("#web_mouseDrag").length&&$("
              ",{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"),$("#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 e=this,t=$(".file_list_header .file_check");0==this.file_table_arry.length?t.removeClass("active active_2").data("checkbox",0):this.file_table_arry.length==this.file_list.length?t.addClass("active").removeClass("active_2").data("checkbox",1):t.addClass("active_2").removeClass("active").data("checkbox",2),this.file_table_arry.length>0?($(document).unbind("keydown").on("keydown",function(t){var i=t.keyCode,a=t.target.localName.toLowerCase();window.navigator.userAgent.indexOf("Mac");if("input"==a||"textarea"==a)return!0;t.ctrlKey&&67==i&&(1==e.file_table_arry.length?(e.file_groud_event($.extend(e.file_table_arry[0],{open:"copy"})),$(".file_all_paste").removeClass("hide")):e.file_table_arry.length>1&&e.batch_file_manage("copy")),t.ctrlKey&&88==i&&(1==e.file_table_arry.length?(e.file_groud_event($.extend(e.file_table_arry[0],{open:"shear"})),$(".file_all_paste").removeClass("hide")):e.file_table_arry.length>1&&e.batch_file_manage("shear"))}),this.file_table_arry.length>1?($(".nav_group.multi").removeClass("hide"),$(".file_menu_tips").addClass("hide")):($(".nav_group.multi").addClass("hide"),$(".file_menu_tips").removeClass("hide"))):($(".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"),e.set_menu_line_view_resize()},set_dir_view_resize:function(){var e=$(".file_path_input"),t=$(".file_path_input .file_dir_view"),i=t.attr("data-width"),a=null;if(i?parseInt(i):(i=t.width(),t.attr("data-width",i)),t.width()-i<90){var l=0;$($(".file_path_input .file_dir_view .file_dir_item").toArray().reverse()).each(function(){var t=0;$(this).attr("data-width")?t=parseInt($(this).attr("data-width")):($(this).attr("data-width",$(this).width()),t=$(this).width()),l+=t,e.width()-l<=90?$(this).addClass("hide"):$(this).removeClass("hide")})}a=t.children(".file_dir_item.hide").clone(!0);0==t.children(".file_dir_item.hide").length?e.removeClass("active").find(".file_dir_omit").addClass("hide"):(a.each(function(){0==$(this).find(".glyphicon-hdd").length&&$(this).find(".file_dir").before('')}),e.addClass("active").find(".file_dir_omit").removeClass("hide"),e.find(".file_dir_omit .nav_down_list").empty().append(a),e.find(".file_dir_omit .nav_down_list .file_dir_item").removeClass("hide"))},set_menu_line_view_resize:function(){var e=$(".file_nav_view").width(),t=0,i=0,a=$(".mount_disk_list"),l=$(".nav_group.multi");a.attr("data-width")||a.attr("data-width",a.innerWidth()),l.attr("data-width")||0==l.innerWidth()||-1==l.innerWidth()||l.attr("data-width",l.innerWidth()),t=parseInt(a.attr("data-width")),parseInt(l.attr("data-width")),$(".file_nav_view>.nav_group").not(".mount_disk_list").each(function(){i+=$(this).innerWidth()}),i+=$(".menu-header-foot").innerWidth(),e-i.nav_btn_group").each(function(e){e>=$(".batch_group_list>.nav_btn_group").length-(indexs+2)?$(this).hide():$(this).show()}),$(".batch_group_list>.nav_btn_group:last-child").removeClass("hide").show()):($(".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 e=this,t=$(".forward_path span");1==e.file_operating.length?t.addClass("active"):e.file_pointer==e.file_operating.length-1?(t.eq(0).removeClass("active"),t.eq(1).addClass("active")):0==e.file_pointer?(t.eq(0).addClass("active"),t.eq(1).removeClass("active")):t.removeClass("active")},set_file_view:function(){var e=$(".file_list_content"),t=this.area[1]-$(".file_table_view")[0].offsetTop-170;$(".file_bodys").height(this.area[1]-100),50*this.file_list.length>t?(e.attr("data-height",e.data("height")||e.height()).css({overflow:"hidden","overflow-y":"auto",height:t+"px"}),$(".file_shadow_bottom").css("opacity",1)):(e.css({overflow:"hidden","overflow-y":"auto",height:t+"px"}),$(".file_shadow_top,.file_shadow_bottom").css("opacity",0))},open_share_view:function(){var e=this;layer.open({type:1,shift:5,closeBtn:2,area:["850px","580px"],title:"Share list",content:'
              Share nameShare addressExpiration dateOpt
              ',success:function(){e.render_share_list(),$(".download_url_list").on("click",".info_down",function(){var t=$(this).attr("data-index");e.file_share_view(e.file_share_list[t],"list")}),$(".download_table .download_url_page").on("click","a",function(t){var i=$(this).attr("href").match(/p=([0-9]+)$/)[1];e.render_share_list({p:i}),t.stopPropagation(),t.preventDefault()})}})},render_share_list:function(e){var t=this,i="";void 0===e&&(e={p:1}),bt_tools.send("files/get_download_url_list",e,function(a){t.file_share_list=a.data,a.data.length>0?$.each(a.data,function(e,t){i+=''+t.ps+''+t.filename+""+bt.format_data(t.expire)+'Details | Close'}):i='No share data',$(".download_url_list").html(i),$(".download_url_page").html(a.page),$(".download_table").on("click",".del_down",function(){var i=$(this).attr("data-id"),a=$(this).attr("data-ps");t.remove_download_url({id:i,fileName:a},function(i){i.status&&t.render_share_list(e),layer.msg(i.msg,{icon:i.status?1:2})})})},"Share list")},remove_check_file:function(e,t,i){for(var a=e.length;a--;)e[a][t]==i&&e.splice(a,1)},open_download_view:function(){var e=this;e.reader_form_line({url:"DownloadFile",beforeSend:function(e){return{url:e.url,path:e.path,filename:e.filename}},overall:{width:"310px"},data:[{label:"URL address:",name:"url",placeholder:"URL address",value:"http://",eventType:["input","focus"],input:function(){var e=$(this).val(),t=e.split("/");$('[name="filename"]').val(t[t.length-1])}},{label:"Download to:",name:"path",placeholder:"Download to",value:e.file_path},{label:"File name:",name:"filename",placeholder:"Save file name",value:"",eventType:"enter",enter:function(){$(".download_file_view .layui-layer-btn0").click()}}]},function(t,i){var a=bt.open({type:1,title:"Download file",area:"500px",shadeClose:!1,skin:"download_file_view",content:i[0].outerHTML,btn:["Comfirm","Close"],success:function(){t.setEvent()},yes:function(i,l){var s=t.getVal();if(!bt.check_url(s.url))return layer.msg("Please enter valid URL address..",{icon:2}),!1;t.submitForm(function(t){e.render_present_task_list(),layer.msg(t.msg,{icon:t.status?1:2}),a.close()})}})})},set_style_width:function(e,t){var i=bt.get_cookie("formHeader")||$("#file_list_info").html(),a="",l=new RegExp("\\.file_"+e+"\\s?\\{width\\s?\\:\\s?(\\w+)\\s\\!important;\\}","g"),s={name:150,type:80,size:80,mtime:150,accept:80,user:80,ps:150};a=i.replace(l,function(i,a,l,n){return".file_"+e+"{width:"+(t<80?s[e]+"px":t+"px")+" !important;}"}),$("#file_list_info").html(a)},set_file_table_width:function(){var e=$(".file_table_view")[0].offsetWidth,t=0,i=0,a=0,l="",s=0,n=45,o="",r={};$.each(this.file_header,function(e,a){"auto"==a?(t++,r[e]=0):(i+=a,l+="."+e+"{width:"+("file_operation"!=e?a:a-16)+"px !important;}")}),this.is_mobile&&$(".file_operation.file_th").attr("style","margin-right:-10px !important;"),this.file_list.length*n>$(".file_list_content").height()?(r.file_tr=e-(this.is_mobile?0:this.scroll_width),e=e,o+=".file_td.file_operation{width:"+(this.file_header.file_operation-(this.is_mobile?0:this.scroll_width)-10)+"px !important;}",o+=".file_th.file_operation{padding-right:"+(10+(this.is_mobile?0:this.scroll_width))+"px !important}"):(e=e,r.file_tr=e,this.is_mobile&&(o+=".file_td.file_operation{width:"+(this.file_header.file_operation-20)+"px !important;}")),r.file_list_header=e,a=e-i,s=a/t,$.each(r,function(e,t){l+="."+e+"{width:"+(0==t?s:t)+"px !important;}"}),$("#file_list_info").html(l+o)},render_path_list:function(e){var t=this,i='
              ',a="",l=this.file_path.split("/").splice(1),s=this.file_path.split("/")[0];"Windows"===bt.os?(0==l.length&&(l=[]),l.unshift('Local disk ('+s+")")):("/"==this.file_path&&(l=[]),l.unshift("Root dir"));for(var n=0;n '+l[n]+' ';$(".path_input").val("").attr("data-path",this.file_path);var o=$(".file_path_input .file_dir_view");o.html(i),o.attr("data-width",o.width()),t.set_dir_view_resize.delay(t,100)},render_path_down_list:function(e,t,i){var a=this,l="",s=$(e).parent().next().find(".file_dir").attr("title");this.get_dir_list({path:t},function(i){$.each(a.data_reconstruction(i.DIR),function(e,i){var a=("/"!=t?t:"")+"/"+i.filename;l+='
            • '+i.filename+"
            • "}),$(e).html(l)})},reader_file_list:function(e,t){var i=this,a="",l="",s=bt.get_cookie("rank"),n=bt.get_cookie("record_paste_type");"null"!=n&&null!=n?$(".file_nav_view .file_all_paste").removeClass("hide"):$(".file_nav_view .file_all_paste").addClass("hide"),$(".file_table_view").removeClass(".list_view,.icon_view").addClass("list"==s?"list_view":"icon_view"),$(".cut_view_model:nth-child("+("list"==s?"2":"1")+")").addClass("active").siblings().removeClass("active"),this.file_images_list=[],this.get_dir_list(e,function(s){if(!1===s.status&&s.msg.indexOf("The specified directory does not exist!")>-1)return i.reader_file_list({path:"/www"});i.file_path=i.path_check(s.PATH),i.file_list=$.merge(i.data_reconstruction(s.DIR,"DIR"),i.data_reconstruction(s.FILES)),i.is_recycle=s.FILE_RECYCLE,i.file_store_list=s.STORE,bt.set_cookie("Path",i.path_check(s.PATH)),i.reader_file_list_content(i.file_list,function(n){$(".path_input").attr("data-path",i.file_path),$(".file_nav_view .multi").addClass("hide"),$(".selection_right_menu").removeAttr("style"),$.each(["100","200","500","1000","2000"],function(e,t){a+='"});var o=$(s.PAGE);o.append('per pageitem(s)"),$(".filePage").html('
              Total '+n.is_dir_num+" directory, "+(i.file_list.length-n.is_dir_num)+'file(s), size:Click to calculate
              '+o[0].outerHTML),e.is_operating&&i.file_operating[i.file_pointer]!=s.PATH&&(l=i.file_operating[i.file_pointer+1],void 0!==l&&l!=s.PATH&&i.file_operating.splice(i.file_pointer+1),i.file_operating.push(s.PATH),i.file_pointer=i.file_operating.length-1),i.render_path_list(),i.set_file_forward(),i.render_favorites_list(),i.set_file_view(),i.set_file_table_width(),t&&t(s)})})},data_reconstruction:function(e,t,i){var a=this,l=[],s=[["/etc","PS: System files directory"],["/home","PS: Home directory"],["/tmp","PS: Common temporary files directory"],["/root","PS: Main directory of system admin"],["/usr","PS: System application directory"],["/boot","PS: System run directory"],["/lib","PS: System source file directory"],["/mnt","PS: Store temporary mapped file system"],["/www","PS: Aapanel program directory"],["/bin","PS: Store binary executable file directory"],["/dev","PS: Storage device file directory"],["/www/wwwlogs","PS: Default site logs directory"],["/www/server","PS: Aapanel soft installed directory"],["/www/wwwlogs","PS: Site logs directory"],["/www/Recycle_bin",lan.files.recycle_bin_dir],["/www/server/panel","PS: Aapanel main program directory, do not move"],["/www/server/panel/plugin","PS: Aapanel plugin directory"],["/www/server/panel/BTPanel","PS: Aapanel directory"],["/www/server/panel/BTPanel/static","PS: Aapanel static directory"],["/www/server/panel/BTPanel/templates","PS: Aapanel templates directory"],[bt.get_cookie("backup_path"),"PS: Default backup directory"],[bt.get_cookie("sites_path"),"PS: Default site directory"]];return e.length<1?[]:($.each(e,function(e,i){var n=i.split(";"),o="",r=n[0].split("."),c=r[r.length-1];switch(n[0]){case".user.ini":o=lan.files.php_profile;break;case".htaccess":o=lan.files.apache_profile;break;case"swap":o=lan.files.swap_file}-1!=n[0].indexOf("Recycle_bin")&&(o=lan.files.swap_file),-1!=n[0].indexOf(".upload.tmp")&&(o=lan.files.recycle_bin_dir);for(var d=0;d0?($.each(this.file_store_list,function(t,i){e+='
            • '+i.name+"
            • "}),e+='
            • Management
            • '):e='
            • (Empty)
            • ',$(".favorites_file_path .nav_down_list").html(e)},set_favorites_manage:function(){var e=this;layer.open({type:1,title:"Manage Favorites",area:["850px","580px"],closeBtn:2,shift:5,shadeClose:!1,content:"
              PathOpt
              ",success:function(t){e.render_favorites_type_list(),setTimeout(function(){$(t).css("top",($(window).height()-$(t).height())/2)},50)},cancel:function(){e.reader_file_list({path:e.file_path})}})},render_favorites_type_list:function(){var e="";this.$http("get_files_store",function(t){t.length>0?$.each(t,function(t,i){e+=''+i.path+'Del"}):e='No favorites',$(".favorites_body").html(e),jQuery.prototype.fixedThead?$(".stroe_tab_list .divtable").fixedThead({resize:!1}):$(".stroe_tab_list .divtable").css({overflow:"auto"})})},load_favorites_index_list:function(){var e=this;this.$http("get_files_store",function(t){e.file_store_list=t,e.render_favorites_list()})},del_favorites:function(e){var t=this;layer.confirm("Comfirm delete path【"+e+"】?",{title:"Delete favorites",closeBtn:2,icon:3},function(i){t.$http("del_files_store",{path:e},function(e){e.status&&t.render_favorites_type_list(),layer.msg(e.msg,{icon:e.status?1:2})})})},reader_file_list_content:function(e,t){var i="",a=this,l=0,s=0;$.each(e,function(e,t){t.filename;var n=bt.get_random(10),o=(a.file_path+"/"+t.filename).replace("//","/"),r=a.determine_file_type(t.ext,"compress"),c=function(){var e="open";switch(a.determine_file_type(t.ext)){case"images":e="Preview";break;case"video":e="Play";break;default:e="compress"==a.determine_file_type(t.ext)?"":"Edit"}return"dir"==t.type&&(e="Open"),e}();a.file_list[e].only_id=n,i+='
              "+t.filename+t.soft_link+""+(t.caret?'':"")+(0!=t.down_id?'':"")+'
              '+("dir"==t.type?"directory":a.ext_type_tips(t.ext))+'
              '+t.user+" / "+t.root_level+'
              '+("dir"==t.type?'Calculate':bt.format_size(t.size))+'
              '+bt.format_data(t.mtime)+'
              '+(t.is_os_ps?t.ps:'')+'
              '+c+' | Copy | Cut | Rename | PMSN | '+(r?"Unzip":"Zip")+' | Del | More
              ',"dir"==t.type&&l++,t.path=o,t.open_type=a.determine_file_type(t.ext),"images"==t.open_type&&(t.images_id=s,a.file_images_list.push(t.path),s++)}),$(".file_list_content").html(i),t&&t({is_dir_num:l}),a.clear_table_active()},render_file_disk_list:function(){var e=this,t="",i="";e.get_disk_list(function(a){$.each(a,function(e,a){t+='",i+='
            • '+("/"==a.path?"Root dir":a.path)+" ("+a.size[2]+")
            • "}),$(".mount_disk_list").html('
              '+lan.files.mounted_disk+'
              '+t+"
              "),e.set_menu_line_view_resize()})},render_file_groud_menu:function(e,t){var i=this,a=$(t).data("index"),l="Open",s=i.file_list[a],n=["zip","rar","gz","war","tgz","bz2"],o={open:l,split_0:!0,download:"Download",share:"Share file",cancel_share:"Cancel share",favorites:"Favorites file",cancel_favorites:"Cancel favorites",split_1:!0,authority:"Permission",split_2:!0,copy:"Copy",shear:"Cut",rename:"Rename",del:"Delete",split_3:!0,compress:"Compress",unzip:"Unzip",open_find_dir:"Open file location",split_4:!0,property:"Properties"};switch(i.determine_file_type(s.ext)){case"images":l="Preview";break;case"video":l="Play";break;default:l="Edit"}o.open="dir"==s.type?"Open":l,"dir"===s.type&&delete o.download,"compress"==s.open_type&&delete o.open,0!=s.down_id?delete o.share:(delete o.cancel_share,o.share="dir"==s.type?"Share dir":"Share file"),!1!==s.caret?delete o.favorites:(delete o.cancel_favorites,o.favorites="dir"==s.type?"Favorites dir":"Favorites file"),"php"==s.ext&&(o.dir_kill="文件查杀"),"php"!=s.ext&&"dir"!=s.type&&delete o.dir_kill;var r=0;$.each(n,function(e,t){t==s.ext&&r++}),0==r&&delete o.unzip,s.is_search?o.open_find_dir="dir"==s.type?"Open dir":"Open file location":delete o.open_find_dir,i.file_selection_operating=o,i.reader_menu_list({el:$(".selection_right_menu"),ev:e,data:s,list:o})},render_file_all_menu:function(e,t){var i=this,a={refresh:"Refresh",split_0:!0,upload:"Upload",create:["New file/folder",{create_dir:"New folder",create_files:"New file",soft_link:"Softlink"}],web_shell:"Terminal",split_1:!0,paste:"Paste"},l=bt.get_cookie("record_paste_type");"null"!=l&&null!=l||(delete a.split_1,delete a.paste),i.reader_menu_list({el:$(".selection_right_menu"),ev:e,data:{},list:a})},render_files_multi_menu:function(e){var t=this,i=[["copy","Copy"],["shear","cut"],["authority","Permission"],["compress","Compress"],["del","Delete"]],a=$(".selection_right_menu").find("ul"),l=a.height(),s=a.width(),n=e.clientX-(this.area[0]-e.clientX'):a.append($('
            • '+i[1]+"
            • ").append(s).on("click",{type:i[0],data:t.file_table_arry},function(e){$(".selection_right_menu").removeAttr("style"),t.batch_file_manage(e.data.type),e.stopPropagation(),e.preventDefault()}))}),$(".selection_right_menu").css({left:n,top:e.clientY-(this.area[1]-e.clientY'):(Array.isArray(l)&&(s=$('
                '),n=s.find(".set_group"),$.each(l[1],function(i,a){n.append($('
              • '+a+"
              • ").on("click",{type:i,data:e.data},function(i){t.file_groud_event($.extend(i.data.data,{open:i.data.type,index:parseInt($(e.ev.currentTarget).data("index")),element:e.ev.currentTarget,type_tips:"dir"==e.data.type?"folder":"file"})),e.el.removeAttr("style"),i.stopPropagation(),i.preventDefault()}))})),i.append($('
              • '+(Array.isArray(l)?l[0]:l)+"
              • ").append(s).on("click",{type:a,data:e.data},function(i){t.file_groud_event($.extend(i.data.data,{open:i.data.type,index:parseInt($(e.ev.currentTarget).data("index")),element:e.ev.currentTarget,type_tips:"dir"==e.data.type?"folder":"file"})),"compress"!=a&&"create"!=a&&e.el.removeAttr("style"),i.stopPropagation(),i.preventDefault()})))}),a=i.innerHeight(),n=e.ev.clientY-(this.area[1]-e.ev.clientY'+lan.files.recycle_bin_warning+"",function(){t.$http("SetBatchData",e,function(e){e.status&&t.reader_file_list({path:t.file_path}),layer.msg(e.msg,{icon:e.status?1:2})})})},batch_file_paste:function(){var e=this,t=bt.get_cookie("record_paste_type");this.check_exists_files_req({dfile:this.file_path},function(i){if(i.length>0){for(var a="",l=0;l'+i[l].filename+""+ToSize(i[l].size)+""+getLocalTime(i[l].mtime)+"";var s='
                '+a+"
                File nameSizeLast edit time
                ";SafeMessage("The following files will be overwritten",s,function(){e.$http("BatchPaste",{type:t,path:e.file_path},function(t){t.status&&(bt.set_cookie("record_paste_type",null),e.reader_file_list({path:e.file_path})),layer.msg(t.msg,{icon:t.status?1:2})})})}else e.$http("BatchPaste",{type:t,path:e.file_path},function(t){t.status&&(bt.set_cookie("record_paste_type",null),e.reader_file_list({path:e.file_path})),layer.msg(t.msg,{icon:t.status?1:2})})})},recycle_bin_view:function(){var e=this;layer.open({type:1,shift:5,closeBtn:2,area:["80%","606px"],title:lan.files.recycle_bin_title,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+'

                '+lan.files.recycle_bin_th1+" "+lan.files.recycle_bin_th2+" "+lan.files.recycle_bin_th3+' '+lan.files.recycle_bin_th4+' '+lan.files.recycle_bin_th5+'
                ',success:function(){-1!=window.location.href.indexOf("database")?($(".re-con-menu p:last-child").addClass("on").siblings().removeClass("on"),e.render_recycle_list(6)):e.render_recycle_list(1),$(".re-con-menu").on("click","p",function(){var t=$(this).data("type");$(this).addClass("on").siblings().removeClass("on"),e.render_recycle_list(t)})}})},render_recycle_list:function(e){var t=this;this.$http("Get_Recycle_bin",function(i){function a(e){var t=e.split("."),i=t.length-1;return t=t[i],t}function l(e){for(var t=["jpg","jpeg","png","bmp","gif","tiff","ico"],i=0;i20&&(o=o.substring(0,20)+"..."),r.length>20&&(r=r.substring(0,20)+"..."),s+=' '+o+' '+r+" "+ToSize(i.dirs[n].size)+" "+getLocalTime(i.dirs[n].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}for(n=0;n20&&(o=o.substring(0,20)+"..."),r.length>20&&(r=r.substring(0,20)+"..."),s+=' '+o+' '+r+" "+ToSize(i.files[n].size)+" "+getLocalTime(i.files[n].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}else{var o=i.files[n].name.replace(/'/,"\\'"),r=i.files[n].dname;o.length>20&&(o=o.substring(0,20)+"..."),r.length>20&&(r=r.substring(0,20)+"..."),s+=' '+o.replace("BTDB_","")+' mysql://'+r.replace("BTDB_","")+" - "+getLocalTime(i.files[n].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(s);case 2:for(n=0;n20&&(o=o.substring(0,20)+"..."),r.length>20&&(r=r.substring(0,20)+"..."),s+=' '+o+' '+r+" "+ToSize(i.dirs[n].size)+" "+getLocalTime(i.dirs[n].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(s);case 3:for(n=0;n20&&(o=o.substring(0,20)+"..."),r.length>20&&(r=r.substring(0,20)+"..."),s+=' '+o+' '+r+" "+ToSize(i.files[n].size)+" "+getLocalTime(i.files[n].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(s);case 4:for(n=0;n20&&(o=o.substring(0,20)+"..."),r.length>20&&(r=r.substring(0,20)+"..."),s+=' '+o+' '+r+" "+ToSize(i.files[n].size)+" "+getLocalTime(i.files[n].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(s);case 5:for(n=0;n20&&(o=o.substring(0,20)+"..."),r.length>20&&(r=r.substring(0,20)+"..."),s+=' '+o+' '+r+" "+ToSize(i.files[n].size)+" "+getLocalTime(i.files[n].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(s);case 6:for(n=0;n20&&(o=o.substring(0,20)+"..."),r.length>20&&(r=r.substring(0,20)+"..."),s+=' '+o.replace("BTDB_","")+' mysql://'+r.replace("BTDB_","")+" - "+getLocalTime(i.files[n].time)+' "+lan.files.recycle_bin_re+' | "+lan.files.recycle_bin_del+" "}return void $("#RecycleBody").html(s)}$("#RecycleBody").html(s)})},recycle_bin_view:function(){var e=this;layer.open({title:lan.files.recycle_bin_title,type:1,skin:"recycle_view",area:["80%","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(){-1!=window.location.href.indexOf("database")?($(".re-con-menu p:last-child").addClass("on").siblings().removeClass("on"),$(".re-con-menu p:eq(5)").click()):$(".re-con-menu p:eq(0)").click();var t=e.render_recycle_list();$(".re-con-menu").on("click","p",function(){$(this).data("type");$(this).addClass("on").siblings().removeClass("on"),t.$refresh_table_list(!0)})}})},render_recycle_list:function(){var e=this;$("#recycle_table").empty();var t=bt_tools.table({el:"#recycle_table",url:"/files?action=Get_Recycle_bin",height:480,dataFilter:function(t){var i=[];switch($(".re-con-menu p.on").index()){case 0:for(let e=0;e-1?(l.dname=l.dname.replace("BTDB_",""),l.name=l.name.replace("BTDB_",""),i.push($.extend(l,{type:"files"}))):"images"==n?i.push($.extend(l,{type:n})):i.push($.extend(l,{type:"files"}))}break;case 1:for(let e=0;e-1&&(a.dname=a.dname.replace("BTDB_",""),a.name=a.name.replace("BTDB_",""),i.push($.extend(a,{type:"files"})))}}return $("#Set_Recycle_bin").attr("checked",t.status),$("#Set_Recycle_bin_db").attr("checked",t.status_db),{data:i}},column:[{type:"checkbox",class:"",width:18},{fid:"name",title:lan.files.recycle_bin_th1,width:155,template:function(e){return'
                '+e.name+"
                "}},{fid:"dname",title:lan.files.recycle_bin_th2,template:function(e){return''+e.dname+""}},{fid:"size",title:lan.files.recycle_bin_th3,width:85,template:function(e){return''+bt.format_size(e.size)+""}},{fid:"time",title:lan.files.recycle_bin_th4,width:180,template:function(e,t){return''+bt.format_data(e.time)+""}},{type:"group",align:"right",width:250,title:lan.files.recycle_bin_th5,group:[{title:lan.files.recycle_bin_re,event:function(e,t,i,a,l){bt_file.ReRecycleBin(e.rname,function(){l.$delete_table_row(t)})}},{title:lan.files.recycle_bin_del,event:function(e,t,i,a,l){bt_file.DelRecycleBin(e.rname,function(){l.$delete_table_row(t)})}}]}],tootls:[{type:"batch",positon:["left","bottom"],placeholder:"Please Choose",buttonValue:"Execute",disabledSelectValue:"Please select the port that needs batch operation!",selectList:[{title:"Restore",url:"/files?action=Re_Recycle_bin",load:!0,param:function(e){return{path:e.rname}},callback:function(e){bt.confirm({title:"Restore files",msg:"Batch restore selected files, do you want to continue?",icon:0},function(i){layer.close(i),e.start_batch({},function(e){for(var i="",a=0;a"+l.name+'
                '+(l.request.status?"Successful recovery":"Recovery failed")+"
                "}t.$batch_success_table({title:"Restore files",th:"File name",html:i}),t.$refresh_table_list(!0)})})}},{title:"Delete files permanently",url:"/files?action=Del_Recycle_bin",load:!0,param:function(e){return{path:e.rname}},callback:function(e){bt.confirm({title:"Delete selected files",msg:"Delete the selected file. The file will be completely deleted and cannot be recovered. Do you want to continue?",icon:0},function(i){layer.close(i),e.start_batch({},function(e){for(var i="",a=0;a"+l.name+'
                '+(l.request.status?"Successfully deleted":"Failed to delete")+"
                "}t.$batch_success_table({title:"Delete multiple files",th:"File name",html:i}),t.$refresh_table_list(!0)})})}}]}]});return bt_tools.$fixed_table_thead("#recycle_table .divtable"),t},Set_Recycle_bin:function(e){var t=layer.msg(lan.public.the,{icon:16,time:0,shade:[.3,"#000"]}),i=this,a={};1==e&&(a={db:e}),$.post("/files?action=Recycle_bin",a,function(a){layer.close(t),a.status&&null==e&&(i.is_recycle=$("#Set_Recycle_bin").prop("checked")),layer.msg(a.msg,{icon:a.status?1:5})})},ReRecycleBin:function(e,t){layer.confirm(lan.files.recycle_bin_re_msg,{title:lan.files.recycle_bin_re_title,closeBtn:2,icon:3},function(){var i=layer.msg(lan.files.recycle_bin_re_the,{icon:16,time:0,shade:[.3,"#000"]});$.post("/files?action=Re_Recycle_bin","path="+encodeURIComponent(e),function(e){layer.close(i),layer.msg(e.msg,{icon:e.status?1:5}),$(t).parents("tr").remove()})})},DelRecycleBin:function(e,t){layer.confirm(lan.files.recycle_bin_del_msg,{title:lan.files.recycle_bin_del_title,closeBtn:2,icon:3},function(){var i=layer.msg(lan.files.recycle_bin_del_the,{icon:16,time:0,shade:[.3,"#000"]});$.post("/files?action=Del_Recycle_bin","path="+encodeURIComponent(e),function(e){layer.close(i),layer.msg(e.msg,{icon:e.status?1:5}),$(t).parents("tr").remove()})})},CloseRecycleBin:function(){var e=this;layer.confirm(lan.files.recycle_bin_close_msg,{title:lan.files.recycle_bin_close,closeBtn:2,icon:3},function(){var t=layer.msg("
                "+lan.files.recycle_bin_close_the+"
                ",{icon:16,time:0,shade:[.3,"#000"]});setTimeout(function(){getSpeed(".myspeed")},1e3),$.post("/files?action=Close_Recycle_bin","",function(i){layer.close(t),layer.msg(i.msg,{icon:i.status?1:5}),e.render_recycle_list()})})},open_property_view:function(e){var t=this;t.$http("get_file_attribute",{filename:e.path},function(i){layer.open({type:1,closeBtn:2,title:"[ "+e.filename+" ] - "+(e.is_dir?"Folder":"File")+" properties",area:["580px","500px"],shadeClose:!1,content:'
                General Detail History
                Type:
                '+(i.is_dir||i.is_link?i.st_type:t.ext_type_tips(i.st_type))+'
                Location:
                '+i.path+'
                Size:
                '+bt.format_size(i.st_size)+" ("+t.font_thousandth(i.st_size)+' byte)
                Permissions:
                '+i.mode+'
                Group:
                '+i.group+'
                User:
                '+i.user+'
                Visit time:
                '+bt.format_data(i.st_atime)+'
                Modified time:
                '+bt.format_data(i.st_mtime)+'
                Properties
                Value
                Modified time
                Size
                MD5
                OPT
                ',success:function(a,l){$(".bt-property-setting .tab-nav span").click(function(){var e=$(this).index();$(this).addClass("on").siblings().removeClass("on"),$(".property-box:eq("+e+")").addClass("active").siblings().removeClass("active")}),$(".history_box_view").on("click",".open_history_file",function(){var t=$(this).attr("data-time");openEditorView(0,e.path),setTimeout(function(){aceEditor.openHistoryEditorView({filename:e.path,history:t},function(){layer.close(l),$(".ace_conter_tips").show(),$(".ace_conter_tips .tips").html("Read-only file, the file is "+_item.path+", historic version [ "+bt.format_data(new Number(t))+' ]Click to restore')})},500)}),$(".history_box_view").on("click",".recovery_file_historys",function(){aceEditor.event_ecovery_file(this)});var s={filename:["Name",e.filename],type:["Type",i.is_dir||i.is_link?i.st_type:t.ext_type_tips(i.st_type)],path:"Location",st_size:["Size",bt.format_size(i.st_size)+" ("+t.font_thousandth(i.st_size)+" byte)"],st_atime:["Visit time",bt.format_data(i.st_atime)],st_mtime:["Modified time",bt.format_data(i.st_mtime)],st_ctime:["Metadata modification time",bt.format_data(i.st_ctime)],md5:"MD5",sha1:"sha1",user:"User",group:"Group",mode:"Permissions",st_uid:"UID",st_gid:"GID",st_nlink:"Num of inode links",st_ino:"inode node num",st_mode:"inode protection mode",st_dev:"inode resident device"},n="",o="";for(var r in s)if(Object.hasOwnProperty.call(s,r)){var c=s[r],d=$.isArray(c)?c[1]:i[r];n+='
                '+($.isArray(c)?c[0]:c)+'
                '+d+"
                "}for(let t=0;t
                '+bt.format_data(a.st_mtime)+'
                '+bt.format_size(a.st_size)+"
                "+a.md5+'
                view  |  restore
                '}""===o&&(o+='
                No historical version
                '),$(".details_list").html(n),$(".history_list ").html(o),t.fixed_table_thead(".details_box_view"),t.fixed_table_thead(".history_box_view ")}})})},fixed_table_thead:function(e){$(e).scroll(function(){var e=this.scrollTop;this.querySelector("thead").style.transform="translateY("+e+"px)"})},font_thousandth:function(e){var t=String(e).split(".");return t[0]=t[0].replace(new RegExp("(\\d)(?=(\\d{3})+$)","ig"),"$1,"),t.join(".")},open_images_preview:function(e){function t(e){ +var t=Math.abs(l.rotate/90),i=t%2==0?l.preview_width:l.preview_height,a=t%2==0?l.preview_height:l.preview_width,s=$("#preview_images"),n={};l.init_width=l.natural_width,l.init_height=l.natural_height,l.init_width>i&&(l.init_width=i,l.init_height=parseFloat((i/l.natural_width*l.init_height).toFixed(2))),l.init_height>a&&(l.init_width=parseFloat((a/l.natural_height*l.init_width).toFixed(2)),l.init_height=a),l.current_width=parseFloat(l.init_width*l.scale),l.current_height=parseFloat(l.init_height*l.scale),l.current_left=parseFloat(((l.preview_width-l.current_width)/2).toFixed(2)),l.current_top=parseFloat(((l.preview_height-l.current_height)/2).toFixed(2)),n={width:l.current_width,height:l.current_height,top:l.current_top,left:l.current_left,display:"inline",transform:"rotate("+l.rotate+"deg)",opacity:1,transition:"all 100ms"},!1===e&&delete n.transition,s.css(n)}var i=this,a=$('
                '+e.filename+'
                '),l={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:!1};if($(".preview_images_mask").length>0)return $("#preview_images").attr("src","/download?filename="+e.path),!1;$("body").css("overflow","hidden").append(a),l.preview_width=a[0].clientWidth,l.preview_height=a[0].clientHeight,$(".preview_body img").load(function(){var i=$(this)[0];$(this).attr("data-index")||$(this).attr("data-index",e.images_id),l.natural_width=i.naturalWidth,l.natural_height=i.naturalHeight,t(!1)}),$(".preview_images_mask .preview_head").on("mousedown",function(e){e=e||window.event;var t=$(this).parent();if($("body").addClass("select"),$(this).onselectstart=$(this).ondrag=function(){return!1},!$(e.target).hasClass("preview_close")){var i=e.clientX-t.offset().left,a=e.clientY-t.offset().top;$(document).on("mousemove",function(e){e=e||window.event;var l=e.clientX-i,s=e.clientY-a;l<0?l=0:l>window.innerWidth-t.width()&&(l=window.innerWidth-t.width()),s<0?s=0:s>window.innerHeight-t.height()&&(s=window.innerHeight-t.height()),t.css({left:l,top:s,margin:0})}).on("mouseup",function(){$(this).unbind("mousemove mouseup")})}}),$(".preview_images_mask #preview_images").on("mousedown",function(e){e=e||window.event,$(this).onselectstart=$(this).ondrag=function(){return!1};var t=$(this),i=$(".preview_images_mask").offset(),a=e.clientX-i.left,s=e.clientY-i.top;$(".preview_images_mask").on("mousemove",function(e){e=e||window.event;var n,o,r=e.clientX-i.left-a,c=e.clientY-i.top-s,d=Math.abs(l.rotate/90),p=d%2==0?l.preview_width:l.preview_height,_=d%2==0?l.preview_height:l.preview_width;if(l.current_width>p){var f=p-l.current_width;n=l.current_left+r,n>0?n=0:n_){var h=_-l.current_height;o=l.current_top+c,o>0?o=0:o_&&l.current_top<=0&&l.current_height-_<=l.current_top&&(l.current_top-=c),t.css({left:l.current_left,top:l.current_top})}).on("mouseup",function(){$(this).unbind("mousemove mouseup")}).on("dragstart",function(){e.preventDefault()})}).on("dragstart",function(){return!1}),$(".preview_close").click(function(e){$(".preview_images_mask").remove()}),$(".preview_toolbar a").click(function(){var e=$(this).index();$("#preview_images");switch(e){case 0:case 1:l.rotate=e?l.rotate+90:l.rotate-90,t();break;case 2:case 3:if(3==l.scale&&2==e||.2==l.scale&&3==e)return layer.msg(l.scale>=1?"The image is the maximum size":"The image is the minimum size"),!1;l.scale=(2==e?Math.round(10*(l.scale+.4)):Math.round(10*(l.scale-.4)))/10,t();break;case 4:var i=l.rotate%360;i>=180?l.rotate+=360-i:l.rotate-=i,l.scale=1,t()}}),$(".preview_full,.preview_small").click(function(){$(this).hasClass("preview_full")?($(this).addClass("hidden").prev().removeClass("hidden"),l.preview_width=i.area[0],l.preview_height=i.area[1],a.css({width:i.area[0],height:i.area[1],top:0,left:0,margin:0}).data("type","full"),t()):($(this).addClass("hidden").next().removeClass("hidden"),$(".preview_images_mask").removeAttr("style"),l.preview_width=750,l.preview_height=650,t())}),$(".preview_cut_view a").click(function(){var e="",t=$("#preview_images"),a=parseInt(t.attr("data-index"));$(this).index()?(a=a==i.file_images_list.length-1?0:a+1,e=i.file_images_list[a]):(a=0===a?i.file_images_list.length-1:a-1,e=i.file_images_list[a]),t.attr("data-index",a).attr("src","/download?filename="+e),$(".preview_title").html(i.get_path_filename(e))})},open_video_play:function(e){var t=e.path,i="/download?filename="+e.path,a=e.path.split("/"),l=a.slice(0,a.length-1).join("/");layer.open({type:1,closeBtn:2,title:'Playing ['+a[a.length-1]+"]",area:["890px","402px"],shadeClose:!1,skin:"movie_pay",content:'
                ',success:function(){$.post("/files?action=get_videos",{path:l},function(e){for(var i='',a=0,s=0;s"}i+="
                File nameSize
                '+e[s].name+''+ToSize(e[s].size)+"
                ",$(".video-list").html(i).scrollTop(34*a)})}})},play_file:function(e,t){if($("#btvideo video").attr("data-filename")==t)return!1;var i="/download?filename="+t+"&play=true",a='';$("#btvideo").html(a);var l=t.split("/");$(".btvideo-title").html(l[l.length-1]),$(".video-avt").removeClass("video-avt"),$(e).parents("tr").addClass("video-avt")},copy_file_or_dir:function(e){bt.set_cookie("record_paste",e.path),bt.set_cookie("record_paste_type","copy"),$(".file_all_paste").removeClass("hide"),layer.msg("Copy successfully. Please click [Paste] or Ctrl + V to paste")},cut_file_or_dir:function(e){bt.set_cookie("record_paste",e.path),bt.set_cookie("record_paste_type","cut"),$(".file_all_paste").removeClass("hide"),layer.msg("Cut successfully. Please click [Paste] or Ctrl + V to paste")},paste_file_or_dir:function(){var e=this,t=bt.get_cookie("record_paste_type"),i=bt.get_cookie("record_paste"),a="";if("null"!=i&&null!=i&&(a=i.split("/").pop()),e.file_path.indexOf(i)>-1)return layer.msg("Can not paste ["+a+"] here, Because the item cannot be pasted into itself.",{icon:0}),!1;if("null"!=t&&null!=t)switch(t){case"cut":case"copy":this.check_exists_files_req({dfile:this.file_path,filename:a},function(t){if(t.length>0){for(var l="",s=0;s'+t[s].filename+""+ToSize(t[s].size)+""+getLocalTime(t[s].mtime)+"";var n='
                '+l+"
                File nameSizeLast edit time
                ";SafeMessage("This files will be overwritten",n,function(){e.config_paste_to(i,a)})}else e.config_paste_to(i,a)});break;case"1":case"2":e.batch_file_paste()}},config_paste_to:function(e,t){var i=this,a=bt.get_cookie("record_paste_type");this.$http("copy"==a?"CopyFile":"MvFile",{sfile:e,dfile:this.file_path+"/"+t},function(e){e.status&&(bt.set_cookie("record_paste",null),bt.set_cookie("record_paste_type",null),i.reader_file_list({path:i.file_path})),layer.msg(e.msg,{icon:e.status?1:2})})},rename_file_or_dir:function(e){var t=this;t.is_editor=!0,$(".file_list_content .file_tr:nth-child("+(e.index+1)+")").addClass("editr_tr").find(".file_title").empty().append($("icon"==bt.get_cookie("rank")?'":'')),"icon"==bt.get_cookie("rank")&&$("textarea[name=rename_file_input]").css({height:$("textarea[name=rename_file_input]")[0].scrollHeight}),$(("icon"==bt.get_cookie("rank")?"textarea":"input")+"[name=rename_file_input]").on("input",function(){if("icon"==bt.get_cookie("rank")&&(this.style.height="auto",this.style.height=this.scrollHeight+"px"),"file"==e.type){var t=$(this).val().split("."),i=t[t.length-1];$(this).parent().prev().find(".file_icon").removeAttr("class").addClass("file_icon file_"+i)}}).keyup(function(e){13==e.keyCode&&$(this).blur(),e.stopPropagation(),e.preventDefault()}).blur(function(){var i=$(this).val().replace(/[\r\n]/g,""),a={sfile:e.path,dfile:t.path_resolve(t.file_path,i)};return e.filename==i||""==i?($(".file_list_content .file_tr:nth-child("+(e.index+1)+")").removeClass("editr_tr").find(".file_title").empty().append($(""+e.filename+"")),t.is_editor=!1,!1):t.match_unqualified_string(i)?layer.msg('The name cannot have /\\:*?"<>| symbol',{icon:2}):(t.rename_file_req(a,function(e){t.reader_file_list({path:t.file_path},function(){layer.msg(e.msg,{icon:e.status?1:2})})}),void(t.is_editor=!1))}).focus()},set_file_share:function(e){var t=this;this.loadY=bt.open({type:1,shift:5,closeBtn:2,area:"450px",title:"Set share "+e.type_tips+"-["+e.filename+"]",btn:["Create","Cancel"],content:'
                Share name
                Expiration date
                Extraction code
                ',yes:function(i,a){var l=$("[name=ps]").val(),s=$("[name=expire]:checked").val(),n=$("[name=password]").val();if(""===l)return layer.msg("No sharing name!",{icon:2}),!1;t.create_download_url({filename:e.path,ps:l,password:n,expire:s},function(i){if(!i.status)return layer.msg(i.msg,{icon:i.status?1:2}),!1;var a=i.msg;t.file_list[e.index]=$.extend(t.file_list[e.index],{down_id:a.id,down_info:a}),t.loadY.close(),t.info_file_share(e),t.reader_file_list_content(t.file_list)})},success:function(e,t){$("#random_paw").click(function(){$(this).prev().val(bt.get_random(6))})}})},info_file_share:function(e){var t=this;if(void 0===e.down_info)return this.get_download_url_find({id:e.down_id},function(i){t.file_list[e.index]=$.extend(t.file_list[e.index],{down_info:i}),t.file_share_view(t.file_list[e.index],"fonticon")}),!1;this.file_share_view(e,"fonticon")},file_share_view:function(e,t){var i=e;"fonticon"==t&&(i=e.down_info);var a=this,l=location.origin+"/down/"+i.token;this.loadY=bt.open({type:1,shift:5,closeBtn:2,area:"550px",title:"Share details-["+i.filename+"]",content:'
                Share name
                Expiration date
                '+(i.expire>new Date("2099-01-01 00:00:00").getTime()/1e3?'Permanent':bt.format_data(i.expire))+'
                ',success:function(s,n){var o=new ClipboardJS(".copy_url"),r=new ClipboardJS(".copy_paw");o.on("success",function(e){layer.msg("Copy link succeeded!",{icon:1}),e.clearSelection()}),r.on("success",function(e){layer.msg("Copy link and extraction code succeeded!",{icon:1}),e.clearSelection()}),$(".layer_close").click(function(){layer.close(n)}),$(".QR_code").click(function(){layer.closeAll("tips"),layer.tips('
                ',".QR_code",{area:["150px","150px"],tips:[1,"#ececec"],time:0,shade:[.05,"#000"],shadeClose:!0,success:function(){jQuery("#QR_code").qrcode({render:"canvas",text:l,height:130,width:130})}})}),$(".close_down").click(function(){a.remove_download_url({id:i.id,fileName:i.filename},function(i){a.loadY.close(),"fonticon"==t&&(a.file_list[e.index].down_id=0,a.reader_file_list_content(a.file_list)),"list"==t&&a.render_share_list(),layer.msg(i.msg,{icon:i.status?1:2})})})}})},del_file_or_dir:function(e){var t=this;t.is_recycle?bt.confirm({title:"Delete "+e.type_tips+"[ "+e.filename+" ]",msg:"Comfirm delete "+e.type_tips+"[ "+e.path+" ],it will move to recycle bin after delete, continue?"},function(){t.del_file_req(e,function(e){t.reader_file_list({path:t.file_path}),layer.msg(e.msg,{icon:e.status?1:2})})}):bt.show_confirm("Delete "+e.type_tips+"[ "+e.filename+" ]",'Recycle bin is not currently open, delete '+("dir"==e.type?"directory":"file")+" cannot be restored after, continue?
                ",function(){t.del_file_req(e,function(e){t.reader_file_list({path:t.file_path}),layer.msg(e.msg,{icon:e.status?1:2})})})},cancel_file_favorites:function(e){var t=this,i=e.index;this.loadY=bt.confirm({title:e.filename+lan.files.unfavorite1,msg:lan.files.unfavorite1+" ["+e.path+"] "+lan.files.continue},function(){t.$http("del_files_store",{path:e.path},function(e){e.status&&(t.file_list[i].caret=!1,t.reader_file_list_content(t.file_list),t.load_favorites_index_list()),layer.msg(e.msg,{icon:e.status?1:2})})})},set_soft_link:function(e){var t=this;bt_tools.open({title:"Create Softlink",area:"520px",content:{class:"pd20",formLabelWidth:"110px",form:[{label:"Source file",group:{type:"text",name:"sfile",width:"280px",placeholder:"Please select the folder and file to be linked",icon:{type:"glyphicon-folder-open",event:function(e){},select:"all"},value:"",input:function(e){}}},{label:"Softlink name",group:{type:"text",name:"name",width:"280px",placeholder:"Please enter the name of the softlink",value:""}}]},init:function(){var e=null,t=setInterval(function(){if($('input[name="sfile"]').length<1&&clearInterval(t),e!=$('input[name="sfile"]').val()){e=$('input[name="sfile"]').val();var i=e.split("/");i.length>1&&$('[name="name"]').val(i[i.length-1])}},100)},yes:function(e,i,a){e=$.extend(e,{dfile:t.file_path+"/"+e.name}),delete e.name,bt_tools.send("files/CreateLink",e,function(e){e.status&&(layer.close(i),bt.msg(e),t.reader_file_list())},{tips:"Create Softlink"})}})},set_file_authority:function(e,t){var i=this;i.get_file_authority({path:e.path},function(a){var l='
                ';i.loadY=layer.open({type:1,closeBtn:2,title:lan.files.set_auth+"["+e.filename+"]",area:"465px",shadeClose:!1,content:'
                Set permission
                Backups list
                '+l+"
                "+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(a,l){i.edit_access_authority(),$("#access").keyup(function(){i.edit_access_authority()}),$("input[type=checkbox]").change(function(){for(var e=["owner","group","public"],t="",i=0;i

                Please enter the current backup name

                Remarks
                ',yes:function(l,s){$(".layer_close").click(function(){layer.close(s)}),a.$http("back_path_permissions",{back_sub_dir:i,path:e,remark:$("input.form-control").val()},function(i){if(layer.close(l),!i.status)return layer.msg(i.msg,{time:1900,icon:2}),!1;if(0==t){var s=a.backup_list();$(".buplist").html(s)}else if(3==t){var n=$("#access").val(),o=$("#chown").val(),r=$("#accept_all").prop("checked")?"True":"False",c="filename="+encodeURIComponent(e)+"&user="+o+"&access="+n+"&all="+r;Oksend(c),layer.closeAll()}layer.msg(i.msg,{time:1900,icon:1})})},btn2:function(){layer.close(l)},cancel:function(){layer.close(l)}})},backup_list:function(){var e="",t=this;t.$http("get_all_back",function(t){for(var i=0;i '+o+' "+t[i][3]+' '+t[i][1]+' Del '}$(".allback .buplist").html(e)})},manage_backup:function(){var e=this,t=layer.open({type:1,closeBtn:2,title:"Manage Backups",area:["630px","500px"],shadeClose:!1,content:'
                Backup time Backup path Name Delect
                ',cancel:function(){layer.close(t)},success:function(){e.backup_list(),$("#btn-backup").click(function(t){var i=$("#server_path").val();e.backup_files_permission(i,0)}),$(".allback").on("click",".del_back",function(){var t=$(this).parents("tr").attr("data-id");e.del_backup(t)})}})},del_backup:function(e){var t=this;layer.confirm("The backup cannot be restored after deletion.
                Continue to delete?",{title:"Confirm delete?",btn:["Yes","No"],closeBtn:2},function(i,a){t.$http("del_path_premissions",{id:e},function(i){var a=$(".layui-layer-title:eq(0)").text();"Manage Backups"!==a?(a=$(".backup_list").attr("data-path"),t.backup_files_list(a)):$(".allback tbody tr[data-id="+e+"]").remove(),layer.msg(i.msg,{icon:i.status?1:2})})})},backup_files_list:function(e){var t=this;t.$http("get_path_premissions",{path:e},function(i){var a="",l="";if(0==i.length)a='No data';else for(var s=0;s '+i[s][4]+" "+i[s][2]+" "+i[s][1]+" "+c+' Restore | Del '} +l='
                Fix all permissions to [ Folder: 755, File: 644 ]
                '+a+"
                Name permission Owner Backup Time Opt
                ",$(".chmodset").hide(),$(".backup_lists").html(l),$(".fixper").click(function(){layer.confirm("Note: Under the file or folder all permissions will be fixed to [ Folder: 755, File: 644 ]",{title:"Fix Permissions?",btn:["Confirm","Cancel"],closeBtn:2},function(i,a){t.$http("fix_permissions",{path:e},function(e){layer.closeAll(),t.reader_file_list({path:t.file_path,is_operating:!1}),layer.msg(e.msg,{icon:e.status?1:2})})})}),$(".restore_backup").click(function(){t.restore_file_permission($(this).attr("data-time"),e)}),$(".backup_list").on("click",".del_back",function(){var e=$(this).attr("data-id");t.del_backup(e)})})},restore_file_permission:function(e,t){var i=this,a=$("#accept_all").prop("checked")?1:0,l=layer.open({type:1,closeBtn:2,title:"Confirm restore",area:"330px",shadeClose:!1,btn:["Yes","No"],content:'
                Restore would overwrite the current settings, continue?
                ',yes:function(l,s){i.$http("restore_path_permissions",{restore_sub_dir:a,date:e,path:t},function(e){layer.closeAll(),layer.msg(e.msg,{icon:1,time:1900})})},btn2:function(){layer.close(l)},cancel:function(){layer.close(l)}})},get_present_task_view:function(){this.file_present_task=layer.open({type:1,title:"Real-time task queue",area:"500px",closeBtn:2,skin:"present_task_list",shadeClose:!1,shade:!1,offset:"auto",content:'
                '})},render_present_task_list:function(){var e=this;this.get_task_req({status:-3},function(t){if(0==t.length)return layer.close(e.file_present_task),e.file_present_task=null,void e.reader_file_list({path:e.file_path,is_operating:!1});var i="",a=!1;$.each(t,function(t,l){-1==l.status?(e.file_present_task||e.get_present_task_view(),"1"==l.type?i+='
                • '+lan.layout.download+l.shell+''+l.log.pre+'%'+lan.public.cancel+'
                  '+l.log.used+"/"+ToSize(l.log.total)+''+(0==l.log.speed?lan.layout.connect:l.log.speed)+'/s'+lan.files.expected_to_be+": "+l.log.time+"
                ":i+='
                '+l.name+": "+l.shell+''+lan.public.cancel+'
                '+l.log+"
                "):(a||(i+='
                '+lan.layout.wait_task+'
                  ',a=!0),i+='
                • '+l.name+": "+l.shell+'X
                • ')}),e.file_present_task&&(a&&(i+="
                "),$(".message-list").html(i)),setTimeout(function(){e.render_present_task_list()},1e3)})},remove_present_task:function(e){var t=this;layer.confirm("Do you want to cancel the upload of files? It need to delete the uploaded files manually. Continue?",{title:"Cancel file upload",icon:0},function(i){bt.send("remove_task","task/remove_task",{id:e},function(e){layer.msg(e.msg,{icon:1}),layer.close(t.file_present_task),t.file_present_task=null}),layer.close(i)})},edit_access_authority:function(){for(var e=$("#access").val(),t=["owner","group","public"],i=0;it.length))switch(l>7&&$("#access").val(e.substr(0,e.length-1)),l){case"1":$("#"+t[a]+"_x").prop("checked",!0);break;case"2":$("#"+t[a]+"_w").prop("checked",!0);break;case"3":$("#"+t[a]+"_x").prop("checked",!0),$("#"+t[a]+"_w").prop("checked",!0);break;case"4":$("#"+t[a]+"_r").prop("checked",!0);break;case"5":$("#"+t[a]+"_r").prop("checked",!0),$("#"+t[a]+"_x").prop("checked",!0);break;case"6":$("#"+t[a]+"_r").prop("checked",!0),$("#"+t[a]+"_w").prop("checked",!0);break;case"7":$("#"+t[a]+"_r").prop("checked",!0),$("#"+t[a]+"_w").prop("checked",!0),$("#"+t[a]+"_x").prop("checked",!0)}}},get_file_authority:function(e,t){this.$http("GetFileAccess",{filename:e.path},function(e){t&&t(e)})},set_dir_kill:function(e){var t=this;"php"==e.ext?t.$http("file_webshell_check",{filename:e.path},function(e){layer.msg(e.msg,{icon:e.status?1:2})}):layer.confirm("目录查杀将包含子目录中的php文件,是否操作?",{title:"目录查杀["+e.filename+"]",closeBtn:2,icon:3},function(i){t.$http("dir_webshell_check",{path:e.path},function(e){layer.msg(e.msg,{icon:e.status?1:2})})})},path_resolve:function(e,t){var i="";return Array.isArray(t)||(t=[t]),e.replace(/([\/|\/]*)$/,function(e){return e,"www"}),$.each(t,function(e,t){i+="/"+t}),(e+i).replace("//","/")},get_ext_name:function(e){for(var t=e.split("."),i=["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"],a=t[t.length-1],l=0;l')},yes:function(){var e=a.getVal();if(""==e.dfile)return layer.msg("Please select a valid address",{icon:2});a.submitForm(function(e,t){setTimeout(function(){i.reader_file_list({path:t.path})},1e3),null!=e&&null!=e||layer.msg(lan.files.zip_ok,{icon:1}),e.status&&i.render_present_task_list(),layer.close(s)})}})})},unpack_file_to_path:function(e){var t=this,i="zip",a="";a=e.path.substring(0,e.path.lastIndexOf("/")),this.reader_form_line({url:"UnZip",overall:{width:"310px"},data:[{label:"File name",name:"z_name",placeholder:"Compress file name",value:e.path},{label:"Compress path",name:"z_path",placeholder:"Compress path",value:a},{label:"Encoding",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:i,coding:e.z_code,password:e.z_password}}},function(a,l){var s=layer.open({type:1,title:"Decompress file",area:"520px",shadeClose:!1,closeBtn:2,skin:"unpack_file_view",btn:["Comfirm","Cancel"],content:l[0].outerHTML,success:function(){"gz"==e.ext&&(i="tar"),"zip"==i&&$(".unpack_file_view .line:nth-child(2)").append('
                Password
                ')},yes:function(){var e=a.getVal();return""==e.z_name?layer.msg("Please enter the file name path",{icon:2}):""==e.z_path?layer.msg("Please enter the decompression address",{icon:2}):void a.submitForm(function(e,i){layer.close(s),setTimeout(function(){t.reader_file_list({path:i.path})},1e3),e.status&&t.render_present_task_list(),layer.msg(e.msg,{icon:e.status?1:2})})}})})},match_unqualified_string:function(e){var t=RegExp(/[(\ )(\*)(\|)(\\)(\:)(\")(\/)(\<)(\>)(\?)(\)]+/);return t.test(e)},reader_form_line:function(e,t){var i=this,a=bt.get_random(10),l=$('
                '),s=e,n=[];i=this;Array.isArray(e)||(s=e.data),$.each(s,function(t,i){var a=i.labelWidth||e.overall.labelWidth||null,s=bt.get_random(10),o=i.labelWidth||e.overall.width||null,r=$('
                "+(i.label||"")+'
                '),c=$(function(){switch(i.type){case"select":return"";case"text":default:return"'}}());(i.eventType||i.event)&&(Array.isArray(i.eventType)||(i.eventType=[i.eventType]),$.each(i.eventType,function(t,a){if(n.push({el:s,type:a||"click",event:i[a]||null}),e.el){var l=$('[data-event="'+i.el+'"]');if(i[a])"enter"==a?l.on("keyup",function(e){13==e.keyCode&&i.event(e)}):l.on(i||"click",i.event);else if("focus"==a){var o=l.val();""!=o&&l.val("").focus().val(o)}else l[a]()}})),r.find(".info-r").append(c),l.append(r)}),e.el&&$(e.el).empty().append(l),t&&t({getVal:function(){return $("#"+a).serializeObject()},setEvent:function(){$.each(n,function(e,t){var i=$('[data-event="'+t.el+'"]');if(null===t.event)if("focus"==t.type){var a=i.val();""!=a&&i.val("").focus().val(a)}else i[t.type]();else"enter"==t.type?i.on("keyup",function(e){13==e.keyCode&&t.event(e)}):i.on(t.type,t.event)})},submitForm:function(t){var a=this.getVal();e.beforeSend&&(a=e.beforeSend(a)),i.loadT=bt.load("submitting the form, please wait..."),bt.send(e.url,"files/"+e.url,a,function(e){i.loadT.close(),t&&t(e,a)})}},l)},$http:function(e,t,i){var a=this,l="";"string"==typeof e?("object"!=typeof t&&(i=t,t={}),Array.isArray(a.method_list[e])||(a.method_list[e]=["files",a.method_list[e]]),a.$http({method:e,tips:!!a.method_list[e][1]&&a.method_list[e][1],module:a.method_list[e][0],data:t,msg:!0},i)):(void 0!==e.tips&&e.tips&&(l=bt.load(e.tips)),bt.send(e.method,(e.module||"files")+"/"+e.method,e.data||{},function(e){if(""!=l&&l.close(),"string"==typeof e&&(e=JSON.parse(e)),!1===e.status&&e.msg)return bt.msg(e),!1;t&&t(e)}))}};bt_file.init(),Function.prototype.delay=function(e,t,i){return Array.isArray(t)||(i=t,t=[]),void 0===i&&(i=0),setTimeout(this.apply(e,t),i),this},jQuery.prototype.serializeObject=function(){var e,t,i,a,l;for(e=this.serializeArray(),t={},i=t.hasOwnProperty,a=0;a",options = { + read_bytes: 'Read Bytes', + read_count: 'Read Count ', + read_merged_count: 'Read Merged Count', + read_time: 'Read Wait', + write_bytes: 'Write Bytes', + write_count: 'Write Count', + write_merged_count: 'Write Merged Count', + write_time: 'Write Wait', + },data = index.iostat.data.tipsData[config[0].dataIndex],list = ['read_count','write_count','read_merged_count','write_merged_count','read_time','write_time',] + for(var i=0;i < config.length;i++){ + if(typeof config[i].data == "undefined") return false + _tips += '  '+ config[i].seriesName +':'+ (parseFloat(config[i].data)).toFixed(2) + ' MB/s' + '
                ' + } + $.each(list,function(index,item){ + _tips += '  '+ options[item] +':' + data[item] + (item.indexOf('time') > -1 ?' ms':' per sec') + '
                ' + }) + return _tips; + } + obj.list = []; + obj.list.push({ name: 'Read Bytes', data: index.iostat.data.uData, circle: 'circle', itemStyle: { normal: { color: '#FF4683' } }, areaStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(255,70,131,1)' }, { offset: 1, color: 'rgba(255,70,131,.4' }], false) } }, lineStyle: { normal: { width: 1, color: '#FF4683' } } }); + obj.list.push({ name: 'Write Bytes', data: index.iostat.data.dData, circle: 'circle', itemStyle: { normal: { color: '#6CC0CF' } }, areaStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(108,192,207,1)' }, { offset: 1, color: 'rgba(108,192,207,.4)' }], false) } }, lineStyle: { normal: { width: 1, color: '#6CC0CF' } } }); + option = bt.control.format_option(obj) + index.iostat.table.setOption(option); + window.addEventListener("resize", function () { + index.iostat.table.resize(); + }); + }, + add: function (read, write,data) { + var _disk = this; + var limit = 8; + var d = new Date() + if (_disk.data.uData.length >= limit) _disk.data.uData.splice(0, 1); + if (_disk.data.dData.length >= limit) _disk.data.dData.splice(0, 1); + if (_disk.data.aData.length >= limit) _disk.data.aData.splice(0, 1); + if (_disk.data.tipsData.length >= limit) _disk.data.tipsData.splice(0, 1); + _disk.data.uData.push(read); + _disk.data.dData.push(write); + _disk.data.tipsData.push(data); + _disk.data.aData.push(d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()); + } + }, mem: { status: 1, set_status: function (obj, status, val) { @@ -98,121 +204,136 @@ var index = { }, get_init: function () { var _this = this; - setTimeout(function () { _this.get_disk_list(); }, 10); + // setTimeout(function () { _this.get_disk_list(); }, 10); setTimeout(function () { _this.get_warning_list(); }, 20); - setTimeout(function () { _this.get_server_info(); }, 30); - - bt.pub.get_user_info(function (rdata) { - if (rdata.status) { - $(".bind-user").html(rdata.data.username); - bt.send('check_user_auth', 'ajax/check_user_auth', {}, function (rd) { - if (!rd.status) bt.msg(rd); - }); - bt.weixin.get_user_info(function (rdata) { - if (!rdata.status) { - bt.msg(rdata); - return; - } - if (JSON.stringify(rdata.msg) != '{}') { - var datas = rdata.msg; - for (var key in datas) { - var item = datas[key]; - item.nickName - $(".bind-weixin a").text(item.nickName); - break; - } - } - }); + // setTimeout(function () { _this.get_server_info(); }, 30); + _this.reander_system_info(function(rdata){ + // 负载悬浮事件 + $('#loadChart').hover(function () { + var arry = [ + [lan.index.avg_load_atlast_onemin,rdata.load.one], + [lan.index.avg_load_atlast_fivemin,rdata.load.five], + [lan.index.avg_load_atlast_fifteenmin,rdata.load.fifteen] + ],tips = ''; + $.each(arry || [],function (index,item){ + tips += item[0]+':'+ item[1] +'
                '; + }) + $.each(rdata.cpu_times || {},function (key,item){ + tips += key +':'+ item +'
                '; + }) + // '最近1分钟平均负载:' + rdata.load.one + '
                最近5分钟平均负载:' + rdata.load.five + '
                最近15分钟平均负载:' + rdata.load.fifteen + '' + layer.tips(tips, this, { time: 0, tips: [1, '#999'] }); + }, function(){ + layer.closeAll('tips'); + }) + // cpu悬浮事件 + $('#cpuChart').hover(function () { + var cpuText = ''; + for (var i = 1; i < rdata.cpu[2].length + 1; i++) { + var cpuUse = parseFloat(rdata.cpu[2][i - 1] == 0 ? 0 : rdata.cpu[2][i - 1]).toFixed(1) + if (i % 2 != 0) { + cpuText += 'CPU-' + i + ':' + cpuUse + '% | ' + } else { + cpuText += 'CPU-' + i + ':' + cpuUse + '%' + cpuText += `\n` + } } - else { - $(".bind-weixin a").attr("href", "javascript:;"); - $(".bind-weixin a").click(function () { - bt.msg({ msg: lan.index.bind_bt_account_first, icon: 2 }); + + layer.tips(rdata.cpu[3] + "
                " + rdata.cpu[5] + " CPU," + (rdata.cpu[4]) + " Physical core, " + rdata.cpu[1]+" Logical core
                "+ cpuText, this, { time: 0, tips: [1, '#999'] }); + }, function(){ + layer.closeAll('tips'); + }) + + $('#memChart').hover(function(){ + $(this).append('
                '); + $(this).find('.mem_mask .mem-re-con').animate({top:'5px'},400); + $(this).next().hide(); + },function(){ + $(this).find('.mem_mask').remove() + $(this).next().show(); + }).click(function(){ + var that = $(this); + var data = _this.chart_result.mem; + bt.show_confirm(lan.index.mem_release_sure, ''+lan.index.mem_release_warn+'', function () { + _this.release = true + var option = JSON.parse(JSON.stringify(_this.series_option)); + // 释放中... + var count = '' + var setInter = setInterval(function(){ + if(count == '...'){ + count = '.' + }else{ + count += '.' + } + option.series[0].detail.formatter = lan.index.memre_ok_0 + count + option.series[0].detail.fontSize = 15 + option.series[0].data[0].value = 0 + _this.chart_view.mem.setOption(option, true) + that.next().hide() + },400) + // 释放接口请求 + bt.system.re_memory(function (res) { + that.next().show() + clearInterval(setInter) + option.series[0].detail = $.extend(option.series[0].detail,{ + formatter:lan.index.memre_ok_1+"\n"+ bt.format_size(data.memRealUsed - res.memRealUsed), + lineHeight:18, + padding:[5,0] + }) + _this.chart_view.mem.setOption(option,true) + setTimeout(function() { + _this.release = false; + _this.chart_result.mem = res; + _this.chart_active('mem'); + }, 2000); }) - } + }) + }) + + // 磁盘悬浮事件 + for(var i = 0; i < rdata.disk.length; i++){ + var disk = rdata.disk[i],texts = ""+lan.index.base_info+"
                " + texts += "Partition: " + disk.filesystem + "
                " + texts += "Type: " + disk.type + "
                " + texts += "Mount point: " + disk.path + "

                " + texts += ""+ lan.index.inode_info +":
                " + texts += lan.index.total+": " + disk.inodes[0] + "
                " + texts += lan.index.already_use+": " + disk.inodes[1] + "
                " + texts += lan.index.available+": " + disk.inodes[2] + "
                " + texts += lan.index.inode_percent+": " + disk.inodes[3] + "

                " + texts += ""+lan.index.capacity_info+"
                " + texts += lan.index.capacity+": " + disk.size[0] + "
                " + texts += lan.index.already_use+": " + disk.size[1] + "
                " + texts += lan.index.available+": " + disk.size[2] + "
                " + texts += lan.index.usage_rate+": " + disk.size[3] + "
                " + $("#diskChart" + i).data('title',texts).hover(function () { + layer.tips($(this).data('title'), this, { time: 0, tips: [1, '#999'] }); + }, function(){ + layer.closeAll('tips'); + }) + } + _this.get_server_info(rdata); + if(rdata.installed === false) bt.index.rec_install(); + if (rdata.user_info.status) { + var rdata_data = rdata.user_info.data; + bt.set_cookie('bt_user_info',JSON.stringify(rdata.user_info)); + $(".bind-user").html(rdata_data.username); + } + else { + $(".bind-weixin a").attr("href", "javascript:;"); + $(".bind-weixin a").click(function () { + bt.msg({ msg: '请先绑定宝塔账号!', icon: 2 }); + }) + } }) - - _this.get_data_info(function (loadbox, rdata) { - loadbox.find('.cicle').hover(function () { - var _this = $(this); - var d = _this.parents('ul').data('data').load; - layer.tips(lan.index.avg_load_atlast_onemin + d.one + '
                '+ lan.index.avg_load_atlast_fivemin + d.five + '
                '+ lan.index.avg_load_atlast_fifteenmin + d.fifteen + '', _this, { time: 0, tips: [1, '#999'] }); - }, function () { - layer.closeAll('tips'); - }) - - $('.cpubox').find('.cicle').hover(function () { - var _this = $(this); - var d = _this.parents('ul').data('data').cpu; - var crs = ''; - var n1 = 0; - for (var i = 0; i < d[2].length; i++) { - n1++; - crs += 'CPU-' + i + ": " + d[2][i] + '%' + (n1 % 2 == 0?'
                ':' | '); - - } - layer.tips(d[3] + "
                " + d[5] + " CPU, " + d[4] + " Core, " + d[4]+" Thread
                "+ crs, _this, { time: 0, tips: [1, '#999'] }); - }, function () { - layer.closeAll('tips'); - }); - - $(".mem-release").hover(function () { - $(this).addClass("shine_green"); - if (!($(this).hasClass("mem-action"))) { - $(this).find(".mem-re-min").hide(); - $(this).find(".occupy").css({ "color": "#d2edd8" }); - $(this).find(".mem-re-con").css({ "display": "block" }); - $(this).find(".mem-re-con").animate({ "top": "0", opacity: 1 }); - } - $(this).next().hide(); - }, function () { - if (!($(this).hasClass("mem-action"))) { - $(this).find(".mem-re-min").show(); - } - else { - return false; - //$(this).find(".mem-re-min").hide(); - } - $(this).removeClass("shine_green"); - $(this).find(".occupy").css({ "color": "#20a53a" }); - $(this).find(".mem-re-con").css({ "top": "15px", opacity: 1, "display": "none" }); - $(this).next().show(); - //$(this).next().html(bt.get_cookie("mem-before")); - }).click(function () { - if (($(this).hasClass("mem-action"))) return false; - var _this = $(this); - bt.show_confirm(lan.index.mem_release_sure, ''+lan.index.mem_release_warn+'', function () { - if (!(_this.hasClass("mem-action"))) { - _this.next().hide(); - _this.find('.mem-re-min').hide(); - var data = _this.parents('ul').data('data').mem; - index.mem.set_status(_this, 2); //释放中 - bt.system.re_memory(function (nData) { - index.mem.set_status(_this, lan.index.memre_ok); - - _this.next().show(); - setTimeout(function () { - var t = nData.memFree - data.memFree; - var m = lan.index.memre_ok_2; - if (t > 0) m = lan.index.memre_ok_1 + "
                " + t + "MB"; - index.mem.set_status(_this, m); - }, 200); - setTimeout(function () { - index.mem.set_status(_this, 1, (nData.memRealUsed * 100 / nData.memTotal).toFixed(1)); - _this.find('.mem-re-min').show(); - }, 1200); - }) - } - }) - }) - }); setTimeout(function () { _this.interval.start(); }, 40) setTimeout(function () { index.get_index_list(); }, 50) - - setTimeout(function () { - _this.net.init(); + _this.net.init(); + }, 60); + setTimeout(function () { + _this.iostat.init() }, 60); setTimeout(function () { @@ -231,123 +352,43 @@ var index = { }, false) }, 70) }, - get_data_info: function (callback) { - var _this = $(this); - bt.system.get_net(function (net) { + get_server_info: function (info) { + var memFree = info.memTotal - info.memRealUsed; + if (memFree < 64) { + $("#messageError").show(); + $("#messageError").append('

                ' + lan.index.mem_warning + '

                ') + } - var pub_arr = [{ val: 100, color: '#dd2f00' }, { val: 90, color: '#ff9900' }, { val: 70, color: '#20a53a' }, { val: 30, color: '#20a53a' }]; - var load_arr = [{ title: lan.index.run_block, val: 100, color: '#dd2f00' }, { title: lan.index.run_slow, val: 90, color: '#ff9900' }, { title: lan.index.run_normal, val: 70, color: '#20a53a' }, { title: lan.index.run_fluent, val: 30, color: '#20a53a' }]; - var _cpubox = $('.cpubox'), _membox = $('.membox'), _loadbox = $('.loadbox'), _diskbox = $('.diskbox') + if (info.isuser > 0) { + $("#messageError").show(); + $("#messageError").append('

                ' + lan.index.user_warning + ' ['+lan.index.cant_ignore+'] ['+lan.index.edit_now+']

                ') + } - index.set_val(_cpubox, { usage: net.cpu[0], title: net.cpu[1]+' '+lan.index.cpu_core, items: pub_arr }) - index.set_val(_membox, { usage: (net.mem.memRealUsed * 100 / net.mem.memTotal).toFixed(1), items: pub_arr, title: net.mem.memRealUsed + '/' + net.mem.memTotal + '(MB)' }) - bt.set_cookie('memSize', net.mem.memTotal) - for (var i = 0; i < _diskbox.length; i++) { - index.set_val(_diskbox.eq(i), { usage: net.disk[i].size[3].split('%')[0], title: net.disk[i].size[1]+'/'+net.disk[i].size[0], items: pub_arr }) - } - - var _lval = Math.round((net.load.one / net.load.max) * 100); - if (_lval > 100) _lval = 100; - index.set_val(_loadbox, { usage: _lval, items: load_arr }) - _loadbox.parents('ul').data('data', net); - var net_key = bt.get_cookie('network_io_key'); - if(net_key){ - console.log(net_key,net.network[net_key]) - net.up = net.network[net_key].up; - net.down = net.network[net_key].down; - net.downTotal = net.network[net_key].downTotal; - net.upTotal = net.network[net_key].upTotal; - net.downPackets = net.network[net_key].downPackets; - net.upPackets = net.network[net_key].upPackets; - net.downAll = net.network[net_key].downTotal; - net.upAll = net.network[net_key].upTotal; - } - var net_option = ''; - $.each(net.network,function(k,v){ - var act = (k == net_key)?'selected':''; - net_option += ''; - }); - - $('select[name="network-io"]').html(net_option); - //刷新流量 - $("#upSpeed").html(net.up + ' KB'); - $("#downSpeed").html(net.down + ' KB'); - $("#downAll").html(bt.format_size(net.downTotal)); - $("#upAll").html(bt.format_size(net.upTotal)); - index.net.add(net.up, net.down); - if (index.net.table) index.net.table.setOption({ xAxis: { data: index.net.data.aData }, series: [{ name: lan.index.net_up, data: index.net.data.uData }, { name: lan.index.net_down, data: index.net.data.dData }] }); - - if (callback) callback(_loadbox, net); - }) - }, - get_server_info: function () { - bt.system.get_total(function (info) { - var memFree = info.memTotal - info.memRealUsed; - if (memFree < 64) { - $("#messageError").show(); - $("#messageError").append('

                ' + lan.index.mem_warning + '

                ') - } - - if (info.isuser > 0) { - $("#messageError").show(); - $("#messageError").append('

                ' + lan.index.user_warning + ' ['+lan.index.cant_ignore+'] ['+lan.index.edit_now+']

                ') - } - - if (info.isport === true) { - $("#messageError").show(); - $("#messageError").append('

                '+lan.index.panel_port_tips+' ['+lan.index.panel_port_tip2+'] ['+lan.index.panel_port_tip3+']

                ') - } - var _system = info.system; - $("#info").html(_system); - $("#running").html(info.time); - if (_system.indexOf("Windows") != -1) { - $(".ico-system").addClass("ico-windows"); - } - else if (_system.indexOf("CentOS") != -1) { - $(".ico-system").addClass("ico-centos"); - } - else if (_system.indexOf("Ubuntu") != -1) { - $(".ico-system").addClass("ico-ubuntu"); - } - else if (_system.indexOf("Debian") != -1) { - $(".ico-system").addClass("ico-debian"); - } - else if (_system.indexOf("Fedora") != -1) { - $(".ico-system").addClass("ico-fedora"); - } - else { - $(".ico-system").addClass("ico-linux"); - } - }) - }, - get_disk_list: function () { - bt.system.get_disk_list(function (rdata) { - if (rdata) { - var data = { table: '#systemInfoList', items: [] }; - for (var i = 0; i < rdata.length; i++) { - var item = rdata[i]; - var obj = {}; - obj.name = item.path; - obj.title = item.size[1] + '/' + item.size[0]; - obj.rate = item.size[3].replace('%', ''); - obj.free = item.size[2]; - var arr = []; - arr.push({ title: lan.index.inode_info, value: '' }) - arr.push({ title: lan.index.total, value: item.inodes[0] }) - arr.push({ title: lan.index.already_use, value: item.inodes[1] }) - arr.push({ title: lan.index.available, value: item.inodes[2] }) - arr.push({ title: lan.index.inode_percent, value: item.inodes[3] }) - arr.push({ title: 'Capacity information', value: '' }) - arr.push({ title: 'Capacity', value: item.size[0] }) - arr.push({ title: 'Used', value: item.size[1] }) - arr.push({ title: 'Available', value: item.size[2] }) - arr.push({ title: 'Usage rate', value: item.size[3] }) - obj.masks = arr; - data.items.push(obj) - } - index.render_disk(data); - } - }) + if (info.isport === true) { + $("#messageError").show(); + $("#messageError").append('

                '+lan.index.panel_port_tips+' ['+lan.index.panel_port_tip2+'] ['+lan.index.panel_port_tip3+']

                ') + } + var _system = info.system; + $("#info").html(_system); + $("#running").html(info.time); + if (_system.indexOf("Windows") != -1) { + $(".ico-system").addClass("ico-windows"); + } + else if (_system.indexOf("CentOS") != -1) { + $(".ico-system").addClass("ico-centos"); + } + else if (_system.indexOf("Ubuntu") != -1) { + $(".ico-system").addClass("ico-ubuntu"); + } + else if (_system.indexOf("Debian") != -1) { + $(".ico-system").addClass("ico-debian"); + } + else if (_system.indexOf("Fedora") != -1) { + $(".ico-system").addClass("ico-fedora"); + } + else { + $(".ico-system").addClass("ico-linux"); + } }, render_disk: function (data) { if (data.items.length > 0) { @@ -391,7 +432,7 @@ var index = { color = '#dd2f00' break; } - + index.set_val(_li, { usage: item.rate, color: color }) _tab.append(_li); } @@ -430,6 +471,252 @@ var index = { if (obj.title) _li.find('h4').text(obj.title); _li.find('.occupy span').html(obj.usage); }, + + /** + * @description 渲染系统信息 + * @param callback 回调函数 + * + */ + reander_system_info:function(callback){ + var _this = this; + bt.system.get_net(function (res){ + _this.chart_result = res + // 动态添加磁盘,并赋值disk_view + if(_this.chart_view.disk == undefined){ + for (var i = 0; i < res.disk.length; i++) { + var diskHtml = "
              • "; + $("#systemInfoList").append(diskHtml); + _this.disk_view.push(echarts.init(document.querySelector("#diskChart" + i))); + } + } + + // 负载 + var loadCount = Math.round((res.load.one / res.load.max) * 100) > 100 ? 100 : Math.round((res.load.one / res.load.max) * 100); + loadCount = loadCount < 0 ? 0 : loadCount; + var loadInfo = _this.chart_color_active(loadCount); + + // cpu + var cpuCount = res.cpu[0]; + var cpuInfo = _this.chart_color_active(cpuCount); + + // 内存 + var memCount = Math.round((res.mem.memRealUsed / res.mem.memTotal) * 1000) / 10; // 返回 memRealUsed 占 memTotal 的百分比 + var memInfo = _this.chart_color_active(memCount); + bt.set_cookie('memSize',res.mem.memTotal) + + // 磁盘 + var diskList = res.disk; + var diskJson = []; + for (var i = 0; i < diskList.length; i++) { + + var ratio = diskList[i].size[3]; + ratio = parseFloat(ratio.substring(0, ratio.lastIndexOf("%"))); + var diskInfo = _this.chart_color_active(ratio) + diskJson.push(diskInfo) + + } + + // chart_json存储最新数据 + _this.chart_json['load'] = loadInfo; + _this.chart_json['cpu'] = cpuInfo; + _this.chart_json['mem'] = memInfo; + _this.chart_json['disk'] = diskJson + // 初始化 || 刷新 + if(_this.chart_view.disk == undefined) { + _this.init_chart_view() + } else { + _this.set_chart_data() + } + $('.rank .titles').show() + + var net_key = bt.get_cookie('network_io_key'); + if(net_key){ + res.up = res.network[net_key].up; + res.down = res.network[net_key].down; + res.downTotal = res.network[net_key].downTotal; + res.upTotal = res.network[net_key].upTotal; + res.downPackets = res.network[net_key].downPackets; + res.upPackets = res.network[net_key].upPackets; + res.downAll = res.network[net_key].downTotal; + res.upAll = res.network[net_key].upTotal; + } + var net_option = ''; + $.each(res.network,function(k,v){ + var act = (k == net_key)?'selected':''; + net_option += ''; + }); + + $('select[name="network-io"]').html(net_option); + //刷新流量 + $("#upSpeed").html(res.up.toFixed(2) + ' KB'); + $("#downSpeed").html(res.down.toFixed(2) + ' KB'); + $("#downAll").html(bt.format_size(res.downTotal)); + $("#upAll").html(bt.format_size(res.upTotal)); + index.net.add(res.up, res.down); + var disk_key = bt.get_cookie('disk_io_key') || 'ALL', disk_io_data = res.iostat[disk_key || 'ALL'],mb = 1048576,ioTime = disk_io_data.write_time>disk_io_data.read_time?disk_io_data.write_time:disk_io_data.read_time + $('#readBytes').html(bt.format_size(disk_io_data.read_bytes)) + $('#writeBytes').html(bt.format_size(disk_io_data.write_bytes)) + $('#diskIops').html((disk_io_data.read_count + disk_io_data.write_count)) + $('#diskTime').html(ioTime +' ms').css({'color':ioTime > 100 && ioTime < 1000?'#ff9900':ioTime >= 1000?'red':'#20a53a'}) + + index.iostat.add((disk_io_data.read_bytes / mb).toFixed(2), (disk_io_data.write_bytes / mb).toFixed(2),disk_io_data); + + + var disk_option = ''; + $.each(res.iostat,function(k,v){ + disk_option += ''; + }); + $('select[name="disk-io"]').html(disk_option); + + if (index.net.table) index.net.table.setOption({ xAxis: { data: index.net.data.aData }, series: [{ name: lan.index.net_up, data: index.net.data.uData }, { name: lan.index.net_down, data: index.net.data.dData }] }); + if (index.iostat.table) index.iostat.table.setOption({ xAxis: { data: index.iostat.data.aData }, series: [{ name: 'Read Bytes', data: index.iostat.data.uData }, { name: 'Write Bytes', data: index.iostat.data.dData }] }); + if(callback) callback(res) + }); + }, + /** + * @description 渲染画布视图 + */ + init_chart_view:function(){ + // 所有图表对象装进chart_view + this.chart_view['load'] = echarts.init(document.querySelector("#loadChart")) + this.chart_view['cpu'] = echarts.init(document.querySelector("#cpuChart")) + this.chart_view['mem'] = echarts.init(document.querySelector("#memChart")) + this.chart_view['disk'] = this.disk_view + + // 图表配置项 + this.series_option = { + series: [{ + type: 'gauge', + startAngle: 90, + endAngle: -270, + animationDuration: 1500, + animationDurationUpdate: 1000, + radius: '99%', + pointer: { + show: false + }, + progress: { + show: true, + overlap: false, + roundCap: true, + clip: false, + itemStyle: { + borderWidth: 1, + borderColor: '#20a53a' + } + }, + axisLine: { + lineStyle: { + width: 7, + color: [[0, "rgba(204,204,204,0.5)"], [1, "rgba(204,204,204,0.5)"]] + } + }, + splitLine: { + show: false, + distance: 0, + length: 10 + }, + axisTick: { + show: false + }, + axisLabel: { + show: false, + distance: 50 + }, + data: [{ + value: 0, + detail: { + offsetCenter: ['0%', '0%'] + }, + itemStyle: { + color: '#20a53a', + borderColor: '#20a53a' + }, + }], + detail: { + width: 50, + height: 15, + lineHeight:15, + fontSize: 17, + color: '#20a53a', + formatter: '{value}%', + fontWeight:'normal' + } + }] + }; + this.set_chart_data() + }, + /** + * @description 赋值chart的数据 + * + */ + set_chart_data:function(){ + this.chart_active("load") + this.chart_active("cpu") + if(!this.release){ + this.chart_active("mem") + } + for(var i = 0; i < this.chart_view.disk.length; i++){ + this.series_option.series[0].data[0].value = this.chart_json.disk[i].val + this.series_option.series[0].data[0].itemStyle.color = this.chart_json.disk[i].color + this.series_option.series[0].data[0].itemStyle.borderColor = this.chart_json.disk[i].color + this.series_option.series[0].progress.itemStyle.borderColor = this.chart_json.disk[i].color + this.series_option.series[0].detail.color = this.chart_json.disk[i].color + this.chart_view.disk[i].setOption(this.series_option, true) + $("#disk" + i).text(this.chart_result.disk[i].size[1] + " / " + this.chart_result.disk[i].size[0]) + $("#diskName" + i).text(this.chart_result.disk[i].path) + } + }, + /** + * @description 赋值chart的数据 + * + */ + chart_active:function(name){ + // 图表数据 + this.series_option.series[0].data[0].value = this.chart_json[name].val + this.series_option.series[0].data[0].itemStyle.color = this.chart_json[name].color + this.series_option.series[0].data[0].itemStyle.borderColor = this.chart_json[name].color + this.series_option.series[0].progress.itemStyle.borderColor = this.chart_json[name].color + this.series_option.series[0].detail.color = this.chart_json[name].color + + this.chart_view[name].setOption(this.series_option, true) + + // 文字 + var val = "" + switch (name) { + case 'load': + val = this.chart_json[name].title + break; + case 'cpu': + val = this.chart_result.cpu[1] + ' '+lan.index.cpu_core + break; + case 'mem': + val = this.chart_result.mem.memRealUsed + " / " + this.chart_result.mem.memTotal + "(MB)" + break; + } + + $("#" + name).text(val) + }, + /** + * @description 赋值chart的颜色 + * + */ + chart_color_active:function(number){ + var activeInfo = {}; + for (var i = 0; i < this.load_config.length; i++) { + if (number >= this.load_config[i].val) { + activeInfo = JSON.parse(JSON.stringify(this.load_config[i])); + break; + } else if (number <= 30) { + activeInfo = JSON.parse(JSON.stringify(this.load_config[3])); + break; + } + } + activeInfo.val = number; + return activeInfo; + }, + + get_index_list: function () { bt.soft.get_index_list(function (rdata) { var con = ''; diff --git a/BTPanel/static/js/public.js b/BTPanel/static/js/public.js index 89958b1b..5abbd1ae 100644 --- a/BTPanel/static/js/public.js +++ b/BTPanel/static/js/public.js @@ -772,7 +772,7 @@ var aceEditor = { $('.ace_dir_tools').on('click','.upper_level',function(){ var _paths = $(this).attr('data-menu-path'); _this.reader_file_dir_menu({path:_paths,is_empty:true}); - $('.ace_catalogue_title').html('Directory: '+ _paths).attr('title',_paths); + $('.ace_catalogue_title').html('Dir: '+ _paths).attr('title',_paths); }); // 新建文件(文件目录主菜单) $('.ace_dir_tools').on('click','.new_folder',function(e){ @@ -2031,6 +2031,9 @@ function openEditorView(type, path) { ace.config.set("workerPath", "/static/ace"); ace.config.set("themePath", "/static/ace"); aceEditor.openEditorView(path); + var _left = parseInt( $(layero).css('left')),_top = parseInt( $(layero).css('top')); + _left<0?$(layero).css('left',Math.abs(_left)):$(layero).css('left',_left) + _top<0?$(layero).css('top',Math.abs(_top)):$(layero).css('top',_top) // $('.aceEditors .layui-layer-min').click(function(e) { // aceEditor.isAceView = false; // setTimeout(function() { @@ -2356,7 +2359,7 @@ function ChangePath(d) { setCookie("SetName", ""); var c = layer.open({ type: 1, - area: "650px", + area: "680px", title: lan.bt.dir, closeBtn: 2, shift: 5, @@ -3986,7 +3989,8 @@ var Term = { Term.send(JSON.stringify(Term.ssh_info || {})) // Term.term.FitAddon.fit(); // Term.resize(); - var f_path = $("#fileInputPath").val(); +// var f_path = $("#fileInputPath").val(); + var f_path = $("#fileInputPath").attr('data-path'); if(f_path){ Term.last_cd = "cd " + f_path; Term.send(Term.last_cd + "\n"); diff --git a/BTPanel/static/js/public_backup.js b/BTPanel/static/js/public_backup.js index 4960861e..0c0b4139 100644 --- a/BTPanel/static/js/public_backup.js +++ b/BTPanel/static/js/public_backup.js @@ -294,50 +294,96 @@ var bt = { return null; } }, - select_path: function(id) { - _this = this; - _this.set_cookie("SetName", ""); + select_path: function(id, type) { + _this = this; + _this.set_cookie("SetName", ""); + var loadT = bt.open({ + type: 1, + area: "680px", + title: type === 'all' ? 'Select directories or files' : lan.bt.dir, + closeBtn: 2, + shift: 5, + content: "
                " + lan.bt.path + ":
                " + lan.bt.comp + "
                  " + lan.bt.filename + "" + lan.bt.etime + "" + lan.bt.access + "" + lan.bt.own + "
                  ", + success: function() { + $('#btn_back').click(function() { + var path = $("#PathPlace").find("span").text(); + path = bt.rtrim(bt.format_path(path), '/'); + var back_path = bt.get_file_path(path); + _this.get_file_list(back_path, type); + }) + //选择 + $('#bt_select').click(function() { + var path = bt.format_path($("#PathPlace").find("span").text()); + if ($('#tbody tr').hasClass('active')) { + path = $('#tbody tr.active .bt_open_dir').attr('path'); + } + path = bt.rtrim(path, '/'); + $("#" + id).val(path).change(); + $("." + id).val(path).change(); + loadT.close(); + }) + } + }); + _this.set_cookie('ChangePath', loadT.form); + var paths = $("#" + id).val(); + if ($('#defaultPath').length > 0 && $("#" + id).parents('.tab-body').length > 0) { + paths = $('#defaultPath').text(); + } + _this.get_file_list(paths, type); - var loadT = bt.open({ - type: 1, - area: "650px", - title: lan.bt.dir, - closeBtn: 2, - shift: 5, - content: "
                  " + lan.bt.path + ":
                  " + lan.bt.comp + "
                    " + lan.bt.filename + "" + lan.bt.etime + "" + lan.bt.access + "" + lan.bt.own + "
                    " - }); - _this.set_cookie('ChangePath', loadT.form); - setTimeout(function() { - $('#btn_back').click(function() { - var path = $("#PathPlace").find("span").text(); - path = bt.rtrim(bt.format_path(path), '/'); - var back_path = bt.get_file_path(path); - - get_file_list(back_path); - }) - //选择 - $('#bt_select').click(function() { - var path = bt.format_path($("#PathPlace").find("span").text()); - path = bt.rtrim(path, '/'); - $("#" + id).val(path); - $("." + id).val(path); - loadT.close(); - }) - }, 100) - get_file_list($("#" + id).val()) - - function get_file_list(path) { - bt.send('GetDir', 'files/GetDir', { path: path, disk: true }, function(rdata) { - var d = '', - a = ''; - if (rdata.DISK != undefined) { - for (var f = 0; f < rdata.DISK.length; f++) { - a += "
                     " + rdata.DISK[f].path + "
                    " - } - $("#changecomlist").html(a) + function ActiveDisk() { + var a = $("#PathPlace").find("span").text().substring(0, 1); + switch (a) { + case "C": + $(".path-con-left dd:nth-of-type(1)").css("background", "#eee").siblings().removeAttr("style"); + break; + case "D": + $(".path-con-left dd:nth-of-type(2)").css("background", "#eee").siblings().removeAttr("style"); + break; + case "E": + $(".path-con-left dd:nth-of-type(3)").css("background", "#eee").siblings().removeAttr("style"); + break; + case "F": + $(".path-con-left dd:nth-of-type(4)").css("background", "#eee").siblings().removeAttr("style"); + break; + case "G": + $(".path-con-left dd:nth-of-type(5)").css("background", "#eee").siblings().removeAttr("style"); + break; + case "H": + $(".path-con-left dd:nth-of-type(6)").css("background", "#eee").siblings().removeAttr("style"); + break; + default: + $(".path-con-left dd").removeAttr("style") + } + } + }, + get_file_list:function(path, type){ + var _that = this; + bt.send('GetDir', 'files/GetDir', { path: path, disk: true }, function(rdata) { + var d = '',a = '',disk = rdata.DISK; + if (disk != undefined) { + for (var f = 0; f < disk.length; f++) { + a += "
                     " + disk[f].path + "
                    " } - for (var f = 0; f < rdata.DIR.length; f++) { - var g = rdata.DIR[f].split(";"); + $("#changecomlist").html(a) + } + for (var f = 0; f < rdata.DIR.length; f++) { + var g = rdata.DIR[f].split(";"); + var e = g[0]; + if (e.length > 20) { + e = e.substring(0, 20) + "..." + } + if (isChineseChar(e)) { + if (e.length > 10) { + e = e.substring(0, 10) + "..." + } + } + d += "" + e + "" + bt.format_data(g[2]) + "" + g[3] + "" + g[4] + "" + } + + if (rdata.FILES != null && rdata.FILES != "") { + for (var f = 0; f < rdata.FILES.length; f++) { + var g = rdata.FILES[f].split(";"); var e = g[0]; if (e.length > 20) { e = e.substring(0, 20) + "..." @@ -347,66 +393,40 @@ var bt = { e = e.substring(0, 10) + "..." } } - d += "" + e + "" + bt.format_data(g[2]) + "" + g[3] + "" + g[4] + "X" + d += "" + (type === 'all' ? '' : '') + "" + e + "" + bt.format_data(g[2]) + "" + g[3] + "" + g[4] + "" } + } - if (rdata.FILES != null && rdata.FILES != "") { - for (var f = 0; f < rdata.FILES.length; f++) { - var g = rdata.FILES[f].split(";"); - var e = g[0]; - if (e.length > 20) { - e = e.substring(0, 20) + "..." - } - if (isChineseChar(e)) { - if (e.length > 10) { - e = e.substring(0, 10) + "..." - } - } - d += "" + e + "" + bt.format_data(g[2]) + "" + g[3] + "" + g[4] + "" + $(".default").hide(); + $(".file-list").show(); + $("#tbody").html(d); + if (rdata.PATH.substr(rdata.PATH.length - 1, 1) != "/") { + rdata.PATH += "/" + } + $("#PathPlace").find("span").html(rdata.PATH); + $("#tbody tr").click(function() { + if ($(this).find('td:eq(0) input').length > 0) { + if ($(this).hasClass('active')) { + $(this).removeClass('active'); + $(this).find('td:eq(0) input').prop('checked', false); + } else { + $(this).find('td:eq(0) input').prop('checked', true); + $(this).siblings().find('td:eq(0) input').prop('checked', false); + $(this).addClass('active').siblings().removeClass('active'); } } - - $(".default").hide(); - $(".file-list").show(); - $("#tbody").html(d); - if (rdata.PATH.substr(rdata.PATH.length - 1, 1) != "/") { - rdata.PATH += "/" - } - $("#PathPlace").find("span").html(rdata.PATH); - - $('.bt_open_dir').click(function() { - get_file_list($(this).attr('path')); - }) + }); + $('#changecomlist dd').click(function(){ + _that.get_file_list($(this).attr('path'), type); + }); + $('.bt_open_dir span').click(function() { + if ($(this).parent().data('type') == 'dir') _that.get_file_list($(this).parent().attr('path'), type); }) - } - - - function ActiveDisk() { - var a = $("#PathPlace").find("span").text().substring(0, 1); - switch (a) { - case "C": - $(".path-con-left dd:nth-of-type(1)").css("background", "#eee").siblings().removeAttr("style"); - break; - case "D": - $(".path-con-left dd:nth-of-type(2)").css("background", "#eee").siblings().removeAttr("style"); - break; - case "E": - $(".path-con-left dd:nth-of-type(3)").css("background", "#eee").siblings().removeAttr("style"); - break; - case "F": - $(".path-con-left dd:nth-of-type(4)").css("background", "#eee").siblings().removeAttr("style"); - break; - case "G": - $(".path-con-left dd:nth-of-type(5)").css("background", "#eee").siblings().removeAttr("style"); - break; - case "H": - $(".path-con-left dd:nth-of-type(6)").css("background", "#eee").siblings().removeAttr("style"); - break; - default: - $(".path-con-left dd").removeAttr("style") - } - } + }) }, + + + show_confirm: function(title, msg, fun, error) { if (error == undefined) { error = "" @@ -498,7 +518,6 @@ var bt = { if (callback) callback(rdata); }).error(function(e, f) { - // console.log(e,f) if (callback) callback('error'); }); } @@ -1415,7 +1434,6 @@ bt.pub = { bt.index = { rec_install: function() { bt.send('GetSoftList', 'ajax/GetSoftList', {}, function(l) { - var c = ""; var g = ""; var e = ""; @@ -1424,7 +1442,7 @@ bt.index = { continue } var o = ""; - var m = ""; + var m = ""; for (var b = 0; b < l[h].versions.length; b++) { var d = ""; if ((l[h].name == "PHP" && (l[h].versions[b].version == "7.4" || l[h].versions[b].version == "7.4")) || (l[h].name == "MySQL" && l[h].versions[b].version == "5.7") || (l[h].name == "phpMyAdmin" && l[h].versions[b].version == "5.0")) { @@ -1451,7 +1469,7 @@ bt.index = { var k = layer.open({ type: 1, title: lan.bt.install_title, - area: ["670px", "510px"], + area: ["670px", "610px"], closeBtn: 2, shadeClose: false, content: "

                    " + lan.bt.install_ps + " " + lan.bt.install_s + " " + lan.bt.install_s1 + "

                    " + lan.bt.install_lnmp + "

                      " + c + "

                    " + lan.bt.install_type + ":

                    " + lan.bt.install_key + "

                    LAMP

                      " + g + "

                    " + lan.bt.install_type + ":

                    "+lan.bt.install_key +"
                    ", @@ -1462,11 +1480,15 @@ bt.index = { '#select_Pure-Ftpd', '#select_PHP', '#select_phpMyAdmin', + '#select_DNS-Server', + '#select_Mail-Server', '#apache_select_Apache', '#apache_select_MySQL', '#apache_select_Pure-Ftpd', '#apache_select_PHP', - '#apache_select_phpMyAdmin' + '#apache_select_phpMyAdmin', + '#apache_select_DNS-Server', + '#apache_select_Mail-Server', ]); form_group.checkbox(); $('.layui-layer-content').css('overflow','inherit'); @@ -1504,7 +1526,7 @@ bt.index = { var n = $(this).val(); j(n, "select_", "data_") }); - + function j(p, r, q) { var n = "4.4"; switch(p) { @@ -1530,7 +1552,7 @@ bt.index = { var n = $(this).val(); a(n) }); - + $("#apache_select_Apache").change(function(){ var apacheVersion = $(this).val(); if(apacheVersion == '2.2'){ @@ -1539,7 +1561,7 @@ bt.index = { layer.msg(lan.bt.install_apache24); } }); - + $("#apache_select_PHP").change(function(){ var apacheVersion = $("#apache_select_Apache").val(); var phpVersion = $(this).val(); @@ -1559,7 +1581,7 @@ bt.index = { } } }); - + function a(n) { memSize = bt.get_cookie("memSize"); max = 64; @@ -1624,23 +1646,25 @@ bt.index = { time: 0, shade: [0.3, "#000"] }); - + install_plugin(q); - + function install_plugin(q){ if(!q[0]) return; p = q[0].split(" ")[0].toLowerCase(); x = q[0].split(" ")[1]; if(p=='pure-ftpd') p = 'pureftpd'; if(p=='php') p = 'php-'+x; - + if(p=='dns-server') p = 'dns_manager'; + if(p=='mail-server') p = 'mail_sys'; + s = "sName=" + p + "&version=" + x + "&type=" + v + "&id=" + (t + 1); bt.send('install_plugin','plugin/install_plugin',s,function(){ q.splice(0,1); install_plugin(q); }); } - + layer.close(loadT); layer.close(k); setTimeout(function() { @@ -1653,7 +1677,7 @@ bt.index = { task() }, 1000) }); - + //InstallTips(); fly("onekey") }) @@ -3341,9 +3365,9 @@ bt.soft = { }, php: { get_config: function(version, callback) { //获取禁用函数,扩展列表 - var loading = bt.load(); + // var loading = bt.load(); bt.send('GetPHPConfig', 'ajax/GetPHPConfig', { version: version }, function(rdata) { - loading.close(); + // loading.close(); if (callback) callback(rdata); }) }, @@ -3549,27 +3573,26 @@ bt.soft = { } return unit; }, - get_product_discount_by: function(pluginName, callback) { - if (pluginName) { - bt.send('get_plugin_price', 'auth/get_plugin_price', { pluginName: pluginName }, function(rdata) { - if (callback) callback(rdata) - }) - } else { - bt.send('get_product_discount_by', 'auth/get_product_discount_by', {}, function(rdata) { - if (callback) callback(rdata) - }) - } - + get_product_discount_by: function(product_id, callback) { + if (product_id) { + bt.send('get_plugin_price', 'auth/get_plugin_price', { product_id: product_id }, function(rdata) { + if (callback) callback(rdata) + }) + } else { + bt.send('get_product_discount_by', 'auth/get_product_discount_by', {}, function(rdata) { + if (callback) callback(rdata) + }) + } }, get_plugin_coupon: function(pid, callback) { - bt.send('check_pay_status', 'auth/check_pay_status', { id: pid }, function(rdata) { - if (callback) callback(rdata); - }) + bt.send('check_pay_status', 'auth/check_pay_status', { id: pid }, function(rdata) { + if (callback) callback(rdata); + }) }, get_re_order_status: function(callback) { - bt.send('get_re_order_status', 'auth/get_re_order_status', {}, function(rdata) { - if (callback) callback(rdata); - }) + bt.send('get_re_order_status', 'auth/get_re_order_status', {}, function(rdata) { + if (callback) callback(rdata); + }) }, get_voucher: function(pid, callback) { if (pid) { @@ -3605,34 +3628,47 @@ bt.soft = { } }) } - - - }, - create_order: function(data, callback) { - if (data.pid) { - var loadO = bt.load("Getting product information!") - bt.soft.get_panel_ssl_status(function(res){ - loadO.close() - if(res.status==true){ - var _cycle_unit = $('#libPay-content .li-con .active span').attr("data-unit").indexOf("year")>-1?"year":"month"; - data.cycle_unit = _cycle_unit,data.charge_type = 1; - bt.send('get_buy_code', 'auth/get_buy_code', data, function(rdata) { - loadO.close() - //rdata = {"status": true, "msg": "weixin://wxpay/bizpayurl?pr=lR6zKqTzz", "ali_msg": "https://qr.alipay.com/bax08320q6rajjt4tytr20f6", "data": {"wxoid": 4533185, "oid": 102639743, "old_id": 0, "ptype": 1, "attach": "161155796024137", "pid": 100000045, "openid": "", "uid": 233152, "transaction_id": "", "cash_fee": 9900, "out_trade_no": "161155796033618", "msg": "宝塔面板", "status": 0, "addtime": 1611557960, "endtime": 0, "idc_code": "", "is_fapiao": 0, "is_pro": 0, "is_activity": 0, "source": 2, "update_at": "2021-01-25 14:59:20", "update_reason": "", "invite_user": 0, "agent_level": 1, "coupon_type": 0, "create_reason": "", "create_at": "2021-01-25 14:59:20", "product_cycle": 0, "product_cycle_unit": "month", "auth_serial": "", "parent_id": 0, "pay_info": null, "order_title": "", "coupon_id": 0, "station_count": 1, "buyer_ip": "", "pay_way": 1}} - if (callback) callback(rdata); - }) - }else{ - $('#libPay-content').empty() - $('#libPay-pay').empty().append('
                    Please apply for SSL before purchasing!
                    ') - return false; - } - }); + + + }, + create_order: function(data, callback) { + if (data.pid) { + var loadT = bt.load("Getting product information!") + bt.soft.get_panel_ssl_status(function (res) { + loadT.close() + if (res.status) { + var _cycle_unit = $('#libPay-content .li-con .active span').attr("data-unit"), + _pay_channel = $('#libPay-mode .pay-cycle-btn span').text().indexOf('Stripe') > -1?'2':'10' + requestNmae = data.serial_no?'renew_product_auth':'get_buy_code' + data.cycle_unit = _cycle_unit; + if(!data.serial_no) { + data.charge_type = 1 + }else{ + data.pay_channel = _pay_channel + } + bt.send(requestNmae, 'auth/'+requestNmae, data, function (rdata) { + loadT.close() + if (callback) callback(rdata); + }) } else { - bt.send('create_order', 'auth/create_order', { cycle: data.cycle }, function(rdata) { - if (callback) callback(rdata); - }) + $('#libPay-content').empty() + $('.libPay-mask').hide(); + $('#libPay-pay').empty().append('
                    Please apply for SSL before purchasing!
                    \ +
                    '); + $('#turn_on_ssl').on('click', function (e) { + setPanelSSL() + }) + return false; } + }); + } else { + bt.send('create_order', 'auth/create_order', { + cycle: data.cycle + }, function (rdata) { + if (callback) callback(rdata); + }) } + } }, updata_commercial_view:function(){ layer.closeAll(); @@ -3668,11 +3704,11 @@ bt.soft = { \ '; layer.open({ - type: 1 + type: 1 ,closeBtn:2 ,area: '500px' ,title: lan.public_backup.up_pro_use_allplug_free - ,shade: 0.6 + ,shade: 0.6 ,anim: 0 ,content:html, success:function(layero,index){ @@ -3701,13 +3737,12 @@ bt.soft = { var data = $(this).parent().data(),that = this; bt.soft.set_product_renew_status({id:data.id,state:0},function(rdata){ if(!res.status){ - console.log(that); $(that).parent().remove(); } bt.msg(rdata); }); }) - } + } }); }, @@ -3738,36 +3773,37 @@ bt.soft = { }, // 产品支付视图(配置参数) product_pay_view:function(config){ - if(!bt.get_cookie('bt_user_info')){ - bt.pub.bind_btname(function(){ - window.location.reload(); - }); - return false; - } + if(!bt.get_cookie('bt_user_info')){ + bt.pub.bind_btname(function(){ + window.location.reload(); + }); + return false; + } + if(config.renew === -1) config.renew = false if(typeof config == "string") config = JSON.parse(config); config = $.extend({ plugin:null, renew:null, active:'', type:'', - pro: parseInt(bt.get_cookie('pro_end')), - ltd: parseInt(bt.get_cookie('ltd_end'))} + pro: parseInt(bt.get_cookie('pro_end')) || -1, + ltd: parseInt(bt.get_cookie('ltd_end')) || -1} ,config); var title = '',that = this,endTime = null; if(!config.is_alone){ if(config.plugin){ // 条件:当前为插件 - title = (config.renew == -1?'Buy ':'续费') + config.name; - ndTime = config.renew != -1?config.renew:null + title = (!config.renew?'Buy ':'续费') + config.name; + ndTime = !config.renew?config.renew:null }else if(config.pro == -1 && config.ltd == -1){ // 条件:专业版和企业版都没有购买过 title = 'Upgrade to Pro, all plugins are free to use'; }else if(config.ltd > 0){ // 条件:企业版续费 - title = '续费' +(config.name == ''?'宝塔专业版':config.name); + title = 'Renew ' +(config.name == ''?'宝塔专业版':config.name); endTime = config.ltd; }else if(config.pro > 0 || config.pro == -2){ // 条件:专业版续费 - title = '续费' + (config.name == ''?'宝塔专业版':config.name); + title = 'Renew ' + (config.name == ''?'宝塔专业版':config.name); endTime = config.pro; }else if(config.ltd == -2){ - title = '续费' + (config.name == ''?'宝塔专业版':config.name); + title = 'Renew ' + (config.name == ''?'宝塔专业版':config.name); endTime = config.ltd; } }else{ @@ -3778,8 +3814,7 @@ bt.soft = { title:title, area:['650px','760px'], shadeClose:false, - content:'\ -
                    \ + content:'
                    \
                    \ Account: \ Expire date:\ @@ -3800,34 +3835,35 @@ bt.soft = {
                    \
                    ', success:function(indexs,layers){ - var bt_user_info = bt.get_cookie('bt_user_info'); - if(!bt_user_info){ - bt.pub.get_user_info(function(res){ - $('.bindUser span').html(res.data.username +'Change'); - }); - }else{ - $('.bindUser span').html(JSON.parse(bt_user_info).data.username +'Change'); - } + $.getScript('https://js.stripe.com/v3/') + var bt_user_info = bt.get_cookie('bt_user_info'); + if(!bt_user_info){ + bt.pub.get_user_info(function(res){ + $('.bindUser span').html(res.data.username +'Change'); + }); + }else{ + $('.bindUser span').html(JSON.parse(bt_user_info).data.username +'Change'); + } endTime != null?$('.endTime span').html(endTime > parseInt(new Date().getTime() /1000)?bt.format_data(endTime):'Expired'):$('.endTime').hide(); $('.bindUser').on('click','a',function(){ bt.pub.bind_btname(function(){ bt.soft.product_pay_view(config); }); }); - var arry = []; + var arry = []; //config.name = '堡塔企业级防篡改'; - if(config.plugin) arry.push({title:config.name,name:config.name,ps:'Plug-in only',pid:config.pid,active:((config.pro < 0 && config.ltd < 0) || (config.type == 12 && config.ltd<0)?true:false)}); - // if((((config.pro > 0 || config.pro == -2 || config.ltd < 0) && ((config.ltd > 0 && config.ltd != config.pro) || config.ltd < 0) && config.type != 12) || config.limit == 'pro' || (config.ltd < 0 && config.pro == -1)) && config.type != 12 && ((config.ltd < 0 && config.pro > 0) || (config.ltd < 0 && config.pro < 0))){ - // arry.push({title:'',name:'',pid:'',ps:'推荐个人购买',active: (((config.type == 8 && !config.plugin) || config.limit == 'pro' || (config.pro > 0 || config.pro == -2)) && config.ltd < 0 && (config.ltd == -2?(config.pro == -2?false:true):true))}); - // } - + if(config.plugin) arry.push({title:config.name,name:config.name,ps:'Plug-in only',pid:config.pid,renew:config.renew || false,active:((config.pro < 0 && config.ltd < 0) || (config.type == 12 && config.ltd<0)?true:false)}); + if((((config.pro > 0 || config.pro == -2 || config.ltd < 0) && ((config.ltd > 0 && config.ltd != config.pro) || config.ltd < 0) && config.type != 12) || config.limit == 'pro' || (config.ltd < 0 && config.pro == -1)) && config.type != 12 && ((config.ltd < 0 && config.pro > 0) || (config.ltd < 0 && config.pro < 0))){ + arry.push({title:'',name:'',pid:'100000058',ps:'Recommended',renew:config.renew || false,active: (((config.type == 8 && !config.plugin) || config.limit == 'pro' || (config.pro > 0 || config.pro == -2)) && config.ltd < 0 && (config.ltd == -2?(config.pro == -2?false:true):true))}); + } + // if((((config.ltd > 0 || config.ltd == -2 || config.pro == -2) || (config.ltd == -1 && config.pro == -1) || config.limit == 'ltd') && (config.pro < 0 || (config.pro >= 0 && config.ltd >0))) || (config.is_alone && config.pid == 100000032)){ // arry.push({title:'',name:'宝塔面板企业版',ps:'推荐企业购买',pid:100000032,recommend:true,active:((config.type == 12 && !config.plugin && config.ltd > 0) || config.limit == 'ltd' || (config.renew == config.ltd && config.ltd > 0)? true:false)}); // } // if(config.type == 12 && config.pro >= 0 && config.ltd < 0) $('.pro-tips').html('温馨提示:专业版升级企业版需要手动结算当前专业版授权,《专业版和企业版切换教程》').css('color','red'); $('#libPay-type .li-con').append(that.product_pay_swicth('type',arry)); if(config.source) bt.set_cookie('pay_source',config.source); - that.each(arry,function(index,item){ + that.each(arry,function(index,item){ if(item.active){ that.product_pay_page_refresh($.extend({condition:1},item)); } @@ -3843,49 +3879,59 @@ bt.soft = { order_cache:{}, // 获取产品周期 ,并进行对象缓存 get_product_discount_cache:function(config,callback){ - var that = this; - if(typeof this.product_cache[config.pid] != "undefined"){ - if(callback) callback(this.product_cache[config.pid]); - }else{ - bt.soft.pro.get_product_discount_by(config.name,function(rdata){ - //rdata = {"36": {"discount": 1, "did": 0, "price": 3564, "name": "正常", "sprice": 3564}, "24": {"discount": 1, "did": 0, "price": 2376, "name": "正常", "sprice": 2376}, "12": {"discount": 1, "did": 0, "price": 1188, "name": "正常", "sprice": 1188}, "6": {"discount": 1, "did": 0, "price": 594, "name": "正常", "sprice": 594}, "3": {"discount": 1, "did": 0, "price": 297, "name": "正常", "sprice": 297}, "1": {"discount": 1, "did": 0, "price": 99, "name": "正常", "sprice": 99}, "pid": "100000045"}; - if(typeof rdata.status === "boolean"){ - if(!rdata.status) return false; - } - that.product_cache[config.pid] = rdata; - setTimeout(function(){ delete that.product_cache[config.pid] },60000); - if(callback) callback(rdata); - }); - } + var that = this; + if(typeof this.product_cache[config.pid] != "undefined"){ + if(callback) callback(this.product_cache[config.pid]); + }else{ + bt.soft.pro.get_product_discount_by(config.pid,function(rdata){ + //rdata = {"36": {"discount": 1, "did": 0, "price": 3564, "name": "正常", "sprice": 3564}, "24": {"discount": 1, "did": 0, "price": 2376, "name": "正常", "sprice": 2376}, "12": {"discount": 1, "did": 0, "price": 1188, "name": "正常", "sprice": 1188}, "6": {"discount": 1, "did": 0, "price": 594, "name": "正常", "sprice": 594}, "3": {"discount": 1, "did": 0, "price": 297, "name": "正常", "sprice": 297}, "1": {"discount": 1, "did": 0, "price": 99, "name": "正常", "sprice": 99}, "pid": "100000045"}; + if(typeof rdata.status === "boolean"){ + if(!rdata.status) return false; + } + that.product_cache[config.pid] = rdata; + setTimeout(function(){ delete that.product_cache[config.pid] },60000); + if(callback) callback(rdata); + }); + } }, // 产品页面刷新 product_pay_page_refresh: function (config){ var condition = config.condition, that = this; switch (condition){ case 1: - var loadT = bt.load(); - bt.send('get_product_auth', 'auth/get_product_auth', { page: 1,pageSize:15 }, function(res) { - bt.soft.pro.get_voucher(config.pid, function (rdata) { - loadT.close(); - var _arry = [{ title: '微信支付', condition: 2 },{ title: 'Stripe', condition: 3 }, { title: 'voucher', condition: 4 },{title: "Authorization", condition: 7}]; - if(res == null) res = []; - if (rdata == null) rdata = []; - _arry[res.length > 0? '3' :(rdata.length > 0 ? '2' : '1')].active = true; - $('#libPay-mode .li-con').empty().append( - that.product_pay_swicth('payment', { - name: config.name, - pid: config.pid, - data: _arry, - voucher_data: rdata - }) - ); - config.condition = (res.length > 0?7:(rdata.length > 0?4:2)) - if (rdata.length > 0) config.voucher_data = rdata; - if(res.length > 0) config.voucher_data = res; - that.product_pay_page_refresh(config); - }); + var loadT = bt.load(); + bt.send('get_product_auth', 'auth/get_product_auth', { page: 1,pageSize:15 }, function(res) { + bt.soft.pro.get_voucher(config.pid, function (rdata) { + loadT.close(); + var _arry = [{ title: '微信支付', condition: 2 },{ title: 'Stripe', condition: 3 }, { title: 'voucher', condition: 4 },{title: "Authorization", condition: 7,"_pid":config.pid}]; + if(config.renew){ + _arry.splice(_arry.length-1,1) + _arry[rdata.length > 0 ? '2' : '1'].active = true + config.condition = rdata.length > 0?4:2 + }else{ + _arry[res.length > 0? '3' :(rdata.length > 0 ? '2' : '1')].active = true; + config.condition = (res.length > 0?7:(rdata.length > 0?4:2)) + } + if(res == null) res = []; + if (rdata == null) rdata = []; + $('#libPay-mode .li-con').empty().append( + that.product_pay_swicth('payment', { + name: config.name, + pid: config.pid, + data: _arry, + voucher_data: rdata + }) + ); + if(config.renew){ + if (rdata.length > 0) config.voucher_data = rdata; + }else{ + if (rdata.length > 0) config.voucher_data = rdata; + if(res.length > 0) config.voucher_data = res; + } + that.product_pay_page_refresh(config); + }); }); - break; + break; case 2: case 3: $('#libPay-content .li-tit').text('Choose your plan'); @@ -3897,24 +3943,23 @@ bt.soft = { } var loadT = bt.load(); bt.soft.get_product_discount_cache(config,function (rdata){ - loadT.close(); - var _arry = [],index = $('#libPay-content .pay-cycle-btn.active').index() || 3; - if(index < 0) index = 3 - try { - delete rdata.pid - } catch (error) { - console.log(rdata.pid); - } - that.each(rdata, function (key, item) { - _arry.push($.extend({ cycle: parseInt(key) }, item)); - }); - _arry[index].active = true; - $('#libPay-content .li-con').empty().append( - that.product_pay_swicth('time',{ name: config.name, pid: config.pid, data: _arry}) - ); - config.condition = 5; - config = $.extend(config, _arry[index]); - that.product_pay_page_refresh(config); + loadT.close(); + var _arry = [],index = 0; + try { + delete rdata.pid + } catch (error) { + console.log(rdata.pid); + } + that.each(rdata, function (key, item) { + _arry.push($.extend({ cycle: parseInt(key) }, item)); + }); + _arry[index].active = true; + $('#libPay-content .li-con').empty().append( + that.product_pay_swicth('time',{ name: config.name, pid: config.pid, data: _arry}) + ); + config.condition = 5; + config = $.extend(config, _arry[index]); + that.product_pay_page_refresh(config); }); break; case 4: @@ -3959,40 +4004,41 @@ bt.soft = { $('#libPay-pay').find('.cost-price').css('display', (config.sprice > config.price ? 'inline-block' : 'none')).html('$ '+(config.sprice).toFixed(2)); $('#libPay-pay').find('#PayQcode').html('
                    Loading, please wait!
                    '); if (qcode) { - $('#libPay-pay').find('#PayQcode').empty().qrcode(qcode); - that.product_pay_monitor({ pid: config.pid, name: config.name }); - $('.libPay-mask').hide(); - return false; - } + $('#libPay-pay').find('#PayQcode').empty().qrcode(qcode); + that.product_pay_monitor({ pid: config.pid, name: config.name }); + $('.libPay-mask').hide(); + return false; + } }else{ $('#libPay-pay').html('
                    Loading, please wait!
                    '); - } - var paream = {pid:config.pid,cycle:config.cycle},pay_source = bt.get_cookie('pay_source'); - if(pay_source) paream.source = bt.get_cookie('pay_source'); - if(!paream.pid) delete paream.pid; + } + var paream = {pid:config.pid,cycle:config.cycle},pay_source = bt.get_cookie('pay_source'); + if(pay_source) paream.source = bt.get_cookie('pay_source'); + if(!paream.pid) delete paream.pid; + if(bt.get_cookie('serial_no') != null) paream.serial_no = config.serial_no || bt.get_cookie('serial_no') that.pro.create_order(paream,function (rdata){ - if (rdata.status === false){ - bt.set_cookie('force', 1); - if (soft) soft.flush_cache(); - layer.msg(rdata.msg, { icon: 2 }); - return; - } - config.pay = parseInt($('#libPay-mode .pay-cycle-btn.active').data('condition')); - // 二维码显示界面 - $('#libPay-pay').empty().append(that.product_pay_swicth((config.pay == 2?'wechat':'alipay'),$.extend({ order_no:rdata.order_no,stripe_publishable_key:rdata.stripe_publishable_key}, config))); + if (rdata.status === false){ + bt.set_cookie('force', 1); + if (soft) soft.flush_cache(); + layer.msg(rdata.msg, { icon: 2 }); + return; + } + config.pay = parseInt($('#libPay-mode .pay-cycle-btn.active').data('condition')); + // 二维码显示界面 + $('#libPay-pay').empty().append(that.product_pay_swicth((config.pay == 2?'wechat':'alipay'),$.extend({ order_no:rdata.order_no,stripe_publishable_key:rdata.stripe_publishable_key}, config))); }); - $("#libPay-pay").on('click','#checkout-button',function(){ - var loadO = bt.load("Getting the session ID,Please waiting!") - var stripe = Stripe($(this).data('keys')); - that.pro.get_check_out_info($(this).data('code'),function(res){ - loadO.close() - if(res.id){ - stripe.redirectToCheckout({ sessionId: res.id }); - }else{ - layer.msg("Payment order failed, please contact administrator!", { icon: 2 }); - } - }) - }) + $("#libPay-pay").on('click','#checkout-button',function(){ + var loadT = bt.load("Getting the session ID,Please waiting!") + var stripe = Stripe($(this).data('keys')); + that.pro.get_check_out_info($(this).data('code'),function(res){ + loadT.close() + if(res.id){ + stripe.redirectToCheckout({ sessionId: res.id }); + }else{ + layer.msg("Payment order failed, please contact administrator!", { icon: 2 }); + } + }) + }) break; case 6: var _html = $('
                    '), _button = $(''); @@ -4011,24 +4057,34 @@ bt.soft = { $('#libPay-pay').empty().append(_html.append(_button)); break; case 7: + if(config.renew) return false var loadA = bt.load("Obtaining authorization information!") - $('#libPay-content .li-tit').text('Authorization information'); - bt.send('get_product_auth', 'auth/get_product_auth', { page: 1,pageSize:15 }, function(res) { + var _pid = config.pid; + $('#libPay-content .li-tit').text('Authorization information'); + bt.send('get_product_auth', 'auth/get_product_auth', { page: 1,pageSize:15 }, function(res) { loadA.close(); if(res.status==false){ layer.msg(res.msg, { icon: res.status ? 1 : 2 }); return false; } _html = $('
                      '); - - if(res.length==0){ - _html.append($('
                    • No authorization
                    • ')); - + if(res.length == 0){ + _html.append($('
                    • No authorization
                    • ')); } + var authorization_flag = false; $.each(res, function (index, item) { - _html.append($('
                    • ' + bt.format_data(item.end_time) + '
                    • ')); + if(_pid == item.product_id){ + _html.append($('
                    • ' + bt.format_data(item.end_time) + '
                    • ')); + authorization_flag = true; + } + if(authorization_flag == false && index == res.length - 1){ + _html.append($('
                    • No authorization
                    • ')); + } }); $('#libPay-content .li-con').empty().append(_html); + $('#libPay-content ul li').click(function(){ + $(this).addClass('active').siblings().removeClass('active') + }); $('#libPay-pay').empty().append($('
                      ')); //授权 $('#authorization').unbind(); @@ -4053,7 +4109,7 @@ bt.soft = { } }); break; - + } }, // 产品购买,渲染方法 @@ -4109,13 +4165,12 @@ bt.soft = { break; case 'wechat': case 'alipay': - // console.log(config) _html = $('
                      ' + 'Total' + '$' + (config.price).toFixed(2) + '' + '$ ' + (config.market_price).toFixed(2) + '
                      ' + '
                      ' + - '' + '' ); // $(_html).find('#PayQcode').qrcode(config.data); $('.libPay-mask').hide(); @@ -4185,9 +4240,20 @@ bt.soft = { } return that; }, + /** + * @description 升级专业版 + */ updata_pro:function(){ - bt.soft.product_pay_view({name:'',pid:'',limit:'pro'}); - }, + bt.soft.product_pay_view({name:'Pro',pid:'100000058',limit:'pro'}); + }, + /** + * @description 续费专业版 + */ + renew_pro:function(){ + var config = {name:'Pro',pid:'100000058',limit:'pro',renew:true} + if(!bt.get_cookie('serial_no')) delete config.renew + bt.soft.product_pay_view(config); + }, // updata_pro: function() { // bt.pub.get_user_info(function(rdata) { // if (!rdata.status) { @@ -4281,27 +4347,27 @@ bt.soft = { var txt = lan.public_backup.buy; if (type) txt = lan.public_backup.renew; var payhtml = '
                      \ -
                      \ -
                      \ -
                      \ -
                      \ -
                      ' + txt + lan.public_backup.duration + '
                      \ -
                        \ -
                      • ' + lan.public_backup.month1 + '
                      • \ -
                      • ' + lan.public_backup.month3 + '
                      • \ -
                      • ' + lan.public_backup.month6 + '
                      • \ -
                      • ' + lan.public_backup.year + '
                      • \ -
                      \ -
                      \ -
                      ' + lan.public_backup.total + '' + lan.public_backup.rmb + '
                      \ -
                      \ -
                      \ -
                      ' + lan.public_backup.pay_by_wechatqrcore + '
                      \ -
                      \ -
                      \ -
                      \ -
                      \ -
                      '; +
                      \ +
                      \ +
                      \ +
                      \ +
                      ' + txt + lan.public_backup.duration + '
                      \ +
                        \ +
                      • ' + lan.public_backup.month1 + '
                      • \ +
                      • ' + lan.public_backup.month3 + '
                      • \ +
                      • ' + lan.public_backup.month6 + '
                      • \ +
                      • ' + lan.public_backup.year + '
                      • \ +
                      \ +
                      \ +
                      ' + lan.public_backup.total + '' + lan.public_backup.rmb + '
                      \ +
                      \ +
                      \ +
                      ' + lan.public_backup.pay_by_wechatqrcore + '
                      \ +
                      \ +
                      \ +
                      \ +
                      \ +
                      '; layer.open({ type: 1, @@ -4335,7 +4401,6 @@ bt.soft = { soft.flush_cache(); return; } - console.log(price, cycle) $(".sale-price").text((price * cycle).toFixed(2)) $(".pay-wx").html(''); $(".pay-wx").qrcode(rdata.msg.code); @@ -4386,7 +4451,7 @@ bt.soft = { code = _active.attr("data-code"), coupon_id = _active.attr("data-coupon-id"), charge_type = _active.attr("data-charge-type"); - + var _span = $("#couponlist .pay-btn-group .active span"), cycle = parseInt(_span.html()),cycle_unit = _span.html.indexOf("Month")?"month":"year"; if (code == undefined) { @@ -4542,11 +4607,15 @@ bt.soft = { } bt.send('get_soft_list', 'plugin/get_soft_list', { p: p, type: type, tojs: 'soft.get_list', force: force, query: search }, function(rdata) { - if (loading) loading.close(); - bt.set_cookie('force', 0); - bt.set_cookie('ltd_end',rdata.ltd); - bt.set_cookie('pro_end',rdata.pro); - if (callback) callback(rdata); + if (loading) loading.close(); + bt.set_cookie('force', 0); + if(rdata.pro_authorization_sn != null){ + bt.set_cookie('serial_no',rdata.pro_authorization_sn); + }else{ + bt.clear_cookie('serial_no') + } + bt.set_cookie('pro_end',rdata.pro); + if (callback) callback(rdata); }) }, to_index: function(name, callback) { @@ -4891,6 +4960,8 @@ bt.soft = { } }) }, + is_loop_speed:true, + is_install:false, //显示进度 show_speed: function() { bt.send('get_lines', 'ajax/get_lines', { @@ -4964,7 +5035,7 @@ bt.soft = { } }); }, - // install_soft: function(item, version, type,that) { //安装单版本 + // install_soft: function(item, version, type,that) { //安装单版本 // if (type == undefined) type = 0; // item.title = bt.replace_all(item.title, '-' + version, ''); // var msg = item.type != 5 ? lan.soft.lib_insatll_confirm.replace('{1}', item.title) : lan.get('install_confirm', [item.title, version]); @@ -5004,8 +5075,12 @@ bt.soft = { bt.pub.get_task_count(function(rdata){ if(rdata > 0 && item.type === 5) messagebox(); }); - if(typeof soft != "undefined") soft.get_list(); - bt.msg(rdata); + if(!rdata.status){ + layer.msg(rdata.msg, {icon: rdata.status ? 1 : 2}); + } + setTimeout(function(){ + if(typeof soft != "undefined") soft.get_list(); + },2000) }) }) }) @@ -5071,12 +5146,12 @@ bt.soft = { _this.install_other(rdata) return; } - layer.close(bt.soft.loadT); + layer.close(bt.soft.loadT); bt.pub.get_task_count(function(rdata){ if(rdata > 0 && item.type === 5) messagebox(); }); if(typeof soft != "undefined") soft.get_list(); - bt.msg(rdata); + bt.msg(rdata); }) }) }, msg); @@ -5175,8 +5250,8 @@ bt.soft = { } rcode = rtmp[1].replace('',''); setTimeout(function(){ - if(!!(window.attachEvent && !window.opera)){ - execScript(rcode); + if(!!(window.attachEvent && !window.opera)){ + execScript(rcode); }else{ window.eval(rcode); } @@ -5938,7 +6013,7 @@ bt.site = { } }); $('.webname' + bs).focus(function(){ - var _this = $(this), + var _this = $(this), tips = 'www will not add by default, if you need to access,please add it like:\
                      hostname.com\
                      www.hostname.com'; @@ -6612,7 +6687,6 @@ bt.data = { rdata.redirect = $(domains[0]).text(); rdata.tourl = $(domains[1]).text(); }else{ - console.log(rdata.tourl); delete rdata.redirect; delete rdata.tourl; } @@ -6768,7 +6842,6 @@ var form_group = { }); $(this).parents('.rec-box').siblings().find('.bt_select_ul.active').each(function(){ is_show_slect_parent(this); - console.log(this); }); } is_show_select_ul($(this).next().hasClass('active')); @@ -6823,4 +6896,90 @@ var form_group = { } }); } -} \ No newline at end of file +} +//设置面板SSL +function setPanelSSL(){ + var loadT = layer.msg(lan.config.ssl_msg,{icon:16,time:0,shade: [0.3, '#000']}); + bt.send('get_cert_source', 'config/get_cert_source', {}, function (rdata) { + layer.close(loadT); + var sdata = rdata; + var _data = { + title: 'Panel SSL', + area: '630px', + class:'ssl_cert_from', + list: [ + { + html:'

                      '+lan.config.ssl_open_ps+'

                      • '+lan.config.ssl_open_ps_1+'
                      • '+lan.config.ssl_open_ps_2+'
                      • '+lan.config.ssl_open_ps_3+'
                      ' + }, + { + title: 'Cert Type', + name: 'cert_type', + type: 'select', + width: '200px', + value: sdata.cert_type, + items: [{value: '1', title: 'Self-signed certificate'}, {value: '2', title: 'Let\'s Encrypt'}], + callback: function (obj) { + var subid = obj.attr('name') + '_subid'; + $('#' + subid).remove(); + if (obj.val() == '2') { + var _tr = bt.render_form_line({ + title: 'Admin E-Mail', + name: 'email', + width: '320px', + placeholder: 'Admin E-Mail', + value: sdata.email + }); + obj.parents('div.line').append('
                      ' + _tr.html + '
                      '); + } + } + }, + { + html:'
                      '+lan.config.ssl_open_ps_5+'

                      ' + } + + ], + btns: [ + { + title: 'Close', name: 'close', callback: function (rdata, load, callback) { + load.close(); + $("#panelSSL").prop("checked", false); + } + }, + { + title: 'Submit', name: 'submit', css: 'btn-success', callback: function (rdata, load, callback) { + if(!$('#checkSSL').is(':checked')){ + bt.msg({status:false,msg:'Please confirm the risk first!'}) + return; + } + var confirm = layer.confirm('Whether to open the panel SSL certificate', {title:'Tips',btn: ['Confirm','Cancel'],icon:0,closeBtn:2}, function() { + var loading = bt.load(); + bt.send('SetPanelSSL', 'config/SetPanelSSL', rdata, function (rdata) { + loading.close() + if (rdata.status) { + layer.msg(rdata.msg,{icon:1}); + $.get('/system?action=ReWeb', function () { + }); + setTimeout(function () { + window.location.href = ((window.location.protocol.indexOf('https') != -1) ? 'http://' : 'https://') + window.location.host + window.location.pathname; + }, 1500); + } + else { + layer.msg(rdata.msg,{icon:2}); + } + }) + }); + } + + } + ], + end: function () { + + } + }; + + var _bs = bt.render_form(_data); + // setTimeout(function () { + // $('.cert_type' + _bs).trigger('change') + // }, 200); + }); +} diff --git a/BTPanel/static/js/site.js b/BTPanel/static/js/site.js index f36013ee..e6cc9265 100644 --- a/BTPanel/static/js/site.js +++ b/BTPanel/static/js/site.js @@ -61,20 +61,20 @@ var site_table = bt_tools.table({ var item = _ssl[_arry[i][0]]; _info += _arry[i][1]+':'+ item + (_arry.length-1 != i?'\n':''); } - return row.ssl === -1?'Not Set':'Expire: '+ row.ssl.endtime +'days'; + return _ssl === -1?'Not Set': (_ssl.endtime >= 0? 'Expire: '+ _ssl.endtime +'days':'Expired'); },event:function(row,index,ev,key,that){ site.web_edit(row); setTimeout(function(){ $('.site-menu p:eq(8)').click(); },500); }}, - {title:lan.site.operate,type:'group',width:95,align:'right',group:[ - // { - // title:'防火墙', - // event:function(row,index,ev,key,that){ - // site.site_waf(row.name); - // } - // }, + {title:lan.site.operate,type:'group',width:118,align:'right',group:[ + { + title:'WAF', + event:function(row,index,ev,key,that){ + site.site_waf(row.name); + } + }, { title:lan.site.set, event:function(row,index,ev,key,that){ @@ -1822,6 +1822,151 @@ var site = { } }, edit: { + update_composer: function () { + loadT = bt.load() + $.post('/files?action=update_composer', { + repo: $("select[name='repo']").val() + }, function (v_data) { + loadT.close(); + bt.msg(v_data); + }); + }, + show_composer_log: function () { + $.post('/ajax?action=get_lines', { + filename: '/tmp/composer.log', + num: 30 + }, function (v_body) { + var log_obj = $("#composer-log") + if (log_obj.length < 1) return; + log_obj.html(v_body.msg); + var div = document.getElementById('composer-log') + div.scrollTop = div.scrollHeight; + if (v_body.msg.indexOf('BT-Exec-Completed') != -1) { + //layer.close(site.edit.comp_showlog); + layer.msg('Execution complete', { + icon: 1 + }); + return; + } + + setTimeout(function () { + site.edit.show_composer_log() + }, 1000) + }); + }, + comp_confirm: 0, + comp_showlog: 0, + exec_composer: function () { + site.edit.comp_confirm = layer.confirm('The impact of Composer execution depends on the composer.json configuration file in this directory. Continue?', { + title: 'Execute composer', + closeBtn: 2, + icon: 3 + }, function (index) { + layer.close(site.edit.comp_confirm); + var pdata = { + php_version: $("select[name='php_version']").val(), + composer_args: $("select[name='composer_args']").val(), + repo: $("select[name='repo']").val(), + path: $("input[name='composer_path']").val(), + user: $("select[name='composer_user']").val() + } + $.post('/files?action=exec_composer', pdata, function (rdatas) { + if (!rdatas.status) { + layer.msg(rdatas.msg, { + icon: 2 + }); + return false; + } + if (rdatas.status === true) { + site.edit.comp_showlog = layer.open({ + area: "800px", + type: 1, + shift: 5, + closeBtn: 2, + title: 'Execute Composer in the ['+ pdata['path'] +'] directory. After execution, please close this window after confirming that there is no problem', + content: "
                      "
                      +                });
                      +                setTimeout(function () {
                      +                  site.edit.show_composer_log();
                      +                }, 200);
                      +              }
                      +            });
                      +          });
                      +        },
                      +        remove_composer_lock: function (path) {
                      +          $.post('/files?action=DeleteFile', {
                      +            path: path + '/composer.lock'
                      +          }, function (rdata) {
                      +            bt.msg(rdata);
                      +            $(".composer-msg").remove();
                      +            $(".composer-rm").remove();
                      +          })
                      +        },
                      +        set_composer: function (web) {
                      +          $.post('/files?action=get_composer_version', {
                      +            path: web.path
                      +          }, function (v_data) {
                      +            if (v_data.status === false) {
                      +              bt.msg(v_data);
                      +              return;
                      +            }
                      +
                      +            var php_versions = '';
                      +            for (var i = 0; i < v_data.php_versions.length; i++) {
                      +              if (v_data.php_versions[i].version == '00') continue;
                      +              php_versions += '';
                      +            }
                      +
                      +            var msg = '';
                      +            if (v_data.comp_lock) {
                      +              msg += '' + v_data.comp_lock + ' [Delete]'
                      +            }
                      +            if (v_data.comp_json !== true) {
                      +              msg += '' + v_data.comp_json + ''
                      +            }
                      +
                      +            var com_body = '' +
                      +              '
                      Version
                      ' + + '
                      PHP
                      ' + + '' + + '
                      ' + + '
                      Parameters
                      ' + + '' + + '
                      ' + + '
                      Source
                      ' + + '' + + '
                      ' + + '
                      User
                      ' + + '' + + '
                      ' + + '
                      Dir
                      ' + + '' + + '
                      ' + + '
                      ' + msg + '
                      ' + + '
                      ' + + '
                      ' + + '
                        ' + + '
                      • Directory:Website root dir by default, please make sure that the dir contains composer.json
                      • ' + + '
                      • User:The default user www, unless your website is run with root privileges, it is not recommended to use the root user to execute composer
                      • ' + + '
                      • Source:source of composer
                      • ' + + '
                      • Parameters:Install (install dependent package), Update (upgrade dependent package), please select as needed
                      • ' + + '
                      • PHP version:The PHP version used to execute composer, it is recommended to try the default, if the installation fails, try to choose another PHP version
                      • ' + + '
                      • Composer version:Composer version, you can click [Upgrade Composer] on the right to upgrade Composer to the latest stable version
                      • ' + + '
                      ' + $("#webedit-con").html(com_body); + }); + }, set_domains: function(web) { var _this = this; var list = [{ @@ -1873,7 +2018,7 @@ var site = { return ''+ row.name +''; }}, {fid:'port',title: lan.site.port,width:50,type:'text'}, - {title:'opt',width:80,type:'group',align:'right',group:[{ + {title:'OPT',width:80,type:'group',align:'right',group:[{ title:'Del', template:function(row,that){ return that.data.length === 1?'Inoperable':'Del'; @@ -1948,7 +2093,7 @@ var site = { {fid:'port',title:lan.site.port,width:70,type:'text'}, {fid:'path',title:lan.site.subdirectories,width:70,type:'text'}, {title:'Opt',width:130,type:'group',align:'right',group:[{ - title:'URL rewirte', + title:'URL rewrite', event:function(row,index,ev,key,that){ bt.site.get_dir_rewrite({ id: row.id }, function (ret) { if (!ret.status) { @@ -2184,13 +2329,13 @@ var site = { }, set_dirguard: function(web) { $('#webedit-con').html('
                      '); - var tab = '
                      \ + var tab = '
                      \ Limit accessDeny access\
                      \ -
                      \ - '; +
                      \ + '; $("#set_dirguard").html(tab); - bt_tools.table({ + var dir_dirguard = bt_tools.table({ el:'#dir_dirguard', url:'/site?action=get_dir_auth', param:{id:web.id}, @@ -2223,57 +2368,135 @@ var site = { site.edit.template_Dir(web.id,true); }}] },{ // 批量操作 - type:'batch', - positon:['left','bottom'], - config:{ - title:' delete', - url:'/site?action=delete_dir_auth_multiple', - param:{site_id:web.id}, - paramId:'name', - paramName:'names', - theadName:'Name', - confirmVerify:false //是否提示验证方式 - } + type: 'batch', + positon: ['left', 'bottom'], + config: { + title: " delete", + url: '/site?action=delete_dir_auth', + param: function (row) { + console.log(row) + return { + id: web.id, + name: row.name + } + }, + load: true, + callback: function (that) { // 手动执行,data参数包含所有选中的站点 + bt.show_confirm('Delete limit access','Do you want to delete limit access ?',function(){ + that.start_batch({}, function (list) { + var html = ''; + for (var i = 0; i < list.length; i++) { + var item = list[i]; + html += '' + item.name + '
                      ' + item.request.msg + '
                      '; + } + dir_dirguard.$batch_success_table({ + title: 'Limit access', + th: 'Limit access name', + html: html + }); + dir_dirguard.$refresh_table_list(true); + }); + }); + } + } }] }); - bt_tools.table({ - el:'#php_dirguard', - url:'/config?action=get_file_deny', - param:{website:web.name}, - dataFilter:function(res){ - return {data:res}; + var php_dirguard = bt_tools.table({ + el: '#php_dirguard', + url: '/config?action=get_file_deny', + param: { + website: web.name + }, + dataFilter: function (res) { + return { + data: res + }; + }, + column: [ + {type:'checkbox',width:20}, + { + fid: 'name', + title: lan.site.name, + type: 'text' }, - column:[ - //{type:'checkbox',width:20}, - {fid:'name',title:lan.site.name,type:'text'}, - {fid:'dir',title:'Path',type:'text', template:function(row){ - return '' + row.dir + ''; - }}, - {fid: 'suffix', title: 'Suffix', template:function(row){ - return '' + row.suffix + ''; - }}, - {title:lan.site.operate,width:110,type:'group',align:'right',group:[{ - title:lan.site.edit, - event:function(row,index,ev,key,that){ - site.edit.template_php(web.name,row); + { + fid: 'dir', + title: 'Path', + type: 'text', + template: function (row) { + return '' + row.dir + ''; + } + }, + { + fid: 'suffix', + title: 'Suffix', + template: function (row) { + return '' + row.suffix + ''; + } + }, + { + title: lan.site.operate, + width: 110, + type: 'group', + align: 'right', + group: [{ + title: lan.site.edit, + event: function (row, index, ev, key, that) { + site.edit.template_php(web.name, row); + } + }, { + title: lan.site.del, + event: function (row, index, ev, key, that) { + site.edit.del_php_deny(web.name, row.name, function (res) { + if (res.status) that.$delete_table_row(index); + bt.msg(res); + }); + } + }], + } + ], + tootls: [{ // 按钮组 + type: 'group', + positon: ['left', 'top'], + list: [{ + title: 'Add deny access', + active: true, + event: function (ev) { + site.edit.template_php(web.name); + } + }] + }, { // 批量操作 + type: 'batch', + positon: ['left', 'bottom'], + config: { + title: " delete", + url: '/site?action=del_file_deny', + param: function (row) { + return { + website: web.name, + deny_name: row.name + } + }, + load: true, + callback: function (that) { // 手动执行,data参数包含所有选中的站点 + bt.show_confirm('Delete deny access', 'Do you want to delete deny access?', function () { + that.start_batch({}, function (list) { + var html = ''; + for (var i = 0; i < list.length; i++) { + var item = list[i]; + html += '' + item.name + '
                      ' + item.request.msg + '
                      '; } - },{ - title:lan.site.del, - event:function(row,index,ev,key,that){ - site.edit.del_php_deny(web.name,row.name,function(res){ - if(res.status) that.$delete_table_row(index); - bt.msg(res); - }); - } - }], - }], - tootls:[{ // 按钮组 - type:'group', - positon:['left','top'], - list:[{title:'Add deny access',active:true, event:function(ev){ - site.edit.template_php(web.name); - }}] - }] + php_dirguard.$batch_success_table({ + title: 'Deny access', + th: 'Deny access name', + html: html + }); + php_dirguard.$refresh_table_list(true); + }); + }); + } + } + }] }); $('#dir_dirguard>.divtable,#php_dirguard>.divtable').css('max-height','340px'); $('#dir_dirguard').append("
                        \ @@ -2282,7 +2505,7 @@ var site = {
                      "); $('#php_dirguard').append("
                        \
                      • Suffix: Indicates the suffix that is not allowed to access, if there are more than one, separate with'|'.
                      • \ -
                      • Path: Quote rules in this directory.
                      • \ +
                      • Path: Quote rules in this directory. e.g: /a/
                      • \
                      • For Example, if you want to deny http://test.com/a/index.php
                      • \
                      • Please fill in [ /a/ ]
                      • \
                      "); @@ -2883,12 +3106,18 @@ var site = { var helps = []; if (_val_obj.data !== false) { _form.title = lan.site.set + '【' + _val_obj.title + '】' + lan.site.interface; + if(_val_obj.help == "How to get API Token"){ + _val_obj.help = ''+_val_obj.help+"" + } helps.push(_val_obj.help); var is_hide = true; for (var i = 0; i < _val_obj.data.length; i++) { _form.list.push({ title: _val_obj.data[i].name, name: _val_obj.data[i].key, value: _val_obj.data[i].value }) if (!_val_obj.data[i].value) is_hide = false; } + if(_val_obj.title == 'CloudFlare'){ + _form.list.push({html : '
                      API-Limit
                      '}); + } _form.btns.push({ title: lan.site.save, css: 'btn-success', @@ -3490,12 +3719,12 @@ var site = { "
                      " + "
                      " + "Path" + - "
                      " + + "
                      " + "
                      " + "
                        " + "
                      • Name:The rule name.
                      • " + "
                      • Suffix: Indicates the suffix that is not allowed to access, if there are more than one, separate with'|'
                      • " + - "
                      • Path: Quote rules in this directory.
                      • " + + "
                      • Path: Quote rules in this directory. e.g: /a/
                      • " + "
                      • For Example, if you want to deny http://test.com/a/index.php
                      • " + "
                      • Please fill in [ /a/ ]" + "
                      ", @@ -4182,7 +4411,7 @@ var site = { var item = obj; bt.open({ type: 1, - area: ['757px', '683px'], + area: ['780px', '683px'], title: lan.site.website_change + '[' + item.name + '] -- ' + lan.site.addtime + '[' + item.addtime + ']', closeBtn: 2, shift: 0, @@ -4201,6 +4430,7 @@ var site = { { title: lan.site.site_menu_6, callback: site.edit.set_config }, { title: lan.site.site_menu_7, callback: site.edit.set_ssl }, { title: lan.site.php_ver, callback: site.edit.set_php_version }, + { title: 'Composer', callback: site.edit.set_composer }, // { title: lan.site.site_menu_9, callback: site.edit.set_tomact }, // { title: lan.site.redirect, callback: site.edit.set_301_old }, { title: lan.site.redirect_test, callback: site.edit.set_301 }, diff --git a/BTPanel/static/js/soft.js b/BTPanel/static/js/soft.js index 41358ec7..dbc6cdf8 100644 --- a/BTPanel/static/js/soft.js +++ b/BTPanel/static/js/soft.js @@ -1,5 +1,9 @@ var soft = { is_install: false, + trail:0,//是否试用 + is_setup:false, + is_setup_name:"", + refresh_data:[], get_list: function(page, type, search) { if (page == undefined || page == 'null' || page == 'undefined') page = 0; if (type == undefined || type == 'null' || type == 'undefined') type = 0; @@ -18,321 +22,326 @@ var soft = { } soft.is_install = false; bt.soft.get_soft_list(page, type, search, function(rdata) { - soft.set_soft_tips('#updata_pro_info',type); - // if (rdata.pro < 0) { - // $("#updata_pro_info").html(''); - // } else if (rdata.pro === -2) { - // $("#updata_pro_info").html('
                      ' + lan.soft.pro_expire + ''); - // } else if (rdata.pro === -1) { - // $("#updata_pro_info").html('
                      ' + lan.soft.upgrade_pro + '\
                      '); - // } + _this.trail = rdata.trail + // if (rdata.pro < 0) { + // // $("#updata_pro_info").html(''); + // } else + // if (rdata.pro === -2) { + // $("#updata_pro_info").html('
                      ' + lan.soft.pro_expire + ''); + // } else if (rdata.pro === -1) { + // $("#updata_pro_info").html('
                      ' + lan.soft.upgrade_pro + '\
                      '); + // } + soft.set_soft_tips('#updata_pro_info',type); - // if (type == 10) { - // $("#updata_pro_info").html('
                      ' + lan.soft.bt_developer + '' + lan.soft.get_third_party_apps + '
                      ') - // } else if (type == 11) { - // $("#updata_pro_info").html('
                      ' + lan.soft.comingsoon + '
                      ') - // } - var tBody = ''; - rdata.type.unshift({icon: 'icon',id: 0,ps: lan.soft.all,sort: 1,title: lan.soft.all}, {icon: 'icon',id: -1,ps: 'Installed',sort: 1,title: 'Installed'}) - for (var i = 0; i < rdata.type.length; i++) { - var c = ''; - if (istype == rdata.type[i].id) { - c = 'class="on"'; - } - // 注释软件管理的付费插件,第三方插件,一键部署 - // if (rdata.type[i].id != "11" && rdata.type[i].id != "10" && rdata.type[i].id != "8") { - if (rdata.type[i].id != "11") { - tBody += '' + rdata.type[i].title + ''; - } - } - if (page) bt.set_cookie('p' + type, page); - $(".softtype").html(tBody); - $(".menu-sub span").click(function() { - var _type = $(this).attr('typeid'); - bt.set_cookie('softType', _type); - $(this).addClass("on").siblings().removeClass("on"); - if (_type !== '11') { - soft.get_list(0, _type); - } else { - soft.get_dep_list(0); - } + // if (type == 10) { + // $("#updata_pro_info").html('
                      ' + lan.soft.bt_developer + '' + lan.soft.get_third_party_apps + '
                      ') + // } else if (type == 11) { + // $("#updata_pro_info").html('
                      ' + lan.soft.comingsoon + '
                      ') + // } + var tBody = ''; + rdata.type.unshift({icon: 'icon',id: 0,ps: lan.soft.all,sort: 1,title: lan.soft.all}, {icon: 'icon',id: -1,ps: 'Installed',sort: 1,title: 'Installed'}) + for (var i = 0; i < rdata.type.length; i++) { + var c = ''; + if (istype == rdata.type[i].id) { + c = 'class="on"'; + } + // 注释软件管理的付费插件,第三方插件,一键部署 + // if (rdata.type[i].id != "11" && rdata.type[i].id != "10" && rdata.type[i].id != "8") { + if (rdata.type[i].id != "11") { + tBody += '' + rdata.type[i].title + ''; + } + } + if (page) bt.set_cookie('p' + type, page); + $(".softtype").html(tBody); + $(".menu-sub span").click(function() { + var _type = $(this).attr('typeid'); + bt.set_cookie('softType', _type); + $(this).addClass("on").siblings().removeClass("on"); + if (_type !== '11') { + soft.get_list(0, _type); + } else { + soft.get_dep_list(0); + } - }) - var data = rdata.list.data; - $('#softPage').html(rdata.list.page); - var phps = ['php-5.2', 'php-5.3', 'php-5.4']; - var _tab = bt.render({ + }) + var data = rdata.list.data; + $('#softPage').html(rdata.list.page); + if(data.length>0){ + for(var i = 0; i < data.length; i++){ + if(data[i].task =='-1'){ + soft.is_setup = true; + soft.is_setup_name = data[i].name; + break; + }else{ + soft.is_setup = false; + soft.is_install = false; + soft.is_setup_name = ""; + } + } + } + if(soft.is_setup==true&&soft.is_setup_name != ""){ + _this.soft_setup_find(); + } + if(soft.refresh_data.length==0){ + _this.refresh_table(page, type, search, rdata); + soft.refresh_data = data; + }else + if(JSON.stringify(data) !=JSON.stringify(soft.refresh_data)){ + _this.refresh_table(page, type, search, rdata); + soft.refresh_data = data; + } + bt.set_cookie('load_page', (page+'').split('not_load')[0]) + bt.set_cookie('load_type', type) + bt.set_cookie('load_search', search) + if (soft.is_install&& soft.is_setup==false) { + setTimeout(function () { + soft.get_list(bt.get_cookie('load_page') + 'not_load', bt.get_cookie('load_type'), bt.get_cookie('load_search')); + }, 3000); + soft.is_install = false; + } + // if(rdata.recommend){ + // _this.render_promote_list(rdata.recommend); + // } + }) + }, + // 查找正在安装软件的状态 + soft_setup_find:function(){ + var _this = this; + if(soft.is_setup==true&&soft.is_setup_name != ""){ + $.post("plugin?action=get_soft_find",{sName:soft.is_setup_name},function(rdata){ + if(rdata.task=="-1"){ + setTimeout(function () { + _this.soft_setup_find(); + }, 3000); + }else{ + soft.is_install=true; + setTimeout(function () { + soft.get_list(bt.get_cookie('load_page') + 'not_load', bt.get_cookie('load_type'), bt.get_cookie('load_search')); + }, 3000); + } + }); + } + }, + // 刷新列表 + refresh_table:function(page, type, search, rdata){ + var _this = this; + var phps = ['php-5.2', 'php-5.3', 'php-5.4']; + var data = rdata.list.data; + var _tab = bt.render({ table: '#softList', columns: [{ - field: 'title', - title: lan.soft.app_name, - width: 165, - templet: function(item) { - var fName = item.name, - version = item.version; - if (bt.contains(item.name, 'php-')) { - fName = 'php'; - version = ''; - } - var click_opt = ' ', - sStyle = ''; - if (item.setup) { - sStyle = ' style="cursor:pointer"'; - if (item.admin) { - if (item.endtime >= 0 || item.price == 0) { - click_opt += 'onclick="bt.soft.set_lib_config(\'' + item.name + '\',\'' + item.title + '\')" '; - } + field: 'title', + title: lan.soft.app_name, + width: 165, + templet: function(item) { + var fName = item.name, + version = item.version; + if (bt.contains(item.name, 'php-')) { + fName = 'php'; + version = ''; + } + var click_opt = ' ', + sStyle = ''; + if (item.setup) { + sStyle = ' style="cursor:pointer"'; + if (item.admin) { + if (item.endtime >= 0 || item.price == 0) { + click_opt += 'onclick="bt.soft.set_lib_config(\'' + item.name + '\',\'' + item.title + '\')" '; + } - } else { - click_opt += ' onclick="soft.set_soft_config(\'' + item.name + '\')" '; - } + } else { + click_opt += ' onclick="soft.set_soft_config(\'' + item.name + '\')" '; } - var is_php5 = item.name.indexOf('php-5') >= 0, - webcache = bt.get_cookie('serverType') == 'openlitespeed' ? true : false, - distribution = bt.get_cookie('distribution'); - if (webcache) { - switch (distribution) { - case 'centos8': - if (is_php5 || item.name == 'php-7.0') { - click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; - } - break; - case 'centos7': - if (item.name == 'php-5.2') { - click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; - } - break; - default: - if (is_php5) { - click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; - } - break; - } - }else if (rdata.apache22 && item.name.indexOf('php-') >= 0 && $.inArray(item.name, phps) == -1){ - click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; + } + var is_php5 = item.name.indexOf('php-5') >= 0, + webcache = bt.get_cookie('serverType') == 'openlitespeed' ? true : false, + distribution = bt.get_cookie('distribution'); + if (webcache) { + switch (distribution) { + case 'centos8': + if (is_php5 || item.name == 'php-7.0') { + click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; + } + break; + case 'centos7': + if (item.name == 'php-5.2') { + click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; + } + break; + default: + if (is_php5) { + click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; + } + break; } - //if (rdata.apache22 && item.name.indexOf('php-') >= 0 && $.inArray(item.name, phps) == -1) click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; - return '' + item.title + ' ' + version + ''; + }else if (rdata.apache22 && item.name.indexOf('php-') >= 0 && $.inArray(item.name, phps) == -1){ + click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; } - }, - { - field: 'price', - title: 'Developer', - width: 110, - templet: function(item) { - if (!item.author) return 'official' - return item.author; - } - }, - { - field: 'ps', - title: lan.soft.instructions, - templet: function(item) { - var ps = item.ps; - var is_php = item.name.indexOf('php-') >= 0; + //if (rdata.apache22 && item.name.indexOf('php-') >= 0 && $.inArray(item.name, phps) == -1) click_opt = ' title="' + lan.soft.ap2_2_not_support + '"'; + return '' + item.title + ' ' + version + ''; + } + }, + { + field: 'price', + title: 'Developer', + width: 110, + templet: function(item) { + if (!item.author) return 'official' + return item.author; + } + }, + { + field: 'ps', + title: lan.soft.instructions, + templet: function(item) { + var ps = item.ps; + var is_php = item.name.indexOf('php-') >= 0; - if (is_php && item.setup) { - if (rdata.apache22 && $.inArray(item.name, phps) >= 0) { - if (item.fpm) { - ps += " (" + lan.soft.apache22 + ")"; - } - } else if (!rdata.apache22) { - if (!item.fpm) { - ps += " (" + lan.soft.apache24 + ")"; - } + if (is_php && item.setup) { + if (rdata.apache22 && $.inArray(item.name, phps) >= 0) { + if (item.fpm) { + ps += " (" + lan.soft.apache22 + ")"; + } + } else if (!rdata.apache22) { + if (!item.fpm) { + ps += " (" + lan.soft.apache24 + ")"; } } - return '' + ps + ''; } - }, - { - field: 'price', - title: lan.soft.price, - width: 92, - templet: function(item) { - var price = lan.soft.free; - if (item.price > 0) { - price = '$' + item.price + ''; - } - return price; + return '' + ps + ''; + } + }, + { + field: 'price', + title: lan.soft.price, + width: 92, + templet: function(item) { + var price = lan.soft.free; + if (item.price > 0) { + price = '$' + item.price + ''; } - }, - (type == 10 ? { - field: 'sort', - width: 80, - title: 'Rated', - templet: function(item) { - return item.sort !== undefined ? ('' + (item.sort <= 0 || item.sort > 5 ? lan.soft.not_rated : item.sort.toFixed(1)) + '') : '--'; - } - } : ''), - { - field: 'endtime', - width: 120, - title: lan.soft.expire_time, - templet: function(item) { - var endtime = '--'; - if (item.pid > 0) { - if (item.endtime > 0) { - if (item.type != 10) { - endtime = bt.format_data(item.endtime, 'yyyy/MM/dd') ; - } else { - endtime = bt.format_data(item.endtime, 'yyyy/MM/dd') ; - } - } else if (item.endtime === 0) { - endtime = lan.soft.permanent; - } else if (item.endtime === -1) { - endtime = lan.soft.not_open; - } else if (item.endtime === -2) { - if (item.type != 10) { - endtime = lan.soft.already_expire ; - } else { - endtime = lan.soft.already_expire ; - } - } - } - return endtime; - } - }, - { - field: 'path', - width: 40, - title: lan.soft.location, - templet: function(item) { - var path = ''; - if (item.setup) { - path = ''; - } - return path; - } - }, - (type != 10 ? { - field: 'status', - width: 40, - title: lan.soft.status1, - templet: function(item) { - var status = ''; - if (item.setup) { - if (item.status) { - status = ''; - } else { - status = ''; - } - } - return status; - } - } : ''), - { - field: 'index', - width: 100, - title: lan.soft.display_at_homepage, - templet: function(item) { - var to_index = ''; - if (item.setup) { - var checked = ''; - if (item.index_display) checked = 'checked'; - var item_id = item.name.replace(/\./, ""); - to_index = '
                      '; - } - return to_index; - } - }, - { - field: 'opt', - width: 190, - title: lan.soft.operate, - align: 'right', - templet: function(item) { - var option = ''; - - var pay_opt = ''; - if (item.endtime < 0 && item.pid > 0) { - var re_msg = ''; - var re_status = 0; - switch (item.endtime) { - case -1: - re_msg = lan.soft.buy_now; - break; - case -2: - re_msg = lan.soft.renew_now; - re_status = 1; - break; - } + return price; + } + }, + (type == 10 ? { + field: 'sort', + width: 80, + title: 'Rated', + templet: function(item) { + return item.sort !== undefined ? ('' + (item.sort <= 0 || item.sort > 5 ? lan.soft.not_rated : item.sort.toFixed(1)) + '') : '--'; + } + } : ''), + { + field: 'endtime', + width: 120, + title: lan.soft.expire_time, + templet: function(item) { + var endtime = '--'; + if (item.pid > 0) { + if (item.endtime > 0) { if (item.type != 10) { - pay_opt = '' + re_msg + ''; + endtime = bt.format_data(item.endtime, 'yyyy/MM/dd') ; } else { - pay_opt = '' + re_msg + ''; + endtime = bt.format_data(item.endtime, 'yyyy/MM/dd') ; + } + } else if (item.endtime === 0) { + endtime = lan.soft.permanent; + } else if (item.endtime === -1) { + endtime = lan.soft.not_open; + } else if (item.endtime === -2) { + if (item.type != 10) { + endtime = lan.soft.already_expire ; + } else { + endtime = lan.soft.already_expire ; } - } - var is_php = item.name.indexOf('php-') >= 0, - is_php5 = item.name.indexOf('php-5') >= 0, - webcache = bt.get_cookie('serverType') == 'openlitespeed' ? true : false, - distribution = bt.get_cookie('distribution'); - if (webcache && is_php) { - if ((is_php5 || item.name == 'php-7.0') && distribution=='centos8') { + } + return endtime; + } + }, + { + field: 'path', + width: 40, + title: lan.soft.location, + templet: function(item) { + var path = ''; + if (item.setup) { + path = ''; + } + return path; + } + }, + (type != 10 ? { + field: 'status', + width: 40, + title: lan.soft.status1, + templet: function(item) { + var status = ''; + if (item.setup) { + if (item.status) { + status = ''; + } else { + status = ''; + } + } + return status; + } + } : ''), + { + field: 'index', + width: 100, + title: lan.soft.display_at_homepage, + templet: function(item) { + var to_index = ''; + if (item.setup) { + var checked = ''; + if (item.index_display) checked = 'checked'; + var item_id = item.name.replace(/\./, ""); + to_index = '
                      '; + } + return to_index; + } + }, + { + field: 'opt', + width: 190, + title: lan.soft.operate, + align: 'right', + templet: function(item) { + var option = ''; + + var pay_opt = ''; + if (item.endtime < 0 && item.pid > 0) { + var re_msg = ''; + var re_status = 0; + switch (item.endtime) { + case -1: + re_msg = lan.soft.buy_now; + break; + case -2: + re_msg = lan.soft.renew_now; + re_status = 1; + break; + } + if (item.type != 10) { + pay_opt = '' + re_msg + ''; + } else { + pay_opt = '' + re_msg + ''; + } + + } + var is_php = item.name.indexOf('php-') >= 0, + is_php5 = item.name.indexOf('php-5') >= 0, + webcache = bt.get_cookie('serverType') == 'openlitespeed' ? true : false, + distribution = bt.get_cookie('distribution'); + if (webcache && is_php) { + if ((is_php5 || item.name == 'php-7.0') && distribution=='centos8') { + option = '' + lan.soft.not_comp + ''; + }else if (distribution=='centos7'&&item.name == 'php-5.2') { + option = '' + lan.soft.not_comp + ''; + }else{ + if (distribution!='centos7'&&is_php5) { option = '' + lan.soft.not_comp + ''; - }else if (distribution=='centos7'&&item.name == 'php-5.2') { - option = '' + lan.soft.not_comp + ''; - }else{ - if (distribution!='centos7'&&is_php5) { - option = '' + lan.soft.not_comp + ''; - } else { - if (item.setup && item.task == '1') { - if (pay_opt == '') { - if (item.versions.length > 1) { - for (var i = 0; i < item.versions.length; i++) { - var min_version = item.versions[i] - var ret = bt.check_version(item.version, min_version.m_version + '.' + min_version.version); - if (ret > 0) { - if (ret == 2) option += '' + lan.soft.update + ' | '; - break; - } - } - } else { - var min_version = item.versions[0]; - var cloud_version = min_version.m_version + '.' + min_version.version; - if (item.version != cloud_version) option += '' + lan.soft.update + ' | '; - } - if (item.admin) { - option += '' + lan.soft.setup + ' | '; - } else { - option += '' + lan.soft.setup + ' | '; - } - } else { - option = pay_opt + ' | ' + option; - } - option += '' + lan.soft.uninstall + ''; - } else if (item.task == '-1') { - option = '' + lan.soft.installing + ''; - soft.is_install = true; - } else if (item.task == '0') { - option = '' + lan.soft.wait_install + ''; - soft.is_install = true; - } else if (item.task == '-2') { - option = 'Updating'; - soft.is_install = true; - } else { - if (pay_opt) { - option = pay_opt; - } else { - option = '' + lan.soft.install + ''; - } - } - } - } - }else { - if (rdata.apache22 && is_php && $.inArray(item.name, phps) == -1) { - if (item.setup) { - option = '' + lan.soft.uninstall + ''; - } else { - option = '' + lan.soft.not_comp + ''; - } - } else if (rdata.apache24 && item.name == 'php-5.2') { - if (item.setup) { - option = '' + lan.soft.uninstall + ''; - } else { - option = '' + lan.soft.not_comp + ''; - } } else { if (item.setup && item.task == '1') { if (pay_opt == '') { @@ -377,20 +386,68 @@ var soft = { } } } - return option; + }else { + if (rdata.apache22 && is_php && $.inArray(item.name, phps) == -1) { + if (item.setup) { + option = '' + lan.soft.uninstall + ''; + } else { + option = '' + lan.soft.not_comp + ''; + } + } else if (rdata.apache24 && item.name == 'php-5.2') { + if (item.setup) { + option = '' + lan.soft.uninstall + ''; + } else { + option = '' + lan.soft.not_comp + ''; + } + } else { + if (item.setup && item.task == '1') { + if (pay_opt == '') { + if (item.versions.length > 1) { + for (var i = 0; i < item.versions.length; i++) { + var min_version = item.versions[i] + var ret = bt.check_version(item.version, min_version.m_version + '.' + min_version.version); + if (ret > 0) { + if (ret == 2) option += '' + lan.soft.update + ' | '; + break; + } + } + } else { + var min_version = item.versions[0]; + var cloud_version = min_version.m_version + '.' + min_version.version; + if (item.version != cloud_version) option += '' + lan.soft.update + ' | '; + } + if (item.admin) { + option += '' + lan.soft.setup + ' | '; + } else { + option += '' + lan.soft.setup + ' | '; + } + } else { + option = pay_opt + ' | ' + option; + } + option += '' + lan.soft.uninstall + ''; + } else if (item.task == '-1') { + option = '' + lan.soft.installing + ''; + soft.is_install = true; + } else if (item.task == '0') { + option = '' + lan.soft.wait_install + ''; + soft.is_install = true; + } else if (item.task == '-2') { + option = 'Updating'; + soft.is_install = true; + } else { + if (pay_opt) { + option = pay_opt; + } else { + option = '' + lan.soft.install + ''; + } + } + } } + return option; } - ], - data: data - }) - bt.set_cookie('load_page', (page + '').split('not_load')[0]) - bt.set_cookie('load_type', type) - bt.set_cookie('load_search', search) - if (soft.is_install) { - setTimeout(function() { - soft.get_list(bt.get_cookie('load_page') + 'not_load', bt.get_cookie('load_type'), bt.get_cookie('load_search')); - }, 3000); - } + } + ], + data: data }) }, // 渲染列表 @@ -441,9 +498,10 @@ var soft = { }else if(item.endtime > 0){ //已购买 thtml = ''; }else if(item.endtime == -1){ //未购买 - thtml = ''; - }else if(item.endtime == -2){ //已过期 - thtml = ''; + + thtml = ''; + }else if(item.endtime == -2){ //已过期 + thtml = ''; } }else{ thtml = ''; @@ -470,11 +528,12 @@ var soft = { } }, set_soft_tips:function(el,type){ - var tips_info = $('
                      '), explain = tips_info.find('.soft_tips_text'), btn_ground = tips_info.find('.btn-ground'); - $(el).empty(); + var tips_info = $('
                      '), explain = tips_info.find('.soft_tips_text'), btn_ground = tips_info.find('.btn-ground'),_this = this; + $(el).empty() type = parseInt(type); if(type != 11) $(el).next('.onekey-menu-sub').remove(); if(type == 10){ + $(el).css('display','block') explain.text('Security Reminder: aaPanel officially conducted a security audit before the third-party plug-in was put on the shelves, but there may be security risks. Please check it out before using it in the production environment.'); btn_ground = soft.render_tips_btn(btn_ground,[ //{title:'免费入驻',href:'https://www.bt.cn/developer/',rel:'noreferrer noopener',target:'_blank',btn:'免费入驻',class:'btn btn-success btn-xs va0',style:"margin-left:10px;"}, @@ -496,15 +555,15 @@ var soft = { ]); $(el).append(tips_info.addClass('alert-info')); }else{ - var ltd = parseInt(bt.get_cookie('ltd_end')),pro = parseInt(bt.get_cookie('pro_end')),todayDate = parseInt(new Date().getTime()/1000),_ltd = null; + var ltd = parseInt(bt.get_cookie('ltd_end') || -1),pro = parseInt(bt.get_cookie('pro_end') || -1),todayDate = parseInt(new Date().getTime()/1000),_ltd = null; if((ltd > 0 && (ltd == pro || pro < 0)) || (ltd < 0 && pro >= 0) || (ltd > 0 && pro >= 0)){ _ltd = ((ltd > 0 && (ltd == pro || pro < 0)) || (ltd > 0 && pro >= 0))?1:0; - explain.html('当前为'+ (_ltd?'Pro':'专业版') +','+ (_ltd?'Pro':'专业版') +'可以免费使用'+ (_ltd?'专业版及企业版插件':'专业版插件') + (!(pro == 0 && ltd < 0)?(',过期时间:'+ (bt.format_data((_ltd?ltd:pro),'yyyy/MM/dd') ) +''+((((_ltd?ltd:pro) - todayDate) <= 15*24*60*60)?(',距离过期仅剩'+ Math.round(((_ltd?ltd:pro) - todayDate) / (24*60*60)) +'天'):'')):',过期时间:永久授权')); + explain.html('The '+ (_ltd?'Pro':'Pro') +' edition can use the '+ (_ltd?'专业版及企业版插件':'professional plug-in for free,') + (!(pro == 0 && ltd < 0)?('expiration time: '+ (bt.format_data((_ltd?ltd:pro),'yyyy/MM/dd') ) +''+((((_ltd?ltd:pro) - todayDate) <= 15*24*60*60)?(',Only '+ Math.round(((_ltd?ltd:pro) - todayDate) / (24*60*60)) +' days until expiration'):'')):',过期时间:永久授权')); }else if(ltd == -1 && pro == -1){ explain.html('Upgrade to Pro edition, all plugins, free to use!'); }else if(pro == 0 && ltd < 0){ _ltd = 2; - explain.html('当前为专业版,专业版可以免费使用专业版插件,过期时间:永久授权。'+(type == 12?'  升级企业版,企业可以免费试用企业版插件及专业版插件。':'')); + explain.html('The Pro edition can use the professional plug-in for free, expiration time: 永久授权。'+(type == 12?'  升级企业版,企业可以免费试用企业版插件及专业版插件。':'')); if(type == 12){ btn_ground = soft.render_tips_btn(btn_ground,{title:'立即升级',href:'javascript:;',btn:'立即升级','class':'btn btn-success btn-xs va0 ml15','style':"margin-left:10px;",click:bt.soft.updata_ltd}); } @@ -514,54 +573,66 @@ var soft = { } var btn_config = {title:null,href:'javascript:;',btn:null,'class':'btn btn-success btn-xs va0 ml15','style':"margin-left:10px;",click:null}; var set_btn_style = function(res){ - if(!res.status || !res){ - $.extend(btn_config,{title:'立即登录',btn:'立即登录',click:function(){ - bt.pub.bind_btname(function(){ - window.location.reload(); - }); - }}); + if(!res.status || !res){ + fun = function(){ + bt.pub.bind_btname(function(){ + window.location.reload(); + }); + } + $.extend(btn_config,{title:'Login',btn:'Login',click:fun}); + }else{ + if(type == 12 && (ltd < 0 && pro >=0)){ + explain.html('企业版可以免费使用专业版及企业版插件,了解专业版和企业版的区别,请点击查看详情《专业版升级企业版教程》'); + $(el).append(tips_info.addClass('alert-ltd-success')); + return false; }else{ - if(type == 12 && (ltd < 0 && pro >=0)){ - explain.html('企业版可以免费使用专业版及企业版插件,了解专业版和企业版的区别,请点击查看详情《专业版升级企业版教程》'); - $(el).append(tips_info.addClass('alert-ltd-success')); - return false; - }else{ - if(_ltd != 2){ - var fun = ''; - switch(_ltd){ - case null: - fun = bt.soft.updata_commercial_view - break; - case 1: - fun = bt.soft.updata_ltd - break; - case 0: - fun = bt.soft.updata_pro - break; - } - $.extend(btn_config,{title:_ltd == null?'Upgrade now':'立即续费',btn:_ltd == null?'Upgrade now':'立即续费',click:fun}) - } - } + if(pro < 0){ + fun = bt.soft.updata_pro + }else{ + fun = bt.soft.renew_pro + } + $.extend(btn_config,{title:_ltd == null?'Upgrade now':'Renew Now',btn:_ltd == null?'Upgrade now':'Renew Now',click:fun}) } - if(_ltd != 2){ - if(!(pro == 0 && ltd < 0)){ - btn_ground = soft.render_tips_btn(btn_ground,btn_config); - } + } + if(_ltd != 2){ + if(!(pro == 0 && ltd < 0)){ + btn_ground = soft.render_tips_btn(btn_ground,btn_config); } - $(el).append(tips_info.addClass(_ltd == 1?'alert-ltd-success':'alert-success')); + } + $(el).append(tips_info.addClass(_ltd == 1?'alert-ltd-success':'alert-success')); + if(_this.trail){ + setTimeout(function (){ + $('.btn-ground').after('Try the Pro edition for free for 15 days') + var trail = $('Click to try'); + trail.click((!res.status || !res)?fun:function(){ + var loadT = bt.load() + bt.confirm({ + title:"Pro Edition", + msg:"Get 15-day Pro edition free, get it now?" + },function (){ + bt.send('free_trial','auth/free_trial',{},function(res){ + loadT.close() + bt.msg(res) + setTimeout(function () { window.location.reload() },2000) + }) + }) + }) + $('.pro_trail').after(trail) + },100) + } } var bt_user_info = bt.get_cookie('bt_user_info'); if(!bt_user_info){ - bt.pub.get_user_info(function(res){ - if(!res.status){ - set_btn_style(false); - return false; - } - bt.set_cookie('bt_user_info',JSON.stringify(res),300000); - set_btn_style(res); - }); + bt.pub.get_user_info(function(res){ + if(!res.status){ + set_btn_style(false); + return false; + } + bt.set_cookie('bt_user_info',JSON.stringify(res),300000); + set_btn_style(res); + }); }else{ - set_btn_style(JSON.parse(bt.get_cookie('bt_user_info'))); + set_btn_style(JSON.parse(bt.get_cookie('bt_user_info'))); } } }, @@ -2791,9 +2862,9 @@ var soft = { } }) setTimeout(function() { - if ($(".bt-soft-menu .bgw").text() === "Installation extension") { - soft.get_tab_contents('set_php_config', obj); - } + if ($(".bt-soft-menu .bgw").index() === 1) { + soft.get_tab_contents('set_php_config', obj); + } }, 3000) }) break; @@ -3851,8 +3922,8 @@ function onekeyCodeSite(codename, versions, title, enable_functions) {
                      Note\
                      \
                      \ -
                      Root Directory\ -
                      \ +
                      Document Root\ +
                      \
                      \
                      Database\
                      \ diff --git a/BTPanel/static/js/term.js b/BTPanel/static/js/term.js index f4cfa5b3..f09a940b 100644 --- a/BTPanel/static/js/term.js +++ b/BTPanel/static/js/term.js @@ -34,29 +34,23 @@ Terms.prototype = { }, //服务器消息事件 on_message: function (ws_event){ - result = ws_event.data; + result= ws_event.data; if(!result) return; - // if (result === "\rServer connection failed!\r" || result == "\rWrong user name or password!\r") { - // this.close(); - // return; - // } + that = this; if ((result.indexOf("@127.0.0.1:") != -1 || result.indexOf("@localhost:") != -1) && result.indexOf('Authentication failed') != -1) { - this.term.write(result); + that.term.write(result); host_trem.localhost_login_form(result); - this.close(); + that.close(); return; } - if(result.length > 1 && this.last_body === false){ - this.last_body = true; + if(result.length > 1 && that.last_body === false){ + that.last_body = true; } - this.term.write(result); - this.set_term_icon(1); - if (result == '\r\nLog out\r\n' || result == 'Log out\r\n' || result == '\r\nlogout\r\n' || result == 'logout\r\n') { - // setTimeout(function () { - // layer.close(Term.term_box); - // }, 500); - this.close(); - this.bws = null; + that.term.write(result); + that.set_term_icon(1); + if (result == '\r\n登出\r\n' || result == '登出\r\n' || result == '\r\nlogout\r\n' || result == 'logout\r\n') { + that.close(); + that.bws = null; } }, @@ -130,7 +124,6 @@ Terms.prototype = { if(this.bws){ size['resize'] = 1; this.send(JSON.stringify(size)); - this.term } }, @@ -175,10 +168,10 @@ var host_trem = { username:'root', password:'', pkey: '', - ps: '' + ps: '' }, init:function(){ - var that = this,isMousemove = true; + var that = this; Object.defineProperty(host_trem,'is_full',{ get:function(val){ return val; @@ -207,23 +200,13 @@ var host_trem = { return false; } } + //本地存储 + var _tool_status = localStorage.getItem("tool_status"); + _tool_host_height = localStorage.getItem("hostHeight"), + _tool_commonly_height = localStorage.getItem("commonlyHeight"); + if(_tool_commonly_height <= 100 )_tool_commonly_height=100; $(window).resize(function(ev){ - var win = $(window)[0],win_width = win.innerHeight,win_height = win.innerHeight,host_commonly = win_height - 185; - if(that.isFullScreen()){ - $('.main-content .safe').height(win_height); - $('#term_box_view,.term_tootls').height(win_height); - $('.tootls_host_list').height((win_height - 80) * .75); - $('.tootls_commonly_list').height((win_height - 80) * .25); - }else{ - $('.main-content .safe').height(win_height - 105); - $('#term_box_view,.term_tootls').height(win_height - 105); - $('.tootls_host_list').height(host_commonly * .75); - $('.tootls_commonly_list').height(host_commonly * .25); - } - var id = $('.term_item_tab .active').data('id'); - var item_term = that.host_term[id].term; - item_term.FitAddon.fit(); - that.host_term[id].resize({cols:item_term.cols, rows:item_term.rows}); + that.on_resize(that); }); $('.tab_tootls').on('click','.glyphicon-resize-full',function(){ $(this).removeClass('glyphicon-resize-full').addClass('glyphicon-resize-small').attr('title','Exit full Screen'); @@ -240,8 +223,13 @@ var host_trem = { var win = $(window)[0],win_width = win.innerHeight,win_height = win.innerHeight,host_commonly = win_height - 185; $('.main-content .safe').height(win_height - 105); $('#term_box_view,.term_tootls').height(win_height - 105); - $('.tootls_host_list').height(host_commonly * .75); - $('.tootls_commonly_list').height(host_commonly * .25); + if(_tool_host_height !=0&&_tool_commonly_height !=0){ + $(".tootls_host_list").css("height",_tool_host_height+"px"), + $(".tootls_commonly_list").css("height", _tool_commonly_height+"px"); + }else{ + $('.tootls_host_list').height(host_commonly * .75); + $('.tootls_commonly_list').height(host_commonly * .25); + } that.open_term_view(); }); @@ -266,8 +254,72 @@ var host_trem = { item.term.FitAddon.fit(); item.resize({cols:item.term.cols, rows:item.term.rows}); } - + }); + //通过本地存储获取显示设置 + if(_tool_status==0){ + $(".term-tool-button").empty(); + $(".term-tool-button").append('').addClass("tool-hide").removeClass("tool-show"); + $(".term_box").css("margin-right","260px"); + $(".term_tootls").css("display","block"); + if(_tool_host_height !=0&&_tool_commonly_height !=0){ + $(".tootls_host_list").css("height",_tool_host_height+"px"), + $(".tootls_commonly_list").css("height", _tool_commonly_height+"px"); + } + }else{ + $(".term-tool-button").empty(); + $(".term-tool-button").append('').addClass("tool-show").removeClass("tool-hide"); + $(".term_box").css("margin-right","0px"); + $(".term_tootls").css("display","none"); + } + + //终端工具栏显示 + $('.term_content_tab').on('click','.tool-show',function(){ + $(this).empty(); + $(this).append('').addClass("tool-hide").removeClass("tool-show"); + $(".term_box").css("margin-right","260px"); + $(".term_tootls").css("display","block"); + localStorage.setItem("tool_status",0); + that.on_resize(that); + }); + + //终端工具栏隐藏 + $('.term_content_tab').on('click','.tool-hide',function(){ + $(this).empty(); + $(this).append('').addClass("tool-show").removeClass("tool-hide"); + $(".term_box").css("margin-right","0px"); + $(".term_tootls").css("display","none"); + localStorage.setItem("tool_status",1); + that.on_resize(that); + }); + + $(".term-move-border").on('mousedown', function (e) { + var hostbox_height = parseInt($(".tootls_host_list").css("height")), + commonlybox_height = parseInt($(".tootls_commonly_list").css("height")), + max_height = hostbox_height + commonlybox_height+38, + move_y = e.clientY; + $(document).on('mousemove', function (ev) { + var offsetY = ev.clientY - move_y, + _host = hostbox_height+offsetY; + _commonly = commonlybox_height-offsetY; + if(_host <= 300){ + _host = 300;_commonly = max_height-_host-38; + }else + if(_commonly <= 100){ + _commonly = 100;_host = max_height-_commonly-38; + } + $(".tootls_host_list").css("height",_host+"px"),$(".tootls_commonly_list").css("height",_commonly+"px"); + }); + $(document).on('mouseup', function (ev) { + var _host_height = parseInt($(".tootls_host_list").css("height")), + _commonly_height = parseInt($(".tootls_commonly_list").css("height")); + localStorage.setItem("hostHeight",_host_height); + localStorage.setItem("commonlyHeight",_commonly_height); + $(this).unbind('mousemove mouseup'); + }); + e.stopPropagation(); + }); + $('.term_item_tab').on('click','.icon-trem-close',function(){ var id = $(this).parent().data('id'); that.remove_term_view(id); @@ -379,7 +431,7 @@ var host_trem = { // $('.tootls_host_list').on('mouseup','li',function(e){ // if(e.button == 0){ // if(clientX == e.clientX && clientY == e.clientY){ - + // } // } // }); @@ -458,7 +510,26 @@ var host_trem = { } this.is_full = false; }, - + + on_resize:function(that){ + var win = $(window)[0],win_width = win.innerHeight,win_height = win.innerHeight,host_commonly = win_height - 185; + if(that.isFullScreen()){ + $('.main-content .safe').height(win_height); + $('#term_box_view,.term_tootls').height(win_height); + $('.tootls_host_list').height((win_height - 80) * .75); + $('.tootls_commonly_list').height((win_height - 80) * .25); + }else{ + $('.main-content .safe').height(win_height - 105); + $('#term_box_view,.term_tootls').height(win_height - 105); + $('.tootls_host_list').height(host_commonly * .75); + $('.tootls_commonly_list').height(host_commonly * .25); + } + var id = $('.term_item_tab .active').data('id'); + var item_term = that.host_term[id].term; + item_term.FitAddon.fit(); + that.host_term[id].resize({cols:item_term.cols, rows:item_term.rows}); + }, + /** * @name 本地服务器登录表单 * @author chudong<2020-08-10> @@ -686,7 +757,7 @@ var host_trem = { break; } }); - if(!obj.form.host){ + if(!obj.form.sort){ delete form.sort; that.create_host(form,function(res){ if(res.status){ @@ -698,7 +769,8 @@ var host_trem = { } }); }else{ - form.new_host = obj.form.host; + form.new_host = form.host; + form.host = obj.form.host; that.modify_host(form,function(res){ if(res.status){ layer.close(indexs) diff --git a/BTPanel/static/js/tools.js b/BTPanel/static/js/tools.js index 4b32ee69..dfa08e40 100644 --- a/BTPanel/static/js/tools.js +++ b/BTPanel/static/js/tools.js @@ -30,10 +30,10 @@ var bt_tools = { var _that = this,$checked = $(''); if(this.config.init) this.config.init(this); $(this.config.el).addClass('bt_table').append($checked); - $checked.focus(function(){ + $checked.focus(function(){ _that.checked = true; return false; - }).blur(function(ev){ + }).blur(function(ev){ _that.checked = false; if(_that.checked_blur) _that.checked_blur(ev); }); @@ -41,7 +41,8 @@ var bt_tools = { if(this.config.tootls){ this.$reader_tootls(this.config.tootls); }else{ - if($(_that.config.el +'.divtable').length === 0) $(_that.config.el).append('
                      '); + console.log(this.config.height) + if ($(_that.config.el + '.divtable').length === 0) $(_that.config.el).append('
                      '); } this.$reader_content(); if(_that.config.url !== undefined){ @@ -68,7 +69,7 @@ var bt_tools = { _that.$reader_content(data,page); }); }, - + /** * @description 激活焦点 * @param {Function} callback 回调函数 @@ -105,7 +106,7 @@ var bt_tools = { for(var j=0;j < column.length;j++){ var item = column[j]; if($.isEmptyObject(item)){ - completion ++; + completion ++; continue; } if(i === 0 && !this.init){ @@ -229,56 +230,29 @@ var bt_tools = { * @returns void 无 */ $set_batch_view:function(){ - var bt_select_val = $(this.config.el + ' .bt_select_value'),bt_select_btn = $(this.config.el + ' .bt_table_select_group').next(); - if(typeof this.config.batch != "undefined"){ //判断是否存在批量操作 - var bt_select_btn = $(this.config.el + ' .set_batch_option'); - if(typeof this.config.batch.config != "undefined"){ // 判断批量操作是多个还是单个 - if(this.checkbox_list.length > 0){ - bt_select_btn.removeClass('bt-disabled btn-default').addClass('btn-success').text(lan.public.please_choose+this.batch_active.title +'('+lan.public.selected+ this.checkbox_list.length+')') - }else{ - bt_select_btn.addClass('bt-disabled btn-default').removeClass('btn-success').text(lan.public.please_choose+this.batch_active.title); - } - }else{ - var bt_select_val = $(this.config.el + ' .bt_select_value'); - if(this.checkbox_list.length > 0){ - bt_select_btn.removeClass('bt-disabled btn-default').addClass('btn-success').prev().removeClass('bt-disabled'); - bt_select_val.find('em').html('('+lan.public.selected+ this.checkbox_list.length+')'); - }else{ - bt_select_btn.addClass('bt-disabled btn-default').removeClass('btn-success').prev().addClass('bt-disabled'); - bt_select_val.children().eq(0).html(lan.public.please_choose+''); - bt_select_val.next().find('li').removeClass('active'); - this.batch_active = {}; - } + var bt_select_val = $(this.config.el + ' .bt_select_value'), + bt_select_btn = $(this.config.el + ' .bt_table_select_group').next(); + if (typeof this.config.batch != "undefined") { //判断是否存在批量操作 + var bt_select_btn = $(this.config.el + ' .set_batch_option'); + if (typeof this.config.batch.config != "undefined") { // 判断批量操作是多个还是单个 + if (this.checkbox_list.length > 0) { + bt_select_btn.removeClass('bt-disabled btn-default').addClass('btn-success').text(lan.public.please_choose + this.batch_active.title + '(' + lan.public.selected + this.checkbox_list.length + ')') + } else { + bt_select_btn.addClass('bt-disabled btn-default').removeClass('btn-success').text(lan.public.please_choose + this.batch_active.title); } + } else { + var bt_select_val = $(this.config.el + ' .bt_select_value'); + if (this.checkbox_list.length > 0) { + bt_select_btn.removeClass('bt-disabled btn-default').addClass('btn-success').prev().removeClass('bt-disabled'); + bt_select_val.find('em').html('(' + lan.public.selected + this.checkbox_list.length + ')'); + } else { + bt_select_btn.addClass('bt-disabled btn-default').removeClass('btn-success').prev().addClass('bt-disabled'); + bt_select_val.children().eq(0).html(lan.public.please_choose + ''); + bt_select_val.next().find('li').removeClass('active'); + this.batch_active = {}; + } + } } - return false; - if(bt_select_val.length > 0){ - if(this.checkbox_list.length > 0){ - bt_select_val.find('em').html('('+lan.public.selected+ this.checkbox_list.length+')'); - bt_select_val.parent().removeClass('bt_disabled'); - bt_select_btn.removeClass('bt-disabled'); - }else{ - bt_select_val.parent().addClass('bt_disabled'); - bt_select_val.find('.bt_select_tips').html(lan.public.please_choose+''); - bt_select_btn.addClass('bt-disabled'); - bt_select_btn.find('.item').removeClass('active'); - this.batch_active = {}; - } - }else{//只有批量按钮的模式 - var bt_select_batch_btn = $(this.config.el + ' .set_batch_option'),all = $(this.config.el + ' [data-checkbox="all"]'); - for(var i=0;i'+ items[item.key] +''; }); } - if(items.init) setTimeout(function(){ items.init(_btn) },400); + if(items.init) setTimeout(function(){ items.init(_btn) },400); } if(!event_list[_btn]) event_list[_btn] = {event:items.event,type:'button'}; }); @@ -580,7 +554,7 @@ var bt_tools = { }else{ $parent.addClass('active'); } - if(bt_selects.height() > (_win_area[1] - area.top)){ + if(bt_selects.height() > (_win_area[1] - area.top)){ bt_selects.addClass('top'); }else{ bt_selects.removeClass('top'); @@ -966,7 +940,7 @@ var bt_tools = { $get_win_area:function(){ return [window.innerWidth,window.innerHeight]; }, - + /** * @description 请求数据, * @param {object} param 参数和请求路径 @@ -974,7 +948,7 @@ var bt_tools = { */ $http:function(success){ var param = {},config = this.config,_page = config.page,_search = config.search,_sort = config.sort || {}; - if(_page){ + if(_page){ param[_page.numberParam] = _page.number,param[_page.pageParam] = _page.page; if(this.config.cookiePrefix) bt.set_cookie(this.config.cookiePrefix+'_'+ _page.numberParam,_page.number); } @@ -1226,79 +1200,52 @@ var bt_tools = { } select_file.reader_view(); }, - /** * @description 渲染Form表单 - * @param {*} config + * @param {*} config * @return 当前实例对象 - */ - form:function(config){ + */ + form: function (config) { var _that = this; - function ReaderForm(config){ + function ReaderForm(config) { this.config = config; + this.data = config.data || {}; this.$load(); } ReaderForm.prototype = { - element:null, - style_list:[], // 样式列表 - event_list:{}, // 事件列表,已绑定事件 - event_type:['click','event','focus','keyup','blur','change',], - hide_list:[], - form_element:{}, - form_config:{}, - random:bt.get_random(5), - $load:function(){ + element: null, + style_list: [], // 样式列表 + event_list: {}, // 事件列表,已绑定事件 + event_type: ['click', 'event', 'focus', 'keyup', 'blur', 'change'], + hide_list: [], + form_element: {}, + form_config: {}, + random: bt.get_random(5), + $load: function () { var that = this; - if(that.el){ - this.$reader_content(function(){ + if (that.el) { + this.$reader_content(function () { that.$event_bind(); }); } }, - /** - * @description 激活焦点 - * @param {Function} callback 回调函数 - * @returns void - */ - $active_focus:function(callback,condition){ - var _that = this; - $('.input_checked_'+ _that.random).focus(); - this.checked_blur = function(ev){ - setTimeout(function(){ - if(condition){ - $('.input_checked_'+ _that.random).focus(); - return false; - } - if(callback) callback(ev); - delete _that.checked_blur; - },200); - } - }, /** * @description 渲染Form内容 * @param {Function} callback 回调函数 */ - $reader_content:function(callback){ - var that = this,html = '',_content = '',event_list = {}; - $.each(that.config.form,function(index,item){ - html += that.$reader_content_row(index,item); + $reader_content: function (callback) { + var that = this, + html = '', + _content = '', + event_list = {}; + $.each(that.config.form, function (index, item) { + html += that.$reader_content_row(index, item); }); - that.element = $('
                      '+ html +'
                      '); - _content = $('
                      '); + that.element = $('
                      ' + html + '
                      '); + _content = $('
                      '); _content.append(that.element); - event_list['input_checked_'+ that.random] = {'focus':{type:'input_checked',onEvent:false, - event:function(ev,that){ - that.checked = true; - return false; - } - },'blur':{type:'input_checked',onEvent:false,event:function(ev,that){ - that.checked = false; - if(that.checked_blur) that.checked_blur(ev); - } - }} - $.extend(that.event_list,event_list); - if(callback) callback(); + if (callback) callback(); return _content[0].outerHTML; }, @@ -1308,188 +1255,221 @@ var bt_tools = { * @param {number} index 下标 * @return {string} HTML结构 */ - $reader_content_row:function(index,data){ - var that = this,help = data.help; - return '
                      '+ - (data.label?''+ data.label +'':'') + - '
                      ' - + that.$reader_form_element(data.group,index) - + (help?('
                      '+ help.list.join('
                      ') +'
                      '):'') - +'
                      ' - +'
                      '; + $reader_content_row: function (index, data) { + var that = this,help = data.help,labelWidth = this.config.formLabelWidth || data.formLabelWidth; + return '
                      ' + + (data.label ? '' + data.label + '' : '') + + '
                      ' + + that.$reader_form_element(data.group, index) + + (help ? ('
                      ' + help.list.join('
                      ') + '
                      ') : '') + + '
                      ' + + '
                      '; }, - + /** * @description 渲染form类型 * @param {object} data 表单数据 * @param {number} index 下标 * @return {string} HTML结构 - */ - $reader_form_element:function(data,index){ - var that = this,config = [],html = '',event_list = {}; - if(!Array.isArray(data)) data = [data]; - $.each(data,function(key,item){ - var style = that.$reader_style(item.style) + _that.$verify(item.width,'width','style'), - attribute = that.$verify_group(item,['name','value','placeholder','disabled','readonly','autofocus','autocomplete','min','max']), - event_group = that.$create_event_config(item), - eventName = ''; - html += item.label?''+ item.label +'':''; - if(typeof item['name'] !== "undefined") event_list[item.name] = event_group; - switch(item.type){ - case 'text': // 文本选择 - case 'checkbox': // 复选框 - case 'password': // 密码 - case 'radio': // 单选框 - case 'number': // 数字 - var _event = 'event_'+ item.name +'_'+ that.random,is_checkbox = item.type === 'checkbox'?true:false; - if(item.type === 'radio'){ - $.each(item.label_tips,function(index,items){ - if(item.block) html += '
                      '; - html += ''; - html += ''; - if(item.block) html += '
                      '; - }) - }else{ - if(item.block) html += '
                      '; - html += ''; - if(item.type == 'checkbox') html += ''; - if(item.block) html += '
                      '; - that.event_list[_event] = {'click':{event:item.event}} - } - if(item.icon){ - html += ''; - event_list[item.name+'_icon'] = {'click':{type:'select_path',config:item}}; - } - break; - case 'textarea': - html += ''; - $.each(['blur','focus','input'],function(index,items){ - if(item.tips){ - var added = null; - switch(items){ - case 'blur': - added = function(ev,item){ - if($(this).val() === '') $(this).next().show(); - layer.close(item.tips.loadT); - } - break; - case 'focus': - added = function(ev,item){ - $(this).next().hide(); - item.tips.loadT = layer.tips(tips,$(this),{tips:[1,'#20a53a'],time:0,area:$(this).width()}) - } - break; - } - } - event_list[item.name][items]?(event_list[item.name][items]['added'] = added):(event_list[item.name][items] = {type:item.type,cust:false,event:item[items],added:added}); - }); - if(item.tips){ - var tips = ''; - if(typeof item.tips.list === "undefined"){ - tips = item.tips.text; - }else{ - tips = item.tips.list.join('
                      '); - } - html += '
                      '+ tips +'
                      '; - event_list[item.name+'_tips'] = {'click':{type:'textarea_tips',config:item}}; - } - break; - case 'select': - html += that.$reader_select(item,style,attribute,index); - that.event_list['custom_select'] = {'click':{type:'custom_select',children:'.bt_select_value'}}; - that.event_list['custom_select_item'] = {'click':{type:'custom_select_item',children:'li.item'}}; - break; - case 'link': - eventName = 'event_' + bt.get_random(6); - html += ''+ item.title +''; - that.event_list[eventName] = {'click':{type:'link_event',event:item.event}} - break; - case 'help': - var _html = ''; - $.each(item.list,function(index,items){ - _html += '
                    • '+items +'
                    • '; - }) - html += '
                        '+ _html +'
                      '; - break; - } + */ + $reader_form_element: function (data, index) { + var that = this,html = ''; + if (!Array.isArray(data)) data = [data]; + $.each(data, function (key, item) { + item.find_index = index; + html+= that.$reader_form_find(item); that.form_config[item.name] = item; }); - $.extend(that.event_list,event_list); return html; }, - + /** + * @descripttion 渲染单个表单元素 + * @param {Object} item 配置 + * @return: viod + */ + $reader_form_element:function(data,index){ + var that = this,config = [],html = '',event_list = {}; + if(!Array.isArray(data)) data = [data]; + $.each(data,function(key,item){ + var style = that.$reader_style(item.style) + _that.$verify(item.width,'width','style'), + attribute = that.$verify_group(item,['name','value','placeholder','disabled','readonly','autofocus','autocomplete','min','max']), + event_group = that.$create_event_config(item), + eventName = ''; + html += item.label?''+ item.label +'':''; + if(typeof item['name'] !== "undefined") event_list[item.name] = event_group; + switch(item.type){ + case 'text': // 文本选择 + case 'checkbox': // 复选框 + case 'password': // 密码 + case 'radio': // 单选框 + case 'number': // 数字 + var _event = 'event_'+ item.name +'_'+ that.random,is_checkbox = item.type === 'checkbox'?true:false; + if(item.type === 'radio'){ + $.each(item.label_tips,function(index,items){ + if(item.block) html += '
                      '; + html += ''; + html += ''; + if(item.block) html += '
                      '; + }) + }else{ + if(item.block) html += '
                      '; + html += ''; + if(item.type == 'checkbox') html += ''; + if(item.block) html += '
                      '; + that.event_list[_event] = {'click':{event:item.event}} + } + if(item.icon){ + html += ''; + event_list[item.name+'_icon'] = {'click':{type:'select_path',config:item}}; + } + break; + case 'textarea': + html += ''; + $.each(['blur','focus','input'],function(index,items){ + if(item.tips){ + var added = null; + switch(items){ + case 'blur': + added = function(ev,item){ + if($(this).val() === '') $(this).next().show(); + layer.close(item.tips.loadT); + } + break; + case 'focus': + added = function(ev,item){ + $(this).next().hide(); + item.tips.loadT = layer.tips(tips,$(this),{tips:[1,'#20a53a'],time:0,area:$(this).width()}) + } + break; + } + } + event_list[item.name][items]?(event_list[item.name][items]['added'] = added):(event_list[item.name][items] = {type:item.type,cust:false,event:item[items],added:added}); + }); + if(item.tips){ + var tips = ''; + if(typeof item.tips.list === "undefined"){ + tips = item.tips.text; + }else{ + tips = item.tips.list.join('
                      '); + } + html += '
                      '+ tips +'
                      '; + event_list[item.name+'_tips'] = {'click':{type:'textarea_tips',config:item}}; + } + break; + case 'select': + html += that.$reader_select(item,style,attribute,index); + that.event_list['custom_select'] = {'click':{type:'custom_select',children:'.bt_select_value'}}; + that.event_list['custom_select_item'] = {'click':{type:'custom_select_item',children:'li.item'}}; + break; + case 'link': + eventName = 'event_' + bt.get_random(6); + html += ''+ item.title +''; + that.event_list[eventName] = {'click':{type:'link_event',event:item.event}} + break; + case 'help': + var _html = ''; + $.each(item.list,function(index,items){ + _html += '
                    • '+items +'
                    • '; + }) + html += '
                        '+ _html +'
                      '; + break; + } + that.form_config[item.name] = item; + }); + $.extend(that.event_list,event_list); + return html; + }, /** * @description 创建事件配置 * @param {object} item 行内配置 * @return {object} 配置信息 - */ - $create_event_config:function(item){ + */ + $create_event_config: function (item) { var config = {}; - if(typeof item['name'] === "undefined") return {}; - $.each(this.event_type,function(key,items){ - if(item[items]){ - config[(items === 'event'?'click':items)] = {type:item.type,event:item[items],cust:(['select','checkbox','radio'].indexOf(item.type) > -1?true:false),config:item}; + if (typeof item['name'] === "undefined") return {}; + $.each(this.event_type, function (key, items) { + if (item[items]) { + config[(items === 'event' ? 'click' : items)] = { + type: item.type, + event: item[items], + cust: (['select', 'checkbox', 'radio'].indexOf(item.type) > -1 ? true : false), + config: item + }; } }); return config; }, /** * @description 渲染样式 - * @param {object|string} data 样式配置 + * @param {object|string} data 样式配置 * @return {string} 样式 - */ - $reader_style:function(data){ + */ + $reader_style: function (data) { var style = ''; - if(typeof data === 'string') return data; - if(typeof data === 'undefined') return ''; - $.each(data,function(key,item){ - style += key+':'+item+';'; + if (typeof data === 'string') return data; + if (typeof data === 'undefined') return ''; + $.each(data, function (key, item) { + style += key + ':' + item + ';'; }); return style; }, - + /** + * @descripttion 局部刷新form表单元素 + * @param {String} name 需要刷新的元素 + * @param {String} name 元素新数据 + * @return: viod + */ + $local_refresh:function(name,config){ + this.element.find('[data-name='+name+']').replaceWith(this.$reader_form_find(config)) + }, /** * @description 渲染下拉,内容方法 - */ - $reader_select:function(item,style,attribute,index){ - var that = this,list = '',option ='',active = {}; - if(!Array.isArray(item.list)){ + */ + $reader_select: function (item, style, attribute, index) { + var that = this, + list = '', + option = '', + active = {}; + if (!Array.isArray(item.list)) { var config = item.list; bt_tools.send({ - url:config.url, - data:config.param || {} - },function(res){ - if(res.status !== false){ - item.list = item.list.dataFilter?item.list.dataFilter(res):res; + url: config.url, + data: config.param || {} + }, function (res) { + if (res.status !== false) { + item.list = item.list.dataFilter ? item.list.dataFilter(res) : res; that.$replace_render_content(index); - }else{ + } else { bt.msg(res); } }); } - $.each(item.list,function(key,items){ - if(items.value === item.value || items.value === that.config.data[item.name]){ - active = items; - }else{ - active = item.list[0]; - } - list += '
                    • '+ items.title +'
                    • '; - option += ''; + $.each(item.list, function (key, items) { + try{ + if (items.value === item.value) { + active = items; + } else { + active = item.list[0]; + } + }catch(er){} + list += '
                    • ' + items.title + '
                    • '; + option += ''; }); - if(!active.title && Array.isArray(item.list)) active = item.list[0]; - return '
                      '+ - ''+ (active.title || 'Getting data') +''+ - '
                        '+ (list || '') +'
                      '+ - ''+ (option || '') +''+ - '
                      '; + if (!active.title && Array.isArray(item.list)) active = item.list[0]; + return '
                      ' + + '' + (active.title || 'Getting data...') + '' + + '
                        ' + (list || '') + '
                      ' + + '' + (option || '') + '' + + '
                      '; }, /** * @description 替换渲染内容 - */ - $replace_render_content:function(index){ - var that = this,config = this.config.form[index]; - $('[data-form='+ that.random +']').find('.line:eq('+ index +')').replaceWith(that.$reader_content_row(index,config)); + */ + $replace_render_content: function (index) { + var that = this, + config = this.config.form[index]; + $('[data-form=' + that.random + ']').find('.line:eq(' + index + ')').replaceWith(that.$reader_content_row(index, config)); }, /** @@ -1497,80 +1477,91 @@ var bt_tools = { * @param {Array} eventList 事件列表 * @param {Function} callback 回调函数 * @return void - */ - $event_bind:function(eventList,callback){ + */ + $event_bind: function (eventList, callback) { var that = this,_event = {}; - that.element = $(typeof eventList === 'object'?that.element:('[data-form='+ that.random +']')); - if(typeof eventList === 'undefined') _event = that.event_list; - $.each(_event,function(key,item){ - if($.isEmptyObject(item)) return true; - $.each(item,function(keys,items){ + that.element = $(typeof eventList === 'object' ? that.element : ('[data-form=' + that.random + ']')); + if (typeof eventList === 'undefined') _event = that.event_list; + console.log(_event); + $.each(_event, function (key, item) { + if ($.isEmptyObject(item)) return true; + $.each(item, function (keys, items) { var childNode = ''; - if(typeof items.cust === "boolean"){ - childNode = '['+(items.cust?'data-':'')+'name='+ key +']'; - }else{ - childNode = '.'+ key; + if (typeof items.cust === "boolean") { + childNode = '[' + (items.cust ? 'data-' : '') + 'name=' + key + ']'; + } else { + childNode = '.' + key; } - (function(items,key){ - if(items.onEvent === false){ - switch(items.type){ + (function (items, key) { + if (items.onEvent === false) { + switch (items.type) { case 'input_checked': - $(childNode).on(keys != 'event'?keys:'click',function(ev){ - items.event.apply(this,[ev,that]); + $(childNode).on(keys != 'event' ? keys : 'click', function (ev) { + items.event.apply(this, [ev, that]); }); - break; + break; } return true; - }else{ - that.element.on(keys != 'event'?keys:'click',items.children?items.children:childNode,function(ev){ - var form = that.$get_form_element(),value = that.$get_form_value(),config = that.form_config[key]; - switch(items.type){ + } else { + that.element.on(keys != 'event' ? keys : 'click', items.children ? items.children : childNode, function (ev) { + var form = that.$get_form_element(true), value = that.$get_form_value(), config = that.form_config[key]; + switch (items.type) { case 'textarea_tips': $(this).hide().prev().focus(); - break; + break; case 'custom_select': - if($(this).parent().hasClass('bt-disabled')) return false; + if ($(this).parent().hasClass('bt-disabled')) return false; var select_value = $(this).next(); - if(!select_value.hasClass('show')){ + if (!select_value.hasClass('show')) { $('.bt_select_list').removeClass('show'); select_value.addClass('show'); - }else{ + } else { select_value.removeClass('show'); } - $(document).click(function(){ + $(document).click(function () { that.element.find('.bt_select_list').removeClass('show'); $(this).unbind('click'); return false; }); return false; - break; + break; case 'custom_select_item': - config = that.form_config[$(this).parents('.bt_select_updown').attr('data-name')],item_config = config.list[$(this).index()] - if($(this).hasClass('disabled')){ + config = that.form_config[$(this).parents('.bt_select_updown').attr('data-name')], item_config = config.list[$(this).index()] + if ($(this).hasClass('disabled')) { $(this).parent().removeClass('show'); - if(item_config.tips) layer.msg(item_config.tips,{icon:2}); + if (item_config.tips) layer.msg(item_config.tips, { + icon: 2 + }); return true; } - if(!$(this).hasClass('active') && !$(this).hasClass('disabled')){ + if (!$(this).hasClass('active') && !$(this).hasClass('disabled')) { $(this).parent().prev().find('.bt_select_content').text($(this).text()); $(this).addClass('active').siblings().removeClass('active'); $(this).parent().next().val(item_config.value.toString()); $(this).parent().removeClass('show'); $(this).parent().next().trigger("change"); } - break; + break; case 'select_path': - bt.select_path('event_'+$(this).prev().attr('name')+'_'+that.random); - break; + bt.select_path('event_' + $(this).prev().attr('name') + '_' + that.random,items.config.icon.select||""); + break; + case 'checkbox': + var checked = $(this).is(':checked'); + if(checked){ + $(this).prev().addClass('active'); + }else{ + $(this).prev().removeClass('active'); + } + break; } - if(items.event) items.event.apply(this,[value,form,that,config,ev]); // 事件 - if(items.added) items.added.apply(this,[ev,config]); + if (items.event) items.event.apply(this, [value,form, that, config, ev]); // 事件 + if (items.added) items.added.apply(this, [ev,config,form]); }); } - }(items,key)); + }(items, key)); }); }); - if(callback) callback(); + if (callback) callback(); }, /** @@ -1583,12 +1574,12 @@ var bt_tools = { /** * @description 设置指定数据 - * - */ - $set_find_value:function(name,value){ + * + */ + $set_find_value: function (name, value) { var config = {},that = this; - typeof name != 'string'?config = name:config[name] = value; - $.each(config,function(key,item){ + typeof name != 'string' ? config = name : config[name] = value; + $.each(config, function (key, item) { that.form_element[key].val(item); }); }, @@ -1596,16 +1587,18 @@ var bt_tools = { /** * @description 获取Form,jquery节点 * @param {Boolean} afresh 是否强制刷新 - * @return {object} + * @return {object} */ - $get_form_element:function(afresh){ - var form = {},that = this; - if(afresh || $.isEmptyObject(that.form_element)){ - this.element.find(':input').each(function(index){ + $get_form_element: function (afresh) { + var form = {}, + that = this; + if (afresh || $.isEmptyObject(that.form_element)) { + this.element.find(':input').each(function (index) { form[$(this).attr('name')] = $(this); }); that.form_element = form; - }else{ + return form; + } else { return that.form_element; } }, @@ -1613,14 +1606,15 @@ var bt_tools = { /** * @description 验证值整个列表是否存在,存在则转换成属性字符串格式 */ - $verify_group:function(config,group){ - var that = this,str = ''; - $.each(group,function(index,item){ - if(typeof config[item] === "undefined") return true; - if(['disabled','readonly'].indexOf(item) > -1){ - str += ' ' + (config[item]?(item+'="'+item +'"'):''); - }else{ - str += ' '+ item + '="' + config[item] +'"'; + $verify_group: function (config, group) { + var that = this, + str = ''; + $.each(group, function (index, item) { + if (typeof config[item] === "undefined") return true; + if (['disabled', 'readonly'].indexOf(item) > -1) { + str += ' ' + (config[item] ? (item + '="' + item + '"') : ''); + } else { + str += ' ' + item + '="' + config[item] + '"'; } }); return str; @@ -1628,18 +1622,24 @@ var bt_tools = { /** * @description 验证绑定事件 - * @param {String} value + * @param {String} value */ - $verify_bind_event:function(eventName,row,group){ + $verify_bind_event: function (eventName, row, group) { var event_list = {}; - $.each(group,function(index,items){ + $.each(group, function (index, items) { var event_fun = row[items]; - if(event_fun){ - if(typeof event_list[eventName] === "object"){ - if(!Array.isArray(event_list[eventName])) event_list[eventName] = [event_list[eventName]]; - event_list[eventName].push({event:event_fun,eventType:items}); - }else{ - event_list[eventName] = {event:event_fun,eventType:items}; + if (event_fun) { + if (typeof event_list[eventName] === "object") { + if (!Array.isArray(event_list[eventName])) event_list[eventName] = [event_list[eventName]]; + event_list[eventName].push({ + event: event_fun, + eventType: items + }); + } else { + event_list[eventName] = { + event: event_fun, + eventType: items + }; } } }); @@ -1651,21 +1651,59 @@ var bt_tools = { * @param {String} value 内容/值 * @param {String|Boolean} attr 属性 * @param {String} type 属性 - */ - $verify:function(value,attr,type){ - if(!value) return ''; - if(type === true) return value?' '+ attr:''; - if(type === 'style') return attr?attr+':'+value+';':value; - return attr?' '+ attr+'="'+value+'"':' '+value; + */ + $verify: function (value, attr, type) { + if (!value) return ''; + if (type === true) return value ? ' ' + attr : ''; + if (type === 'style') return attr ? attr + ':' + value + ';' : value; + return attr ? ' ' + attr + '="' + value + '"' : ' ' + value; + }, + /** + * @description 验证form表单 + */ + $verify_form:function(){ + var form_list = {},form = this.config.form,form_value = this.$get_form_value(),form_element = this.$get_form_element(true); + for(var key = 0; key< form.length; key++){ + var item = form[key]; + if(!Array.isArray(item.group)) item.group = [item.group]; + for(var i=0;i -1?('本地磁盘('+ item.path.match(/[A-Z]+/)[0])+ ':)':item.path) mount_html += '
                      '+ ''+ ''+ name +''+ '
                      '; - }); - + }); + $.each(dir_list,function(index,item){ - if((_this.type == 0) && item.type != _this.type_limit) return true; - var mtime = bt.format_data(item.mtime), - type = (item.type == 'dir'?'文件夹':'文件'); - dir_html += '\ + if((_this.type == 0) && item.type != _this.type_limit) return true; + var mtime = bt.format_data(item.mtime), + type = (item.type == 'dir'?'文件夹':'文件'); + dir_html += '\ '+ item.filename +'\ '+ mtime +'\ '+ (item.type == 'dir'?'文件夹':'文件') +'\ '; }); $('#select_mount_list').html(mount_html); - $('#select_dir_list').html(dir_html); + $('#select_dir_list').html(dir_html); if(callback) callback(rdata); }); }, @@ -1953,71 +2004,71 @@ var bt_tools = { * @param {Function} callback 回调函数 * @return void */ - - data_reconstruction:function(data,type,callback){ - if(data.length < 1) return []; - var _array = []; - $.each(data,function(index,item){ - var itemD = item.split(";"),fileMsg ='',fileN = itemD[0].split('.'),extName = fileN[fileN.length - 1]; - switch(itemD[0]) { - case '.user.ini': - fileMsg = 'PS: PHP用户配置文件(防跨站)!'; - break; - case '.htaccess': - fileMsg = 'PS: Apache用户配置文件(伪静态)'; - break; - case 'swap': - fileMsg = 'PS: 宝塔默认设置的SWAP交换分区文件'; - break; - } - if(itemD[0].indexOf('Recycle_bin') != -1) fileMsg = 'PS: 回收站目录,勿动!'; - if(itemD[0].indexOf('.upload.tmp') != -1) fileMsg = 'PS: 宝塔文件上传临时文件,重新上传从断点续传,可删除'; - _array.push({ - caret: itemD[8] == '1'?true:false, //是否收藏 - down_id: itemD[9], //是否分享 分享id - ext: (type == 'DIR'?'':extName), //文件类型 - filename: itemD[0], //文件名称 - mtime: itemD[2], //时间 - ps: fileMsg || itemD[10], //备注 - size: itemD[1], //文件大小 - type: type == 'DIR'?'dir':'file', //文件类型 - user: itemD[3], //用户权限 - root_level:itemD[4] //所有者 - // accept: 666, - //composer: 0, - // link: "", - // shell: false, - }) - - }) - return _array; - }, - render_path_list: function (callback){ - var _this = this,html = '
                      ', path_before = '',dir_list = this.file_path.split("/").splice(1),first_dir = this.file_path.split("/")[0]; - if(bt.os === 'Windows'){ - if(dir_list.length == 0) dir_list = []; - dir_list.unshift('本地磁盘('+ first_dir +')'); - }else{ - if(this.file_path == '/') dir_list = []; - dir_list.unshift('根目录'); - } - for(var i = 0; i < dir_list.length; i++){ - path_before += '/' + dir_list[i]; - if (i == 0) path_before = ''; - html += '
                      \ - ' + dir_list[i] + '\ - \ - \ -
                      '; - } - $('.path_input').val('').attr('data-path',this.file_path); - var file_dir_view = $('.file_path_input .file_dir_view'); - file_dir_view.html(html); - file_dir_view.attr('data-width',file_dir_view.width()); - _this.set_dir_view_resize(); - }, + + data_reconstruction:function(data,type,callback){ + if(data.length < 1) return []; + var _array = []; + $.each(data,function(index,item){ + var itemD = item.split(";"),fileMsg ='',fileN = itemD[0].split('.'),extName = fileN[fileN.length - 1]; + switch(itemD[0]) { + case '.user.ini': + fileMsg = 'PS: PHP用户配置文件(防跨站)!'; + break; + case '.htaccess': + fileMsg = 'PS: Apache用户配置文件(伪静态)'; + break; + case 'swap': + fileMsg = 'PS: 宝塔默认设置的SWAP交换分区文件'; + break; + } + if(itemD[0].indexOf('Recycle_bin') != -1) fileMsg = 'PS: 回收站目录,勿动!'; + if(itemD[0].indexOf('.upload.tmp') != -1) fileMsg = 'PS: 宝塔文件上传临时文件,重新上传从断点续传,可删除'; + _array.push({ + caret: itemD[8] == '1'?true:false, //是否收藏 + down_id: itemD[9], //是否分享 分享id + ext: (type == 'DIR'?'':extName), //文件类型 + filename: itemD[0], //文件名称 + mtime: itemD[2], //时间 + ps: fileMsg || itemD[10], //备注 + size: itemD[1], //文件大小 + type: type == 'DIR'?'dir':'file', //文件类型 + user: itemD[3], //用户权限 + root_level:itemD[4] //所有者 + // accept: 666, + //composer: 0, + // link: "", + // shell: false, + }) + + }) + return _array; + }, + render_path_list: function (callback){ + var _this = this,html = '
                      ', path_before = '',dir_list = this.file_path.split("/").splice(1),first_dir = this.file_path.split("/")[0]; + if(bt.os === 'Windows'){ + if(dir_list.length == 0) dir_list = []; + dir_list.unshift('本地磁盘('+ first_dir +')'); + }else{ + if(this.file_path == '/') dir_list = []; + dir_list.unshift('根目录'); + } + for(var i = 0; i < dir_list.length; i++){ + path_before += '/' + dir_list[i]; + if (i == 0) path_before = ''; + html += '
                      \ + ' + dir_list[i] + '\ + \ + \ +
                      '; + } + $('.path_input').val('').attr('data-path',this.file_path); + var file_dir_view = $('.file_path_input .file_dir_view'); + file_dir_view.html(html); + file_dir_view.attr('data-width',file_dir_view.width()); + _this.set_dir_view_resize(); + }, /** * @description 设置标题宽度 @@ -2056,89 +2107,89 @@ var bt_tools = { scrollbarWidth = odiv.offsetWidth - odiv.clientWidth;//相减 odiv.remove();//移除创建的div return scrollbarWidth;//返回滚动条宽度 - }, - set_dir_view_resize:function(){ - var file_path_input = $('.file_path_input'),file_dir_view = $('.file_path_input .file_dir_view'),_path_width = file_dir_view.attr('data-width'),file_item_hide = null; - if(_path_width){ - parseInt(_path_width); - }else{ - _path_width = file_dir_view.width(); - file_dir_view.attr('data-width',_path_width); - } - if(file_dir_view.width() - _path_width < 90){ - var width = 0; - $($('.file_path_input .file_dir_view .file_dir_item').toArray().reverse()).each(function(){ - var item_width = 0; - if(!$(this).attr('data-width')){ - $(this).attr('data-width',$(this).width()); - item_width = $(this).width(); - }else{ - item_width = parseInt($(this).attr('data-width')); - } - width += item_width; - if((file_path_input.width() - width) <= 90){ - $(this).addClass('hide'); - }else{ - $(this).removeClass('hide'); - } - }); - } - var file_item_hide = file_dir_view.children('.file_dir_item.hide').clone(true); - if(file_dir_view.children('.file_dir_item.hide').length == 0){ - file_path_input.removeClass('active').find('.file_dir_omit').addClass('hide'); - }else{ - file_item_hide.each(function(){ - if($(this).find('.glyphicon-hdd').length == 0){ - $(this).find('.file_dir').before(''); - } - }); - file_path_input.addClass('active').find('.file_dir_omit').removeClass('hide'); - file_path_input.find('.file_dir_omit .nav_down_list').empty().append(file_item_hide); - file_path_input.find('.file_dir_omit .nav_down_list .file_dir_item').removeClass('hide'); - } - }, - /** - * @description 渲染文件列表 - * @param {Object} data 参数对象,例如分页、显示数量、排序,不传参数使用默认或继承参数 - * @param {Function} callback 回调函数 - * @return void - */ - reader_file_list:function (data, callback){ - var _this = this,select_page_num = '',next_path = ''; - if(typeof data === "function") callback = data,data = {is_operating:false}; - if(typeof data === "undefined") data = {is_operating:false}; - if(limit){ - layer.msg('只能在该目录下操作',{icon:2}); - return false; - } - this.loadT = bt.load('正在获取文件列表,请稍候...'); - this.file_images_list = []; - _this.get_dir_list(data,function(res){ - _this.loadT.close(); - _this.file_list = $.merge(_this.data_reconstruction(res.DIR,'DIR'), _this.data_reconstruction(res.FILES)); - _this.file_path = res.PATH; - _this.is_recycle = res.FILE_RECYCLE; - _this.file_store_list = res.STORE; - bt.set_cookie('Path',res.PATH); - - - var mount_html = '',dir_html = '', - disk_list = res.DISK, - dir_list = _this.file_list; - _this.select_list = _this.file_list; - _this.render_path_list(); + }, + set_dir_view_resize:function(){ + var file_path_input = $('.file_path_input'),file_dir_view = $('.file_path_input .file_dir_view'),_path_width = file_dir_view.attr('data-width'),file_item_hide = null; + if(_path_width){ + parseInt(_path_width); + }else{ + _path_width = file_dir_view.width(); + file_dir_view.attr('data-width',_path_width); + } + if(file_dir_view.width() - _path_width < 90){ + var width = 0; + $($('.file_path_input .file_dir_view .file_dir_item').toArray().reverse()).each(function(){ + var item_width = 0; + if(!$(this).attr('data-width')){ + $(this).attr('data-width',$(this).width()); + item_width = $(this).width(); + }else{ + item_width = parseInt($(this).attr('data-width')); + } + width += item_width; + if((file_path_input.width() - width) <= 90){ + $(this).addClass('hide'); + }else{ + $(this).removeClass('hide'); + } + }); + } + var file_item_hide = file_dir_view.children('.file_dir_item.hide').clone(true); + if(file_dir_view.children('.file_dir_item.hide').length == 0){ + file_path_input.removeClass('active').find('.file_dir_omit').addClass('hide'); + }else{ + file_item_hide.each(function(){ + if($(this).find('.glyphicon-hdd').length == 0){ + $(this).find('.file_dir').before(''); + } + }); + file_path_input.addClass('active').find('.file_dir_omit').removeClass('hide'); + file_path_input.find('.file_dir_omit .nav_down_list').empty().append(file_item_hide); + file_path_input.find('.file_dir_omit .nav_down_list .file_dir_item').removeClass('hide'); + } + }, + /** + * @description 渲染文件列表 + * @param {Object} data 参数对象,例如分页、显示数量、排序,不传参数使用默认或继承参数 + * @param {Function} callback 回调函数 + * @return void + */ + reader_file_list:function (data, callback){ + var _this = this,select_page_num = '',next_path = ''; + if(typeof data === "function") callback = data,data = {is_operating:false}; + if(typeof data === "undefined") data = {is_operating:false}; + if(limit){ + layer.msg('只能在该目录下操作',{icon:2}); + return false; + } + this.loadT = bt.load('正在获取文件列表,请稍候...'); + this.file_images_list = []; + _this.get_dir_list(data,function(res){ + _this.loadT.close(); + _this.file_list = $.merge(_this.data_reconstruction(res.DIR,'DIR'), _this.data_reconstruction(res.FILES)); + _this.file_path = res.PATH; + _this.is_recycle = res.FILE_RECYCLE; + _this.file_store_list = res.STORE; + bt.set_cookie('Path',res.PATH); + + + var mount_html = '',dir_html = '', + disk_list = res.DISK, + dir_list = _this.file_list; + _this.select_list = _this.file_list; + _this.render_path_list(); $.each(disk_list,function(index,item){ var name = (item.path == '/'?'根目录':item.path.indexOf(':/') > -1?('本地磁盘('+ item.path.match(/[A-Z]+/)[0])+ ':)':item.path) mount_html += '
                      '+ ''+ ''+ name +''+ '
                      '; - }); - + }); + $.each(dir_list,function(index,item){ - if((_this.type == 0) && item.type != _this.type_limit) return true; - var mtime = bt.format_data(item.mtime), - type = (item.type == 'dir'?'文件夹':'文件'); + if((_this.type == 0) && item.type != _this.type_limit) return true; + var mtime = bt.format_data(item.mtime), + type = (item.type == 'dir'?'文件夹':'文件'); dir_html += '\ '+ item.filename +'\ '+ mtime +'\ @@ -2146,337 +2197,337 @@ var bt_tools = { '; }); $('#select_mount_list').html(mount_html); - $('#select_dir_list').html(dir_html); - var _i = res.PATH.lastIndexOf("\/"), - index_file = res.PATH.substring(_i + 1, res.PATH.length); - //if(_this.type_limit != 'file') $('[name="select_name"].file_directory').val(index_file); + $('#select_dir_list').html(dir_html); + var _i = res.PATH.lastIndexOf("\/"), + index_file = res.PATH.substring(_i + 1, res.PATH.length); + //if(_this.type_limit != 'file') $('[name="select_name"].file_directory').val(index_file); if(callback) callback(rdata); - }); - }, + }); + }, - /** - * @description 渲染文件列表内容 - * @param {Object} data 文件列表数据 - * @param {Function} callback 回调函数 - * @return void - */ - reader_file_list_content:function(data,callback){ - var _html = '',_this = this,is_dir_num = 0; - $.each(data,function(index,item){ - var _title = item.filename + item.ps; - _this.file_list[index] = item = _this.$file_data_dispose(item); - _this.file_list[index]['only_index'] = index; - if(item.filename.indexOf('Recycle_bin')) _tips = 'PS: 回收站目录,勿动!'; - if(_title.length > 20) _title = _title.substring(0, 20) + '...'; - if(bt.check_chinese(_title) && _title.length > 10) _title = _title.substring(0, 10) + '...' - _html += '
                      '+ - '
                      '+ - '
                      '+ - '
                      '+ - ''+ item.filename + item.ps +''+ (item.caret?'':'') + (item.down_id?'':'') + - '
                      '+ - '
                      '+ item.type_tips +'
                      '+ - '
                      '+ (item.type == 'dir'?'点击计算':bt.format_size(item.size)) +'
                      '+ - '
                      ' + bt.format_data(item.mtime) + '
                      '+ - '
                      '; - if(item.type == 'dir') is_dir_num ++; // 获取目录数量 - if(item.ispreview){ // 获取图片数量 - _this.file_images_list.push(item.path); - if(typeof item.images_id) item.images_id = _this.file_images_list.length - 1; - } + /** + * @description 渲染文件列表内容 + * @param {Object} data 文件列表数据 + * @param {Function} callback 回调函数 + * @return void + */ + reader_file_list_content:function(data,callback){ + var _html = '',_this = this,is_dir_num = 0; + $.each(data,function(index,item){ + var _title = item.filename + item.ps; + _this.file_list[index] = item = _this.$file_data_dispose(item); + _this.file_list[index]['only_index'] = index; + if(item.filename.indexOf('Recycle_bin')) _tips = 'PS: 回收站目录,勿动!'; + if(_title.length > 20) _title = _title.substring(0, 20) + '...'; + if(bt.check_chinese(_title) && _title.length > 10) _title = _title.substring(0, 10) + '...' + _html += '
                      '+ + '
                      '+ + '
                      '+ + '
                      '+ + ''+ item.filename + item.ps +''+ (item.caret?'':'') + (item.down_id?'':'') + + '
                      '+ + '
                      '+ item.type_tips +'
                      '+ + '
                      '+ (item.type == 'dir'?'点击计算':bt.format_size(item.size)) +'
                      '+ + '
                      ' + bt.format_data(item.mtime) + '
                      '+ + '
                      '; + if(item.type == 'dir') is_dir_num ++; // 获取目录数量 + if(item.ispreview){ // 获取图片数量 + _this.file_images_list.push(item.path); + if(typeof item.images_id) item.images_id = _this.file_images_list.length - 1; + } - }); - $('.file_list_content').html(_html); - if(callback) callback({is_dir_num:is_dir_num}) - }, - /** - * @description 文件数据处理 - * @param {Object} data 配置参数 - * @return {Object} 重新生成的文件对象 - */ - $file_data_dispose:function(data){ - var models = {languages:null,model:null}; - //if(data.type !== 'dir') models = this.$get_file_model(data); - return $.extend(data,{ - only_id:bt.get_random(10), // 文件唯一ID - type_tips:data.type === 'dir'?'文件夹':this.ext_type_tips(data.ext), // 文件类型描述 - open_type:this.determine_file_type(data.ext), // 打开类型 - languages:models.languages, // 文件语言 - path:data.path || this.path_resolve(this.file_path,data.filename), // 文件全路径 - model:models.model, // 语言模型 - }); - }, - /** - * @description 文件路径合并 - * @param {String} paths 旧路径 - * @param {String} param 新路径 - * @return {String} 新的路径 - */ - path_resolve:function(paths, param){ - var path = '',split = ''; - if(!Array.isArray(param)) param = [param]; - paths.replace(/([\/|\/]*)$/,function($1){ - split = $1; - return 'www'; - }); - $.each(param,function(index,item){ - path += '/' + item; - }); - return paths + path; - }, - /** - * @description 获取文件语言配置模型 - * @param {Object} data 当前文件的数据对象 - * @return {Object} 当前语言配置模型 - */ - $get_file_model:function(data){ - var config = this.vscode_editor.config; - for(languages in config.supportedModes){ - var item = config.supportedModes[languages]; - for(var j=0;j'+ - ''+ - ''+(item.path == '/'?'根目录':item.path)+' ('+ item.size[2] +')'+ - '
                      '; - }); - $('.mount_disk_list').html(html); - }); - }, - /** - * @description 文件类型判断,或返回格式类型(不传入type) - * @param {String} ext - * @param {String} type - * @return {Boolean|Object} 返回类型或类型是否支持 - */ - determine_file_type:function(ext,type){ - var config = { - images:['jpg','jpeg','png','bmp','gif','tiff','ico'], - compress:['zip','rar','gz','war','tgz'], - video:['mp4', 'mpeg', 'mpg', 'mov', 'avi', 'webm', 'mkv'], - ont_text:['iso','xlsx','xsl','doc','docx','tiff','exe','so','7z','bz','dmg','apk'] - },returnVal = false; - if(type != undefined){ - if(type == 'text'){ - $.each(config,function(key,item){ - $.each(item,function(index,items){ - if(items == ext){ - returnVal = true; - return false; - } - }) - }); - returnVal = !returnVal - }else{ - if(typeof config[type] == "undefined") return false; - $.each(config[type],function(key,item){ - if(item == ext){ - returnVal = true; - return false; - } - }); - } - }else{ - $.each(config,function(key,item){ - $.each(item,function(index,items){ - if(items == ext){ - returnVal = key; - return false; - } - }) - }); - if(typeof returnVal == "boolean") returnVal = 'text'; - } - return returnVal; - }, + }); + $('.file_list_content').html(_html); + if(callback) callback({is_dir_num:is_dir_num}) + }, + /** + * @description 文件数据处理 + * @param {Object} data 配置参数 + * @return {Object} 重新生成的文件对象 + */ + $file_data_dispose:function(data){ + var models = {languages:null,model:null}; + //if(data.type !== 'dir') models = this.$get_file_model(data); + return $.extend(data,{ + only_id:bt.get_random(10), // 文件唯一ID + type_tips:data.type === 'dir'?'文件夹':this.ext_type_tips(data.ext), // 文件类型描述 + open_type:this.determine_file_type(data.ext), // 打开类型 + languages:models.languages, // 文件语言 + path:data.path || this.path_resolve(this.file_path,data.filename), // 文件全路径 + model:models.model, // 语言模型 + }); + }, + /** + * @description 文件路径合并 + * @param {String} paths 旧路径 + * @param {String} param 新路径 + * @return {String} 新的路径 + */ + path_resolve:function(paths, param){ + var path = '',split = ''; + if(!Array.isArray(param)) param = [param]; + paths.replace(/([\/|\/]*)$/,function($1){ + split = $1; + return 'www'; + }); + $.each(param,function(index,item){ + path += '/' + item; + }); + return paths + path; + }, + /** + * @description 获取文件语言配置模型 + * @param {Object} data 当前文件的数据对象 + * @return {Object} 当前语言配置模型 + */ + $get_file_model:function(data){ + var config = this.vscode_editor.config; + for(languages in config.supportedModes){ + var item = config.supportedModes[languages]; + for(var j=0;j'+ + ''+ + ''+(item.path == '/'?'根目录':item.path)+' ('+ item.size[2] +')'+ + '
                      '; + }); + $('.mount_disk_list').html(html); + }); + }, + /** + * @description 文件类型判断,或返回格式类型(不传入type) + * @param {String} ext + * @param {String} type + * @return {Boolean|Object} 返回类型或类型是否支持 + */ + determine_file_type:function(ext,type){ + var config = { + images:['jpg','jpeg','png','bmp','gif','tiff','ico'], + compress:['zip','rar','gz','war','tgz'], + video:['mp4', 'mpeg', 'mpg', 'mov', 'avi', 'webm', 'mkv'], + ont_text:['iso','xlsx','xsl','doc','docx','tiff','exe','so','7z','bz','dmg','apk'] + },returnVal = false; + if(type != undefined){ + if(type == 'text'){ + $.each(config,function(key,item){ + $.each(item,function(index,items){ + if(items == ext){ + returnVal = true; + return false; + } + }) + }); + returnVal = !returnVal + }else{ + if(typeof config[type] == "undefined") return false; + $.each(config[type],function(key,item){ + if(item == ext){ + returnVal = true; + return false; + } + }); + } + }else{ + $.each(config,function(key,item){ + $.each(item,function(index,items){ + if(items == ext){ + returnVal = key; + return false; + } + }) + }); + if(typeof returnVal == "boolean") returnVal = 'text'; + } + return returnVal; + }, - /** - * @description 渲染右键鼠标菜单 - * @param {Object} ev 事件event对象 - * @param {Object} el 事件对象DOM - * @return void - */ - render_file_groud_menu: function (ev,el){ - var _this = this,index = $(el).data('index'),data = _this.file_list[index],config_group = [['open','打开'],['split',''],['download','下载'],['share','分享目录/文件'],['cancel_share','取消分享'],['favorites','收藏目录/文件'],['cancel_favorites','取消收藏'],['split',''],['dir_kill','目录查杀'],['authority','权限'],['split',''],['copy','复制'],['shear','剪切'],['rename','重命名'],['del','删除'],['split',''],['killing','创建压缩',[['gzip','tar.gz (推荐)'],['zip','zip (通用格式)'],['rar','rar (中文兼容较好)']]],['unzip','解压',[['local','解压到当前'],['folad','解压到当前']]]],compression = ['zip','rar','gz','war','tgz','bz2'],offsetNum = 0; - if(data.type == 'dir'){ // 判断是否为目录,目录不可下载 - config_group.splice(2,1); - offsetNum ++; - } - if(data.down_id !== 0){ //判断是否分享 - config_group.splice(3-offsetNum,1); - offsetNum ++; - }else{ - config_group.splice(4-offsetNum,1); - config_group[3-offsetNum][1] = (data.type == 'dir'?'分享目录':'分享文件'); - offsetNum ++; - } - if(data.caret !== false){ // 判断是否收藏 - config_group.splice((5-offsetNum),1); - offsetNum ++; - }else{ - config_group.splice((6-offsetNum),1); - config_group[5-offsetNum][1] = (data.type == 'dir'?'收藏目录':'收藏文件'); - offsetNum ++; - } - if(data.ext != 'php' && data.type != 'dir'){ // 判断是否为php,非php文件(排除目录)无法扫描 - config_group.splice((8-offsetNum),1); - offsetNum ++; - } - var num = 0; - $.each(compression,function(index,item){ - if(item == data.ext) num ++; - }); - if(num == 0){ - config_group.splice((17-offsetNum),1); - offsetNum ++; - } - _this.reader_menu_list({el:$('.selection_right_menu'),ev:ev,data:data,list:config_group}); - }, + /** + * @description 渲染右键鼠标菜单 + * @param {Object} ev 事件event对象 + * @param {Object} el 事件对象DOM + * @return void + */ + render_file_groud_menu: function (ev,el){ + var _this = this,index = $(el).data('index'),data = _this.file_list[index],config_group = [['open','打开'],['split',''],['download','下载'],['share','分享目录/文件'],['cancel_share','取消分享'],['favorites','收藏目录/文件'],['cancel_favorites','取消收藏'],['split',''],['dir_kill','目录查杀'],['authority','权限'],['split',''],['copy','复制'],['shear','剪切'],['rename','重命名'],['del','删除'],['split',''],['killing','创建压缩',[['gzip','tar.gz (推荐)'],['zip','zip (通用格式)'],['rar','rar (中文兼容较好)']]],['unzip','解压',[['local','解压到当前'],['folad','解压到当前']]]],compression = ['zip','rar','gz','war','tgz','bz2'],offsetNum = 0; + if(data.type == 'dir'){ // 判断是否为目录,目录不可下载 + config_group.splice(2,1); + offsetNum ++; + } + if(data.down_id !== 0){ //判断是否分享 + config_group.splice(3-offsetNum,1); + offsetNum ++; + }else{ + config_group.splice(4-offsetNum,1); + config_group[3-offsetNum][1] = (data.type == 'dir'?'分享目录':'分享文件'); + offsetNum ++; + } + if(data.caret !== false){ // 判断是否收藏 + config_group.splice((5-offsetNum),1); + offsetNum ++; + }else{ + config_group.splice((6-offsetNum),1); + config_group[5-offsetNum][1] = (data.type == 'dir'?'收藏目录':'收藏文件'); + offsetNum ++; + } + if(data.ext != 'php' && data.type != 'dir'){ // 判断是否为php,非php文件(排除目录)无法扫描 + config_group.splice((8-offsetNum),1); + offsetNum ++; + } + var num = 0; + $.each(compression,function(index,item){ + if(item == data.ext) num ++; + }); + if(num == 0){ + config_group.splice((17-offsetNum),1); + offsetNum ++; + } + _this.reader_menu_list({el:$('.selection_right_menu'),ev:ev,data:data,list:config_group}); + }, - /** - * @description 渲染右键全局菜单 - * @param {Object} ev 事件event对象 - * @param {Object} el 事件对象DOM - * @return void - */ - render_file_all_menu:function (ev,el) { - var _this = this,config_group = [['refresh','刷新'],['split',''],['upload','上传'],['create','新建文件夹/文件',[['create_dir','新建文件夹'],['create_files','新建文件']]],['split',''],['paste','粘贴']],offsetNum = 0; - if(!bt.get_storage('session','copy_path')){ - config_group.splice(5,1); - offsetNum ++; - } - _this.reader_menu_list({el:$('.selection_right_menu'),ev:ev,data:{},list:config_group}); - }, - get_dir_list:function(data, callback,is_tips) { - var _this = this; - if(typeof callback === "boolean") is_tips = callback,callback = null; - that.$http('GetDir',$.extend({ - disk:true, - path:_this.file_path, - sort:bt.get_cookie('files_sort') || 'type', - },data),callback,is_tips); - }, - /** - * @description 返回上一层目录地址 - * @param {String} path 当前路径 - * @returns 返回上一层地址 - */ - retrun_prev_path:function(path){ - var dir_list = path.split('/'); - dir_list.splice(dir_list.length - 1); - return dir_list.join('/'); - }, + /** + * @description 渲染右键全局菜单 + * @param {Object} ev 事件event对象 + * @param {Object} el 事件对象DOM + * @return void + */ + render_file_all_menu:function (ev,el) { + var _this = this,config_group = [['refresh','刷新'],['split',''],['upload','上传'],['create','新建文件夹/文件',[['create_dir','新建文件夹'],['create_files','新建文件']]],['split',''],['paste','粘贴']],offsetNum = 0; + if(!bt.get_storage('session','copy_path')){ + config_group.splice(5,1); + offsetNum ++; + } + _this.reader_menu_list({el:$('.selection_right_menu'),ev:ev,data:{},list:config_group}); + }, + get_dir_list:function(data, callback,is_tips) { + var _this = this; + if(typeof callback === "boolean") is_tips = callback,callback = null; + that.$http('GetDir',$.extend({ + disk:true, + path:_this.file_path, + sort:bt.get_cookie('files_sort') || 'type', + },data),callback,is_tips); + }, + /** + * @description 返回上一层目录地址 + * @param {String} path 当前路径 + * @returns 返回上一层地址 + */ + retrun_prev_path:function(path){ + var dir_list = path.split('/'); + dir_list.splice(dir_list.length - 1); + return dir_list.join('/'); + }, - /** - * @description 渲染菜单列表 - * @param {Object} config 菜单配置列表和数据 - * @returns void - */ - reader_menu_list:function(config){ - var _this = this,el = config.el.find('ul'),el_height = el.height(),el_width = el.width(),left = config.ev.clientX - ((this.area[0] - config.ev.clientX) < el_width?el_width:0); - el.empty(); - $.each(config.list,function(index,item){ - var $children = null,$children_list = null; - if(item[0] == 'split'){ - el.append('
                    • '); - }else{ - if(Array.isArray(item[2])){ - $children = $('
                        '); - $children_list = $children.find('.set_group'); - $.each(item[2],function(indexs,items) { - $children_list.append($('
                      • '+ items[1] +'
                      • ').on('click',{type:items[0],data:config.data},function(ev){ - _this.file_groud_event($.extend(ev.data.data,{ - open:ev.data.type, - index:parseInt($(config.ev.currentTarget).data('index')), - element:config.ev.currentTarget, - type_tips:item.type?'文件夹':'文件' - })); - config.el.removeAttr('style'); - ev.stopPropagation(); - ev.preventDefault(); - })) - }); - } - el.append($('
                      • '+ item[1] +'
                      • ').append($children).on('click',{type:item[0],data:config.data},function(ev){ - _this.file_groud_event($.extend(ev.data.data,{ - open:ev.data.type, - index:parseInt($(config.ev.currentTarget).data('index')), - element:config.ev.currentTarget, - type_tips:item.type?'文件夹':'文件' - })); - config.el.removeAttr('style'); - ev.stopPropagation(); - ev.preventDefault(); - })); - } - }); - config.el.css({ - left: left, - top: config.ev.clientY - ((this.area[1] - config.ev.clientY) < el_height?el_height:0) - }).removeClass('left_menu right_menu').addClass(this.area[0] - (left + el_width) < 230?'left_menu':'right_menu'); - $(document).one('click',function(e){ - $(config.ev.currentTarget).removeClass('selected'); - config.el.removeAttr('style'); - e.stopPropagation(); - e.preventDefault(); - }); - }, + /** + * @description 渲染菜单列表 + * @param {Object} config 菜单配置列表和数据 + * @returns void + */ + reader_menu_list:function(config){ + var _this = this,el = config.el.find('ul'),el_height = el.height(),el_width = el.width(),left = config.ev.clientX - ((this.area[0] - config.ev.clientX) < el_width?el_width:0); + el.empty(); + $.each(config.list,function(index,item){ + var $children = null,$children_list = null; + if(item[0] == 'split'){ + el.append('
                      • '); + }else{ + if(Array.isArray(item[2])){ + $children = $('
                          '); + $children_list = $children.find('.set_group'); + $.each(item[2],function(indexs,items) { + $children_list.append($('
                        • '+ items[1] +'
                        • ').on('click',{type:items[0],data:config.data},function(ev){ + _this.file_groud_event($.extend(ev.data.data,{ + open:ev.data.type, + index:parseInt($(config.ev.currentTarget).data('index')), + element:config.ev.currentTarget, + type_tips:item.type?'文件夹':'文件' + })); + config.el.removeAttr('style'); + ev.stopPropagation(); + ev.preventDefault(); + })) + }); + } + el.append($('
                        • '+ item[1] +'
                        • ').append($children).on('click',{type:item[0],data:config.data},function(ev){ + _this.file_groud_event($.extend(ev.data.data,{ + open:ev.data.type, + index:parseInt($(config.ev.currentTarget).data('index')), + element:config.ev.currentTarget, + type_tips:item.type?'文件夹':'文件' + })); + config.el.removeAttr('style'); + ev.stopPropagation(); + ev.preventDefault(); + })); + } + }); + config.el.css({ + left: left, + top: config.ev.clientY - ((this.area[1] - config.ev.clientY) < el_height?el_height:0) + }).removeClass('left_menu right_menu').addClass(this.area[0] - (left + el_width) < 230?'left_menu':'right_menu'); + $(document).one('click',function(e){ + $(config.ev.currentTarget).removeClass('selected'); + config.el.removeAttr('style'); + e.stopPropagation(); + e.preventDefault(); + }); + }, - /** - * @description 返回后缀类型说明 - * @param {String} ext 后缀类型 - * @return {String} 文件类型 - */ - ext_type_tips:function(ext){ - var config = {ai:"Adobe Illustrator格式图形",apk:"安卓安装包",asp:"动态网页文件",bat:"批处理文件",bin:"二进制文件",bas:"BASIC源文件",bak:"备份文件",css:'CSS样式表',cad:"备份文件",cxx:"C++源代码文件",crt:"认证文件",cpp:"C++代码文件",conf:"配置文件",dat:"数据文件",der:"认证文件",doc:"Microsoft Office Word 97-2003 文档",docx:"Microsoft Office Word 2007 文档",exe:"程序应用",gif:"图形文件",go:"Go语言源文件",htm:"超文本文档",html:"超文本文档",ico:"图形文件",java:"Java源文件",jsp:"HTML网页",jpe:"图形文件",jpeg:"图形文件",jpg:"图形文件",log:"日志文件",link:"快捷方式文件",js:"Javascript源文件",mdb:"Microsoft Access数据库",mp3:"音频文件",mp4:"视频文件",mng:"多映像网络图形",msi:"Windows Installe安装文件包",png:"图形文件",py:"Python源代码",pyc:"Python字节码文件",pdf:"文档格式文件",ppt:"Microsoft Powerpoint 97-2003 幻灯片演示文稿",pptx:"Microsoft Powerpoint2007 幻灯片演示文稿",psd:"Adobe photoshop位图文件",pl:"Perl脚本语言",rar:"RAR压缩文件",reg:"注册表文件",sys:"系统文件",sql:"数据库文件",sh:"Shell脚本文件",txt:"文本格式",vb:"Visual Basic的一种宏语言",xml:"扩展标记语言",xls:"Microsoft Office Excel 97-2003 工作表",xlsx:"Microsoft Office Excel 2007 工作表",gz:"压缩文件",zip:"ZIP压缩文件",z:"","7z":"7Z压缩文件",json:'JSON文本'}; - return typeof config[ext] != "undefined"?config[ext]:(ext+'文件'); - }, - /** + /** + * @description 返回后缀类型说明 + * @param {String} ext 后缀类型 + * @return {String} 文件类型 + */ + ext_type_tips:function(ext){ + var config = {ai:"Adobe Illustrator格式图形",apk:"安卓安装包",asp:"动态网页文件",bat:"批处理文件",bin:"二进制文件",bas:"BASIC源文件",bak:"备份文件",css:'CSS样式表',cad:"备份文件",cxx:"C++源代码文件",crt:"认证文件",cpp:"C++代码文件",conf:"配置文件",dat:"数据文件",der:"认证文件",doc:"Microsoft Office Word 97-2003 文档",docx:"Microsoft Office Word 2007 文档",exe:"程序应用",gif:"图形文件",go:"Go语言源文件",htm:"超文本文档",html:"超文本文档",ico:"图形文件",java:"Java源文件",jsp:"HTML网页",jpe:"图形文件",jpeg:"图形文件",jpg:"图形文件",log:"日志文件",link:"快捷方式文件",js:"Javascript源文件",mdb:"Microsoft Access数据库",mp3:"音频文件",mp4:"视频文件",mng:"多映像网络图形",msi:"Windows Installe安装文件包",png:"图形文件",py:"Python源代码",pyc:"Python字节码文件",pdf:"文档格式文件",ppt:"Microsoft Powerpoint 97-2003 幻灯片演示文稿",pptx:"Microsoft Powerpoint2007 幻灯片演示文稿",psd:"Adobe photoshop位图文件",pl:"Perl脚本语言",rar:"RAR压缩文件",reg:"注册表文件",sys:"系统文件",sql:"数据库文件",sh:"Shell脚本文件",txt:"文本格式",vb:"Visual Basic的一种宏语言",xml:"扩展标记语言",xls:"Microsoft Office Excel 97-2003 工作表",xlsx:"Microsoft Office Excel 2007 工作表",gz:"压缩文件",zip:"ZIP压缩文件",z:"","7z":"7Z压缩文件",json:'JSON文本'}; + return typeof config[ext] != "undefined"?config[ext]:(ext+'文件'); + }, + /** * @description 事件绑定 */ - event_bind: function(){ - var _this = this; - //单击选中文件 + event_bind: function(){ + var _this = this; + //单击选中文件 $('#select_dir_list').on('click','tr[data-index]',function(e){ - var index = $(this).data('index'), - _type = $(this).attr('data-type'), - select_name_val = (_this.type_limit=='file' && _type == 'dir')?'':_this.select_list[index].filename; - $(this).addClass('active').siblings().removeClass('active'); - $('[name="select_name"]').val(select_name_val); - if (_type == 'file'){ - $('.file_path_views .forward_path span:eq(1)').addClass('active'); - }else{ - $('.file_path_views .forward_path span:eq(1)').removeClass('active'); - } + var index = $(this).data('index'), + _type = $(this).attr('data-type'), + select_name_val = (_this.type_limit=='file' && _type == 'dir')?'':_this.select_list[index].filename; + $(this).addClass('active').siblings().removeClass('active'); + $('[name="select_name"]').val(select_name_val); + if (_type == 'file'){ + $('.file_path_views .forward_path span:eq(1)').addClass('active'); + }else{ + $('.file_path_views .forward_path span:eq(1)').removeClass('active'); + } }); $('.select_list_body').on('scroll',function(e){ var top = $(this).scrollTop(),left = $(this).scrollLeft(); @@ -2491,8 +2542,8 @@ var bt_tools = { e.stopPropagation(); e.preventDefault(); }); - //文件刷新按钮 - $('.file_path_refresh').on('click',function(){ + //文件刷新按钮 + $('.file_path_refresh').on('click',function(){ _this.render_file_list(); }); $('.select_dir_list thead th .icon-drag').on('mousedown',function(ev){ @@ -2538,433 +2589,444 @@ var bt_tools = { }).blur(function(){ $(this).next().hide(); }); - //提交选中文件 - $('#select_file_directory .select_file_group').on('click','.select_btn_group .btn-success',function(e){ - var select_val = $('[name="select_name"]').val(), - submit_val = ''; - if (select_val == '') { - layer.msg('只能选择' + _this.type_tips,{icon:2}); - }else{ - submit_val = _this.file_path+'/'+select_val; - console.log(submit_val) - } - }); - //新建文件夹 - $('#select_file_directory .select_file_tootls').on('click','.creat_dir',function(e){ - var a = "   "; - if($("#tbody tr").length == 0) { - $("#select_dir_list").append(a) - } else { - $("#select_dir_list tr:first-child").before(a) - } - $(".newFolderName").focus(); - $("#nameOk").click(function() { - var c = $("#newFolderName").val(), - b = $(".file_path_views .path_input").attr("data-path"); - newTxt = b+"/"+ c; - that.$http('CreateDir', {'path': newTxt},function(e){ - if(e.status == true) { - _this.reader_file_list({path:b,is_operating:false}); - layer.msg(e.msg, {icon: 1}); - } else { - layer.msg(e.msg, {icon: 2}); - } - }); - }); - }); - // 左侧根目录点击跳转 - $('#select_mount_list').on('click','.item',function(){ - _this.reader_file_list({path:$(this).attr('data-menu'),is_operating:true}); - }); + //提交选中文件 + $('#select_file_directory .select_file_group').on('click','.select_btn_group .btn-success',function(e){ + var select_val = $('[name="select_name"]').val(), + submit_val = ''; + if (select_val == '') { + layer.msg('只能选择' + _this.type_tips,{icon:2}); + }else{ + submit_val = _this.file_path+'/'+select_val; + console.log(submit_val) + } + }); + //新建文件夹 + $('#select_file_directory .select_file_tootls').on('click','.creat_dir',function(e){ + var a = "   "; + if($("#tbody tr").length == 0) { + $("#select_dir_list").append(a) + } else { + $("#select_dir_list tr:first-child").before(a) + } + $(".newFolderName").focus(); + $("#nameOk").click(function() { + var c = $("#newFolderName").val(), + b = $(".file_path_views .path_input").attr("data-path"); + newTxt = b+"/"+ c; + that.$http('CreateDir', {'path': newTxt},function(e){ + if(e.status == true) { + _this.reader_file_list({path:b,is_operating:false}); + layer.msg(e.msg, {icon: 1}); + } else { + layer.msg(e.msg, {icon: 2}); + } + }); + }); + }); + // 左侧根目录点击跳转 + $('#select_mount_list').on('click','.item',function(){ + _this.reader_file_list({path:$(this).attr('data-menu'),is_operating:true}); + }); - - // 窗口大小限制 - $(window).resize(function(ev){ - if($(this)[0].innerHeight != _this.area[1]){ - _this.area[1] = $(this)[0].innerHeight; - _this.set_file_view(); - } - if($(this)[0].innerWidth != _this.area[0]){ - _this.area[0] = $(this)[0].innerWidth; - _this.set_dir_view_resize(); - // _this.set_file_table_width(); - } - if(_this.vscode_editor.view){ - if(_this.vscode_editor.is_full_min > 0){ - layer.style(_this.vscode_editor.view,{ - 'top':0, - 'left':0,'width':_this.area[0], - 'height':_this.area[1] - }); - } - } - if(_this.vscode_editor.view && $.isEmptyObject(_this.vscode_editor.list)) _this.vscode.layout(); - // console.log($.isEmptyObject(_this.vscode_editor.list)); - }).keydown(function(e){ // 全局按键事件 - e = window.event || e; - var keyCode = e.keyCode,tagName = e.target.tagName.toLowerCase(); - if(keyCode == 8 && tagName !== 'input' && tagName !== 'textarea'){ //退格键 -> 后退操作 - if(_this.vscode_editor.view == null){ - $('.forward_path span:eq(0)').click(); - } - return false; - } - }); - - // 文件路径事件(获取焦点、失去焦点、回车提交) - $('.file_path_input .path_input').on('focus blur keyup',function(e){ - e = e || window.event; - var path = $(this).attr('data-path'); - switch(e.type){ - case 'focus': - $(this).addClass('focus').val(path).prev().hide(); - break; - case 'blur': - $(this).removeClass('focus').val('').prev().show(); - break; - case 'keyup': - if(e.keyCode != 13 && e.type == 'keyup') return false; - var _val = $(this); - if($(this).data('path') != $(this).val()){ - _this.reader_file_list({path:$(this).val(),is_operating:true},function(res){ - if(res.status === false){ - $(_val).val(path); - }else{ - $(_val).val(res.PATH); - $(_val).blur().prev().show(); - } - }); - } - break; - } - e.stopPropagation(); - }); - - // 文件路径点击跳转 - $('.file_path_input .file_dir_view').on('click','.file_dir',function(){ - _this.reader_file_list({path:$(this).attr('title'),is_operating:true}); - }); - - // 操作前进或后退 - $('.forward_path span').click(function(){ - var index = $(this).index(),path = ''; - if(!$(this).hasClass('active')){ - switch(index){ - case 0: - _this.file_pointer = _this.file_pointer - 1 - path = _this.retrun_prev_path(_this.file_path); - break; - case 1: - _this.file_pointer = _this.file_pointer + 1 - //path = _this.file_operating[_this.file_pointer]; - path = _this.file_path + '/' + $(".select_file_group .file_directory").val(); - break; - case 2: - _this.file_pointer = _this.file_pointer - 1 - path = _this.retrun_prev_path(_this.file_path); - break; - } - _this.reader_file_list({path:path,is_operating:false}); - } - }); - - //展示已隐藏的目录 - $('.file_path_input .file_dir_view').on('click','.file_dir_omit',function(e){ - var _this = this,new_down_list = $(this).children('.nav_down_list'); - $(this).addClass('active'); - new_down_list.addClass('show'); - $(document).one('click',function(){ - $(_this).removeClass('active'); - new_down_list.removeClass('show'); - e.stopPropagation(); - }); - e.stopPropagation(); - }); - - // 打开文件夹和文件 --- 双击 - $('#select_dir_list').on('dblclick','tr',function(e){ - if($(e.target).hasClass('file_check')) return false; - var path = $(this).attr('data-path'),type = $(this).attr('data-type'); - if(type == 'dir'){ - _this.reader_file_list({path:_this.file_path + '/' + path}); - }else{ - - } - e.stopPropagation(); - e.preventDefault(); - }); - - // 文件刷新 - $('.file_path_refresh').click(function(){ - _this.reader_file_list({path:_this.file_path}); - }); - - // 上传 - $('.file_nav_view .upload_or_download').on('click',function(e){ - _this.open_upload_view(); - e.stopPropagation(); - e.preventDefault(); - }); - - // 上传与下载下拉点击 - $('.file_nav_view .upload_or_download li').on('click',function(e){ - var type = $(this).data('type') - if(type === 'uploadFile'){ - _this.open_upload_view(); - }else{ - _this.open_download_view(); - } - e.stopPropagation(); - e.preventDefault(); - }); - - // 打开硬盘挂载的目录 - $('.mount_disk_list').on('click','.nav_btn',function(){ - var path = $(this).data('menu'); - _this.reader_file_list({path:path}); - }); - - // 表头点击事件,触发排序字段和排序方式 - $('.file_list_header').on('click','.file_name,.file_size,.file_mtime,.file_accept,.file_user', function (e) { - var _tid = $(this).attr('data-tid'), - _reverse = $(this).find('.icon_sort').hasClass('active'), - _active = $(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 (!_active) _reverse = true - bt.set_cookie('files_sort', _tid); - bt.set_cookie('name_reverse', _reverse ? 1 : 0); - _this.reader_file_list(); - return false; - }); - - // 设置排序显示 - $('.file_list_header .file_th').each(function (index, item) { - var files_sort = bt.get_cookie('files_sort'), - name_reverse = bt.get_cookie('name_reverse'); - if ($(this).attr('data-tid') === files_sort){ - $(this).addClass('active').siblings().removeClass('active').find('.icon_sort').removeClass('active').empty(); - $(this).find('.icon_sort').html(''); - if (name_reverse === 0) $(this).find('.icon_sort').addClass('active'); - } - }); - - // 全选选中文件 - $('.file_list_header .file_check').on('click', function (e){ - var checkbox = parseInt($(this).data('checkbox')); - switch(checkbox){ - case 0: - $(this).addClass('active').removeClass('active_2').data('checkbox',1); - $('.file_list_content .file_tr').addClass('active').removeClass('active_2'); - _this.file_table_arry = _this.file_list; - break; - case 2: - $(this).addClass('active').removeClass('active_2').data('checkbox',1); - $('.file_list_content .file_tr').addClass('active'); - _this.file_table_arry = _this.file_list; - break; - case 1: - $(this).removeClass('active active_2').data('checkbox',0); - $('.file_list_content .file_tr').removeClass('active'); - _this.file_table_arry = []; - break; - } - }); - - // 选中文件 - $('.file_list_content').on('click', '.file_check', function (e) { //列表选择 - var _tr = $(this).parents('.file_tr'),index = _tr.data('index'),header_check = $('.file_list_header .file_check'),filename = _tr.attr('data-filename'); - $('.selection_right_menu').removeAttr('style'); - if(_tr.hasClass('active')){ - _tr.removeClass('active'); - _this.remove_check_file(_this.file_table_arry,'filename',filename); - if(_this.file_table_arry.length > 0){ - header_check.addClass('active_2').removeClass('active').data('checkbox',2); - }else if(_this.file_table_arry.length == 0){ - header_check.removeClass('active active_2').data('checkbox',0); - } - }else{ - _tr.addClass('active'); - _tr.attr('data-filename',_this.file_list[index]['filename']); - if(_this.file_table_arry.length == _this.file_list.length){ - header_check.addClass('active').removeClass('active_2').data('checkbox',1); - }else{ - header_check.addClass('active_2').removeClass('active').data('checkbox',2); - } - _this.file_table_arry.push(_this.file_list[index]); - } - e.stopPropagation(); - }); - - // 文件列表滚动条事件 - $('.file_list_content').scroll(function(e){ - 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(e){ - $('.selection_right_menu').removeAttr('style'); - $(this).find('.file_checkbox .file_check').click(); - e.stopPropagation(); - e.preventDefault(); - }); - - // 打开文件夹或文件 --- 文件名单击 - $('.file_table_view .file_list_content').on('click','.file_title i',function(e){ - var file_tr = $(this).parents('.file_tr'),index = file_tr.data('index'),data = _this.file_list[index]; - if(data.type == 'dir'){ - _this.reader_file_list({path:_this.file_path + '/' + data['filename']}); - }else{ - - } - e.stopPropagation(); - }); - - // 打开文件的分享状态 - $('.file_table_view .file_list_content').on('click','.file_name .icon-share1',function(e){ - var file_tr = $(this).parents('.file_tr'),index = file_tr.data('index'),data = _this.file_list[index]; - _this.info_file_share(data,file_tr); - e.stopPropagation(); - }); - - - // 打开文件的收藏夹状态 - $('.file_table_view .file_list_content').on('click','.file_name .icon-favorites',function(e){ - var file_tr = $(this).parents('.file_tr'),index = file_tr.data('index'),data = _this.file_list[index]; - data.typeText = data.type?'文件夹':'文件'; - _this.cancel_file_favorites(data,file_tr); - e.stopPropagation(); - }); - - - // 打开文件夹和文件 --- 双击 - $('.file_table_view .file_list_content').on('dblclick','.file_tr',function(e){ - if($(e.target).hasClass('file_check')) return false; - var index = $(this).data('index'),data = _this.file_list[index]; - if(data.type == 'dir'){ - - _this.reader_file_list({path:_this.file_path + '/' + data['filename']}); - }else{ - - } - e.stopPropagation(); - e.preventDefault(); - }); - - // 文件夹和文件鼠标右键 - $('.file_list_content').on('contextmenu','.file_tr',function(ev){ - var _that = this; - if(ev.which == 3){ - _this.render_file_groud_menu(ev,this); - $('.content_right_menu').removeAttr('style'); - $(this).addClass('selected').siblings().removeClass('selected'); - $(document).one('click',function(e){ - $(_that).removeClass('selected'); - $('.selection_right_menu').removeAttr('style'); - e.stopPropagation(); - e.preventDefault(); - }); - } - ev.stopPropagation(); - ev.preventDefault(); - }); - - // 文件空白区域右键菜单 - $('.file_list_content').on('contextmenu',function(ev){ - var content_right_menu = $('.content_right_menu'),content_menu_width = content_right_menu.width(),content_menu_height = content_right_menu.height(),_that = this; - if(ev.which == 3){ - $('.selection_right_menu').removeAttr('style'); - _this.render_file_all_menu(ev,this) - } - ev.stopPropagation(); - ev.preventDefault(); - }); - - //设置单页显示的数量,默认为100,设置local本地缓存 - $('.filePage').on('change','.showRow',function(){ - var val = $(this).val(); - bt.set_storage('showRow',val); - _this.reader_file_list(); - }); - - // 获取文件夹大小 - $('.file_list_content').on('click','.folder_size',function(e){ - var data = _this.file_list[$(this).parents('.file_tr').data('index')],_this = this; - _this.get_file_size({path:data.path},function(res){ - $(_this).text(bt.format_size(res.size)); - }); - e.stopPropagation(); - e.preventDefault(); - }); - - // 视图调整 - $('.cut_view_model').on('click',function(){ - var type = $(this).data('type'); - $('.file_table_view').addClass(type == 'icon'?'icon_view':'list_view').removeClass(type != 'icon'?'icon_view':'list_view'); - $(this).addClass('active').siblings().removeClass('active'); - }); - - }, - /** - * @description 设置文件前进或后退状态 - * @returns void - */ - set_file_forward:function(){ - var _this = this,forward_path = $('.forward_path span'); - console.log(_this.file_operation) - if(_this.file_operating.length == 1){ - forward_path.addClass('active'); - }else if(_this.file_pointer == _this.file_operating.length -1){ - forward_path.eq(0).removeClass('active'); - forward_path.eq(1).addClass('active'); - }else if(_this.file_pointer == 0){ - forward_path.eq(0).addClass('active'); - forward_path.eq(1).removeClass('active'); - }else{ - forward_path.removeClass('active'); - } - }, - /** - * @description 设置文件视图 - * @returns void - */ - set_file_view:function(){ - var file_list_content = $('.file_list_content'),height = this.area[1] - 170; - $('.file_bodys').height(this.area[1] - 100); - if((this.file_list.length * 50) > height){ - file_list_content.attr('data-height',file_list_content.data('height') || file_list_content.height()).height(height); - $('.file_shadow_bottom').css('opacity',1); - }else{ - file_list_content.height(height); - $('.file_shadow_top,.file_shadow_bottom').css('opacity',0); - } - }, - /** - * @description 清除表格选中数据和样式 - * @returns void - */ - clear_table_active:function(){ - this.file_table_arry = []; - $('.file_list_header .file_check').removeClass('active active_2'); - $('.file_list_content .file_tr').removeClass('active'); - }, + + // 窗口大小限制 + $(window).resize(function(ev){ + if($(this)[0].innerHeight != _this.area[1]){ + _this.area[1] = $(this)[0].innerHeight; + _this.set_file_view(); + } + if($(this)[0].innerWidth != _this.area[0]){ + _this.area[0] = $(this)[0].innerWidth; + _this.set_dir_view_resize(); + // _this.set_file_table_width(); + } + if(_this.vscode_editor.view){ + if(_this.vscode_editor.is_full_min > 0){ + layer.style(_this.vscode_editor.view,{ + 'top':0, + 'left':0,'width':_this.area[0], + 'height':_this.area[1] + }); + } + } + if(_this.vscode_editor.view && $.isEmptyObject(_this.vscode_editor.list)) _this.vscode.layout(); + // console.log($.isEmptyObject(_this.vscode_editor.list)); + }).keydown(function(e){ // 全局按键事件 + e = window.event || e; + var keyCode = e.keyCode,tagName = e.target.tagName.toLowerCase(); + if(keyCode == 8 && tagName !== 'input' && tagName !== 'textarea'){ //退格键 -> 后退操作 + if(_this.vscode_editor.view == null){ + $('.forward_path span:eq(0)').click(); + } + return false; + } + }); + + // 文件路径事件(获取焦点、失去焦点、回车提交) + $('.file_path_input .path_input').on('focus blur keyup',function(e){ + e = e || window.event; + var path = $(this).attr('data-path'); + switch(e.type){ + case 'focus': + $(this).addClass('focus').val(path).prev().hide(); + break; + case 'blur': + $(this).removeClass('focus').val('').prev().show(); + break; + case 'keyup': + if(e.keyCode != 13 && e.type == 'keyup') return false; + var _val = $(this); + if($(this).data('path') != $(this).val()){ + _this.reader_file_list({path:$(this).val(),is_operating:true},function(res){ + if(res.status === false){ + $(_val).val(path); + }else{ + $(_val).val(res.PATH); + $(_val).blur().prev().show(); + } + }); + } + break; + } + e.stopPropagation(); + }); + + // 文件路径点击跳转 + $('.file_path_input .file_dir_view').on('click','.file_dir',function(){ + _this.reader_file_list({path:$(this).attr('title'),is_operating:true}); + }); + + // 操作前进或后退 + $('.forward_path span').click(function(){ + var index = $(this).index(),path = ''; + if(!$(this).hasClass('active')){ + switch(index){ + case 0: + _this.file_pointer = _this.file_pointer - 1 + path = _this.retrun_prev_path(_this.file_path); + break; + case 1: + _this.file_pointer = _this.file_pointer + 1 + //path = _this.file_operating[_this.file_pointer]; + path = _this.file_path + '/' + $(".select_file_group .file_directory").val(); + break; + case 2: + _this.file_pointer = _this.file_pointer - 1 + path = _this.retrun_prev_path(_this.file_path); + break; + } + _this.reader_file_list({path:path,is_operating:false}); + } + }); + + //展示已隐藏的目录 + $('.file_path_input .file_dir_view').on('click','.file_dir_omit',function(e){ + var _this = this,new_down_list = $(this).children('.nav_down_list'); + $(this).addClass('active'); + new_down_list.addClass('show'); + $(document).one('click',function(){ + $(_this).removeClass('active'); + new_down_list.removeClass('show'); + e.stopPropagation(); + }); + e.stopPropagation(); + }); + + // 打开文件夹和文件 --- 双击 + $('#select_dir_list').on('dblclick','tr',function(e){ + if($(e.target).hasClass('file_check')) return false; + var path = $(this).attr('data-path'),type = $(this).attr('data-type'); + if(type == 'dir'){ + _this.reader_file_list({path:_this.file_path + '/' + path}); + }else{ + + } + e.stopPropagation(); + e.preventDefault(); + }); + + // 文件刷新 + $('.file_path_refresh').click(function(){ + _this.reader_file_list({path:_this.file_path}); + }); + + // 上传 + $('.file_nav_view .upload_or_download').on('click',function(e){ + _this.open_upload_view(); + e.stopPropagation(); + e.preventDefault(); + }); + + // 上传与下载下拉点击 + $('.file_nav_view .upload_or_download li').on('click',function(e){ + var type = $(this).data('type') + if(type === 'uploadFile'){ + _this.open_upload_view(); + }else{ + _this.open_download_view(); + } + e.stopPropagation(); + e.preventDefault(); + }); + + // 打开硬盘挂载的目录 + $('.mount_disk_list').on('click','.nav_btn',function(){ + var path = $(this).data('menu'); + _this.reader_file_list({path:path}); + }); + + // 表头点击事件,触发排序字段和排序方式 + $('.file_list_header').on('click','.file_name,.file_size,.file_mtime,.file_accept,.file_user', function (e) { + var _tid = $(this).attr('data-tid'), + _reverse = $(this).find('.icon_sort').hasClass('active'), + _active = $(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 (!_active) _reverse = true + bt.set_cookie('files_sort', _tid); + bt.set_cookie('name_reverse', _reverse ? 1 : 0); + _this.reader_file_list(); + return false; + }); + + // 设置排序显示 + $('.file_list_header .file_th').each(function (index, item) { + var files_sort = bt.get_cookie('files_sort'), + name_reverse = bt.get_cookie('name_reverse'); + if ($(this).attr('data-tid') === files_sort){ + $(this).addClass('active').siblings().removeClass('active').find('.icon_sort').removeClass('active').empty(); + $(this).find('.icon_sort').html(''); + if (name_reverse === 0) $(this).find('.icon_sort').addClass('active'); + } + }); + + // 全选选中文件 + $('.file_list_header .file_check').on('click', function (e){ + var checkbox = parseInt($(this).data('checkbox')); + switch(checkbox){ + case 0: + $(this).addClass('active').removeClass('active_2').data('checkbox',1); + $('.file_list_content .file_tr').addClass('active').removeClass('active_2'); + _this.file_table_arry = _this.file_list; + break; + case 2: + $(this).addClass('active').removeClass('active_2').data('checkbox',1); + $('.file_list_content .file_tr').addClass('active'); + _this.file_table_arry = _this.file_list; + break; + case 1: + $(this).removeClass('active active_2').data('checkbox',0); + $('.file_list_content .file_tr').removeClass('active'); + _this.file_table_arry = []; + break; + } + }); + + // 选中文件 + $('.file_list_content').on('click', '.file_check', function (e) { //列表选择 + var _tr = $(this).parents('.file_tr'),index = _tr.data('index'),header_check = $('.file_list_header .file_check'),filename = _tr.attr('data-filename'); + $('.selection_right_menu').removeAttr('style'); + if(_tr.hasClass('active')){ + _tr.removeClass('active'); + _this.remove_check_file(_this.file_table_arry,'filename',filename); + if(_this.file_table_arry.length > 0){ + header_check.addClass('active_2').removeClass('active').data('checkbox',2); + }else if(_this.file_table_arry.length == 0){ + header_check.removeClass('active active_2').data('checkbox',0); + } + }else{ + _tr.addClass('active'); + _tr.attr('data-filename',_this.file_list[index]['filename']); + if(_this.file_table_arry.length == _this.file_list.length){ + header_check.addClass('active').removeClass('active_2').data('checkbox',1); + }else{ + header_check.addClass('active_2').removeClass('active').data('checkbox',2); + } + _this.file_table_arry.push(_this.file_list[index]); + } + e.stopPropagation(); + }); + + // 文件列表滚动条事件 + $('.file_list_content').scroll(function(e){ + 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(e){ + $('.selection_right_menu').removeAttr('style'); + $(this).find('.file_checkbox .file_check').click(); + e.stopPropagation(); + e.preventDefault(); + }); + + // 打开文件夹或文件 --- 文件名单击 + $('.file_table_view .file_list_content').on('click','.file_title i',function(e){ + var file_tr = $(this).parents('.file_tr'),index = file_tr.data('index'),data = _this.file_list[index]; + if(data.type == 'dir'){ + _this.reader_file_list({path:_this.file_path + '/' + data['filename']}); + }else{ + + } + e.stopPropagation(); + }); + + // 打开文件的分享状态 + $('.file_table_view .file_list_content').on('click','.file_name .icon-share1',function(e){ + var file_tr = $(this).parents('.file_tr'),index = file_tr.data('index'),data = _this.file_list[index]; + _this.info_file_share(data,file_tr); + e.stopPropagation(); + }); + + + // 打开文件的收藏夹状态 + $('.file_table_view .file_list_content').on('click','.file_name .icon-favorites',function(e){ + var file_tr = $(this).parents('.file_tr'),index = file_tr.data('index'),data = _this.file_list[index]; + data.typeText = data.type?'文件夹':'文件'; + _this.cancel_file_favorites(data,file_tr); + e.stopPropagation(); + }); + + + // 打开文件夹和文件 --- 双击 + $('.file_table_view .file_list_content').on('dblclick','.file_tr',function(e){ + if($(e.target).hasClass('file_check')) return false; + var index = $(this).data('index'),data = _this.file_list[index]; + if(data.type == 'dir'){ + + _this.reader_file_list({path:_this.file_path + '/' + data['filename']}); + }else{ + + } + e.stopPropagation(); + e.preventDefault(); + }); + + // 文件夹和文件鼠标右键 + $('.file_list_content').on('contextmenu','.file_tr',function(ev){ + var _that = this; + if(ev.which == 3){ + _this.render_file_groud_menu(ev,this); + $('.content_right_menu').removeAttr('style'); + $(this).addClass('selected').siblings().removeClass('selected'); + $(document).one('click',function(e){ + $(_that).removeClass('selected'); + $('.selection_right_menu').removeAttr('style'); + e.stopPropagation(); + e.preventDefault(); + }); + } + ev.stopPropagation(); + ev.preventDefault(); + }); + + // 文件空白区域右键菜单 + $('.file_list_content').on('contextmenu',function(ev){ + var content_right_menu = $('.content_right_menu'),content_menu_width = content_right_menu.width(),content_menu_height = content_right_menu.height(),_that = this; + if(ev.which == 3){ + $('.selection_right_menu').removeAttr('style'); + _this.render_file_all_menu(ev,this) + } + ev.stopPropagation(); + ev.preventDefault(); + }); + + //设置单页显示的数量,默认为100,设置local本地缓存 + $('.filePage').on('change','.showRow',function(){ + var val = $(this).val(); + bt.set_storage('showRow',val); + _this.reader_file_list(); + }); + + // 获取文件夹大小 + $('.file_list_content').on('click','.folder_size',function(e){ + var data = _this.file_list[$(this).parents('.file_tr').data('index')],_this = this; + _this.get_file_size({path:data.path},function(res){ + $(_this).text(bt.format_size(res.size)); + }); + e.stopPropagation(); + e.preventDefault(); + }); + + // 视图调整 + $('.cut_view_model').on('click',function(){ + var type = $(this).data('type'); + $('.file_table_view').addClass(type == 'icon'?'icon_view':'list_view').removeClass(type != 'icon'?'icon_view':'list_view'); + $(this).addClass('active').siblings().removeClass('active'); + }); + + }, + /** + * @description 设置文件前进或后退状态 + * @returns void + */ + set_file_forward:function(){ + var _this = this,forward_path = $('.forward_path span'); + console.log(_this.file_operation) + if(_this.file_operating.length == 1){ + forward_path.addClass('active'); + }else if(_this.file_pointer == _this.file_operating.length -1){ + forward_path.eq(0).removeClass('active'); + forward_path.eq(1).addClass('active'); + }else if(_this.file_pointer == 0){ + forward_path.eq(0).addClass('active'); + forward_path.eq(1).removeClass('active'); + }else{ + forward_path.removeClass('active'); } - select_file.reader_view(); + }, + /** + * @description 设置文件视图 + * @returns void + */ + set_file_view:function(){ + var file_list_content = $('.file_list_content'),height = this.area[1] - 170; + $('.file_bodys').height(this.area[1] - 100); + if((this.file_list.length * 50) > height){ + file_list_content.attr('data-height',file_list_content.data('height') || file_list_content.height()).height(height); + $('.file_shadow_bottom').css('opacity',1); + }else{ + file_list_content.height(height); + $('.file_shadow_top,.file_shadow_bottom').css('opacity',0); + } + }, + /** + * @description 清除表格选中数据和样式 + * @returns void + */ + clear_table_active:function(){ + this.file_table_arry = []; + $('.file_list_header .file_check').removeClass('active active_2'); + $('.file_list_content .file_tr').removeClass('active'); + }, + } + select_file.reader_view(); select_file.event_bind(); - }, + }, + /** + * @description 固定表头 + * @param {string} el DOM选择器 + * @return void + */ + $fixed_table_thead:function(el){ + $(el).scroll(function(){ + var scrollTop = this.scrollTop; + this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)'; + }); + }, /** * @description 请求封装 @@ -2974,111 +3036,111 @@ var bt_tools = { * @returns void 无 */ send:function(param1,param2,param3,param4,param5,param6){ - var params = {},success = null,error = null,config = [],param_one = ''; - $.each(arguments,function(index,items){ - config.push([items,typeof items]); - }); - function diff_data(i){ - try { - success = config[i][1] == "function"?config[i][0]:null; - error = config[(i+1)][1] == "function"?config[(i+1)][0]:null; - } catch (error){} - } - param_one = config[0]; - switch(param_one[1]){ - case "string": - $.each(config,function(index,items){ - var value = items[0],type = items[1]; - if(index > 1 && (type == "boolean" || type == "string" || type == "object")){ - var arry = param_one[0].split('/'); - params['url'] = '/'+ arry[0] +'?action=' + arry[1]; - params['load'] = value; - if(type == "object"){ - params['load'] = value.load; - params['tips'] = value.tips; - params['verify'] = value.verify; - } - return false; - }else{ - params['url'] = param_one[0]; - } - }); - if(config[1][1] === "object"){ - params['data'] = config[1][0]; - diff_data(2); - }else{ - diff_data(1); - } - break; - case 'object': - params['url'] = param_one[0].url; - params['data'] = param_one[0].data || {}; - $.each(config,function(index,items){ - var value = items[0],type = items[1]; - if(index > 1 && (type == "boolean" || type == "string" || type == "object")){ - params['load'] = items; - if(type == "object"){ - params['load'] = value.load; - params['tips'] = value.tips; - } - return true; - } - }); - if(config[1][1] === "object"){ - params['data'] = config[1][0]; - diff_data(2); - }else{ - diff_data(1); - } - break; - } - if(params.load) params.load = this.load(params.load); - $.ajax({ - type:params.type|| "POST", - url:params.url, - data:params.data || {}, - dataType: params.dataType || "JSON", - complete:function(){ - if(params.load) params.load.close(); - }, - success:function (res){ - if(params.verify){ - if(success) success(res); - return false; - } - if(typeof res === "string"){ - layer.msg(res,{icon:2,time:0,closeBtn:2}); - return false; - } - if(params.bacth){ - if(success) success(res); - return false; - } - if(res.status === false){ - bt_tools.msg(res); - return false; - } - if(params.tips){ - bt_tools.msg(res); - } - if(success) success(res); - }, - error:function(er){ - if(error) error(er); - layer.closeAll('dialog'); - layer.closeAll('loading'); - layer.msg('Service response error:'+ er.status +'
                          error msg:'+er.statusText+'
                          URL:' + params.url+'
                          param:' + JSON.stringify(params.data) ,{icon:2,time:0,closeBtn:2}); - } - }); - }, + var params = {},success = null,error = null,config = [],param_one = ''; + $.each(arguments,function(index,items){ + config.push([items,typeof items]); + }); + function diff_data(i){ + try { + success = config[i][1] == "function"?config[i][0]:null; + error = config[(i+1)][1] == "function"?config[(i+1)][0]:null; + } catch (error){} + } + param_one = config[0]; + switch(param_one[1]){ + case "string": + $.each(config,function(index,items){ + var value = items[0],type = items[1]; + if(index > 1 && (type == "boolean" || type == "string" || type == "object")){ + var arry = param_one[0].split('/'); + params['url'] = '/'+ arry[0] +'?action=' + arry[1]; + params['load'] = value; + if(type == "object"){ + params['load'] = value.load; + params['tips'] = value.tips; + params['verify'] = value.verify; + } + return false; + }else{ + params['url'] = param_one[0]; + } + }); + if(config[1][1] === "object"){ + params['data'] = config[1][0]; + diff_data(2); + }else{ + diff_data(1); + } + break; + case 'object': + params['url'] = param_one[0].url; + params['data'] = param_one[0].data || {}; + $.each(config,function(index,items){ + var value = items[0],type = items[1]; + if(index > 1 && (type == "boolean" || type == "string" || type == "object")){ + params['load'] = items; + if(type == "object"){ + params['load'] = value.load; + params['tips'] = value.tips; + } + return true; + } + }); + if(config[1][1] === "object"){ + params['data'] = config[1][0]; + diff_data(2); + }else{ + diff_data(1); + } + break; + } + if(params.load) params.load = this.load(params.load); + $.ajax({ + type:params.type|| "POST", + url:params.url, + data:params.data || {}, + dataType: params.dataType || "JSON", + complete:function(){ + if(params.load) params.load.close(); + }, + success:function (res){ + if(params.verify){ + if(success) success(res); + return false; + } + if(typeof res === "string"){ + layer.msg(res,{icon:2,time:0,closeBtn:2}); + return false; + } + if(params.bacth){ + if(success) success(res); + return false; + } + if(res.status === false){ + bt_tools.msg(res); + return false; + } + if(params.tips){ + bt_tools.msg(res); + } + if(success) success(res); + }, + error:function(er){ + if(error) error(er); + layer.closeAll('dialog'); + layer.closeAll('loading'); + layer.msg('Service response error:'+ er.status +'
                          error msg:'+er.statusText+'
                          URL:' + params.url+'
                          param:' + JSON.stringify(params.data) ,{icon:2,time:0,closeBtn:2}); + } + }); + }, }; -$.fn.serializeObject = function(){ - var hasOwnProperty = Object.prototype.hasOwnProperty; - return this.serializeArray().reduce(function(data,pair){ - if(!hasOwnProperty.call(data,pair.name)){ - data[pair.name]=pair.value; - } - return data; - },{}); +$.fn.serializeObject = function(){ + var hasOwnProperty = Object.prototype.hasOwnProperty; + return this.serializeArray().reduce(function(data,pair){ + if(!hasOwnProperty.call(data,pair.name)){ + data[pair.name]=pair.value; + } + return data; + },{}); }; diff --git a/BTPanel/static/js/tools.min.js b/BTPanel/static/js/tools.min.js index 1ebeb6f1..27e0fdf5 100644 --- a/BTPanel/static/js/tools.min.js +++ b/BTPanel/static/js/tools.min.js @@ -1,3 +1,3 @@ -var bt_tools={table:function(e){function t(e){this.config=e,this.$load()}return t.prototype={style_list:[],event_list:{},checkbox_list:[],batch_active:{},event_rows_model:{},data:[],page:"",column:[],batch_thread:[],random:bt.get_random(5),init:!1,checked:!1,$load:function(){var e=this,t=$('');this.config.init&&this.config.init(this),$(this.config.el).addClass("bt_table").append(t),t.focus(function(){return e.checked=!0,!1}).blur(function(t){e.checked=!1,e.checked_blur&&e.checked_blur(t)}),this.config.minWidth&&this.style_list.push({className:this.config.el+" table",css:"min-width:"+this.config.minWidth}),this.config.tootls?this.$reader_tootls(this.config.tootls):0===$(e.config.el+".divtable").length&&$(e.config.el).append('
                          '),this.$reader_content(),void 0!==e.config.url?this.$refresh_table_list():void 0!==this.config.data?this.$reader_content(this.config.data):alert(lan.public.miss_data_or_url),this.config.methods&&$.extend(this,this.config.methods)},$refresh_table_list:function(e){var t,i=this;e&&(t=bt.load(lan.database.get_data)),this.$http(function(a,s){e&&t.close(),i.$reader_content(a,s)})},$active_focus:function(e){var t=this;$("#checked_"+t.random).focus(),this.checked_blur=function(i){setTimeout(function(){e&&e(i),delete t.checked_blur},200)}},$reader_content:function(e,t){var i=this,a="",s="",n=0,l=this.config.column,c={},o=$(i.config.el+" .checkbox_"+i.random);e=e||[],this.data=e,o.length&&(o.removeClass("active selected"),i.checkbox_list=[],i.$set_batch_view());do{var r=e[n],d=0;e.length>0&&(s+="");for(var p=0;p"+("checkbox"==_.type?'':""+_.title+"")+(_.sort?'':"")+"",0===n&&(!c[h]&&_.sort&&(c[h]={event:this.config.sortEvent,eventType:"click",type:"sort"}),c[f]||(c[f]={event:_.checked,eventType:"click",type:"checkbox"}))}if(void 0!==r){var v="",b="event-"+_.fid+"-"+this.random;_.template?v=i.$custom_template_render(_,r,p):(v=this.$reader_column_type(_,r),c=$.extend(c,v[1]),v=v[0]),s+=""+v+"",0===n&&!c[b]&&_.event&&(c[b]={event:_.event,eventType:"click",type:"rows"})}}}e.length>0&&(s+=""),0==e.length&&(s+=''+(this.config.default||lan.public.empty)+""),n++}while(n'+a+""+s+"
                          "),this.init=!0,this.config.success&&this.config.success(this)},$custom_template_render:function(e,t,i){var a="event-"+e.fid+"-"+this.random,s=e.template(t,i),n=$(s);return n.length>0?template=n.addClass(a)[0].outerHTML:"text"===e.type?template=''+s+"":template=''+s+"",template},$modify_row_data:function(e){this.event_rows_model.rows=$.extend(this.event_rows_model.rows,e);var t=this.event_rows_model,i=null;i=void 0!==t.model.template?$(this.$custom_template_render(t.model,t.rows,t.index)):$(this.$reader_column_type(t.model,t.rows)[0]),t.el.replaceWith(i),t.el=i},$batch_success_table:function(e){var t=this;bt.open({type:1,title:e.title,area:e.area||["380px","350px"],shadeClose:!1,closeBtn:2,content:e.content||'
                          '+e.title+" "+lan.public.success+'
                          "+e.html+"
                          '+e.th+''+lan.public.result+"
                          ",success:function(){t.$fixed_table_thead(".fiexd_thead")}})},$delete_table_row:function(e){this.data.splice(e,1),this.$reader_content(this.data)},$fixed_table_thead:function(e){$(e).scroll(function(){var e=this.scrollTop;this.querySelector("thead").style.transform="translateY("+e+"px)"})},$set_batch_view:function(){var e=$(this.config.el+" .bt_select_value"),t=$(this.config.el+" .bt_table_select_group").next();if(void 0!==this.config.batch){t=$(this.config.el+" .set_batch_option");if(void 0!==this.config.batch.config)this.checkbox_list.length>0?t.removeClass("bt-disabled btn-default").addClass("btn-success").text(lan.public.please_choose+this.batch_active.title+"("+lan.public.selected+this.checkbox_list.length+")"):t.addClass("bt-disabled btn-default").removeClass("btn-success").text(lan.public.please_choose+this.batch_active.title);else{e=$(this.config.el+" .bt_select_value");this.checkbox_list.length>0?(t.removeClass("bt-disabled btn-default").addClass("btn-success").prev().removeClass("bt-disabled"),e.find("em").html("("+lan.public.selected+this.checkbox_list.length+")")):(t.addClass("bt-disabled btn-default").removeClass("btn-success").prev().addClass("bt-disabled"),e.children().eq(0).html(lan.public.please_choose+""),e.next().find("li").removeClass("active"),this.batch_active={})}}return!1},$reader_column_type:function(e,t){var i=t[e.fid],a={},s="",n=[],l=this;switch(e.type){case"text":n=[i,a];break;case"checkbox":n=['',a];break;case"password":s="ico_"+l.random+"_";var c='**********';e.eye_open&&(c+='',a[s+"eye_open"]||(a[s+"eye_open"]={type:"eye_open_password"})),e.copy&&(c+='',a[s+"copy"]||(a[s+"copy"]={type:"copy_password"})),n=[c,a];break;case"link":s="click_"+e.fid+"_"+this.random,!a[s]&&e.event&&(a[s]={event:e.event,type:"rows"}),n=[''+i+"",a];break;case"input":blurName="blur_"+e.fid+"_"+this.random,keyupName="keyup_"+e.fid+"_"+this.random,!a[blurName]&&e.blur&&(a[blurName]={event:e.blur,eventType:"blur",type:"rows"}),!a[keyupName]&&e.keyup&&(a[keyupName]={event:e.keyup,eventType:"keyup",type:"rows"}),n=['',a];break;case"status":var o="";s="click_"+e.fid+"_"+this.random,$.each(e.config.list,function(e,t){t[0]===i&&(o=t)}),!a[s]&&e.event&&(a[s]={event:e.event,type:"rows"}),n=['-1?"":o[2])+'" style="'+(o[2].indexOf("#")>-1?"color:"+o[2]+";":"")+'" href="javascript:;">'+o[1]+""+(e.config.icon?'':"")+"",a];break;case"switch":break;case"group":var r="";$.each(e.group,function(i,n){if(s=(e.fid?e.fid:"group")+"_"+i+"_"+l.random,n.template){var c=n.template(t,l),o=$(c);o.length>0?r+=o.addClass(s)[0].outerHTML:r+=''+c+""}else r+='"+n.title+"";r+=e.group.length-1!=i?" | ":"",!a[s]&&n.event&&(a[s]={event:n.event,type:"rows"})}),n=[r,a];break;default:n=[i,a]}return n},$reader_tootls:function(e){function t(e,t){var i=bt.load(e.title+lan.site.executing),s={},n=a.$get_data_batch_list(e.paramId,t);e.beforeRequest?s[e.paramName]=e.beforeRequest(t):s[e.paramName]=n.join(","),bt_tools.send({url:e.url||a.config.batch.url,data:$.extend(e.param||{},s)},function(s){if(i.close(),!s.status)return!1;if(void 0===e.tips||e.tips){var n="";$.each(s.error,function(e,t){n+=""+e+'
                          '+t+"
                          "}),$.each(s.success,function(e,t){n+=""+t+'
                          '+lan.public.success+"
                          "}),a.$batch_success_table({title:e.title,th:e.theadName,html:n}),a.$refresh_table_list(!0)}e.success&&e.success(s,t,a)})}function i(e,i,a){e.callback?e.callback({loadT:0,config:{},check_list:i,bacth_status:!0,start_batch:function(t,i){var a=this;e.load&&(this.loadT=layer.msg(lan.public.executeing+e.title+','+lan.public.schedule+":0/"+this.check_list.length+","+lan.public.please_wait+(e.clear?'cancel':""),$.extend({icon:16,skin:"batch_tips",shade:.3,time:0},e.clear?{area:"420px"}:{})),$("#layui-layer"+a.loadT).on("click",".clear_batch",function(){a.clear_bacth()})),this.config={param:t,url:e.url},this.bacth(i)},bacth:function(t,s){var n=this,l={};if("function"==typeof t&&(s=t,t=0),t'+lan.public.executeing+e.title+','+lan.public.schedule+":"+t+"/"+n.check_list.length+","+lan.public.please_wait+(e.clear?'cancel':"")),bt_tools.send({url:this.config.url,data:this.config.param,bacth:!0},function(e){$.extend(n.check_list[t],{request:{status:"boolean"==typeof e.status&&e.status,msg:e.msg||lan.public.request_error}}),t++,n.bacth(t,s)})}else a&&a(),s(this.check_list),layer.close(this.loadT)},clear_bacth:function(){this.bacth_status=!1,layer.close(this.loadT)}}):e.confirm?t(e,i):e.confirmVerify?bt.show_confirm(e.title+lan.public.in_bulk,e.title+lan.public.in_bulk+","+lan.public.risk_prompt,t):bt.confirm({title:e.title+lan.public.in_bulk,msg:e.title+lan.public.in_bulk+","+lan.public.risk_prompt},function(){t&&t(e,i)})}for(var a=this,s={},n=0;n
                          ',c.list&&$.each(c.list,function(e,t){'
                        • "}),t.init&&setTimeout(function(){t.init(i)},400)):l+='",s[i]||(s[i]={event:t.event,type:"button"})});break;case"search":this.config.search=c;var o="search_input_"+this.random,r="search_btn_"+this.random;l='',s[o]||(s[o]={eventType:"keyup",type:"search_input"}),s[r]||(s[r]={type:"search_btn"});break;case"batch":this.config.batch=c;var d=[],p="",_=c.config;void 0!==c.config?(a.batch_active=_,$(a.config.el).on("click",".set_batch_option",function(e){for(var s=[],n=0;n'+i.title+""}),delete t.group):(d.push(t),p+='
                        • '+t.title+"
                        • ")}),$(a.config.el).on("click",".bt_table_select_group .bt_select_value",function(e){var t=$(this).parent(),i=t.find(".bt_selects"),s=t.offset(),n=a.$get_win_area();return t.hasClass("bt-disabled")?(layer.tips(a.config.batch.disabledSelectValue,t,{tips:[1,"red"],time:2e3}),!1):(t.hasClass("active")?t.removeClass("active"):t.addClass("active"),i.height()>n[1]-s.top?i.addClass("top"):i.removeClass("top"),$(document).one("click",function(){return $(a.config.el).find(".bt_table_select_group").removeClass("active"),!1}),!1)}),$(a.config.el).on("click",".bt_table_select_group .item",function(e){var t=$(this).text(),i=$(this).index();$(this).addClass("active").siblings().removeClass("active"),$(a.config.el+" .bt_select_tips").html(t+lan.public.in_bulk+"("+lan.site.have_been_selected+a.checkbox_list.length+")"),a.batch_active=d[i],a.checked||$(".bt_table_select_group").removeClass("active")}),$(a.config.el).on("click",".set_batch_option",function(e){var s=[],n=a.batch_active;if($(this).hasClass("bt-disabled"))return layer.tips(a.config.batch.disabledSelectValue,$(this),{tips:[1,"red"],time:2e3}),!1;for(var l=0;l'+(void 0!==c.config?'":'
                          '+lan.public.select_opt_type+'
                            '+p+'
                          ")+"
                          ";break;case"page":this.config.page=c;var h=bt.get_cookie(this.config.cookiePrefix+"_"+this.config.page.numberParam);this.config.cookiePrefix&&h&&(this.config.page.number=h),l=this.$reader_page(this.config.page,'
                          1 '+lan.public_backup.total+"
                          ")}if(l){var f=$(a.config.el+" .tootls_"+c.positon[1]);if(f.length){var u=f.find(".pull-"+c.positon[0]);u.append(l)}else{var v='
                          '+("left"==c.positon[0]?l:"")+'
                          '+("right"==c.positon[0]?l:"")+"
                          ";"top"===c.positon[1]?($(a.config.el).append(v),0===$(a.config.el+" .divtable").length&&$(a.config.el).append('
                          ')):(0===$(a.config.el+" .divtable").length&&$(a.config.el).append('
                          '),$(a.config.el).append(v))}}}this.init||this.$event_bind(s)},$get_data_batch_list:function(e,t){var i=[];return $.each(t||this.data,function(t,a){i.push(a[e])}),i},$reader_page:function(e,t){var i=this,a=$(t),s="",n={};if(a.find("a").addClass("page_link_"+this.random),s+=a.html(),e.numberStatus){var l="page_select_"+this.random;s+='",n[l]={eventType:"change",type:"page_select"}}if(e.jump){var c="page_jump_input-"+this.random,o="page_jump_btn_"+this.random;s+='
                          '+lan.public.jump_to_page+'
                          ",n[c]={eventType:"keyup",type:"page_jump_input"},n[o]={type:"page_jump_btn"}}return n["page_link_"+this.random]={type:"cut_page_number"},i.config.page.total=parseInt(a.find(".Pcount").html().match(/([0-9]*)/g)[1]),i.$event_bind(n),'
                          '+s+"
                          "},$dynamic_merge_style:function(e,t){var i="";return $.each(e,function(e,t){switch(e){case"align":i+="text-align:"+t+";";break;case"width":i+="width:"+("string"==typeof t?t:t+"px")+";";break;case"style":i+=t;break;case"minWidth":i+="min-width:"+("string"==typeof t?t:t+"px")+";";break;case"maxWidth":i+="max-width:"+("string"==typeof t?t:t+"px")+";"}}),{index:t,css:i}},$event_bind:function(e){var t=this;$.each(e,function(e,i){if(t.event_list[e]&&t.event_list[e].eventType===i.eventType)return!0;t.event_list[e]=i,$(t.config.el).on(i.eventType||"click","."+e,function(a){var s=$(this).parents("tr").index(),n=$(this).data(),l=[];switch(i.type){case"rows":t.event_rows_model={el:$(this),model:t.config.column[$(this).parents("td").index()],rows:t.data[s],index:s},l=[t.event_rows_model.rows,t.event_rows_model.index,a,e,t];break;case"sort":var c=t.config.column[n.index];$(this).hasClass("sort-active")&&$(".sort_"+t.random+" .sort-active").data({sort:"desc"}),$(".sort_"+t.random).removeClass("sort-active").find(".glyphicon").removeClass("glyphicon-triangle-top").addClass("glyphicon-triangle-bottom"),$(this).addClass("sort-active"),"asc"==n.sort?($(this).data({sort:"desc"}),$(this).find(".glyphicon").removeClass("glyphicon-triangle-top").addClass("glyphicon-triangle-bottom")):($(this).data({sort:"asc"}),$(this).find(".glyphicon").removeClass("glyphicon-triangle-bottom").addClass("glyphicon-triangle-top")),t.config.sort=t.config.sortParam({name:c.fid,sort:n.sort}),t.$refresh_table_list(!0);break;case"checkbox":var o=$(t.config.el+' [data-checkbox="all"]'),r=$(t.config.el+" tbody .checkbox_"+t.random);null==n.checkbox?$(this).hasClass("active")?($(this).removeClass("active"),t.checkbox_list.splice(t.checkbox_list.indexOf(s),1),t.checkbox_list.length>0?o.addClass("selected").removeClass("active"):o.removeClass("selected active")):($(this).addClass("active"),t.checkbox_list.push(s),t.data.length===t.checkbox_list.length?o.addClass("active").removeClass("selected"):t.checkbox_list.length>0&&o.addClass("selected")):t.checkbox_list.length===t.data.length?(t.checkbox_list=[],r.removeClass("active selected").next().prop("checked","checked"),o.removeClass("active")):(r.each(function(e,i){$(this).hasClass("active")||($(this).addClass("active").next().prop("checked","checked"),t.checkbox_list.push(e))}),o.removeClass("selected").addClass("active")),t.$set_batch_view();break;case"button":l.push(a,t);break;case"search_focus":var d=$(t.config.el+" .bt_search_tips");$(t.config.el+" .bt_search_tips").length>0&&d.remove();break;case"search_input":if(13==a.keyCode)return $(t.config.el+" .search_btn_"+t.random).click(),!1;break;case"search_btn":var p=$(t.config.el+" .search_input"),_=$(t.config.el+" .search_input").val();t.config.search.value=_,p.append('
                          '+_+'
                          '),t.$refresh_table_list(!0);break;case"page_select":var h=parseInt($(this).val());return t.config.page.number=h,t.config.page.page=1,t.$refresh_table_list(!0),!1;case"page_jump_input":return 13==a.keyCode&&($(t.config.el+" .page_jump_btn_"+t.random).click(),$(this).focus()),!1;case"page_jump_btn":var f=parseInt($(t.config.el+" .page_jump_input-"+t.random).val()),u=Math.ceil(t.config.page.total/t.config.page.number);f>u&&(f=t.config.page.page),t.config.page.page=f,t.$refresh_table_list(!0);break;case"cut_page_number":var v=parseInt($(this).attr("href").match(/([0-9]*)$/)[0]);return t.config.page.page=v,t.$refresh_table_list(!0),!1;case"eye_open_password":return $(this).hasClass("glyphicon-eye-open")?($(this).addClass("glyphicon-eye-close").removeClass("glyphicon-eye-open"),$(this).prev().text(t.data[s].password)):($(this).addClass("glyphicon-eye-open").removeClass("glyphicon-eye-close"),$(this).prev().html("**********")),!1;case"copy_password":return bt.pub.copy_pass(t.data[s].password),!1}i.event&&i.event.apply(this,l)})})},$style_bind:function(e,t){var i="",a=this;$.each(e,function(e,t){""!=t.css&&(t.className?i+=t.className+"{"+t.css+"}":i+=a.config.el+" thead th:nth-child("+(t.index+1)+"),"+a.config.el+" tbody tr td:nth-child"+(t.span?" span":"")+"("+(t.index+1)+"){"+t.css+"}")}),0==$("#bt_table_"+a.random).length&&$(a.config.el).append('")},$get_win_area:function(){return[window.innerWidth,window.innerHeight]},$http:function(e){var t={},i=this.config,a=i.page,s=i.search,n=i.sort||{};a&&(t[a.numberParam]=a.number,t[a.pageParam]=a.page,this.config.cookiePrefix&&bt.set_cookie(this.config.cookiePrefix+"_"+a.numberParam,a.number)),s&&(t[s.searchParam]=s.value),this.config.beforeRequest&&(i.param=this.config.beforeRequest(i.param)),bt_tools.send({url:i.url,data:$.extend(i.param,t,n)},function(t){if(i.dataFilter){var a=i.dataFilter(t);e&&e(a.data,a.page)}else e&&e(t.data,t.page)})}},new t(e)},select_file:function(e,t){"string"==typeof e&&(e={path:e,type:2,title:lan.public.select_fileordir,ext:[],limit:""}),"function"==typeof e&&(type=t,t=e,e={path:bt.get_cookie("Path")}),"number"!=typeof type&&(type=0);var i=this,a={type:type,type_tips:0==type?lan.public.dir:1==type?lan.site.file:lan.public.fileordir,select_list:[],select_path:bt.get_cookie("Path")||("Windows"==bt.os?setup_path:"/www/wwwroot"),select_config:{},scroll_width:0,reader_view:function(){var t=this;this.scroll_width=a.getScrollbarWidth(),layer.open({type:1,title:e.title||lan.public.select+t.type_tips,shadeClose:!1,closeBtn:1,area:["650px","550px"],content:'
                          '+lan.public.name+''+lan.public.modify_time+''+lan.site.redirect_type+'
                          文件修改时间类型
                          '+t.type_tips+'名:
                          ',success:function(){t.evnet_bind(),t.render_file_list(function(){t.set_path_width()}),$(".select_list_thaed").css("right",t.scroll_width+"px")}})},evnet_bind:function(){var e=this;$("#select_dir_list").on("click","tr",function(){var t=$(this).data("index");$(this).addClass("active").siblings().removeClass("active"),$('[name="select_name"]').val(e.select_list[t].filename)}),$(".select_list_body").on("scroll",function(e){var t=$(this).scrollTop(),i=$(this).scrollLeft();t>0?$(".select_list_shadow").show():$(".select_list_shadow").hide(),i>=0&&$(".select_list_thaed").css("left",4-i+"px"),e.stopPropagation(),e.preventDefault()}),$(".file_path_refresh").on("click",function(){e.render_file_list()}),$(".select_dir_list thead th .icon-drag").on("mousedown",function(t){var i=t.clientX,a=$(this).parent(),s=a.index(),n=a[0].clientWidth;parseInt($(this).parent().attr("data-min"));if(1===t.which){var l=function(t){var a=t.clientX,l=a-i,c=n+l;setTimeout(function(){e.set_select_width(s,"width:"+c+"px")},0)};$(document).on("mousemove",l).one("mouseup",function(){$(this).unbind(l),$(this).unbind(this)})}t.stopPropagation()}),$(".select_dir_list thead th>span").on("click",function(t){var i=$(this).parent(),a=i.data("type"),s=i.hasClass("active"),n=i.hasClass("sort");s?i.addClass("sort").removeClass("active"):n?i.addClass("active").removeClass("sort"):i.addClass("active"),i.siblings().removeClass("active sort"),e.render_file_list({sort:a,reverse:s?1:0}),t.stopPropagation()}),$(".search_path_views input").on("keyup",function(){$(this).val()})},set_path_width:function(e){var t=0,i=$(".file_dir_view")[0].offsetWidth,a=($(".file_dir_view .file_dir_item"),[]);t=0;$(".file_dir_view .file_dir_item").each(function(){a.push($(this)[0].offsetWidth)});for(var s=a.reverse(),n=0;n-1?"本地磁盘("+t.path.match(/[A-Z]+/)[0]+":)":t.path;a+='
                          '+i+"
                          "}),$.each(o,function(e,t){var i=bt.format_data(t.mtime),a="dir"==t.type?"文件夹":"文件";s+=' '+t.filename+" "+i+" "+("dir"==t.type?"文件夹":"文件")+" "}),$("#select_mount_list").html(a),$("#select_dir_list").html(s),t&&t(e)})},render_path_list:function(e,t){var i='
                          ',a="",s=e.split("/").splice(1),n=e.split("/")[0];"Windows"===bt.os?(0==s.length&&(s=[]),s.unshift('本地磁盘('+n+")")):("/"==e&&(s=[]),s.unshift("根目录"));for(var l=0;l '+s[l]+'
                          ';$(".path_input").val("").attr("data-path",e);var c=$("#select_file_directory .file_path_input .file_dir_view");c.html(i),t&&t(e)},set_select_width:function(e,t){var i=".select_dir_list tbody td:nth-child("+(e+1)+")>span,.select_dir_list thead th:nth-child("+(e+1)+")>span",a=$("#th-index-"+e);a.length>0?a.html(i+"{"+t+"}"):$("#select_file_style").append('")},cut_style_object:function(e){var t={};e.split(";");return t},getScrollbarWidth:function(){var e,t,i=document.createElement("div"),a={width:"100px",height:"100px",overflowY:"scroll"};for(e in a)i.style[e]=a[e];return document.body.appendChild(i),t=i.offsetWidth-i.clientWidth,i.remove(),t}};a.reader_view()},form:function(e){function t(e){this.config=e,this.$load()}var i=this;return t.prototype={element:null,style_list:[],event_list:{},event_type:["click","event","focus","keyup","blur","change"],hide_list:[],form_element:{},form_config:{},random:bt.get_random(5),$load:function(){var e=this;e.el&&this.$reader_content(function(){e.$event_bind()})},$active_focus:function(e,t){var i=this;$(".input_checked_"+i.random).focus(),this.checked_blur=function(a){setTimeout(function(){if(t)return $(".input_checked_"+i.random).focus(),!1;e&&e(a),delete i.checked_blur},200)}},$reader_content:function(e){var t=this,a="",s="",n={};return $.each(t.config.form,function(e,i){a+=t.$reader_content_row(e,i)}),t.element=$('
                          '+a+"
                          "),s=$('
                          '),s.append(t.element),n["input_checked_"+t.random]={focus:{type:"input_checked",onEvent:!1,event:function(e,t){return t.checked=!0,!1}},blur:{type:"input_checked",onEvent:!1,event:function(e,t){t.checked=!1,t.checked_blur&&t.checked_blur(e)}}}, -$.extend(t.event_list,n),e&&e(),s[0].outerHTML},$reader_content_row:function(e,t){var a=this,s=t.help;return'
                          "+(t.label?''+t.label+"":"")+'
                          "+a.$reader_form_element(t.group,e)+(s?'
                          "+s.list.join("
                          ")+"
                          ":"")+"
                          "},$reader_form_element:function(e,t){var a=this,s="",n={};return Array.isArray(e)||(e=[e]),$.each(e,function(e,l){var c=a.$reader_style(l.style)+i.$verify(l.width,"width","style"),o=a.$verify_group(l,["name","value","placeholder","disabled","readonly","autofocus","autocomplete","min","max"]),r=a.$create_event_config(l),d="";switch(s+=l.label?''+l.label+"":"",void 0!==l.name&&(n[l.name]=r),l.type){case"text":case"checkbox":case"password":case"radio":case"number":var p="event_"+l.name+"_"+a.random,_="checkbox"===l.type;"radio"===l.type?$.each(l.label_tips,function(e,t){l.block&&(s+='
                          '),s+='',s+='",l.block&&(s+="
                          ")}):(l.block&&(s+='
                          '),s+='","checkbox"==l.type&&(s+='"),l.block&&(s+="
                          "),a.event_list[p]={click:{event:l.event}}),l.icon&&(s+='",n[l.name+"_icon"]={click:{type:"select_path",config:l}});break;case"textarea":if(s+='",$.each(["blur","focus","input"],function(e,t){if(l.tips){var i=null;switch(t){case"blur":i=function(e,t){""===$(this).val()&&$(this).next().show(),layer.close(t.tips.loadT)};break;case"focus":i=function(e,t){$(this).next().hide(),t.tips.loadT=layer.tips(h,$(this),{tips:[1,"#20a53a"],time:0,area:$(this).width()})}}}n[l.name][t]?n[l.name][t].added=i:n[l.name][t]={type:l.type,cust:!1,event:l[t],added:i}}),l.tips){var h="";h=void 0===l.tips.list?l.tips.text:l.tips.list.join("
                          "),s+='
                          "+h+"
                          ",n[l.name+"_tips"]={click:{type:"textarea_tips",config:l}}}break;case"select":s+=a.$reader_select(l,c,o,t),a.event_list.custom_select={click:{type:"custom_select",children:".bt_select_value"}},a.event_list.custom_select_item={click:{type:"custom_select_item",children:"li.item"}};break;case"link":d="event_"+bt.get_random(6),s+='
                          "+l.title+"",a.event_list[d]={click:{type:"link_event",event:l.event}};break;case"help":var f="";$.each(l.list,function(e,t){f+="
                        • "+t+"
                        • "}),s+='
                            "+f+"
                          "}a.form_config[l.name]=l}),$.extend(a.event_list,n),s},$create_event_config:function(e){var t={};return void 0===e.name?{}:($.each(this.event_type,function(i,a){e[a]&&(t["event"===a?"click":a]={type:e.type,event:e[a],cust:["select","checkbox","radio"].indexOf(e.type)>-1,config:e})}),t)},$reader_style:function(e){var t="";return"string"==typeof e?e:void 0===e?"":($.each(e,function(e,i){t+=e+":"+i+";"}),t)},$reader_select:function(e,t,a,s){var n=this,l="",c="",o={};if(!Array.isArray(e.list)){var r=e.list;bt_tools.send({url:r.url,data:r.param||{}},function(t){!1!==t.status?(e.list=e.list.dataFilter?e.list.dataFilter(t):t,n.$replace_render_content(s)):bt.msg(t)})}return $.each(e.list,function(t,a){o=a.value===e.value||a.value===n.config.data[e.name]?a:e.list[0],l+='
                        • '+a.title+"
                        • ",c+='"}),!o.title&&Array.isArray(e.list)&&(o=e.list[0]),'
                          '+(o.title||"Getting data")+'
                            '+(l||"")+"
                          "+(c||"")+"
                          "},$replace_render_content:function(e){var t=this,i=this.config.form[e];$("[data-form="+t.random+"]").find(".line:eq("+e+")").replaceWith(t.$reader_content_row(e,i))},$event_bind:function(e,t){var i=this,a={};i.element=$("object"==typeof e?i.element:"[data-form="+i.random+"]"),void 0===e&&(a=i.event_list),$.each(a,function(e,t){if($.isEmptyObject(t))return!0;$.each(t,function(t,a){var s="";s="boolean"==typeof a.cust?"["+(a.cust?"data-":"")+"name="+e+"]":"."+e,function(e,a){if(!1===e.onEvent){switch(e.type){case"input_checked":$(s).on("event"!=t?t:"click",function(t){e.event.apply(this,[t,i])})}return!0}i.element.on("event"!=t?t:"click",e.children?e.children:s,function(t){var s=i.$get_form_element(),n=i.$get_form_value(),l=i.form_config[a];switch(e.type){case"textarea_tips":$(this).hide().prev().focus();break;case"custom_select":if($(this).parent().hasClass("bt-disabled"))return!1;var c=$(this).next();return c.hasClass("show")?c.removeClass("show"):($(".bt_select_list").removeClass("show"),c.addClass("show")),$(document).click(function(){return i.element.find(".bt_select_list").removeClass("show"),$(this).unbind("click"),!1}),!1;case"custom_select_item":if(l=i.form_config[$(this).parents(".bt_select_updown").attr("data-name")],item_config=l.list[$(this).index()],$(this).hasClass("disabled"))return $(this).parent().removeClass("show"),item_config.tips&&layer.msg(item_config.tips,{icon:2}),!0;$(this).hasClass("active")||$(this).hasClass("disabled")||($(this).parent().prev().find(".bt_select_content").text($(this).text()),$(this).addClass("active").siblings().removeClass("active"),$(this).parent().next().val(item_config.value.toString()),$(this).parent().removeClass("show"),$(this).parent().next().trigger("change"));break;case"select_path":bt.select_path("event_"+$(this).prev().attr("name")+"_"+i.random)}e.event&&e.event.apply(this,[n,s,i,l,t]),e.added&&e.added.apply(this,[t,l])})}(a,e)})}),t&&t()},$get_form_value:function(){return this.element.serializeObject()},$set_find_value:function(e,t){var i={},a=this;"string"!=typeof e?i=e:i[e]=t,$.each(i,function(e,t){a.form_element[e].val(t)})},$get_form_element:function(e){var t={},i=this;if(!e&&!$.isEmptyObject(i.form_element))return i.form_element;this.element.find(":input").each(function(e){t[$(this).attr("name")]=$(this)}),i.form_element=t},$verify_group:function(e,t){var i="";return $.each(t,function(t,a){if(void 0===e[a])return!0;["disabled","readonly"].indexOf(a)>-1?i+=" "+(e[a]?a+'="'+a+'"':""):i+=" "+a+'="'+e[a]+'"'}),i},$verify_bind_event:function(e,t,i){var a={};return $.each(i,function(i,s){var n=t[s];n&&("object"==typeof a[e]?(Array.isArray(a[e])||(a[e]=[a[e]]),a[e].push({event:n,eventType:s})):a[e]={event:n,eventType:s})}),a},$verify:function(e,t,i){return e?!0===i?e?" "+t:"":"style"===i?t?t+":"+e+";":e:t?" "+t+'="'+e+'"':" "+e:""},$submit:function(e,t){}},new t(e)},tab:function(e){function t(e){this.config=e,this.theme=this.config.theme||{},this.$load()}var i=this;return t.prototype={type:1,theme_list:[{content:"tab-body",nav:"tab-nav",body:"tab-con",active:"on"},{content:"bt-w-body",nav:"bt-w-menu",body:"bt-w-con"}],random:bt.get_random(5),$init:function(){var e=this,t=(this.config.active,e.config.list);this.$event_bind(),t[e.active].success&&t[e.active].success(),t[e.active].init=!0},$load:function(){},$reader_content:function(){var e=this,t=e.config.list,a="",s="",n=e.theme,l=e.config;return void 0===e.active&&(e.active=0),$.isEmptyObject(l.theme)||(n=this.theme_list[e.active],$.each(l.theme,function(e,t){n[e]&&(n[e]+=" "+t)}),e.theme=n),l.type&&$.isEmptyObject(l.theme)&&(this.theme=this.theme_list[e.active]),$.each(t,function(t,i){var l=e.active===t,c=n.active||"active";a+=''+i.title+"",s+='
                          '+(l?i.content:"")+"
                          "}),e.element=$('
                          '+a+'
                          '+s+"
                          "),e.element[0].outerHTML},$reader_find:function(){},$event_bind:function(){var e=this,t=e.theme,i=t.active||"active";e.el||(e.element=$("#tab_"+e.random)),e.element.on("click","."+t.nav.replace(/\s+/g,".")+" span",function(){var a=$(this).index(),s=e.config.list[a];$(this).addClass(i).siblings().removeClass(i),$("."+t.body+">div:eq("+a+")").addClass(i).siblings().removeClass(i),e.active=a,s.init||($("."+t.body+">div:eq("+a+")").html(s.content),s.success&&s.success(),s.init=!0)})}},new t(e)},load:function(e){var t=layer.msg(e+",please wait...",{icon:16,time:0,shade:.3});return!0===e&&(t=layer.load()),{close:function(){layer.close(t)}}},open:function(e){var t={},i=null;return t=$.extend({type:1,area:"640px",closeBtn:2,btn:["确认","取消"]},e),i=layer.open(t),{close:function(){layer.close(i)}}},msg:function(e,t){var i=null,a="",s={};return"object"==typeof e&&"boolean"==typeof e.status&&(a=e.msg,s={icon:e.status?1:2}),"string"==typeof e&&(a=e,s={icon:void 0!==t?t:1}),i=layer.msg(a,s),{close:function(){layer.close(i)}}},$verify:function(e,t,i){return e?!0===i?e?" "+t:"":"style"===i?t?t+":"+e+";":e:t?" "+t+'="'+e+'"':" "+e:""},select_path:function(e,t,i,a){"number"!=typeof i&&(i=1),"number"!=typeof a&&(a=!1),bt.set_cookie("Path","/www/server/panel/BTPanel/static");var s=this,n={type:i,type_tips:0==i?"目录":1==i?"文件":"目录或文件",type_limit:0==i?"dir":1==i?"file":"all",select_list:[],select_path:bt.get_cookie("Path")||("Windows"==bt.os?setup_path:"/www/wwwroot"),select_config:{},scroll_width:0,file_path:bt.get_cookie("Path"),file_operating:[],area:[window.innerWidth,window.innerHeight],reader_view:function(){var t=this;this.scroll_width=n.getScrollbarWidth(),layer.open({type:1,title:e.title||"选择"+t.type_tips,shadeClose:!1,closeBtn:2,area:["650px","555px"],content:'
                          名称修改时间类型
                          文件修改时间类型
                          '+t.type_tips+'名:
                          ',success:function(){t.render_file_list(),$(".select_list_thaed").css("right",t.scroll_width+"px")}})},render_file_list:function(e,t){var i="",a="",n=this,l={path:this.select_path,sort:"type",disk:!0};void 0===e&&(e=l),"function"==typeof e&&(t=e,e=l),n.select_config=$.extend(l,e),s.$http("GetDir",n.select_config,function(e){var s=e.DISK,l=$.merge(n.data_reconstruction(e.DIR,"DIR"),n.data_reconstruction(e.FILES));n.select_list=l,n.render_path_list(),$.each(s,function(e,t){var a="/"==t.path?"根目录":t.path.indexOf(":/")>-1?"本地磁盘("+t.path.match(/[A-Z]+/)[0]+":)":t.path;i+='
                          '+a+"
                          "}),$.each(l,function(e,t){if(0==n.type&&t.type!=n.type_limit)return!0;var i=bt.format_data(t.mtime),s="dir"==t.type?"文件夹":"文件";a+=' '+t.filename+" "+i+" "+("dir"==t.type?"文件夹":"文件")+" "}),$("#select_mount_list").html(i),$("#select_dir_list").html(a),t&&t(e)})},data_reconstruction:function(e,t,i){if(e.length<1)return[];var a=[];return $.each(e,function(e,i){var s=i.split(";"),n="",l=s[0].split("."),c=l[l.length-1];switch(s[0]){case".user.ini":n="PS: PHP用户配置文件(防跨站)!";break;case".htaccess":n="PS: Apache用户配置文件(伪静态)";break;case"swap":n="PS: 宝塔默认设置的SWAP交换分区文件"}-1!=s[0].indexOf("Recycle_bin")&&(n="PS: 回收站目录,勿动!"),-1!=s[0].indexOf(".upload.tmp")&&(n="PS: 宝塔文件上传临时文件,重新上传从断点续传,可删除"),a.push({caret:"1"==s[8],down_id:s[9],ext:"DIR"==t?"":c,filename:s[0],mtime:s[2],ps:n||s[10],size:s[1],type:"DIR"==t?"dir":"file",user:s[3],root_level:s[4]})}),a},render_path_list:function(e){var t=this,i='
                          ',a="",s=this.file_path.split("/").splice(1),n=this.file_path.split("/")[0];"Windows"===bt.os?(0==s.length&&(s=[]),s.unshift('本地磁盘('+n+")")):("/"==this.file_path&&(s=[]),s.unshift("根目录"));for(var l=0;l\t\t\t\t\t\t\t\t'+s[l]+'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t';$(".path_input").val("").attr("data-path",this.file_path);var c=$(".file_path_input .file_dir_view");c.html(i),c.attr("data-width",c.width()),t.set_dir_view_resize()},set_select_width:function(e,t){var i=".select_dir_list tbody td:nth-child("+(e+1)+")>span,.select_dir_list thead th:nth-child("+(e+1)+")>span",a=$("#th-index-"+e);a.length>0?a.html(i+"{"+t+"}"):$("#select_file_style").append('")},cut_style_object:function(e){var t={},i=e.split(";");return console.log(i),t},getScrollbarWidth:function(){var e,t,i=document.createElement("div"),a={width:"100px",height:"100px",overflowY:"scroll"};for(e in a)i.style[e]=a[e];return document.body.appendChild(i),t=i.offsetWidth-i.clientWidth,i.remove(),t},set_dir_view_resize:function(){var e=$(".file_path_input"),t=$(".file_path_input .file_dir_view"),i=t.attr("data-width"),a=null;if(i?parseInt(i):(i=t.width(),t.attr("data-width",i)),t.width()-i<90){var s=0;$($(".file_path_input .file_dir_view .file_dir_item").toArray().reverse()).each(function(){var t=0;$(this).attr("data-width")?t=parseInt($(this).attr("data-width")):($(this).attr("data-width",$(this).width()),t=$(this).width()),s+=t,e.width()-s<=90?$(this).addClass("hide"):$(this).removeClass("hide")})}a=t.children(".file_dir_item.hide").clone(!0);0==t.children(".file_dir_item.hide").length?e.removeClass("active").find(".file_dir_omit").addClass("hide"):(a.each(function(){0==$(this).find(".glyphicon-hdd").length&&$(this).find(".file_dir").before('')}),e.addClass("active").find(".file_dir_omit").removeClass("hide"),e.find(".file_dir_omit .nav_down_list").empty().append(a),e.find(".file_dir_omit .nav_down_list .file_dir_item").removeClass("hide"))},reader_file_list:function(e,t){var i=this;if("function"==typeof e&&(t=e,e={is_operating:!1}),void 0===e&&(e={is_operating:!1}),a)return layer.msg("只能在该目录下操作",{icon:2}),!1;this.loadT=bt.load("正在获取文件列表,请稍候..."),this.file_images_list=[],i.get_dir_list(e,function(e){i.loadT.close(),i.file_list=$.merge(i.data_reconstruction(e.DIR,"DIR"),i.data_reconstruction(e.FILES)),i.file_path=e.PATH,i.is_recycle=e.FILE_RECYCLE,i.file_store_list=e.STORE,bt.set_cookie("Path",e.PATH);var a="",s="",n=e.DISK,l=i.file_list;i.select_list=i.file_list,i.render_path_list(),$.each(n,function(e,t){var i="/"==t.path?"根目录":t.path.indexOf(":/")>-1?"本地磁盘("+t.path.match(/[A-Z]+/)[0]+":)":t.path;a+='
                          '+i+"
                          "}),$.each(l,function(e,t){if(0==i.type&&t.type!=i.type_limit)return!0;var a=bt.format_data(t.mtime),n="dir"==t.type?"文件夹":"文件";s+=' '+t.filename+" "+a+" "+("dir"==t.type?"文件夹":"文件")+" "}),$("#select_mount_list").html(a),$("#select_dir_list").html(s);var c=e.PATH.lastIndexOf("/");e.PATH.substring(c+1,e.PATH.length);t&&t(rdata)})},reader_file_list_content:function(e,t){var i="",a=this,s=0;$.each(e,function(e,t){var n=t.filename+t.ps;a.file_list[e]=t=a.$file_data_dispose(t),a.file_list[e].only_index=e,t.filename.indexOf("Recycle_bin")&&(_tips="PS: 回收站目录,勿动!"),n.length>20&&(n=n.substring(0,20)+"..."),bt.check_chinese(n)&&n.length>10&&(n=n.substring(0,10)+"..."),i+='
                          '+t.filename+t.ps+""+(t.caret?'':"")+(t.down_id?'':"")+'
                          '+t.type_tips+'
                          '+("dir"==t.type?'点击计算':bt.format_size(t.size))+'
                          '+bt.format_data(t.mtime)+"
                          ","dir"==t.type&&s++,t.ispreview&&(a.file_images_list.push(t.path),t.images_id,t.images_id=a.file_images_list.length-1)}),$(".file_list_content").html(i),t&&t({is_dir_num:s})},$file_data_dispose:function(e){var t={languages:null,model:null};return $.extend(e,{only_id:bt.get_random(10),type_tips:"dir"===e.type?"文件夹":this.ext_type_tips(e.ext),open_type:this.determine_file_type(e.ext),languages:t.languages,path:e.path||this.path_resolve(this.file_path,e.filename),model:t.model})},path_resolve:function(e,t){var i="";return Array.isArray(t)||(t=[t]),e.replace(/([\/|\/]*)$/,function(e){return e,"www"}),$.each(t,function(e,t){i+="/"+t}),e+i},$get_file_model:function(e){var t=this.vscode_editor.config;for(languages in t.supportedModes)for(var i=t.supportedModes[languages],a=0;a'+("/"==i.path?"根目录":i.path)+" ("+i.size[2]+")"}),$(".mount_disk_list").html(t)})},determine_file_type:function(e,t){var i={images:["jpg","jpeg","png","bmp","gif","tiff","ico"],compress:["zip","rar","gz","war","tgz"],video:["mp4","mpeg","mpg","mov","avi","webm","mkv"],ont_text:["iso","xlsx","xsl","doc","docx","tiff","exe","so","7z","bz","dmg","apk"]},a=!1;if(null!=t)if("text"==t)$.each(i,function(t,i){$.each(i,function(t,i){if(i==e)return a=!0,!1})}),a=!a;else{if(void 0===i[t])return!1;$.each(i[t],function(t,i){if(i==e)return a=!0,!1})}else $.each(i,function(t,i){$.each(i,function(i,s){if(s==e)return a=t,!1})}),"boolean"==typeof a&&(a="text");return a},render_file_groud_menu:function(e,t){var i=this,a=$(t).data("index"),s=i.file_list[a],n=[["open","打开"],["split",""],["download","下载"],["share","分享目录/文件"],["cancel_share","取消分享"],["favorites","收藏目录/文件"],["cancel_favorites","取消收藏"],["split",""],["dir_kill","目录查杀"],["authority","权限"],["split",""],["copy","复制"],["shear","剪切"],["rename","重命名"],["del","删除"],["split",""],["killing","创建压缩",[["gzip","tar.gz (推荐)"],["zip","zip (通用格式)"],["rar","rar (中文兼容较好)"]]],["unzip","解压",[["local","解压到当前"],["folad","解压到当前"]]]],l=["zip","rar","gz","war","tgz","bz2"],c=0;"dir"==s.type&&(n.splice(2,1),c++),0!==s.down_id?(n.splice(3-c,1),c++):(n.splice(4-c,1),n[3-c][1]="dir"==s.type?"分享目录":"分享文件",c++),!1!==s.caret?(n.splice(5-c,1),c++):(n.splice(6-c,1),n[5-c][1]="dir"==s.type?"收藏目录":"收藏文件",c++),"php"!=s.ext&&"dir"!=s.type&&(n.splice(8-c,1),c++);var o=0;$.each(l,function(e,t){t==s.ext&&o++}),0==o&&(n.splice(17-c,1),c++),i.reader_menu_list({el:$(".selection_right_menu"),ev:e,data:s,list:n})},render_file_all_menu:function(e,t){var i=this,a=[["refresh","刷新"],["split",""],["upload","上传"],["create","新建文件夹/文件",[["create_dir","新建文件夹"],["create_files","新建文件"]]],["split",""],["paste","粘贴"]];bt.get_storage("session","copy_path")||a.splice(5,1),i.reader_menu_list({el:$(".selection_right_menu"),ev:e,data:{},list:a})},get_dir_list:function(e,t,i){var a=this;"boolean"==typeof t&&(i=t,t=null),s.$http("GetDir",$.extend({disk:!0,path:a.file_path,sort:bt.get_cookie("files_sort")||"type"},e),t,i)},retrun_prev_path:function(e){var t=e.split("/");return t.splice(t.length-1),t.join("/")},reader_menu_list:function(e){var t=this,i=e.el.find("ul"),a=i.height(),s=i.width(),n=e.ev.clientX-(this.area[0]-e.ev.clientX'):(Array.isArray(s[2])&&(n=$('
                            '),l=n.find(".set_group"),$.each(s[2],function(i,a){l.append($('
                          • '+a[1]+"
                          • ").on("click",{type:a[0],data:e.data},function(i){t.file_groud_event($.extend(i.data.data,{open:i.data.type,index:parseInt($(e.ev.currentTarget).data("index")),element:e.ev.currentTarget,type_tips:s.type?"文件夹":"文件"})),e.el.removeAttr("style"),i.stopPropagation(),i.preventDefault()}))})),i.append($('
                          • '+s[1]+"
                          • ").append(n).on("click",{type:s[0],data:e.data},function(i){t.file_groud_event($.extend(i.data.data,{open:i.data.type,index:parseInt($(e.ev.currentTarget).data("index")),element:e.ev.currentTarget,type_tips:s.type?"文件夹":"文件"})),e.el.removeAttr("style"),i.stopPropagation(),i.preventDefault()})))}),e.el.css({left:n,top:e.ev.clientY-(this.area[1]-e.ev.clientY0?$(".select_list_shadow").show():$(".select_list_shadow").hide(),i>=0&&$(".select_list_thaed").css("left",4-i+"px"),e.stopPropagation(),e.preventDefault()}),$(".file_path_refresh").on("click",function(){e.render_file_list()}),$(".select_dir_list thead th .icon-drag").on("mousedown",function(t){var i=t.clientX,a=$(this).parent(),s=a.index(),n=a[0].clientWidth;parseInt($(this).parent().attr("data-min"));if(1===t.which){var l=function(t){var a=t.clientX,l=a-i,c=n+l;setTimeout(function(){e.set_select_width(s,"width:"+c+"px")},0)};$(document).on("mousemove",l).one("mouseup",function(){$(this).unbind(l),$(this).unbind(this)})}t.stopPropagation()}),$(".select_dir_list thead th>span").on("click",function(t){var i=$(this).parent(),a=i.data("type"),s=i.hasClass("active"),n=i.hasClass("sort");s?i.addClass("sort").removeClass("active"):n?i.addClass("active").removeClass("sort"):i.addClass("active"),i.siblings().removeClass("active sort"),e.render_file_list({sort:a,reverse:s?1:0}),t.stopPropagation()}),$(".search_path_views input").on("keyup",function(){var e=$(this).val();console.log(e)}),$(".search_path_views input").focus(function(){$(this).next().show()}).blur(function(){$(this).next().hide()}),$("#select_file_directory .select_file_group").on("click",".select_btn_group .btn-success",function(t){var i=$('[name="select_name"]').val(),a="";""==i?layer.msg("只能选择"+e.type_tips,{icon:2}):(a=e.file_path+"/"+i,console.log(a))}),$("#select_file_directory .select_file_tootls").on("click",".creat_dir",function(t){var i="   ";0==$("#tbody tr").length?$("#select_dir_list").append(i):$("#select_dir_list tr:first-child").before(i),$(".newFolderName").focus(),$("#nameOk").click(function(){var t=$("#newFolderName").val(),i=$(".file_path_views .path_input").attr("data-path");newTxt=i+"/"+t,s.$http("CreateDir",{path:newTxt},function(t){1==t.status?(e.reader_file_list({path:i,is_operating:!1}),layer.msg(t.msg,{icon:1})):layer.msg(t.msg,{icon:2})})})}),$("#select_mount_list").on("click",".item",function(){e.reader_file_list({path:$(this).attr("data-menu"),is_operating:!0})}),$(window).resize(function(t){$(this)[0].innerHeight!=e.area[1]&&(e.area[1]=$(this)[0].innerHeight,e.set_file_view()), -$(this)[0].innerWidth!=e.area[0]&&(e.area[0]=$(this)[0].innerWidth,e.set_dir_view_resize()),e.vscode_editor.view&&e.vscode_editor.is_full_min>0&&layer.style(e.vscode_editor.view,{top:0,left:0,width:e.area[0],height:e.area[1]}),e.vscode_editor.view&&$.isEmptyObject(e.vscode_editor.list)&&e.vscode.layout()}).keydown(function(t){t=window.event||t;var i=t.keyCode,a=t.target.tagName.toLowerCase();if(8==i&&"input"!==a&&"textarea"!==a)return null==e.vscode_editor.view&&$(".forward_path span:eq(0)").click(),!1}),$(".file_path_input .path_input").on("focus blur keyup",function(t){t=t||window.event;var i=$(this).attr("data-path");switch(t.type){case"focus":$(this).addClass("focus").val(i).prev().hide();break;case"blur":$(this).removeClass("focus").val("").prev().show();break;case"keyup":if(13!=t.keyCode&&"keyup"==t.type)return!1;var a=$(this);$(this).data("path")!=$(this).val()&&e.reader_file_list({path:$(this).val(),is_operating:!0},function(e){!1===e.status?$(a).val(i):($(a).val(e.PATH),$(a).blur().prev().show())})}t.stopPropagation()}),$(".file_path_input .file_dir_view").on("click",".file_dir",function(){e.reader_file_list({path:$(this).attr("title"),is_operating:!0})}),$(".forward_path span").click(function(){var t=$(this).index(),i="";if(!$(this).hasClass("active")){switch(t){case 0:e.file_pointer=e.file_pointer-1,i=e.retrun_prev_path(e.file_path);break;case 1:e.file_pointer=e.file_pointer+1,i=e.file_path+"/"+$(".select_file_group .file_directory").val();break;case 2:e.file_pointer=e.file_pointer-1,i=e.retrun_prev_path(e.file_path)}e.reader_file_list({path:i,is_operating:!1})}}),$(".file_path_input .file_dir_view").on("click",".file_dir_omit",function(e){var t=this,i=$(this).children(".nav_down_list");$(this).addClass("active"),i.addClass("show"),$(document).one("click",function(){$(t).removeClass("active"),i.removeClass("show"),e.stopPropagation()}),e.stopPropagation()}),$("#select_dir_list").on("dblclick","tr",function(t){if($(t.target).hasClass("file_check"))return!1;var i=$(this).attr("data-path"),a=$(this).attr("data-type");"dir"==a&&e.reader_file_list({path:e.file_path+"/"+i}),t.stopPropagation(),t.preventDefault()}),$(".file_path_refresh").click(function(){e.reader_file_list({path:e.file_path})}),$(".file_nav_view .upload_or_download").on("click",function(t){e.open_upload_view(),t.stopPropagation(),t.preventDefault()}),$(".file_nav_view .upload_or_download li").on("click",function(t){var i=$(this).data("type");"uploadFile"===i?e.open_upload_view():e.open_download_view(),t.stopPropagation(),t.preventDefault()}),$(".mount_disk_list").on("click",".nav_btn",function(){var t=$(this).data("menu");e.reader_file_list({path:t})}),$(".file_list_header").on("click",".file_name,.file_size,.file_mtime,.file_accept,.file_user",function(t){var i=$(this).attr("data-tid"),a=$(this).find(".icon_sort").hasClass("active"),s=$(this).hasClass("active");return!$(this).find(".icon_sort").hasClass("active")&&$(this).hasClass("active")?$(this).find(".icon_sort").addClass("active"):$(this).find(".icon_sort").removeClass("active"),$(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty(),$(this).find(".icon_sort").html(''),s||(a=!0),bt.set_cookie("files_sort",i),bt.set_cookie("name_reverse",a?1:0),e.reader_file_list(),!1}),$(".file_list_header .file_th").each(function(e,t){var i=bt.get_cookie("files_sort"),a=bt.get_cookie("name_reverse");$(this).attr("data-tid")===i&&($(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty(),$(this).find(".icon_sort").html(''),0===a&&$(this).find(".icon_sort").addClass("active"))}),$(".file_list_header .file_check").on("click",function(t){var i=parseInt($(this).data("checkbox"));switch(i){case 0:$(this).addClass("active").removeClass("active_2").data("checkbox",1),$(".file_list_content .file_tr").addClass("active").removeClass("active_2"),e.file_table_arry=e.file_list;break;case 2:$(this).addClass("active").removeClass("active_2").data("checkbox",1),$(".file_list_content .file_tr").addClass("active"),e.file_table_arry=e.file_list;break;case 1:$(this).removeClass("active active_2").data("checkbox",0),$(".file_list_content .file_tr").removeClass("active"),e.file_table_arry=[]}}),$(".file_list_content").on("click",".file_check",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),s=$(".file_list_header .file_check"),n=i.attr("data-filename");$(".selection_right_menu").removeAttr("style"),i.hasClass("active")?(i.removeClass("active"),e.remove_check_file(e.file_table_arry,"filename",n),e.file_table_arry.length>0?s.addClass("active_2").removeClass("active").data("checkbox",2):0==e.file_table_arry.length&&s.removeClass("active active_2").data("checkbox",0)):(i.addClass("active"),i.attr("data-filename",e.file_list[a].filename),e.file_table_arry.length==e.file_list.length?s.addClass("active").removeClass("active_2").data("checkbox",1):s.addClass("active_2").removeClass("active").data("checkbox",2),e.file_table_arry.push(e.file_list[a])),t.stopPropagation()}),$(".file_list_content").scroll(function(e){$(this).scrollTop()==$(this)[0].scrollHeight-$(this)[0].clientHeight?($(this).prev().css("opacity",1),$(this).next().css("opacity",0)):$(this).scrollTop()>0?$(this).prev().css("opacity",1):0==$(this).scrollTop()&&($(this).prev().css("opacity",0),$(this).next().css("opacity",1))}),$(".file_table_view .file_list_content").on("click",".file_tr",function(e){$(".selection_right_menu").removeAttr("style"),$(this).find(".file_checkbox .file_check").click(),e.stopPropagation(),e.preventDefault()}),$(".file_table_view .file_list_content").on("click",".file_title i",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),s=e.file_list[a];"dir"==s.type&&e.reader_file_list({path:e.file_path+"/"+s.filename}),t.stopPropagation()}),$(".file_table_view .file_list_content").on("click",".file_name .icon-share1",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),s=e.file_list[a];e.info_file_share(s,i),t.stopPropagation()}),$(".file_table_view .file_list_content").on("click",".file_name .icon-favorites",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),s=e.file_list[a];s.typeText=s.type?"文件夹":"文件",e.cancel_file_favorites(s,i),t.stopPropagation()}),$(".file_table_view .file_list_content").on("dblclick",".file_tr",function(t){if($(t.target).hasClass("file_check"))return!1;var i=$(this).data("index"),a=e.file_list[i];"dir"==a.type&&e.reader_file_list({path:e.file_path+"/"+a.filename}),t.stopPropagation(),t.preventDefault()}),$(".file_list_content").on("contextmenu",".file_tr",function(t){var i=this;3==t.which&&(e.render_file_groud_menu(t,this),$(".content_right_menu").removeAttr("style"),$(this).addClass("selected").siblings().removeClass("selected"),$(document).one("click",function(e){$(i).removeClass("selected"),$(".selection_right_menu").removeAttr("style"),e.stopPropagation(),e.preventDefault()})),t.stopPropagation(),t.preventDefault()}),$(".file_list_content").on("contextmenu",function(t){var i=$(".content_right_menu");i.width(),i.height();3==t.which&&($(".selection_right_menu").removeAttr("style"),e.render_file_all_menu(t,this)),t.stopPropagation(),t.preventDefault()}),$(".filePage").on("change",".showRow",function(){var t=$(this).val();bt.set_storage("showRow",t),e.reader_file_list()}),$(".file_list_content").on("click",".folder_size",function(e){var t=i.file_list[$(this).parents(".file_tr").data("index")],i=this;i.get_file_size({path:t.path},function(e){$(i).text(bt.format_size(e.size))}),e.stopPropagation(),e.preventDefault()}),$(".cut_view_model").on("click",function(){var e=$(this).data("type");$(".file_table_view").addClass("icon"==e?"icon_view":"list_view").removeClass("icon"!=e?"icon_view":"list_view"),$(this).addClass("active").siblings().removeClass("active")})},set_file_forward:function(){var e=this,t=$(".forward_path span");console.log(e.file_operation),1==e.file_operating.length?t.addClass("active"):e.file_pointer==e.file_operating.length-1?(t.eq(0).removeClass("active"),t.eq(1).addClass("active")):0==e.file_pointer?(t.eq(0).addClass("active"),t.eq(1).removeClass("active")):t.removeClass("active")},set_file_view:function(){var e=$(".file_list_content"),t=this.area[1]-170;$(".file_bodys").height(this.area[1]-100),50*this.file_list.length>t?(e.attr("data-height",e.data("height")||e.height()).height(t),$(".file_shadow_bottom").css("opacity",1)):(e.height(t),$(".file_shadow_top,.file_shadow_bottom").css("opacity",0))},clear_table_active:function(){this.file_table_arry=[],$(".file_list_header .file_check").removeClass("active active_2"),$(".file_list_content .file_tr").removeClass("active")}};n.reader_view(),n.event_bind()},send:function(e,t,i,a,s,n){function l(e){try{o="function"==d[e][1]?d[e][0]:null,r="function"==d[e+1][1]?d[e+1][0]:null}catch(e){}}var c={},o=null,r=null,d=[],p="";switch($.each(arguments,function(e,t){d.push([t,typeof t])}),p=d[0],p[1]){case"string":$.each(d,function(e,t){var i=t[0],a=t[1];if(e>1&&("boolean"==a||"string"==a||"object"==a)){var s=p[0].split("/");return c.url="/"+s[0]+"?action="+s[1],c.load=i,"object"==a&&(c.load=i.load,c.tips=i.tips,c.verify=i.verify),!1}c.url=p[0]}),"object"===d[1][1]?(c.data=d[1][0],l(2)):l(1);break;case"object":c.url=p[0].url,c.data=p[0].data||{},$.each(d,function(e,t){var i=t[0],a=t[1];if(e>1&&("boolean"==a||"string"==a||"object"==a))return c.load=t,"object"==a&&(c.load=i.load,c.tips=i.tips),!0}),"object"===d[1][1]?(c.data=d[1][0],l(2)):l(1)}c.load&&(c.load=this.load(c.load)),$.ajax({type:c.type||"POST",url:c.url,data:c.data||{},dataType:c.dataType||"JSON",complete:function(){c.load&&c.load.close()},success:function(e){return c.verify?(o&&o(e),!1):"string"==typeof e?(layer.msg(e,{icon:2,time:0,closeBtn:2}),!1):c.bacth?(o&&o(e),!1):!1===e.status?(bt_tools.msg(e),!1):(c.tips&&bt_tools.msg(e),void(o&&o(e)))},error:function(e){r&&r(e),layer.closeAll("dialog"),layer.closeAll("loading"),layer.msg("Service response error:"+e.status+"
                            error msg:"+e.statusText+"
                            URL:"+c.url+"
                            param:"+JSON.stringify(c.data),{icon:2,time:0,closeBtn:2})}})}};$.fn.serializeObject=function(){var e=Object.prototype.hasOwnProperty;return this.serializeArray().reduce(function(t,i){return e.call(t,i.name)||(t[i.name]=i.value),t},{})}; \ No newline at end of file +var bt_tools={table:function(e){function t(e){this.config=e,this.$load()}return t.prototype={style_list:[],event_list:{},checkbox_list:[],batch_active:{},event_rows_model:{},data:[],page:"",column:[],batch_thread:[],random:bt.get_random(5),init:!1,checked:!1,$load:function(){var e=this,t=$('');this.config.init&&this.config.init(this),$(this.config.el).addClass("bt_table").append(t),t.focus(function(){return e.checked=!0,!1}).blur(function(t){e.checked=!1,e.checked_blur&&e.checked_blur(t)}),this.config.minWidth&&this.style_list.push({className:this.config.el+" table",css:"min-width:"+this.config.minWidth}),this.config.tootls?this.$reader_tootls(this.config.tootls):0===$(e.config.el+".divtable").length&&$(e.config.el).append('
                            '),this.$reader_content(),void 0!==e.config.url?this.$refresh_table_list():void 0!==this.config.data?this.$reader_content(this.config.data):alert(lan.public.miss_data_or_url),this.config.methods&&$.extend(this,this.config.methods)},$refresh_table_list:function(e){var t,i=this;e&&(t=bt.load(lan.database.get_data)),this.$http(function(a,s){e&&t.close(),i.$reader_content(a,s)})},$active_focus:function(e){var t=this;$("#checked_"+t.random).focus(),this.checked_blur=function(i){setTimeout(function(){e&&e(i),delete t.checked_blur},200)}},$reader_content:function(e,t){var i=this,a="",s="",n=0,l=this.config.column,c={},o=$(i.config.el+" .checkbox_"+i.random);e=e||[],this.data=e,o.length&&(o.removeClass("active selected"),i.checkbox_list=[],i.$set_batch_view());do{var r=e[n],d=0;e.length>0&&(s+="");for(var p=0;p"+("checkbox"==h.type?'':""+h.title+"")+(h.sort?'':"")+"",0===n&&(!c[_]&&h.sort&&(c[_]={event:this.config.sortEvent,eventType:"click",type:"sort"}),c[f]||(c[f]={event:h.checked,eventType:"click",type:"checkbox"}))}if(void 0!==r){var v="",b="event-"+h.fid+"-"+this.random;h.template?v=i.$custom_template_render(h,r,p):(v=this.$reader_column_type(h,r),c=$.extend(c,v[1]),v=v[0]),s+=""+v+"",0===n&&!c[b]&&h.event&&(c[b]={event:h.event,eventType:"click",type:"rows"})}}}e.length>0&&(s+=""),0==e.length&&(s+=''+(this.config.default||lan.public.empty)+""),n++}while(n'+a+""+s+""),this.init=!0,this.config.success&&this.config.success(this)},$custom_template_render:function(e,t,i){var a="event-"+e.fid+"-"+this.random,s=e.template(t,i),n=$(s);return n.length>0?template=n.addClass(a)[0].outerHTML:"text"===e.type?template=''+s+"":template=''+s+"",template},$modify_row_data:function(e){this.event_rows_model.rows=$.extend(this.event_rows_model.rows,e);var t=this.event_rows_model,i=null;i=void 0!==t.model.template?$(this.$custom_template_render(t.model,t.rows,t.index)):$(this.$reader_column_type(t.model,t.rows)[0]),t.el.replaceWith(i),t.el=i},$batch_success_table:function(e){var t=this;bt.open({type:1,title:e.title,area:e.area||["380px","350px"],shadeClose:!1,closeBtn:2,content:e.content||'
                            '+e.title+" "+lan.public.success+'
                            "+e.html+"
                            '+e.th+''+lan.public.result+"
                            ",success:function(){t.$fixed_table_thead(".fiexd_thead")}})},$delete_table_row:function(e){this.data.splice(e,1),this.$reader_content(this.data)},$fixed_table_thead:function(e){$(e).scroll(function(){var e=this.scrollTop;this.querySelector("thead").style.transform="translateY("+e+"px)"})},$set_batch_view:function(){var e=$(this.config.el+" .bt_select_value"),t=$(this.config.el+" .bt_table_select_group").next();if(void 0!==this.config.batch){t=$(this.config.el+" .set_batch_option");if(void 0!==this.config.batch.config)this.checkbox_list.length>0?t.removeClass("bt-disabled btn-default").addClass("btn-success").text(lan.public.please_choose+this.batch_active.title+"("+lan.public.selected+this.checkbox_list.length+")"):t.addClass("bt-disabled btn-default").removeClass("btn-success").text(lan.public.please_choose+this.batch_active.title);else{e=$(this.config.el+" .bt_select_value");this.checkbox_list.length>0?(t.removeClass("bt-disabled btn-default").addClass("btn-success").prev().removeClass("bt-disabled"),e.find("em").html("("+lan.public.selected+this.checkbox_list.length+")")):(t.addClass("bt-disabled btn-default").removeClass("btn-success").prev().addClass("bt-disabled"),e.children().eq(0).html(lan.public.please_choose+""),e.next().find("li").removeClass("active"),this.batch_active={})}}},$reader_column_type:function(e,t){var i=t[e.fid],a={},s="",n=[],l=this;switch(e.type){case"text":n=[i,a];break;case"checkbox":n=['',a];break;case"password":s="ico_"+l.random+"_";var c='**********';e.eye_open&&(c+='',a[s+"eye_open"]||(a[s+"eye_open"]={type:"eye_open_password"})),e.copy&&(c+='',a[s+"copy"]||(a[s+"copy"]={type:"copy_password"})),n=[c,a];break;case"link":s="click_"+e.fid+"_"+this.random,!a[s]&&e.event&&(a[s]={event:e.event,type:"rows"}),n=[''+i+"",a];break;case"input":blurName="blur_"+e.fid+"_"+this.random,keyupName="keyup_"+e.fid+"_"+this.random,!a[blurName]&&e.blur&&(a[blurName]={event:e.blur,eventType:"blur",type:"rows"}),!a[keyupName]&&e.keyup&&(a[keyupName]={event:e.keyup,eventType:"keyup",type:"rows"}),n=['',a];break;case"status":var o="";s="click_"+e.fid+"_"+this.random,$.each(e.config.list,function(e,t){t[0]===i&&(o=t)}),!a[s]&&e.event&&(a[s]={event:e.event,type:"rows"}),n=['-1?"":o[2])+'" style="'+(o[2].indexOf("#")>-1?"color:"+o[2]+";":"")+'" href="javascript:;">'+o[1]+""+(e.config.icon?'':"")+"",a];break;case"switch":break;case"group":var r="";$.each(e.group,function(i,n){if(s=(e.fid?e.fid:"group")+"_"+i+"_"+l.random,n.template){var c=n.template(t,l),o=$(c);o.length>0?r+=o.addClass(s)[0].outerHTML:r+=''+c+""}else r+='"+n.title+"";r+=e.group.length-1!=i?" | ":"",!a[s]&&n.event&&(a[s]={event:n.event,type:"rows"})}),n=[r,a];break;default:n=[i,a]}return n},$reader_tootls:function(e){function t(e,t){var i=bt.load(e.title+lan.site.executing),s={},n=a.$get_data_batch_list(e.paramId,t);e.beforeRequest?s[e.paramName]=e.beforeRequest(t):s[e.paramName]=n.join(","),bt_tools.send({url:e.url||a.config.batch.url,data:$.extend(e.param||{},s)},function(s){if(i.close(),!s.status)return!1;if(void 0===e.tips||e.tips){var n="";$.each(s.error,function(e,t){n+=""+e+'
                            '+t+"
                            "}),$.each(s.success,function(e,t){n+=""+t+'
                            '+lan.public.success+"
                            "}),a.$batch_success_table({title:e.title,th:e.theadName,html:n}),a.$refresh_table_list(!0)}e.success&&e.success(s,t,a)})}function i(e,i,a){e.callback?e.callback({loadT:0,config:{},check_list:i,bacth_status:!0,start_batch:function(t,i){var a=this;e.load&&(this.loadT=layer.msg(lan.public.executeing+e.title+','+lan.public.schedule+":0/"+this.check_list.length+","+lan.public.please_wait+(e.clear?'cancel':""),$.extend({icon:16,skin:"batch_tips",shade:.3,time:0},e.clear?{area:"420px"}:{})),$("#layui-layer"+a.loadT).on("click",".clear_batch",function(){a.clear_bacth()})),this.config={param:t,url:e.url},this.bacth(i)},bacth:function(t,s){var n=this,l={};if("function"==typeof t&&(s=t,t=0),t'+lan.public.executeing+e.title+','+lan.public.schedule+":"+t+"/"+n.check_list.length+","+lan.public.please_wait+(e.clear?'cancel':"")),bt_tools.send({url:this.config.url,data:this.config.param,bacth:!0},function(e){$.extend(n.check_list[t],{request:{status:"boolean"==typeof e.status&&e.status,msg:e.msg||lan.public.request_error}}),t++,n.bacth(t,s)})}else a&&a(),s(this.check_list),layer.close(this.loadT)},clear_bacth:function(){this.bacth_status=!1,layer.close(this.loadT)}}):e.confirm?t(e,i):e.confirmVerify?bt.show_confirm(e.title+lan.public.in_bulk,e.title+lan.public.in_bulk+","+lan.public.risk_prompt,t):bt.confirm({title:e.title+lan.public.in_bulk,msg:e.title+lan.public.in_bulk+","+lan.public.risk_prompt},function(){t&&t(e,i)})}for(var a=this,s={},n=0;n ',c.list&&$.each(c.list,function(e,t){'
                          • "}),t.init&&setTimeout(function(){t.init(i)},400)):l+='",s[i]||(s[i]={event:t.event,type:"button"})});break;case"search":this.config.search=c;var o="search_input_"+this.random,r="search_btn_"+this.random;l='',s[o]||(s[o]={eventType:"keyup",type:"search_input"}),s[r]||(s[r]={type:"search_btn"});break;case"batch":this.config.batch=c;var d=[],p="",h=c.config;void 0!==c.config?(a.batch_active=h,$(a.config.el).on("click",".set_batch_option",function(e){for(var s=[],n=0;n'+i.title+""}),delete t.group):(d.push(t),p+='
                          • '+t.title+"
                          • ")}),$(a.config.el).on("click",".bt_table_select_group .bt_select_value",function(e){var t=$(this).parent(),i=t.find(".bt_selects"),s=t.offset(),n=a.$get_win_area();return t.hasClass("bt-disabled")?(layer.tips(a.config.batch.disabledSelectValue,t,{tips:[1,"red"],time:2e3}),!1):(t.hasClass("active")?t.removeClass("active"):t.addClass("active"),i.height()>n[1]-s.top?i.addClass("top"):i.removeClass("top"),$(document).one("click",function(){return $(a.config.el).find(".bt_table_select_group").removeClass("active"),!1}),!1)}),$(a.config.el).on("click",".bt_table_select_group .item",function(e){var t=$(this).text(),i=$(this).index();$(this).addClass("active").siblings().removeClass("active"),$(a.config.el+" .bt_select_tips").html(t+lan.public.in_bulk+"("+lan.site.have_been_selected+a.checkbox_list.length+")"),a.batch_active=d[i],a.checked||$(".bt_table_select_group").removeClass("active")}),$(a.config.el).on("click",".set_batch_option",function(e){var s=[],n=a.batch_active;if($(this).hasClass("bt-disabled"))return layer.tips(a.config.batch.disabledSelectValue,$(this),{tips:[1,"red"],time:2e3}),!1;for(var l=0;l'+(void 0!==c.config?'":'
                            '+lan.public.select_opt_type+'
                              '+p+'
                            ")+"";break;case"page":this.config.page=c;var _=bt.get_cookie(this.config.cookiePrefix+"_"+this.config.page.numberParam);this.config.cookiePrefix&&_&&(this.config.page.number=_),l=this.$reader_page(this.config.page,'
                            1 '+lan.public_backup.total+"
                            ")}if(l){var f=$(a.config.el+" .tootls_"+c.positon[1]);if(f.length){var u=f.find(".pull-"+c.positon[0]);u.append(l)}else{var v='
                            '+("left"==c.positon[0]?l:"")+'
                            '+("right"==c.positon[0]?l:"")+"
                            ";"top"===c.positon[1]?($(a.config.el).append(v),0===$(a.config.el+" .divtable").length&&$(a.config.el).append('
                            ')):(0===$(a.config.el+" .divtable").length&&$(a.config.el).append('
                            '),$(a.config.el).append(v))}}}this.init||this.$event_bind(s)},$get_data_batch_list:function(e,t){var i=[];return $.each(t||this.data,function(t,a){i.push(a[e])}),i},$reader_page:function(e,t){var i=this,a=$(t),s="",n={};if(a.find("a").addClass("page_link_"+this.random),s+=a.html(),e.numberStatus){var l="page_select_"+this.random;s+='",n[l]={eventType:"change",type:"page_select"}}if(e.jump){var c="page_jump_input-"+this.random,o="page_jump_btn_"+this.random;s+='
                            '+lan.public.jump_to_page+'
                            ",n[c]={eventType:"keyup",type:"page_jump_input"},n[o]={type:"page_jump_btn"}}return n["page_link_"+this.random]={type:"cut_page_number"},i.config.page.total=parseInt(a.find(".Pcount").html().match(/([0-9]*)/g)[1]),i.$event_bind(n),'
                            '+s+"
                            "},$dynamic_merge_style:function(e,t){var i="";return $.each(e,function(e,t){switch(e){case"align":i+="text-align:"+t+";";break;case"width":i+="width:"+("string"==typeof t?t:t+"px")+";";break;case"style":i+=t;break;case"minWidth":i+="min-width:"+("string"==typeof t?t:t+"px")+";";break;case"maxWidth":i+="max-width:"+("string"==typeof t?t:t+"px")+";"}}),{index:t,css:i}},$event_bind:function(e){var t=this;$.each(e,function(e,i){if(t.event_list[e]&&t.event_list[e].eventType===i.eventType)return!0;t.event_list[e]=i,$(t.config.el).on(i.eventType||"click","."+e,function(a){var s=$(this).parents("tr").index(),n=$(this).data(),l=[];switch(i.type){case"rows":t.event_rows_model={el:$(this),model:t.config.column[$(this).parents("td").index()],rows:t.data[s],index:s},l=[t.event_rows_model.rows,t.event_rows_model.index,a,e,t];break;case"sort":var c=t.config.column[n.index];$(this).hasClass("sort-active")&&$(".sort_"+t.random+" .sort-active").data({sort:"desc"}),$(".sort_"+t.random).removeClass("sort-active").find(".glyphicon").removeClass("glyphicon-triangle-top").addClass("glyphicon-triangle-bottom"),$(this).addClass("sort-active"),"asc"==n.sort?($(this).data({sort:"desc"}),$(this).find(".glyphicon").removeClass("glyphicon-triangle-top").addClass("glyphicon-triangle-bottom")):($(this).data({sort:"asc"}),$(this).find(".glyphicon").removeClass("glyphicon-triangle-bottom").addClass("glyphicon-triangle-top")),t.config.sort=t.config.sortParam({name:c.fid,sort:n.sort}),t.$refresh_table_list(!0);break;case"checkbox":var o=$(t.config.el+' [data-checkbox="all"]'),r=$(t.config.el+" tbody .checkbox_"+t.random);null==n.checkbox?$(this).hasClass("active")?($(this).removeClass("active"),t.checkbox_list.splice(t.checkbox_list.indexOf(s),1),t.checkbox_list.length>0?o.addClass("selected").removeClass("active"):o.removeClass("selected active")):($(this).addClass("active"),t.checkbox_list.push(s),t.data.length===t.checkbox_list.length?o.addClass("active").removeClass("selected"):t.checkbox_list.length>0&&o.addClass("selected")):t.checkbox_list.length===t.data.length?(t.checkbox_list=[],r.removeClass("active selected").next().prop("checked","checked"),o.removeClass("active")):(r.each(function(e,i){$(this).hasClass("active")||($(this).addClass("active").next().prop("checked","checked"),t.checkbox_list.push(e))}),o.removeClass("selected").addClass("active")),t.$set_batch_view();break;case"button":l.push(a,t);break;case"search_focus":var d=$(t.config.el+" .bt_search_tips");$(t.config.el+" .bt_search_tips").length>0&&d.remove();break;case"search_input":if(13==a.keyCode)return $(t.config.el+" .search_btn_"+t.random).click(),!1;break;case"search_btn":var p=$(t.config.el+" .search_input"),h=$(t.config.el+" .search_input").val();t.config.search.value=h,p.append('
                            '+h+'
                            '),t.$refresh_table_list(!0);break;case"page_select":var _=parseInt($(this).val());return t.config.page.number=_,t.config.page.page=1,t.$refresh_table_list(!0),!1;case"page_jump_input":return 13==a.keyCode&&($(t.config.el+" .page_jump_btn_"+t.random).click(),$(this).focus()),!1;case"page_jump_btn":var f=parseInt($(t.config.el+" .page_jump_input-"+t.random).val()),u=Math.ceil(t.config.page.total/t.config.page.number);f>u&&(f=t.config.page.page),t.config.page.page=f,t.$refresh_table_list(!0);break;case"cut_page_number":var v=parseInt($(this).attr("href").match(/([0-9]*)$/)[0]);return t.config.page.page=v,t.$refresh_table_list(!0),!1;case"eye_open_password":return $(this).hasClass("glyphicon-eye-open")?($(this).addClass("glyphicon-eye-close").removeClass("glyphicon-eye-open"),$(this).prev().text(t.data[s].password)):($(this).addClass("glyphicon-eye-open").removeClass("glyphicon-eye-close"),$(this).prev().html("**********")),!1;case"copy_password":return bt.pub.copy_pass(t.data[s].password),!1}i.event&&i.event.apply(this,l)})})},$style_bind:function(e,t){var i="",a=this;$.each(e,function(e,t){""!=t.css&&(t.className?i+=t.className+"{"+t.css+"}":i+=a.config.el+" thead th:nth-child("+(t.index+1)+"),"+a.config.el+" tbody tr td:nth-child"+(t.span?" span":"")+"("+(t.index+1)+"){"+t.css+"}")}),0==$("#bt_table_"+a.random).length&&$(a.config.el).append('")},$get_win_area:function(){return[window.innerWidth,window.innerHeight]},$http:function(e){var t={},i=this.config,a=i.page,s=i.search,n=i.sort||{};a&&(t[a.numberParam]=a.number,t[a.pageParam]=a.page,this.config.cookiePrefix&&bt.set_cookie(this.config.cookiePrefix+"_"+a.numberParam,a.number)),s&&(t[s.searchParam]=s.value),this.config.beforeRequest&&(i.param=this.config.beforeRequest(i.param)),bt_tools.send({url:i.url,data:$.extend(i.param,t,n)},function(t){if(i.dataFilter){var a=i.dataFilter(t);e&&e(a.data,a.page)}else e&&e(t.data,t.page)})}},new t(e)},select_file:function(e,t){"string"==typeof e&&(e={path:e,type:2,title:lan.public.select_fileordir,ext:[],limit:""}),"function"==typeof e&&(type=t,t=e,e={path:bt.get_cookie("Path")}),"number"!=typeof type&&(type=0);var i=this,a={type:type,type_tips:0==type?lan.public.dir:1==type?lan.site.file:lan.public.fileordir,select_list:[],select_path:bt.get_cookie("Path")||("Windows"==bt.os?setup_path:"/www/wwwroot"),select_config:{},scroll_width:0,reader_view:function(){var t=this;this.scroll_width=a.getScrollbarWidth(),layer.open({type:1,title:e.title||lan.public.select+t.type_tips,shadeClose:!1,closeBtn:1,area:["650px","550px"],content:'
                            '+lan.public.name+''+lan.public.modify_time+''+lan.site.redirect_type+'
                            文件修改时间类型
                            '+t.type_tips+'名:
                            ',success:function(){t.evnet_bind(),t.render_file_list(function(){t.set_path_width()}),$(".select_list_thaed").css("right",t.scroll_width+"px")}})},evnet_bind:function(){var e=this;$("#select_dir_list").on("click","tr",function(){var t=$(this).data("index");$(this).addClass("active").siblings().removeClass("active"),$('[name="select_name"]').val(e.select_list[t].filename)}),$(".select_list_body").on("scroll",function(e){var t=$(this).scrollTop(),i=$(this).scrollLeft();t>0?$(".select_list_shadow").show():$(".select_list_shadow").hide(),i>=0&&$(".select_list_thaed").css("left",4-i+"px"),e.stopPropagation(),e.preventDefault()}),$(".file_path_refresh").on("click",function(){e.render_file_list()}),$(".select_dir_list thead th .icon-drag").on("mousedown",function(t){var i=t.clientX,a=$(this).parent(),s=a.index(),n=a[0].clientWidth;parseInt($(this).parent().attr("data-min"));if(1===t.which){var l=function(t){var a=t.clientX,l=a-i,c=n+l;setTimeout(function(){e.set_select_width(s,"width:"+c+"px")},0)};$(document).on("mousemove",l).one("mouseup",function(){$(this).unbind(l),$(this).unbind(this)})}t.stopPropagation()}),$(".select_dir_list thead th>span").on("click",function(t){var i=$(this).parent(),a=i.data("type"),s=i.hasClass("active"),n=i.hasClass("sort");s?i.addClass("sort").removeClass("active"):n?i.addClass("active").removeClass("sort"):i.addClass("active"),i.siblings().removeClass("active sort"),e.render_file_list({sort:a,reverse:s?1:0}),t.stopPropagation()}),$(".search_path_views input").on("keyup",function(){$(this).val()})},set_path_width:function(e){var t=0,i=$(".file_dir_view")[0].offsetWidth,a=($(".file_dir_view .file_dir_item"),[]);t=0;$(".file_dir_view .file_dir_item").each(function(){a.push($(this)[0].offsetWidth)});for(var s=a.reverse(),n=0;n-1?"本地磁盘("+t.path.match(/[A-Z]+/)[0]+":)":t.path;a+='
                            '+i+"
                            "}),$.each(o,function(e,t){var i=bt.format_data(t.mtime),a="dir"==t.type?"文件夹":"文件";s+=' '+t.filename+" "+i+" "+("dir"==t.type?"文件夹":"文件")+" "}),$("#select_mount_list").html(a),$("#select_dir_list").html(s),t&&t(e)})},render_path_list:function(e,t){var i='
                            ',a="",s=e.split("/").splice(1),n=e.split("/")[0];"Windows"===bt.os?(0==s.length&&(s=[]),s.unshift('本地磁盘('+n+")")):("/"==e&&(s=[]),s.unshift("根目录"));for(var l=0;l '+s[l]+' ';$(".path_input").val("").attr("data-path",e);var c=$("#select_file_directory .file_path_input .file_dir_view");c.html(i),t&&t(e)},set_select_width:function(e,t){var i=".select_dir_list tbody td:nth-child("+(e+1)+")>span,.select_dir_list thead th:nth-child("+(e+1)+")>span",a=$("#th-index-"+e);a.length>0?a.html(i+"{"+t+"}"):$("#select_file_style").append('")},cut_style_object:function(e){var t={};e.split(";");return t},getScrollbarWidth:function(){var e,t,i=document.createElement("div"),a={width:"100px",height:"100px",overflowY:"scroll"};for(e in a)i.style[e]=a[e];return document.body.appendChild(i),t=i.offsetWidth-i.clientWidth,i.remove(),t}};a.reader_view()},form:function(e){function t(e){this.config=e,this.data=e.data||{},this.$load()}var i=this;return t.prototype={element:null,style_list:[],event_list:{},event_type:["click","event","focus","keyup","blur","change"],hide_list:[],form_element:{},form_config:{},random:bt.get_random(5),$load:function(){var e=this;e.el&&this.$reader_content(function(){e.$event_bind()})},$reader_content:function(e){var t=this,a="",s="";return $.each(t.config.form,function(e,i){a+=t.$reader_content_row(e,i)}),t.element=$('
                            '+a+"
                            "),s=$('
                            '),s.append(t.element),e&&e(),s[0].outerHTML},$reader_content_row:function(e,t){var a=this,s=t.help,n=this.config.formLabelWidth||t.formLabelWidth;return'
                            "+(t.label?'"+t.label+"":"")+'
                            "+a.$reader_form_element(t.group,e)+(s?'
                            "+s.list.join("
                            ")+"
                            ":"")+"
                            "},$reader_form_element:function(e,t){var i=this,a="";return Array.isArray(e)||(e=[e]),$.each(e,function(e,s){s.find_index=t,a+=i.$reader_form_find(s),i.form_config[s.name]=s}),a},$reader_form_element:function(e,t){var a=this,s="",n={};return Array.isArray(e)||(e=[e]),$.each(e,function(e,l){var c=a.$reader_style(l.style)+i.$verify(l.width,"width","style"),o=a.$verify_group(l,["name","value","placeholder","disabled","readonly","autofocus","autocomplete","min","max"]),r=a.$create_event_config(l),d="";switch(s+=l.label?''+l.label+"":"",void 0!==l.name&&(n[l.name]=r),l.type){case"text":case"checkbox":case"password":case"radio":case"number":var p="event_"+l.name+"_"+a.random,h="checkbox"===l.type;"radio"===l.type?$.each(l.label_tips,function(e,t){l.block&&(s+='
                            '),s+='',s+='",l.block&&(s+="
                            ")}):(l.block&&(s+='
                            '),s+='","checkbox"==l.type&&(s+='"),l.block&&(s+="
                            "),a.event_list[p]={click:{event:l.event}}),l.icon&&(s+='",n[l.name+"_icon"]={click:{type:"select_path",config:l}});break;case"textarea":if(s+='",$.each(["blur","focus","input"],function(e,t){if(l.tips){var i=null;switch(t){case"blur":i=function(e,t){""===$(this).val()&&$(this).next().show(),layer.close(t.tips.loadT)};break;case"focus":i=function(e,t){$(this).next().hide(),t.tips.loadT=layer.tips(_,$(this),{tips:[1,"#20a53a"],time:0,area:$(this).width()})}}}n[l.name][t]?n[l.name][t].added=i:n[l.name][t]={type:l.type,cust:!1,event:l[t],added:i}}),l.tips){var _="";_=void 0===l.tips.list?l.tips.text:l.tips.list.join("
                            "),s+='
                            "+_+"
                            ",n[l.name+"_tips"]={click:{type:"textarea_tips",config:l}}}break;case"select":s+=a.$reader_select(l,c,o,t),a.event_list.custom_select={click:{type:"custom_select",children:".bt_select_value"}},a.event_list.custom_select_item={click:{type:"custom_select_item",children:"li.item"}};break;case"link":d="event_"+bt.get_random(6),s+='
                            "+l.title+"",a.event_list[d]={click:{type:"link_event",event:l.event}};break;case"help":var f="";$.each(l.list,function(e,t){f+="
                          • "+t+"
                          • "}),s+='
                              "+f+"
                            "}a.form_config[l.name]=l}),$.extend(a.event_list,n),s},$create_event_config:function(e){var t={};return void 0===e.name?{}:($.each(this.event_type,function(i,a){e[a]&&(t["event"===a?"click":a]={type:e.type,event:e[a],cust:["select","checkbox","radio"].indexOf(e.type)>-1,config:e})}),t)},$reader_style:function(e){var t="";return"string"==typeof e?e:void 0===e?"":($.each(e,function(e,i){t+=e+":"+i+";"}),t)},$local_refresh:function(e,t){this.element.find("[data-name="+e+"]").replaceWith(this.$reader_form_find(t))},$reader_select:function(e,t,a,s){var n=this,l="",c="",o={};if(!Array.isArray(e.list)){var r=e.list;bt_tools.send({url:r.url,data:r.param||{}},function(t){!1!==t.status?(e.list=e.list.dataFilter?e.list.dataFilter(t):t,n.$replace_render_content(s)):bt.msg(t)})}return $.each(e.list,function(t,a){try{o=a.value===e.value?a:e.list[0]}catch(e){}l+='
                          • '+a.title+"
                          • ",c+='"}),!o.title&&Array.isArray(e.list)&&(o=e.list[0]),'
                            '+(o.title||"Getting data...")+'
                              '+(l||"")+"
                            "+(c||"")+"
                            "},$replace_render_content:function(e){var t=this,i=this.config.form[e];$("[data-form="+t.random+"]").find(".line:eq("+e+")").replaceWith(t.$reader_content_row(e,i))},$event_bind:function(e,t){var i=this,a={};i.element=$("object"==typeof e?i.element:"[data-form="+i.random+"]"),void 0===e&&(a=i.event_list),$.each(a,function(e,t){if($.isEmptyObject(t))return!0;$.each(t,function(t,a){var s="";s="boolean"==typeof a.cust?"["+(a.cust?"data-":"")+"name="+e+"]":"."+e,function(e,a){if(!1===e.onEvent){switch(e.type){case"input_checked":$(s).on("event"!=t?t:"click",function(t){e.event.apply(this,[t,i])})}return!0}i.element.on("event"!=t?t:"click",e.children?e.children:s,function(t){var s=i.$get_form_element(!0),n=i.$get_form_value(),l=i.form_config[a];switch(e.type){case"textarea_tips":$(this).hide().prev().focus();break;case"custom_select":if($(this).parent().hasClass("bt-disabled"))return!1;var c=$(this).next();return c.hasClass("show")?c.removeClass("show"):($(".bt_select_list").removeClass("show"),c.addClass("show")),$(document).click(function(){return i.element.find(".bt_select_list").removeClass("show"),$(this).unbind("click"),!1}),!1;case"custom_select_item":if(l=i.form_config[$(this).parents(".bt_select_updown").attr("data-name")],item_config=l.list[$(this).index()],$(this).hasClass("disabled"))return $(this).parent().removeClass("show"),item_config.tips&&layer.msg(item_config.tips,{icon:2}),!0;$(this).hasClass("active")||$(this).hasClass("disabled")||($(this).parent().prev().find(".bt_select_content").text($(this).text()),$(this).addClass("active").siblings().removeClass("active"),$(this).parent().next().val(item_config.value.toString()),$(this).parent().removeClass("show"),$(this).parent().next().trigger("change"));break;case"select_path":bt.select_path("event_"+$(this).prev().attr("name")+"_"+i.random,e.config.icon.select||"");break;case"checkbox":var o=$(this).is(":checked");o?$(this).prev().addClass("active"):$(this).prev().removeClass("active")}e.event&&e.event.apply(this,[n,s,i,l,t]),e.added&&e.added.apply(this,[t,l,s])})}(a,e)})}),t&&t()},$get_form_value:function(){return this.element.serializeObject()},$set_find_value:function(e,t){var i={},a=this;"string"!=typeof e?i=e:i[e]=t,$.each(i,function(e,t){a.form_element[e].val(t)})},$get_form_element:function(e){var t={},i=this;return e||$.isEmptyObject(i.form_element)?(this.element.find(":input").each(function(e){t[$(this).attr("name")]=$(this)}),i.form_element=t,t):i.form_element},$verify_group:function(e,t){var i="";return $.each(t,function(t,a){if(void 0===e[a])return!0;["disabled","readonly"].indexOf(a)>-1?i+=" "+(e[a]?a+'="'+a+'"':""):i+=" "+a+'="'+e[a]+'"'}),i},$verify_bind_event:function(e,t,i){var a={};return $.each(i,function(i,s){var n=t[s];n&&("object"==typeof a[e]?(Array.isArray(a[e])||(a[e]=[a[e]]),a[e].push({event:n,eventType:s})):a[e]={event:n,eventType:s})}),a},$verify:function(e,t,i){return e?!0===i?e?" "+t:"":"style"===i?t?t+":"+e+";":e:t?" "+t+'="'+e+'"':" "+e:""},$verify_form:function(){for(var e={},t=this.config.form,i=this.$get_form_value(),a=this.$get_form_element(!0),s=0;s'+i.title+"",s+='
                            '+(l?i.content:"")+"
                            "}),e.element=$('
                            '+a+'
                            '+s+"
                            "),e.element[0].outerHTML},$reader_find:function(){},$event_bind:function(){var e=this,t=e.theme,i=t.active||"active";e.el||(e.element=$("#tab_"+e.random)),e.element.on("click","."+t.nav.replace(/\s+/g,".")+" span",function(){var a=$(this).index(),s=e.config.list[a];$(this).addClass(i).siblings().removeClass(i),$("."+t.body+">div:eq("+a+")").addClass(i).siblings().removeClass(i),e.active=a,s.init||($("."+t.body+">div:eq("+a+")").html(s.content),s.success&&s.success(),s.init=!0)})}},new t(e)},load:function(e){var t=layer.msg(e+",please wait...",{icon:16,time:0,shade:.3});return!0===e&&(t=layer.load()),{close:function(){layer.close(t)}}},open:function(e){var t={},i=null,a=null;if(t=$.extend({type:1,area:"640px",closeBtn:2,btn:["Yes","No"]},e),"object"==typeof t.content){var s=t.content;a=bt_tools.form(s),t.success=function(e,i){a.$event_bind(),void 0!==t.init&&t.init(e,i)},t.yes=function(t,i){var s=a.$verify_form();if(!s)return!1;if(void 0!==e.yes){var n=e.yes.apply(a,[s,t,i]);if(!n)return!1}},t.content=a.$reader_content()}return i=layer.open(t),{close:function(){layer.close(i)},form:a}},msg:function(e,t){var i=null,a="",s={};return"object"==typeof e&&"boolean"==typeof e.status&&(a=e.msg,s={icon:e.status?1:2}),"string"==typeof e&&(a=e,s={icon:void 0!==t?t:1}),i=layer.msg(a,s),{close:function(){layer.close(i)}}},$verify:function(e,t,i){return e?!0===i?e?" "+t:"":"style"===i?t?t+":"+e+";":e:t?" "+t+'="'+e+'"':" "+e:""},select_path:function(e,t,i,a){"number"!=typeof i&&(i=1),"number"!=typeof a&&(a=!1),bt.set_cookie("Path","/www/server/panel/BTPanel/static");var s=this,n={type:i,type_tips:0==i?"目录":1==i?"文件":"目录或文件",type_limit:0==i?"dir":1==i?"file":"all",select_list:[],select_path:bt.get_cookie("Path")||("Windows"==bt.os?setup_path:"/www/wwwroot"),select_config:{},scroll_width:0,file_path:bt.get_cookie("Path"),file_operating:[],area:[window.innerWidth,window.innerHeight],reader_view:function(){var t=this;this.scroll_width=n.getScrollbarWidth(),layer.open({type:1,title:e.title||"选择"+t.type_tips,shadeClose:!1,closeBtn:2,area:["650px","555px"],content:'
                            名称修改时间类型
                            文件修改时间类型
                            '+t.type_tips+'名:
                            ',success:function(){t.render_file_list(),$(".select_list_thaed").css("right",t.scroll_width+"px")}})},render_file_list:function(e,t){var i="",a="",n=this,l={path:this.select_path,sort:"type",disk:!0};void 0===e&&(e=l),"function"==typeof e&&(t=e,e=l),n.select_config=$.extend(l,e),s.$http("GetDir",n.select_config,function(e){var s=e.DISK,l=$.merge(n.data_reconstruction(e.DIR,"DIR"),n.data_reconstruction(e.FILES));n.select_list=l,n.render_path_list(),$.each(s,function(e,t){var a="/"==t.path?"根目录":t.path.indexOf(":/")>-1?"本地磁盘("+t.path.match(/[A-Z]+/)[0]+":)":t.path;i+='
                            '+a+"
                            "}),$.each(l,function(e,t){if(0==n.type&&t.type!=n.type_limit)return!0;var i=bt.format_data(t.mtime),s="dir"==t.type?"文件夹":"文件";a+=' '+t.filename+" "+i+" "+("dir"==t.type?"文件夹":"文件")+" "}),$("#select_mount_list").html(i),$("#select_dir_list").html(a),t&&t(e)})},data_reconstruction:function(e,t,i){if(e.length<1)return[];var a=[];return $.each(e,function(e,i){var s=i.split(";"),n="",l=s[0].split("."),c=l[l.length-1];switch(s[0]){case".user.ini":n="PS: PHP用户配置文件(防跨站)!";break;case".htaccess":n="PS: Apache用户配置文件(伪静态)";break;case"swap":n="PS: 宝塔默认设置的SWAP交换分区文件"}-1!=s[0].indexOf("Recycle_bin")&&(n="PS: 回收站目录,勿动!"),-1!=s[0].indexOf(".upload.tmp")&&(n="PS: 宝塔文件上传临时文件,重新上传从断点续传,可删除"),a.push({caret:"1"==s[8],down_id:s[9],ext:"DIR"==t?"":c,filename:s[0],mtime:s[2],ps:n||s[10],size:s[1],type:"DIR"==t?"dir":"file",user:s[3],root_level:s[4]})}),a},render_path_list:function(e){var t=this,i='
                            ',a="",s=this.file_path.split("/").splice(1),n=this.file_path.split("/")[0];"Windows"===bt.os?(0==s.length&&(s=[]),s.unshift('本地磁盘('+n+")")):("/"==this.file_path&&(s=[]),s.unshift("根目录"));for(var l=0;l '+s[l]+' ';$(".path_input").val("").attr("data-path",this.file_path);var c=$(".file_path_input .file_dir_view");c.html(i),c.attr("data-width",c.width()),t.set_dir_view_resize()},set_select_width:function(e,t){var i=".select_dir_list tbody td:nth-child("+(e+1)+")>span,.select_dir_list thead th:nth-child("+(e+1)+")>span",a=$("#th-index-"+e);a.length>0?a.html(i+"{"+t+"}"):$("#select_file_style").append('")},cut_style_object:function(e){var t={};e.split(";");return t},getScrollbarWidth:function(){var e,t,i=document.createElement("div"),a={width:"100px",height:"100px",overflowY:"scroll"};for(e in a)i.style[e]=a[e];return document.body.appendChild(i),t=i.offsetWidth-i.clientWidth,i.remove(),t},set_dir_view_resize:function(){var e=$(".file_path_input"),t=$(".file_path_input .file_dir_view"),i=t.attr("data-width"),a=null;if(i?parseInt(i):(i=t.width(),t.attr("data-width",i)),t.width()-i<90){var s=0;$($(".file_path_input .file_dir_view .file_dir_item").toArray().reverse()).each(function(){var t=0;$(this).attr("data-width")?t=parseInt($(this).attr("data-width")):($(this).attr("data-width",$(this).width()),t=$(this).width()),s+=t,e.width()-s<=90?$(this).addClass("hide"):$(this).removeClass("hide")})}a=t.children(".file_dir_item.hide").clone(!0);0==t.children(".file_dir_item.hide").length?e.removeClass("active").find(".file_dir_omit").addClass("hide"):(a.each(function(){0==$(this).find(".glyphicon-hdd").length&&$(this).find(".file_dir").before('')}),e.addClass("active").find(".file_dir_omit").removeClass("hide"),e.find(".file_dir_omit .nav_down_list").empty().append(a),e.find(".file_dir_omit .nav_down_list .file_dir_item").removeClass("hide"))},reader_file_list:function(e,t){var i=this;if("function"==typeof e&&(t=e,e={is_operating:!1}),void 0===e&&(e={is_operating:!1}),a)return layer.msg("只能在该目录下操作",{icon:2}),!1;this.loadT=bt.load("正在获取文件列表,请稍候..."),this.file_images_list=[],i.get_dir_list(e,function(e){i.loadT.close(),i.file_list=$.merge(i.data_reconstruction(e.DIR,"DIR"),i.data_reconstruction(e.FILES)),i.file_path=e.PATH,i.is_recycle=e.FILE_RECYCLE,i.file_store_list=e.STORE,bt.set_cookie("Path",e.PATH);var a="",s="",n=e.DISK,l=i.file_list;i.select_list=i.file_list,i.render_path_list(),$.each(n,function(e,t){var i="/"==t.path?"根目录":t.path.indexOf(":/")>-1?"本地磁盘("+t.path.match(/[A-Z]+/)[0]+":)":t.path;a+='
                            '+i+"
                            "}),$.each(l,function(e,t){if(0==i.type&&t.type!=i.type_limit)return!0;var a=bt.format_data(t.mtime),n="dir"==t.type?"文件夹":"文件";s+=' '+t.filename+" "+a+" "+("dir"==t.type?"文件夹":"文件")+" "}),$("#select_mount_list").html(a),$("#select_dir_list").html(s);var c=e.PATH.lastIndexOf("/");e.PATH.substring(c+1,e.PATH.length);t&&t(rdata)})},reader_file_list_content:function(e,t){var i="",a=this,s=0;$.each(e,function(e,t){var n=t.filename+t.ps;a.file_list[e]=t=a.$file_data_dispose(t),a.file_list[e].only_index=e,t.filename.indexOf("Recycle_bin")&&(_tips="PS: 回收站目录,勿动!"),n.length>20&&(n=n.substring(0,20)+"..."),bt.check_chinese(n)&&n.length>10&&(n=n.substring(0,10)+"..."),i+='
                            '+t.filename+t.ps+""+(t.caret?'':"")+(t.down_id?'':"")+'
                            '+t.type_tips+'
                            '+("dir"==t.type?'点击计算':bt.format_size(t.size))+'
                            '+bt.format_data(t.mtime)+"
                            ","dir"==t.type&&s++,t.ispreview&&(a.file_images_list.push(t.path),t.images_id,t.images_id=a.file_images_list.length-1)}),$(".file_list_content").html(i),t&&t({is_dir_num:s})},$file_data_dispose:function(e){var t={languages:null,model:null};return $.extend(e,{only_id:bt.get_random(10),type_tips:"dir"===e.type?"文件夹":this.ext_type_tips(e.ext),open_type:this.determine_file_type(e.ext),languages:t.languages,path:e.path||this.path_resolve(this.file_path,e.filename),model:t.model})},path_resolve:function(e,t){var i="";return Array.isArray(t)||(t=[t]),e.replace(/([\/|\/]*)$/,function(e){return e,"www"}),$.each(t,function(e,t){i+="/"+t}),e+i},$get_file_model:function(e){var t=this.vscode_editor.config;for(languages in t.supportedModes)for(var i=t.supportedModes[languages],a=0;a'+("/"==i.path?"根目录":i.path)+" ("+i.size[2]+")"}),$(".mount_disk_list").html(t)})},determine_file_type:function(e,t){var i={images:["jpg","jpeg","png","bmp","gif","tiff","ico"],compress:["zip","rar","gz","war","tgz"],video:["mp4","mpeg","mpg","mov","avi","webm","mkv"],ont_text:["iso","xlsx","xsl","doc","docx","tiff","exe","so","7z","bz","dmg","apk"]},a=!1;if(null!=t)if("text"==t)$.each(i,function(t,i){$.each(i,function(t,i){if(i==e)return a=!0,!1})}),a=!a;else{if(void 0===i[t])return!1;$.each(i[t],function(t,i){if(i==e)return a=!0,!1})}else $.each(i,function(t,i){$.each(i,function(i,s){if(s==e)return a=t,!1})}),"boolean"==typeof a&&(a="text");return a},render_file_groud_menu:function(e,t){var i=this,a=$(t).data("index"),s=i.file_list[a],n=[["open","打开"],["split",""],["download","下载"],["share","分享目录/文件"],["cancel_share","取消分享"],["favorites","收藏目录/文件"],["cancel_favorites","取消收藏"],["split",""],["dir_kill","目录查杀"],["authority","权限"],["split",""],["copy","复制"],["shear","剪切"],["rename","重命名"],["del","删除"],["split",""],["killing","创建压缩",[["gzip","tar.gz (推荐)"],["zip","zip (通用格式)"],["rar","rar (中文兼容较好)"]]],["unzip","解压",[["local","解压到当前"],["folad","解压到当前"]]]],l=["zip","rar","gz","war","tgz","bz2"],c=0;"dir"==s.type&&(n.splice(2,1),c++),0!==s.down_id?(n.splice(3-c,1),c++):(n.splice(4-c,1),n[3-c][1]="dir"==s.type?"分享目录":"分享文件",c++),!1!==s.caret?(n.splice(5-c,1),c++):(n.splice(6-c,1),n[5-c][1]="dir"==s.type?"收藏目录":"收藏文件",c++),"php"!=s.ext&&"dir"!=s.type&&(n.splice(8-c,1),c++);var o=0;$.each(l,function(e,t){t==s.ext&&o++}),0==o&&(n.splice(17-c,1),c++),i.reader_menu_list({el:$(".selection_right_menu"),ev:e,data:s,list:n})},render_file_all_menu:function(e,t){var i=this,a=[["refresh","刷新"],["split",""],["upload","上传"],["create","新建文件夹/文件",[["create_dir","新建文件夹"],["create_files","新建文件"]]],["split",""],["paste","粘贴"]];bt.get_storage("session","copy_path")||a.splice(5,1),i.reader_menu_list({el:$(".selection_right_menu"),ev:e,data:{},list:a})},get_dir_list:function(e,t,i){var a=this;"boolean"==typeof t&&(i=t,t=null),s.$http("GetDir",$.extend({disk:!0,path:a.file_path,sort:bt.get_cookie("files_sort")||"type"},e),t,i)},retrun_prev_path:function(e){var t=e.split("/");return t.splice(t.length-1),t.join("/")},reader_menu_list:function(e){var t=this,i=e.el.find("ul"),a=i.height(),s=i.width(),n=e.ev.clientX-(this.area[0]-e.ev.clientX'):(Array.isArray(s[2])&&(n=$('
                              '),l=n.find(".set_group"),$.each(s[2],function(i,a){l.append($('
                            • '+a[1]+"
                            • ").on("click",{type:a[0],data:e.data},function(i){t.file_groud_event($.extend(i.data.data,{open:i.data.type,index:parseInt($(e.ev.currentTarget).data("index")),element:e.ev.currentTarget,type_tips:s.type?"文件夹":"文件"})),e.el.removeAttr("style"),i.stopPropagation(),i.preventDefault()}))})),i.append($('
                            • '+s[1]+"
                            • ").append(n).on("click",{type:s[0],data:e.data},function(i){t.file_groud_event($.extend(i.data.data,{open:i.data.type,index:parseInt($(e.ev.currentTarget).data("index")),element:e.ev.currentTarget,type_tips:s.type?"文件夹":"文件"})),e.el.removeAttr("style"),i.stopPropagation(),i.preventDefault()})))}),e.el.css({left:n,top:e.ev.clientY-(this.area[1]-e.ev.clientY0?$(".select_list_shadow").show():$(".select_list_shadow").hide(),i>=0&&$(".select_list_thaed").css("left",4-i+"px"),e.stopPropagation(),e.preventDefault()}),$(".file_path_refresh").on("click",function(){e.render_file_list()}),$(".select_dir_list thead th .icon-drag").on("mousedown",function(t){var i=t.clientX,a=$(this).parent(),s=a.index(),n=a[0].clientWidth;parseInt($(this).parent().attr("data-min"));if(1===t.which){var l=function(t){var a=t.clientX,l=a-i,c=n+l;setTimeout(function(){e.set_select_width(s,"width:"+c+"px")},0)};$(document).on("mousemove",l).one("mouseup",function(){$(this).unbind(l),$(this).unbind(this)})}t.stopPropagation()}),$(".select_dir_list thead th>span").on("click",function(t){var i=$(this).parent(),a=i.data("type"),s=i.hasClass("active"),n=i.hasClass("sort");s?i.addClass("sort").removeClass("active"):n?i.addClass("active").removeClass("sort"):i.addClass("active"),i.siblings().removeClass("active sort"),e.render_file_list({sort:a,reverse:s?1:0}),t.stopPropagation()}),$(".search_path_views input").on("keyup",function(){$(this).val()}),$(".search_path_views input").focus(function(){$(this).next().show()}).blur(function(){$(this).next().hide()}),$("#select_file_directory .select_file_group").on("click",".select_btn_group .btn-success",function(t){var i=$('[name="select_name"]').val();""==i?layer.msg("只能选择"+e.type_tips,{icon:2}):e.file_path}),$("#select_file_directory .select_file_tootls").on("click",".creat_dir",function(t){ +var i="   ";0==$("#tbody tr").length?$("#select_dir_list").append(i):$("#select_dir_list tr:first-child").before(i),$(".newFolderName").focus(),$("#nameOk").click(function(){var t=$("#newFolderName").val(),i=$(".file_path_views .path_input").attr("data-path");newTxt=i+"/"+t,s.$http("CreateDir",{path:newTxt},function(t){1==t.status?(e.reader_file_list({path:i,is_operating:!1}),layer.msg(t.msg,{icon:1})):layer.msg(t.msg,{icon:2})})})}),$("#select_mount_list").on("click",".item",function(){e.reader_file_list({path:$(this).attr("data-menu"),is_operating:!0})}),$(window).resize(function(t){$(this)[0].innerHeight!=e.area[1]&&(e.area[1]=$(this)[0].innerHeight,e.set_file_view()),$(this)[0].innerWidth!=e.area[0]&&(e.area[0]=$(this)[0].innerWidth,e.set_dir_view_resize()),e.vscode_editor.view&&e.vscode_editor.is_full_min>0&&layer.style(e.vscode_editor.view,{top:0,left:0,width:e.area[0],height:e.area[1]}),e.vscode_editor.view&&$.isEmptyObject(e.vscode_editor.list)&&e.vscode.layout()}).keydown(function(t){t=window.event||t;var i=t.keyCode,a=t.target.tagName.toLowerCase();if(8==i&&"input"!==a&&"textarea"!==a)return null==e.vscode_editor.view&&$(".forward_path span:eq(0)").click(),!1}),$(".file_path_input .path_input").on("focus blur keyup",function(t){t=t||window.event;var i=$(this).attr("data-path");switch(t.type){case"focus":$(this).addClass("focus").val(i).prev().hide();break;case"blur":$(this).removeClass("focus").val("").prev().show();break;case"keyup":if(13!=t.keyCode&&"keyup"==t.type)return!1;var a=$(this);$(this).data("path")!=$(this).val()&&e.reader_file_list({path:$(this).val(),is_operating:!0},function(e){!1===e.status?$(a).val(i):($(a).val(e.PATH),$(a).blur().prev().show())})}t.stopPropagation()}),$(".file_path_input .file_dir_view").on("click",".file_dir",function(){e.reader_file_list({path:$(this).attr("title"),is_operating:!0})}),$(".forward_path span").click(function(){var t=$(this).index(),i="";if(!$(this).hasClass("active")){switch(t){case 0:e.file_pointer=e.file_pointer-1,i=e.retrun_prev_path(e.file_path);break;case 1:e.file_pointer=e.file_pointer+1,i=e.file_path+"/"+$(".select_file_group .file_directory").val();break;case 2:e.file_pointer=e.file_pointer-1,i=e.retrun_prev_path(e.file_path)}e.reader_file_list({path:i,is_operating:!1})}}),$(".file_path_input .file_dir_view").on("click",".file_dir_omit",function(e){var t=this,i=$(this).children(".nav_down_list");$(this).addClass("active"),i.addClass("show"),$(document).one("click",function(){$(t).removeClass("active"),i.removeClass("show"),e.stopPropagation()}),e.stopPropagation()}),$("#select_dir_list").on("dblclick","tr",function(t){if($(t.target).hasClass("file_check"))return!1;var i=$(this).attr("data-path"),a=$(this).attr("data-type");"dir"==a&&e.reader_file_list({path:e.file_path+"/"+i}),t.stopPropagation(),t.preventDefault()}),$(".file_path_refresh").click(function(){e.reader_file_list({path:e.file_path})}),$(".file_nav_view .upload_or_download").on("click",function(t){e.open_upload_view(),t.stopPropagation(),t.preventDefault()}),$(".file_nav_view .upload_or_download li").on("click",function(t){var i=$(this).data("type");"uploadFile"===i?e.open_upload_view():e.open_download_view(),t.stopPropagation(),t.preventDefault()}),$(".mount_disk_list").on("click",".nav_btn",function(){var t=$(this).data("menu");e.reader_file_list({path:t})}),$(".file_list_header").on("click",".file_name,.file_size,.file_mtime,.file_accept,.file_user",function(t){var i=$(this).attr("data-tid"),a=$(this).find(".icon_sort").hasClass("active"),s=$(this).hasClass("active");return!$(this).find(".icon_sort").hasClass("active")&&$(this).hasClass("active")?$(this).find(".icon_sort").addClass("active"):$(this).find(".icon_sort").removeClass("active"),$(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty(),$(this).find(".icon_sort").html(''),s||(a=!0),bt.set_cookie("files_sort",i),bt.set_cookie("name_reverse",a?1:0),e.reader_file_list(),!1}),$(".file_list_header .file_th").each(function(e,t){var i=bt.get_cookie("files_sort"),a=bt.get_cookie("name_reverse");$(this).attr("data-tid")===i&&($(this).addClass("active").siblings().removeClass("active").find(".icon_sort").removeClass("active").empty(),$(this).find(".icon_sort").html(''),0===a&&$(this).find(".icon_sort").addClass("active"))}),$(".file_list_header .file_check").on("click",function(t){var i=parseInt($(this).data("checkbox"));switch(i){case 0:$(this).addClass("active").removeClass("active_2").data("checkbox",1),$(".file_list_content .file_tr").addClass("active").removeClass("active_2"),e.file_table_arry=e.file_list;break;case 2:$(this).addClass("active").removeClass("active_2").data("checkbox",1),$(".file_list_content .file_tr").addClass("active"),e.file_table_arry=e.file_list;break;case 1:$(this).removeClass("active active_2").data("checkbox",0),$(".file_list_content .file_tr").removeClass("active"),e.file_table_arry=[]}}),$(".file_list_content").on("click",".file_check",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),s=$(".file_list_header .file_check"),n=i.attr("data-filename");$(".selection_right_menu").removeAttr("style"),i.hasClass("active")?(i.removeClass("active"),e.remove_check_file(e.file_table_arry,"filename",n),e.file_table_arry.length>0?s.addClass("active_2").removeClass("active").data("checkbox",2):0==e.file_table_arry.length&&s.removeClass("active active_2").data("checkbox",0)):(i.addClass("active"),i.attr("data-filename",e.file_list[a].filename),e.file_table_arry.length==e.file_list.length?s.addClass("active").removeClass("active_2").data("checkbox",1):s.addClass("active_2").removeClass("active").data("checkbox",2),e.file_table_arry.push(e.file_list[a])),t.stopPropagation()}),$(".file_list_content").scroll(function(e){$(this).scrollTop()==$(this)[0].scrollHeight-$(this)[0].clientHeight?($(this).prev().css("opacity",1),$(this).next().css("opacity",0)):$(this).scrollTop()>0?$(this).prev().css("opacity",1):0==$(this).scrollTop()&&($(this).prev().css("opacity",0),$(this).next().css("opacity",1))}),$(".file_table_view .file_list_content").on("click",".file_tr",function(e){$(".selection_right_menu").removeAttr("style"),$(this).find(".file_checkbox .file_check").click(),e.stopPropagation(),e.preventDefault()}),$(".file_table_view .file_list_content").on("click",".file_title i",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),s=e.file_list[a];"dir"==s.type&&e.reader_file_list({path:e.file_path+"/"+s.filename}),t.stopPropagation()}),$(".file_table_view .file_list_content").on("click",".file_name .icon-share1",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),s=e.file_list[a];e.info_file_share(s,i),t.stopPropagation()}),$(".file_table_view .file_list_content").on("click",".file_name .icon-favorites",function(t){var i=$(this).parents(".file_tr"),a=i.data("index"),s=e.file_list[a];s.typeText=s.type?"文件夹":"文件",e.cancel_file_favorites(s,i),t.stopPropagation()}),$(".file_table_view .file_list_content").on("dblclick",".file_tr",function(t){if($(t.target).hasClass("file_check"))return!1;var i=$(this).data("index"),a=e.file_list[i];"dir"==a.type&&e.reader_file_list({path:e.file_path+"/"+a.filename}),t.stopPropagation(),t.preventDefault()}),$(".file_list_content").on("contextmenu",".file_tr",function(t){var i=this;3==t.which&&(e.render_file_groud_menu(t,this),$(".content_right_menu").removeAttr("style"),$(this).addClass("selected").siblings().removeClass("selected"),$(document).one("click",function(e){$(i).removeClass("selected"),$(".selection_right_menu").removeAttr("style"),e.stopPropagation(),e.preventDefault()})),t.stopPropagation(),t.preventDefault()}),$(".file_list_content").on("contextmenu",function(t){var i=$(".content_right_menu");i.width(),i.height();3==t.which&&($(".selection_right_menu").removeAttr("style"),e.render_file_all_menu(t,this)),t.stopPropagation(),t.preventDefault()}),$(".filePage").on("change",".showRow",function(){var t=$(this).val();bt.set_storage("showRow",t),e.reader_file_list()}),$(".file_list_content").on("click",".folder_size",function(e){var t=i.file_list[$(this).parents(".file_tr").data("index")],i=this;i.get_file_size({path:t.path},function(e){$(i).text(bt.format_size(e.size))}),e.stopPropagation(),e.preventDefault()}),$(".cut_view_model").on("click",function(){var e=$(this).data("type");$(".file_table_view").addClass("icon"==e?"icon_view":"list_view").removeClass("icon"!=e?"icon_view":"list_view"),$(this).addClass("active").siblings().removeClass("active")})},set_file_forward:function(){var e=this,t=$(".forward_path span");1==e.file_operating.length?t.addClass("active"):e.file_pointer==e.file_operating.length-1?(t.eq(0).removeClass("active"),t.eq(1).addClass("active")):0==e.file_pointer?(t.eq(0).addClass("active"),t.eq(1).removeClass("active")):t.removeClass("active")},set_file_view:function(){var e=$(".file_list_content"),t=this.area[1]-170;$(".file_bodys").height(this.area[1]-100),50*this.file_list.length>t?(e.attr("data-height",e.data("height")||e.height()).height(t),$(".file_shadow_bottom").css("opacity",1)):(e.height(t),$(".file_shadow_top,.file_shadow_bottom").css("opacity",0))},clear_table_active:function(){this.file_table_arry=[],$(".file_list_header .file_check").removeClass("active active_2"),$(".file_list_content .file_tr").removeClass("active")}};n.reader_view(),n.event_bind()},$fixed_table_thead:function(e){$(e).scroll(function(){var e=this.scrollTop;this.querySelector("thead").style.transform="translateY("+e+"px)"})},send:function(e,t,i,a,s,n){function l(e){try{o="function"==d[e][1]?d[e][0]:null,r="function"==d[e+1][1]?d[e+1][0]:null}catch(e){}}var c={},o=null,r=null,d=[],p="";switch($.each(arguments,function(e,t){d.push([t,typeof t])}),p=d[0],p[1]){case"string":$.each(d,function(e,t){var i=t[0],a=t[1];if(e>1&&("boolean"==a||"string"==a||"object"==a)){var s=p[0].split("/");return c.url="/"+s[0]+"?action="+s[1],c.load=i,"object"==a&&(c.load=i.load,c.tips=i.tips,c.verify=i.verify),!1}c.url=p[0]}),"object"===d[1][1]?(c.data=d[1][0],l(2)):l(1);break;case"object":c.url=p[0].url,c.data=p[0].data||{},$.each(d,function(e,t){var i=t[0],a=t[1];if(e>1&&("boolean"==a||"string"==a||"object"==a))return c.load=t,"object"==a&&(c.load=i.load,c.tips=i.tips),!0}),"object"===d[1][1]?(c.data=d[1][0],l(2)):l(1)}c.load&&(c.load=this.load(c.load)),$.ajax({type:c.type||"POST",url:c.url,data:c.data||{},dataType:c.dataType||"JSON",complete:function(){c.load&&c.load.close()},success:function(e){return c.verify?(o&&o(e),!1):"string"==typeof e?(layer.msg(e,{icon:2,time:0,closeBtn:2}),!1):c.bacth?(o&&o(e),!1):!1===e.status&&e.msg?(bt_tools.msg(e),!1):(c.tips&&bt_tools.msg(e),void(o&&o(e)))},error:function(e){r&&r(e),layer.closeAll("dialog"),layer.closeAll("loading"),layer.msg("Service response error:"+e.status+"
                              error msg:"+e.statusText+"
                              URL:"+c.url+"
                              param:"+JSON.stringify(c.data),{icon:2,time:0,closeBtn:2})}})}};$.fn.serializeObject=function(){var e=Object.prototype.hasOwnProperty;return this.serializeArray().reduce(function(t,i){return e.call(t,i.name)||(t[i.name]=i.value),t},{})}; \ No newline at end of file diff --git a/BTPanel/static/language/English/lan.js b/BTPanel/static/language/English/lan.js index a48f0519..2f19e0a1 100644 --- a/BTPanel/static/language/English/lan.js +++ b/BTPanel/static/language/English/lan.js @@ -45,9 +45,9 @@ var lan = { "memre_ok_0":"Releasing", "memre_ok_1":"Released", "memre_ok_2":"Already the best", - "mem_warning":"Currently available physical memory is less than 64M, which may cause MySQL to automatically stop, site 502 and other errors, please try to free the memory!", + "mem_warning":"Currently available physical RAM is less than 64M, which may cause MySQL to automatically stop, site 502 and other errors, please try to free the memory!", "user_warning":"Current panel user is admin, which may bring risks to the panel!!", - "cpu_core":"Core", + "cpu_core":"Core(s)", "interfacespeed":"Interface speed", "package_num":"Package number", "interface_net":"Interface traffic in real time", @@ -107,14 +107,14 @@ var lan = { "rep_panel_title":"Repair panel", "rep_panel_the":"Verifying module...", "rep_panel_ok":"Repair completed, please press Ctrl+F5 to refresh the cache!", - "bind_bt_account_first":"Please bind your BT account first!", + "bind_bt_account_first":"Please bind your aaPanel account first!", "avg_load_atlast_onemin":"Average load in the last 1 minute: ", "avg_load_atlast_fivemin":"Average load in the last 5 minutes: ", "avg_load_atlast_fifteenmin":"Average load in the last 15 minutes: ", "mem_release_sure":"Are you sure to to free the memory?", - "mem_release_warn":"If your site is in a state of heavy access, freeing up memory can have unpredictable consequences. Are you sure you want to free memory now?", + "mem_release_warn":"If your site is in a state of heavy access, freeing up RAM can have unpredictable consequences. Are you sure you want to free RAM now?", "update":"Update", - "find_bug_reward":"Find bugs, get BT coins", + "find_bug_reward":"Find bugs, get aaPanel coins", "run_block":"Running blocked", "run_slow":"Running slowly", "run_normal":"Running normally", @@ -124,7 +124,7 @@ var lan = { "edit_now":"Modify now", "inode_info":"Inode info", "total":"Total", - "already_use":"Already used", + "already_use":"Used", "available":"Available", "inode_percent":"Inode usage", "test_version":"Beta", @@ -164,7 +164,11 @@ var lan = { "panel_port_tips":"The current panel uses the default port [8888], which has security risks. Please modify the panel port in the panel settings!", "panel_port_tip1":"This security issue cannot be ignored, please handle it as soon as possible.", "panel_port_tip2":"Not negligible", - "panel_port_tip3":"Change now" + "panel_port_tip3":"Change now", + "base_info": "basic information", + "capacity_info":"Capacity information", + "capacity":"Capacity", + "usage_rate":"Usage rate" }, "config":{ "modify_time":"Modified time", @@ -173,13 +177,13 @@ var lan = { "close_panel_title":"Disable Panel", "config_save":"Saving configuration...", "config_sync":"Syncing time...", - "config_user_binding":"Binding your BT account", - "config_user_edit":"Change BT account", + "config_user_binding":"Binding your aaPanel account", + "config_user_edit":"Change aaPanel account", "binding":"Bind", "token_get":"Getting token...", "user_bt":"Username", "pass_bt":"Password", - "binding_un_msg":"Are you sure to unbind BT account?", + "binding_un_msg":"Are you sure to unbind aaPanel account?", "binding_un_title":"Unbind", "binding_un":"unbind", "ssl_close_msg":"You will have to use http protocol to access the panel after turning off SSL, continue?", @@ -217,13 +221,13 @@ var lan = { "confirm_unbind":"Are you sure to cancel the current binding?", "cancel":"Cancel", "bind_success":"Successfully bound", - "open_small_app":"Open the BT panel Mini Program", + "open_small_app":"Open the aaPanel panel Mini Program", "qrcore_of_small_app":"QR code of Mini Program", - "scan_qrcore_with_small_app":"Use BT Mini Program to scan the current QR code to bind the panel", + "scan_qrcore_with_small_app":"Use aaPanel Mobile to scan the current QR code to bind the panel", "return_bind_list":"Return to the panel binding list", "read_bind_list":"View binding list", "bind_wechat":"Bind WeChat", - "no_bind_bt_account":"BT account NOT bound", + "no_bind_bt_account":"aaPanel account NOT bound", "get_api":"Getting API info...", "set_api":"Configuration panel API", "api":"API", @@ -299,8 +303,8 @@ var lan = { "TZZ5":"Friday", "TZZ6":"Saturday", "TZZ7":"Sunday", - "mem_ps":"Free memory of PHP/MySQL/Pure-FTPd/Apache/Nginx, recommended to be executed every midnight!", - "mem":"Free memory", + "mem_ps":"Free RAM of PHP/MySQL/Pure-FTPd/Apache/Nginx, recommended to be executed every midnight!", + "mem":"Free RAM", "log_empty":"Current log is empty", "microsoft_yahei":"Microsoft Yahei", "crontab_stop":"Disable the cron job", @@ -313,7 +317,7 @@ var lan = { "db_bak":"Backup database", "log_split":"Log cutting", "dir_bak":"Directory backup", - "mem_release":"Free memory", + "mem_release":"Free RAM", "get_url":"Get URL", "hourly":"Hourly", "daily":"Daily", @@ -335,7 +339,7 @@ var lan = { "copies":"copies", "shell_content":"Script content", "tips":"Tips", - "tips_content":"Free memory of PHP/MySQL/Pure-FTPd/Apache/Nginx, recommended to be executed every midnight!", + "tips_content":"Free RAM of PHP/MySQL/Pure-FTPd/Apache/Nginx, recommended to be executed every midnight!", "edit_save":"Save changes", "saving":"Saving changes, please wait...", "crontab_stop_will":"The cron job will not continue to run after suspended. Are you sure to suspend this cron job?", @@ -384,10 +388,10 @@ var lan = { "bt_default_port":"Default port of aaPanel", "site_default_port":"Default port of WebSite", "del":"Del", - "number":"Number", - "behavior":"Behavior", + "number":"ID", + "behavior":"Rule", "status":"Status", - "add_time":"Time added", + "add_time":"Added date", "instructions":"Instructions", "operate":"Operation", "operate_type":"Operation type", @@ -418,7 +422,7 @@ var lan = { "comp":"Computer", "filename":"File name", "etime":"Modification time", - "access":"pPermission", + "access":"Permission", "own":"Owner", "adddir":"Add directory", "editdir": "Edit directory", @@ -521,7 +525,7 @@ var lan = { "install_apache24":"Selected Apache 2.4, PHP will run in php-fpm mode!", "insatll_s22":"Apache 2.2 NOT support", "insatll_s24":"Apache 2.4 NOT support", - "insatll_mem":"Your memory is less than {1}, NOT recommended to install MySQL-{2}", + "insatll_mem":"Your RAM is less than {1}, NOT recommended to install MySQL-{2}", "install_to":"Adding to installer...", "install_ok":"Request of installation added to installer", "task_add":"Added to queue", @@ -578,7 +582,7 @@ var lan = { "check_same_name_file":"Checking if the file with the same name exists, please wait...", "recycle_bin_re":"Recover", "recycle_bin_del":"Delete Permanently", - "recycle_bin_on":"Turn on recycle bin feature", + "recycle_bin_on":"File recycle bin", "recycle_bin_on_db":"Database recycle bin", "recycle_bin_ps":"Warning: Removed files cannot be restored if recycle bin feature is turned off!", "recycle_bin_close":"Empty recycle bin", @@ -633,7 +637,7 @@ var lan = { "shell":"Terminal", "paste":"Paste", "paste_all":"Paste all", - "path_root":"Root directory", + "path_root":"Document Root", "all":"Batch", "set_auth":"Set permission", "up_title":"Upload Files", @@ -677,7 +681,7 @@ var lan = { "calc_click":"Click to calculate", "ps_php":"PS: PHP configuration file (Anti-crossing-directory)!", "ps_ap":"PS: Apache user configuration file (Rewrite rules)", - "ps_swap":"PS: BT default swap virtual memory file", + "ps_swap":"PS: aaPanel default swap virtual RAM file", "last_edit_time":"Last modified", "will_cover_this_file":"about to overwrite the following file(s)", "file_name_cant_empty":"File name cannot be empty!", @@ -707,10 +711,10 @@ var lan = { "add_pass":"Password", "add_pass_tips":"Please enter FTP password", "add_pass_rep":"Random password", - "add_path":"Root directory", + "add_path":"Home", "add_path_tips":"Please enter or select FTP directory", "add_path_rep":"Select directory", - "add_path_title":"Root directory of user, which will automatically create directory of the same name", + "add_path_title":"Document root of user, which will automatically create directory of the same name", "add_path_ps":"Directory that FTP points to", "add_ps":"Note", "add_ps_title":"Note info (Less than 255 characters)", @@ -834,7 +838,7 @@ var lan = { "status":"Current status", "restart":"Restart", "reload":"Reload", - "mysql_mem_err":"Server memory is less than 1G. It is not recommended to use MySQL 5.5 or later.
                            • If the database stops automatically, try to increase swap with Linux Toolbox or increase server memory", + "mysql_mem_err":"Server RAM is less than 1G. It is not recommended to use MySQL 5.5 or later.
                            • If the database stops automatically, try to increase swap with Linux Toolbox or increase server memory", "concurrency_m":"Custom", "concurrency":"Concurrency", "concurrency_type":"Concurrency plan", @@ -959,7 +963,7 @@ var lan = { "lib_uninstall_the":"Uninstalling, please wait...", "mysql_set_msg":"Optimization plan", "mysql_set_select":"Select", - "mysql_set_maxmem":"Max memory usage", + "mysql_set_maxmem":"Max RAM usage", "mysql_set_key_buffer_size":"Buffer size for indexing", "mysql_set_query_cache_size":"Query cache, set to 0 for not enabled", "mysql_set_tmp_table_size":"Temporary table cache size", @@ -976,7 +980,7 @@ var lan = { "mysql_set_max_connections":"Max connections", "mysql_set_restart":"Restart mysqld service", "mysql_set_conn":"Num of connections", - "mysql_set_err":"ERROR, memory allocation is too high!

                              Physical memory: {1}MB
                              Maximum memory: {2}MB
                              Possible result: mysqld service unstable, even unable to start!

                              ", + "mysql_set_err":"ERROR, RAM allocation is too high!

                              Physical memory: {1}MB
                              Maximum memory: {2}MB
                              Possible result: mysqld service unstable, even unable to start!

                              ", "mysql_status_title1":"Launch Time", "mysql_status_title2":" Total Connections", "mysql_status_title3":"Output", @@ -1091,7 +1095,7 @@ var lan = { "run_days":"Running days", "curr_listen_port":"Currently listened port", "connected_clients":"Connected clients", - "used_memory_rss":"Total system memory currently used by Redis", + "used_memory_rss":"Total system RAM currently used by Redis", "used_memory":"The peak of memory allocated by Redis in history", "mem_fragmentation_ratio":"Memory fragment ratio", "total_connections_received":"Total connections received since started", @@ -1107,7 +1111,7 @@ var lan = { "size":"Size", "author":"Author", "source":"Source", - "third_party_apps_tips1":"This is a plugin developed by a third party, BT can not verify its reliability!", + "third_party_apps_tips1":"This is a plugin developed by a third party, aaPanel can not verify its reliability!", "third_party_apps_tips2":"The installation process may take a few minutes, please be patient!", "third_party_apps_tips3":"If this plugin already exists, it will be replaced!", "cancel":"Cancel", @@ -1156,13 +1160,13 @@ var lan = { "success_txt":"Successfully created site", "php_ver":"PHP version", "site_add":"Add site", - "domain":"Domain", + "domain":"Domain name", "port":"Port", "note":"Note", "note_ph":"Site note", - "web_root_dir":"Web root directory", + "web_root_dir":"Web document root", "web_dir":"Web directory", - "root_dir":"Root directory", + "root_dir":"Document Root", "yes":"Create", "no":"Cancel", "ftp_set":"FTP settings", @@ -1178,8 +1182,8 @@ var lan = { "default_doc_help":"Default indexes, one per line, priority top-to-bottom.", "site_stop_txt":"Unable to access when you turn off site, are you sure to continue?", "site_start_txt":"About to turn on this site, are you sure to continue?", - "site_del_info":"Whether to delete corresponding FTP, database and root directory", - "all_del_info":"Delete site and root directory at the same time", + "site_del_info":"Whether to delete corresponding FTP, database and document root", + "all_del_info":"Delete site and document root at the same time", "all_del_site":"Batch delete sites", "del_err":"Failed to delete the following sites", "click_access":"Click to access", @@ -1212,7 +1216,7 @@ var lan = { "site_menu_1":"Subdirectory binding", "site_menu_2":"Site directory", "site_menu_3":"Traffic control", - "site_menu_4":"URL rewirte", + "site_menu_4":"URL rewrite", "site_menu_5":"Default indexes", "site_menu_6":"Config", "site_menu_7":"SSL", @@ -1259,7 +1263,7 @@ var lan = { "limit_net_13":"Limit of single IP accessing max concurrency", "limit_net_14":"Traffic control", "limit_net_15":"Limit the max traffic limit per request (unit: KB)", - "subdirectories":"SubDir", + "subdirectories":"Subdir", "url_rewrite_alter":"Are you sure to create a independent URL rewrite rule for this subdirectory?", "rule_cov_tool":"Rewrite rule converter", "a_c_n":"Apache to Nginx", @@ -1290,7 +1294,7 @@ var lan = { "enable_301":"Enable 301", "to301_help_1":"If choose entire site, please do NOT set the target URL to the domain in the same site.", "to301_help_2":"After cancelling the 301 redirect, you need to clear your browser cache to see the results", - "bt_ssl":"BT SSL", + "bt_ssl":"aaPanel SSL", "lets_ssl":"Let's Encrypt free certificate", "other":"Other", "other_ssl":"Other certificate", @@ -1301,20 +1305,20 @@ var lan = { "ssl_key":"Private key (KEY)", "ssl_crt":"Certificate (CRT/PEM)", "ssl_close":"Disable SSL", - "bt_bind_no":"Not bound to BT account, please register and bind. After binding BT account (non-forum account), you can deploy SSL with one click", - "bt_user":"BT Account", + "bt_bind_no":"Not bound to aaPanel account, please register and bind. After binding aaPanel account (non-forum account), you can deploy SSL with one click", + "bt_user":"aaPanel Account", "bt_user_first":"Account", "login":"Login", - "bt_reg":"Register BT account", - "bt_ssl_help_1":"BT SSL certificate is issued by TrustAsia, requires real name identification", - "bt_ssl_help_2":"If you have BT account, please log in and bind it", - "bt_ssl_help_3":"BT SSL applys certificate TrustAsia DV SSL CA - G5. Original price: 1900 RMB/year, but free for aaPanel users!", + "bt_reg":"Register aaPanel account", + "bt_ssl_help_1":"aaPanel SSL certificate is issued by TrustAsia, requires real name identification", + "bt_ssl_help_2":"If you have aaPanel account, please log in and bind it", + "bt_ssl_help_3":"aaPanel SSL applys certificate TrustAsia DV SSL CA - G5. Original price: 1900 RMB/year, but free for aaPanel users!", "bt_ssl_help_4":"Free reissue after one year of maturity.", "btapply":"Apply", "endtime":"Expired date", "status":"Status", "bt_ssl_help_5":"Please check domain resolution before applying, unresolved domain leads to audit failure.", - "bt_ssl_help_6":"BT SSL certificate is the free version of TrustAsia DV SSL CA - G5 certificate, which only supports a single domain.", + "bt_ssl_help_6":"aaPanel SSL certificate is the free version of TrustAsia DV SSL CA - G5 certificate, which only supports a single domain.", "bt_ssl_help_7":"Valid for 1 year, renewal is not supported, reapplication is required after expiration.", "bt_ssl_help_8":"Let's Encrypt free certificate, valid for 3 months, supports wildcard domain. Auto-renew by default.", "bt_ssl_help_9":"If your site uses CDN or 301 redirect, you will not be able to apply for and renew certificate through file verification.", @@ -1375,7 +1379,7 @@ var lan = { "del_site": "Delete site", "site_classification": "Site category", "all_classification": "All category", - "firewalld_nonactivated_tips": "{1} Firewall is NOT activated yet.
                              Please go to"Software Store > Paid plugins > {2} Firewall"
                              to activate and install it.", + "firewalld_nonactivated_tips": "{1} WAF is not activated yet.
                              Please go to"APP Store > Professional > {2} WAF"
                              to activate and install it.", "firewalld_nonactivated": "Firewall NOT activated", "download": "Download", "submit": "Submit", @@ -1415,16 +1419,16 @@ var lan = { "video": "Video", "not_resolve_domain": "You applied for a certificate for the domain [{1}], but the program detected that you did not bind and resolve its root domain [{2}] to the site, which would cause the certificate failed to be issued!", "ssl_tips1": "Before applying, please make sure the domain name has been resolved. If it is not resolved, the audit will fail (including the root domain).", - "ssl_tips2": "BT SSL applys for the free version of TrustAsia DV SSL CA - G5 certificate, which only supports single domain name application.", + "ssl_tips2": "aaPanel SSL applys for the free version of TrustAsia DV SSL CA - G5 certificate, which only supports single domain name application.", "ssl_tips3": "Valid for 1 year, renewal is not supported, reapplication is required after expiration", "ssl_tips4": "It is recommended to use a domain name with a secondary domain name of www to apply for a certificate, so that the system will give away the top-level domain name as an optional name by default", "ssl_tips5": "When you do not specify a SSL default site, if you use HTTPS to access a site that does not have SSL enabled, you will directly access a site that has SSL enabled", - "ssl_tips6": "99% of users can easily deploy themselves, if you don't understand, BT provides certificate deployment service 50 yuan Once", + "ssl_tips6": "99% of users can easily deploy themselves, if you don't understand, aaPanel provides certificate deployment service 50 yuan Once", "checking_mode": "Verification mode", "file_check": "File verification", "dns_check_tips1": "In DNS validation, we provide three automated DNS API, and provide manual mode", "dns_check_tips2": "The certificate can be renewed automatically by using the DNS API. In manual mode, the certificate needs to be reapplied after the certificate expires", - "dns_check_tips3": "Before using the [BT DNS Cloud Resolution] API, you need to confirm that the domain DNS for which you want to apply for SSL certificate is [Cloud Resolution]", + "dns_check_tips3": "Before using the [aaPanel DNS Cloud Resolution] API, you need to confirm that the domain DNS for which you want to apply for SSL certificate is [Cloud Resolution]", "dns_check_tips4": "Before using the [DNSPod/ Ali Cloud DNS] API, you need to set the API key of the corresponding interface in the pop-up window", "dns_check_tips5": "Check in advance (identify problems in advance)", "check_dns": "DNS verification", @@ -1440,7 +1444,7 @@ var lan = { "txt": "TXT record value", "dns_resolve_tips1": "It takes a while to resolve the domain, so after all resolution operations completed, please wait at least 3 minutes before clicking the Verify button", "dns_resolve_tips2": "Domain resolution can be manually verified by the CMD command: nslookup-q=txt _ acme-challenge.bt.cn", - "dns_resolve_tips3": "If you are using the BT Cloud Resolution plugin, Ali Cloud DNS,DNSPod as a DNS, you can set auto-resolution with the DNS API", + "dns_resolve_tips3": "If you are using the aaPanel Cloud Resolution plugin, Ali Cloud DNS,DNSPod as a DNS, you can set auto-resolution with the DNS API", "dns_resolve_tips4": "It takes a while to resolve the domain, so after all resolution operations completed, please wait a minute before clicking the Verify button", "ssl_dir": "Certificate holder", "brand": "Brand", @@ -1542,9 +1546,9 @@ var lan = { "batch_selected":"Selected", "batch_text":"Batch ", "add_site":{ - "domain":"domain", + "domain":"Domain name", "description":"Description", - "root":"Root directory", + "root":"Website Path", "ftp":"FTP", "database":"Database", "program":"Program type", @@ -1561,9 +1565,9 @@ var lan = { "database_ph":"Create Database account", "database_password":"Database Password", "bath_code_ph":"domain|1|0|0|0\ndomain|1|0|0|0\ndomain|1|0|0|0", - "bath_tips1":"Batch format: Domain|Root directory|FTP|Database|PHP version", + "bath_tips1":"Batch format: Domain|Document Root|FTP|Database|PHP version", "bath_tips2":"Domain format: domains use  ,  spilt", - "bath_tips3":"Root directory: Input 1 is automatic creation, or enter a specific directory", + "bath_tips3":"Document Root: Input 1 is automatic creation, or enter a specific directory", "bath_tips4":"FTP format: Input 1 is automatic creation, input 0 is not creat", "bath_tips5":"Database format: Input 1 is automatic creation, input 0 is not creat", "bath_tips6":"PHP version: Input 0 is static, or input the specific version of PHP, eq,56、71、74", @@ -1660,7 +1664,7 @@ var lan = { "login_expire":"Your login status has expired, please log in again!", "session_expire":"Session expired", "logout":"Log out", - "bt_terminal":"BT terminal", + "bt_terminal":"aaPanel terminal", "paste_comm_this":"Please paste the command here...", "send":"Send", "turnoff":"Close", @@ -1716,7 +1720,7 @@ var lan = { "plug_err":"Plugin class name, or plugin method name missing!", "request_err":"An error occurred in the request process!", "already_install":"Installed", - "rootdir":"Root directory", + "rootdir":"Document Root", "back":"Back", "flush":"Refresh", "set_account":"Account setup", @@ -1796,9 +1800,9 @@ var lan = { "server":"Server", "cp_success":"Successfully copied", "cp_fail":"Failed to copy, browser is not compatible!", - "bind_bt_account":"Bind Account registered", + "bind_bt_account":"Bind aaPanel account", "mobile_phone":"Mobile phone", - "mobile_phone_or_email":"Mobile phone or Email", + "mobile_phone_or_email":"Your Email address", "pass":"Password", "rootpass":"Root password", "login":"Log in", @@ -1813,9 +1817,9 @@ var lan = { "confirm":"OK", "cancel":"Cancel", "unbind":"Unbind", - "open_bt_small_app":"Open the BT panel mini program", + "open_bt_small_app":"Open the aaPanel panel mini program", "app_qr_core":"Mini program QR code", - "scan_qr_core":"Use BT Mini Programs to scan the current QR code and bind to the panel", + "scan_qr_core":"Use aaPanel Mobile to scan the current QR code and bind to the panel", "return_bind_list":"Return to panel binding list", "read_bind_list":"View binding list", "bind_wechat":"Bind WeChat", @@ -1924,7 +1928,7 @@ var lan = { "domain":"Domain", "domian_tips":"A domain per line, the default port is 80
                              Wildcard domain format: *.domain.com
                              To add another port, the format is www.domain.com:88", "site_ps":"Site note", - "root_dir":"Root directory", + "root_dir":"Document Root", "dont_create":"Not create", "create":"Create", "set_ftp":"FTP settings", @@ -1948,7 +1952,8 @@ var lan = { "cancel":"Cancel", "connect":"Connecting..", "wait_task":"Waiting the task to execute", - "cancel_task":"Cancelling task..." + "cancel_task":"Cancelling task...", + "task_queue":"Task queue" }, "install":{ "passwd_cant_empty":"Username or password cannot be empty!", @@ -1956,9 +1961,9 @@ var lan = { "setting_up":"Processing..." }, "login":{ - "qr_core_login":"BT Mini Program QR code login", + "qr_core_login":"aaPanel Mobile QR code login", "open":"Open", - "bt_small_p":"BT Mini Program", + "bt_small_p":"aaPanel Mobile", "scan_login":"Scan to log in", "scan_more_safety":"QR code login is more secure", "scan_success":"Successfully scanned QR code, please wait...", @@ -2092,7 +2097,7 @@ var lan = { "mem":"Memory", "status":"Status", "operate":"Operate", - "py_tips1":"By default, the manager uses the pip to install the module in requirements.txt in the root directory. If there are other modules to be installed, please manually enter the virtual environment to install", + "py_tips1":"By default, the manager uses the pip to install the module in requirements.txt in the Document Root. If there are other modules to be installed, please manually enter the virtual environment to install", "py_tips2":"Method to enter the virtual environment:", "py_tips3":"Enter on the CLI", "py_tips4":"Source project path/project name_venv/bin/activate", @@ -2182,7 +2187,7 @@ var lan = { "save_conf_now":"Saving configuration info, please wait...", "choose_file":"Please select a file", "input_newfile_name":"Please enter a new file name", - "rootdir":"Root directory", + "rootdir":"Document Root", "create_newfile":"Creating new file, please wait...", "get_file_list":"Getting file list, please wait...", "plug_err":"The plugin class name, or plugin method name is missing!", @@ -2303,7 +2308,7 @@ var lan = { "get_file_list":"Getting file list...", "del":"Del", "download":"Download", - "roodir":"Root directory", + "roodir":"Document Root", "back":"Back", "flush":"Refresh", "set_account":"Account setting", @@ -2345,7 +2350,7 @@ var lan = { "set_time_zone":"Time zone setting", "sys_pass":"System password", "set_ip":"IP settings", - "mem_disk":"Memory disk", + "mem_disk":"RAM disk", "m_dns":"Primary DNS", "b_dns":"Alternate DNS", "test":"Test", @@ -2357,7 +2362,7 @@ var lan = { "no_use":"Available:", "add_swap":"Add Swap", "confirm":"Confirm", - "swap_tips1":"Swap is virtual memory under Linux, set the appropriate swap to increase server stability", + "swap_tips1":"Swap is virtual RAM under Linux, set the appropriate swap to increase server stability", "swap_tips2":"It is recommended that the swap capacity be about 1.5 times the real memory capacity. If your server memory is larger than 4GB, you can set a fixed value of 1-2GB", "swap_tips3":"The swap file is saved by default in /www/swap. Make sure the disk space is enough before setting", "swap_tips4":"If you don't need swap, set the capacity to 0.", @@ -2382,8 +2387,8 @@ var lan = { "space":"Capacity", "used":"Used", "mem_disk_tips1":"The ramdisk has a read/write speed that is unmatched by physical disks, but can only be used to save temporary data!", - "mem_disk_tips2":"The memory disk directly mounts part of the physical memory as a disk. Please arrange the mount capacity according to the current server memory usage!", - "mem_disk_tips3":"After restarting the server or unloading the memory disk, the data saved in the memory disk will be cleared!", + "mem_disk_tips2":"The RAM disk directly mounts part of the physical RAM as a disk. Please arrange the mount capacity according to the current server RAM usage!", + "mem_disk_tips3":"After restarting the server or unloading the RAM disk, the data saved in the RAM disk will be cleared!", "only_supp_centos":"Currently only CentOS is supported!", "init_netcard":"Initialize the NIC", "cancel":"Cancel", @@ -2394,8 +2399,8 @@ var lan = { "del_netcard_confirm":"Are you sure you want to remove [{1}] from the NIC configuration?", "del_ip":"Delete IP address", "deleting":"Deleting...", - "umount_mem_disk":"Unmount the memory disk", - "umount_tips1":"After uninstalling the memory disk, the target mount directory will be cleared.

                              Are you sure you want to uninstall the mount directory [{1}]?", + "umount_mem_disk":"Unmount the RAM disk", + "umount_tips1":"After uninstalling the RAM disk, the target mount directory will be cleared.

                              Are you sure you want to uninstall the mount directory [{1}]?", "umountting":"Uninstalling...", "change_pass_now":"Changing password...", "setting_time_zone":"Setting time zone...", @@ -2441,7 +2446,7 @@ var lan = { "redis_status_tips1": "Number of days in operation", "redis_status_tips2": "current listening port", "redis_status_tips3": "Number of connected clients", - "redis_status_tips4": "The total amount of system memory currently occupied by Redis", + "redis_status_tips4": "The total amount of system RAM currently occupied by Redis", "redis_status_tips5": "The peak of Redis history allocation memory", "redis_status_tips6": "memory fragmentation ratio", "redis_status_tips7": "The total number of clients connected since the run", @@ -2535,8 +2540,8 @@ var lan = { "domain_tips":"A domain per line, the default port is 80
                              Wildcard domain format: *.domain.com
                              To add another port, the format is www.domain.com:88", "remark":"Remark", "web_note":"Website note", - "root_dir":"Root directory", - "web_root_dir":"Website root directory", + "root_dir":"Document root", + "web_root_dir":"Website Document Root", "db":"Database", "username_dbname":"Username/Database name", "src_code":"Source code", diff --git a/BTPanel/static/language/English/log.json b/BTPanel/static/language/English/log.json index 985abe92..3a54a434 100644 --- a/BTPanel/static/language/English/log.json +++ b/BTPanel/static/language/English/log.json @@ -138,7 +138,7 @@ "PLUG_MAM": "Plugin manager", "SET_PLUG": "Set plugin ['{1}'] AS!", "INSTALL_THIRD_PARDY_PLUG": "Installed third-party plugin [{1}]", - "SITE_DIR_NOT_EXIST_RECREATE": "Site [{1}], root directory [{2}] does NOT exist, recreated!", + "SITE_DIR_NOT_EXIST_RECREATE": "Site [{1}], document root [{2}] does NOT exist, recreated!", "SITE_STOP_ANTI_STEALING_LINK": "Hotlink Protection for site [{1}] disabled!", "SITE_START_ANTI_STEALING_LINK": "Hotlink Protection for site [{1}] enabled!", "SET_PHP_CLI":"Set the PHP-CLI version to: {1}", @@ -170,5 +170,7 @@ "REMOVE_PARA": "Remove custom compilation parameters: {1}:{2}", "SET_SOFTWARE_COMPILATION": "Setup software: Custom compilation parameters for {1} are configured as: {2}", "SET_FILE_NOTES": "Set the file name [{1}], notes: {2}", - "CLEAR_FILE_NOTES": "Clear file notes [{1}]" + "CLEAR_FILE_NOTES": "Clear file notes [{1}]", + "CREATE_SOFTLINK": "Create softlink: {1} -> {2}", + "EXEC_COMPOSER": "Execute composer [{1}] in the directory: [{2}]," } diff --git a/BTPanel/static/language/English/public.json b/BTPanel/static/language/English/public.json index aa093484..38f066fa 100644 --- a/BTPanel/static/language/English/public.json +++ b/BTPanel/static/language/English/public.json @@ -112,7 +112,7 @@ "SITE_STOP_SUCCESS":"Site stopped", "SITE_NETLIMIT_ERR":"Site Traffic Control only supports Nginx Web Server!", "SITE_NETLIMIT_CLOSE_SUCCESS":"Site Traffic Control has been turned off!", - "SITE_ADD_BINDING":"Domain and Name of Subdirectory cannot be empty!", + "SITE_ADD_BINDING":"Domain and name of subdirectory cannot be empty!", "SITE_INDEX_ERR_FORMAT":"Default Document Format is invalid, e.g., index.html", "SITE_INDEX_ERR_EMPTY":"Default Document cannot be empty!", "SITE_PATH_ERR_RE":"Same as original directory, no need to change!", @@ -783,7 +783,7 @@ "REDIS_CONF_TIPS4": "Max num of connections", "REDIS_CONF_TIPS5": "Number of databases", "REDIS_CONF_TIPS6": "redis password, leaving blank means no password is set", - "REDIS_CONF_TIPS7": "MB, max memory usage, 0 means no limit", + "REDIS_CONF_TIPS7": "MB, max RAM usage, 0 means no limit", "RDB_ERR": "Please enter an integer for the RDB parameter", "SYS_DB_CANT_DEL": "System database, cannot be deleted", "SAVE_CONF": "Configuration has been saved", @@ -926,7 +926,7 @@ "ACME_USE_TIPS": "Required parameters: --domain list of domain names, multiple separated by commas!", "ACME_USE_TIPS1": "Please specify the domain name to apply for a certificate", "ACME_USE_TIPS2": "Please specify verification type", - "ACME_USE_TIPS3": "Please specify the website root directory", + "ACME_USE_TIPS3": "Please specify the website document root", "ACME_USE_TIPS4": "Please specify DNSAPI", "ACME_USE_TIPS5": "Please specify DNSAPI key", "ACME_USE_TIPS6": "Please specify DNSAPI secret", @@ -936,7 +936,7 @@ "ACME_USE_TIPS10": "Please enter the index of the order to be revoked in the --index parameter", "ACME_USE_TIPS11": "Please specify the domain name for which you want to apply for a certificate in the --domain parameter, multiple separated by commas (,)", "ACME_USE_TIPS12": "Please specify the correct authentication type in the --type parameter, supporting dns and http", - "ACME_USE_TIPS13": "Please specify the website root directory in the --path parameter!", + "ACME_USE_TIPS13": "Please specify the website document root in the --path parameter!", "ACME_USE_TIPS14": "The specified site root does not exist, please check: {1}", "ACME_USE_TIPS15": "When applying using dnsapi, specify the dnsapi key in the --dns_key parameter!", "ACME_USE_TIPS16": "When applying using dnsapi, specify the secret of dnsapi in the --dns_secret parameter!", @@ -1042,14 +1042,14 @@ "BACKUP_DIR_NOT_EXIST": "The specified directory {1} does not exist!", "BACKUP_UPLOADING": "Uploading to {1}, please wait ...", "BACKUP_UPLOAD_SUCCESS": "Successfully uploaded to {1}", - "BACKUP_UPLOAD_FAILED": "Error: File upload failed, skip this backup!", + "BACKUP_UPLOAD_FAILED": "File upload failed, skip this backup!", "BACKUP_DEL": "User settings do not retain local backups, deleted {1}", "BACKUP_CLEAN_ERR": "Failed to clean expired backup, error: {1}", "BACKUP_KEEP": "Keep the latest number of backups: {1} copies", "BACKUP_CLEAN": "Expired backup files have been cleaned from disk: {1}", "BACKUP_CLEAN_REMOVE": "Expired backup files have been cleaned from {1}: {2}", "BACKUP_SITE": "Backup site: {1}", - "WEBSITE_DIR": "Website root directory: {1}", + "WEBSITE_DIR": "Website document root: {1}", "BACKUP_DIR": "Backup directory: {1}", "DIR_SIZE": "Directory size: {1}", "BACKUP_EXCLUSION": "Exclusion setting: {1}", @@ -1108,7 +1108,7 @@ "MYSQL_ROOT_PASSWD_EMTPY_ERR": "Root password cannot be empty", "DB_PASSWD_EMPTY_ERR": "Database [{1}] password cannot be empty", "NGINX_NOT_INSTALL": "Nginx is not install", - "CREATE_SITE_DIR_ERR": "Failed to create site root directory, {1}", + "CREATE_SITE_DIR_ERR": "Failed to create site document root, {1}", "CHOOSE_DOMAIN": "Please choose a domain name", "CHOOSE_PORT": "Please choose a port", "CERT_ERR": "Certificate error, please paste the correct PEM format certificate!", @@ -1123,7 +1123,7 @@ "COMPLIANT_NAME_ERR": "Non-compliant names can only be numbers, letters, underscores", "PARA_NOT_EXIST": "The specified custom compilation parameters do not exist!", "WRONG_PARAMETER": "Wrong parameter", - "UPLOAD_DIR_ERR": "Cannot upload files to the system root directory!", + "UPLOAD_DIR_ERR": "Cannot upload files to the system document root!", "RECYCLE_BIN_ERR": "This is the recycle bin directory, please press the [Recycle Bin] button in the upper right corner to open", "DIR_ERR": "This is not a directory", "FILE_EXIST_ERR": "The target file name already exists!", @@ -1219,5 +1219,21 @@ "File_END_WITH": "It is not recommended to use \".\" at the end of the file because there may be security risks", "DIR_END_WITH1": "It is not recommended to use \".\" at the end of the directory, because there may be safety risks", "API_DISABLED": "API has been disabled", - "UNBOUND_USER": "Unbound user" + "UNBOUND_USER": "Unbound user", + "FILE_NAME_ERR": "No special characters can be included in the file name!", + "SOFTLINK_FILE_EXIST": "The softlink file name already exists, please use another file name or delete it!", + "SOFTLINK_FILE_PATH": "The softlink file name must be an absolute path (full path)", + "SOFTLINK_CREATE_ERR": "Softlink file creation failed", + "SOFTLINK_CREATE_SUCCESS": "The softlink file was created successfully", + "COMPOSER_CONF_NOT_EXIST": "[Composer.json] configuration file is not found in the specified directory!", + "COMPOSERLOGCK_EXIST": "[Composer.lock] file exists in the specified directory, please delete it before executing", + "KEEP_LOCAL": "Local backup has been kept", + "DB_CONN_ERR": "The database connection is abnormal. Please check whether the root user authority or database configuration parameters are correct.", + "BACKUP_TASK_TITLE": "{1}-{2} The task was executed successfully", + "NOTIFICATION_SENT": "Notification has been sent", + "NOTIFICATION_ERR": "Failed to send notification", + "BACKUP_MSG": "Backup to {1}, a total of {3} {2}, and failures {4}.", + "BACKUP_MSG1": "Backup failed {1}/total {2} sites", + "NOTIFICATION": "Notification" + } diff --git a/BTPanel/static/language/English/template.json b/BTPanel/static/language/English/template.json index 06e219ff..e5913408 100644 --- a/BTPanel/static/language/English/template.json +++ b/BTPanel/static/language/English/template.json @@ -7,7 +7,7 @@ "V3":"Check update", "S1":"System:", "S2":"Loading: ", - "S3":"Time of running uninterrupted: ", + "S3":"Time of running", "S4":" Loading", "S5":"Restart server", "S6":"Restart panel", @@ -23,8 +23,8 @@ "T2":"Connection Manager", "T3":"Task Manager", "P1":"CPU usage", - "P2":"Memory usage", - "P3":"Click to free memory", + "P2":"RAM usage", + "P3":"Click to free RAM", "P4":"Software", "NET1":"Network traffic", "NET2":"Upload speed", @@ -52,7 +52,7 @@ "H1":"Dashboard", "H2":"Site Manager", "SEARCH":"Site search", - "PS":"After the website is created, the file owner will be set to [www], You can add your backup plan in ", + "PS":"After the website is created, the file owner will be set to [www], you can add your backup plan in ", "BTN1":"Add site", "BTN2":"Default page", "BTN3":"Default WebSite", @@ -82,7 +82,7 @@ "TH1":"User", "TH2":"Password", "TH3":"Status", - "TH4":"Root directory", + "TH4":"Document Root", "TH5":"Notes", "TH6":"Action", "JS1":"Pls install Prue-Ftpd first!", @@ -221,20 +221,20 @@ "H2":"Cron Job", "H3":"Add Cron Job", "H4":"Task List", - "PS":"Type of task: shell script, backup site, backup database, cut log, free memory, access URL", + "PS":"Type of task: shell script, backup site, backup database, cut log, free RAM, access URL", "PS1":"When adding a backup task, you should run it manually and check if the backup package is complete", "PS2":"Insufficient disk space, database password error, network instability, etc. may result in incomplete data backup", "PS3":"Support file or directory exclusion when backing up sites and directories. Please upgrade the plug-ins that need to be excluded to the latest version", "T1":"Type of Task", "T2":"Name of Task", - "T3":"Period", - "T4":"Script Content", + "T3":"Execution cycle", + "T4":"Script content", "T5":"Add Task", "TT1":"Shell Script", "TT2":"Backup Site", "TT3":"Backup Database", "TT4":"Cut Log", - "TT5":"Free Memory", + "TT5":"Free RAM", "TT6":"Access URL", "TZ1":"Daily", "TZ2":"N Days", @@ -368,10 +368,10 @@ "N13":"Forget Password>>", "JS1":"Error, please try again!", "JS2":"Loading...", - "QR_CORE_LOGIN":"QR Code login with BT mini program", + "QR_CORE_LOGIN":"Login with aaPanel Mobile", "OPEN":"Open", - "BT_SMALL_P":"BT Mini Program", - "SCAN_LOGIN":"Scan to log in", + "BT_SMALL_P":"aaPanel Mobile", + "SCAN_LOGIN":"Scan with ", "SCAN_SUCCESS":"Scanned successfully, please wait...", "SAFE_LOGGING_NOW":"Securely logging in, please wait...", "SCAN_MORE_SAFETY":"QR code login is more secure", diff --git a/BTPanel/static/language/Simplified_Chinese/lan.js b/BTPanel/static/language/Simplified_Chinese/lan.js index f29077b8..d9005579 100644 --- a/BTPanel/static/language/Simplified_Chinese/lan.js +++ b/BTPanel/static/language/Simplified_Chinese/lan.js @@ -45,7 +45,7 @@ var lan = { "memre_ok_0": "Releasing", "memre_ok_1": "Released", "memre_ok_2": "Already the best", - "mem_warning": "Memory is less than 64M, It may make MySQL automatically shut down, or 502 Error, Please Release Memory!", + "mem_warning": "RAM is less than 64M, It may make MySQL automatically shut down, or 502 Error, Please Release Memory!", "user_warning": "Current user is admin, this could pose a security risk to the Panel!", "cpu_core": "Core", "interfacespeed": "Interface Speed", @@ -112,7 +112,7 @@ var lan = { "avg_load_atlast_fivemin": "Average load in the last 5 minute:", "avg_load_atlast_fifteenmin": "Average load in the last 15 minute:", "mem_release_sure": "Really want to free the memory?", - "mem_release_warn": "If your site is in a state of heavy access, freeing up memory can have unpredictable consequences. Are you sure you want to free memory now?", + "mem_release_warn": "If your site is in a state of heavy access, freeing up RAM can have unpredictable consequences. Are you sure you want to free RAM now?", "update": "Update", "find_bug_reward": "找Bug奖宝塔币", "run_block": "Running blocking", @@ -271,7 +271,7 @@ var lan = { "hour": "Hour", "minute": "Minute", "sun": "Day", - "sbody": "Script Content", + "sbody": "Script content", "log_site": "Cut Site Log", "url_address": "URL address", "backup_to": "Backup to", @@ -285,7 +285,7 @@ var lan = { "TZZ5": "Friday", "TZZ6": "Saturday", "TZZ7": "Sunday", - "mem_ps": "Release Memory of PHP、MYSQL、PURE-FTPD、APACHE、NGINX, suggestion: Execute this task at midnight every day!", + "mem_ps": "Release RAM of PHP、MYSQL、PURE-FTPD、APACHE、NGINX, suggestion: Execute this task at midnight every day!", "mem": "Release Memory", "log_empty": "Current log is empty", "microsoft_yahei": "微软雅黑", @@ -299,7 +299,7 @@ var lan = { "db_bak": "Backup database", "log_split": "Log cutting", "dir_bak": "Backup directory", - "mem_release": "Free memory", + "mem_release": "Free RAN", "get_url": "Access URL", "hourly": "per hour", "daily": "every day", @@ -321,7 +321,7 @@ var lan = { "copies": "Share", "shell_content": "Script content", "tips": "prompt", - "tips_content": "Free memory usage of PHP, MYSQL, PURE-FTPD, APACHE, NGINX, it is recommended to execute in the middle of the night!", + "tips_content": "Free RAM usage of PHP, MYSQL, PURE-FTPD, APACHE, NGINX, it is recommended to execute in the middle of the night!", "edit_save": "Save edit", "saving": "Editing content is being saved, please wait", "crontab_stop_will": "After the scheduled task is suspended, it will not be able to continue running. Do you really want to disable this scheduled task?", @@ -500,7 +500,7 @@ var lan = { "install_apache24": "Selected Apache2.4, PHP will run in php-fpm mode!", "insatll_s22": "Apache2.2 NOT supported", "insatll_s24": "Apache2.4 NOT supported", - "insatll_mem": "Your Memory is less than {1}, NOT recommeded to install MySQL-{2}", + "insatll_mem": "Your RAM is less than {1}, NOT recommeded to install MySQL-{2}", "install_to": "Adding to installer...", "install_ok": "Requestment of installing added to installer", "task_add": "Added to queue", @@ -582,7 +582,7 @@ var lan = { "shell": "Terminal", "paste": "Paste", "paste_all": "Paste all", - "path_root": "Root directory", + "path_root": "Document Root", "all": "Batch", "set_auth": "Set permission", "up_title": "Upload", @@ -653,10 +653,10 @@ var lan = { "add_pass": "Password", "add_pass_tips": "Pls enter FTP password", "add_pass_rep": "Random password", - "add_path": "Root directory", + "add_path": "Document Root", "add_path_tips": "Pls enter or select FTP directory", "add_path_rep": "Select directory", - "add_path_title": "Root directory of user, automatically create directory of the same name", + "add_path_title": "Document root of user, automatically create directory of the same name", "add_path_ps": "Directory that FTP points to", "add_ps": "Note", "add_ps_title": "Note information (Less than 255 characters)", @@ -780,7 +780,7 @@ var lan = { "status": "Current status", "restart": "Restart", "reload": "Rload", - "mysql_mem_err": "Memory is less than 1G, MySQL version higher than5.5 version is NOT recommended.
                            • If database automatically stop frequently, please try to use linux tools to increase SWAP or upgrade server memory", + "mysql_mem_err": "RAM is less than 1G, MySQL version higher than5.5 version is NOT recommended.
                            • If database automatically stop frequently, please try to use linux tools to increase SWAP or upgrade server memory", "concurrency_m": "Custom", "concurrency": "Concurrency", "concurrency_type": "Concurrency plan", @@ -904,7 +904,7 @@ var lan = { "lib_uninstall_the": "Uninstalling, please wait...", "mysql_set_msg": "Optimization plan", "mysql_set_select": "Select", - "mysql_set_maxmem": "Max memory usage", + "mysql_set_maxmem": "Max RAM usage", "mysql_set_key_buffer_size": "Buffer size for indexing", "mysql_set_query_cache_size": "Query cache, set to 0 if not enabled", "mysql_set_tmp_table_size": "Temporary table cache size", @@ -921,7 +921,7 @@ var lan = { "mysql_set_max_connections": "Max connections", "mysql_set_restart": "Restart mysqld service", "mysql_set_conn": "Num of connections", - "mysql_set_err": "Error, memory allocation is too high!

                              Physical memory: {1}MB
                              Maximum memory: {2}MB
                              Possible result: Causing mysqld service unstable, even unable to start!

                              ", + "mysql_set_err": "Error, RAM allocation is too high!

                              Physical memory: {1}MB
                              Maximum memory: {2}MB
                              Possible result: Causing mysqld service unstable, even unable to start!

                              ", "mysql_status_title1": "Launch time", "mysql_status_title2": " Total connections", "mysql_status_title3": "Output", @@ -1092,9 +1092,9 @@ var lan = { "port": "Port", "note": "Note", "note_ph": "Site note", - "web_root_dir": "Web root directory", + "web_root_dir": "Web document root", "web_dir": "Web directory", - "root_dir": "Root directory", + "root_dir": "Document root", "yes": "Create", "no": "Cancel", "ftp_set": "FTP setting", @@ -1110,8 +1110,8 @@ var lan = { "default_doc_help": "Default indexes, one per line, priority top-to-bottom.", "site_stop_txt": "Unable to access when you turn off site, are you sure to continue?", "site_start_txt": "Ready to turn on this site, are you sure to continue?", - "site_del_info": "Whether to delete corresponding FTP, database and root directory", - "all_del_info": "Delete site and root directory at the same time", + "site_del_info": "Whether to delete corresponding FTP, database and document root", + "all_del_info": "Delete site and document root at the same time", "all_del_site": "Batch delete sites", "del_err": "Failed to delete the following sites", "click_access": "Click to access", @@ -1554,7 +1554,7 @@ var lan = { "plug_err": "The plugin class name, or the plugin method name is missing!", "request_err": "The request process found an error!", "already_install": "Installed", - "rootdir": "root directory", + "rootdir": "document root", "back": "back", "flush": "refresh", "set_account": "Account Settings", @@ -1705,7 +1705,7 @@ var lan = { "domain": "Domain name", "domian_tips": "Fill a domain name per line, the default is 80 port
                              General resolution add method *.domain.com
                              If the port format is www.domain.com:88", "site_ps": "Website Notes", - "root_dir": "Root directory", + "root_dir": "Document root", "dont_create": "Do not create", "create": "Create", "set_ftp": "FTP settings", @@ -1872,7 +1872,7 @@ var lan = { "mem": "memory", "status": "Status", "operate": "Operation", - "py_tips1": "The manager uses the module in the root directory requirements.txt of the pip installation project by default. If there are other modules to be installed, please manually enter the virtual environment installation", + "py_tips1": "The manager uses the module in the document root requirements.txt of the pip installation project by default. If there are other modules to be installed, please manually enter the virtual environment installation", "py_tips2": "Enter the virtual environment method:", "py_tips3": "Enter at command line", "py_tips4": "source project path / project name _venv/bin/activate", @@ -1962,7 +1962,7 @@ var lan = { "save_conf_now": "Saving configuration information, please wait...", "choose_file": "Please select a file", "input_newfile_name": "Please enter a new file name", - "rootdir": "root directory", + "rootdir": "document root", "create_newfile": "New file is being created, please wait...", "get_file_list": "Getting a list of files, please wait...", "plug_err": "The plugin class name, or the plugin method name is missing!", @@ -2083,7 +2083,7 @@ var lan = { "get_file_list": "Getting a list of files...", "del": "Del", "download": "Download", - "roodir": "root directory", + "roodir": "document root", "back": "Back", "flush": "Refresh", "set_account": "Account Settings", @@ -2125,7 +2125,7 @@ var lan = { "set_time_zone": "Time zone setting", "sys_pass": "system password", "set_ip": "IP settings", - "mem_disk": "memory disk", + "mem_disk": "RAM disk", "m_dns": "Primary DNS", "b_dns": "Alternate DNS", "test": "test", @@ -2137,8 +2137,8 @@ var lan = { "no_use": "Available:", "add_swap": "Add Swap", "confirm": "OK", - "swap_tips1": "swap is virtual memory under Linux, setting the appropriate swap can increase server stability", - "swap_tips2": "The recommended swap capacity is about 1.5 times the real memory capacity. If your server memory is larger than 4GB, you can set a fixed value of 1-2GB", + "swap_tips1": "swap is virtual RAM under Linux, setting the appropriate swap can increase server stability", + "swap_tips2": "The recommended swap capacity is about 1.5 times the real RAM capacity. If your server RAM is larger than 4GB, you can set a fixed value of 1-2GB", "swap_tips3": "The swap file is saved by default at /www/swap. Make sure the disk space is sufficient before setting it.", "swap_tips4": "If you don't need swap, set the capacity to 0", "swap_tips5": "This feature is not available for OVZ Virtual Architecture machines", @@ -2162,7 +2162,7 @@ var lan = { "sapce": "capacity", "used": "used", "mem_disk_tips1": "The ramdisk has a read/write speed that is unmatched by the physical disk, but can only be used to save temporary data!", - "mem_disk_tips2": "The memory disk is directly mounted as part of the physical memory, please arrange the storage capacity according to the current server memory usage!", + "mem_disk_tips2": "The RAM disk is directly mounted as part of the physical memory, please arrange the storage capacity according to the current server RAM usage!", "mem_disk_tips3": "After restarting the server, or unloading the ramdisk, the data saved in the ramdisk will be emptied!", "only_supp_centos": "Centre only supports Centos!", "init_netcard": "Initialize the network card", @@ -2174,7 +2174,7 @@ var lan = { "del_netcard_confirm": "Are you sure you want to remove [{1}] from the NIC configuration?", "del_ip": "delete IP address", "deleting": "Deleting...", - "umount_mem_disk": "Unload memory disk", + "umount_mem_disk": "Unload RAM disk", "umount_tips1": "After unloading the ramdisk, the target mount directory will be emptied

                              Are you sure you want to uninstall the mount directory [{1}]?", "umountting": "Unloading...", "change_pass_now": "Modifying password...", diff --git a/BTPanel/static/language/Simplified_Chinese/log.json b/BTPanel/static/language/Simplified_Chinese/log.json index 7a759224..6d17182c 100644 --- a/BTPanel/static/language/Simplified_Chinese/log.json +++ b/BTPanel/static/language/Simplified_Chinese/log.json @@ -136,7 +136,7 @@ "PLUG_MAM": "Plugin manager", "SET_PLUG": "Set plugin ['{1}'] AS!", "INSTALL_THIRD_PARDY_PLUG": "Installed third-party plugin [{1}]", - "SITE_DIR_NOT_EXIST_RECREATE": "Site [{1}], root directory [{2}] does NOT exist, recreated!", + "SITE_DIR_NOT_EXIST_RECREATE": "Site [{1}], document root [{2}] does NOT exist, recreated!", "SITE_STOP_ANTI_STEALING_LINK": "Hotlink Protection for site [{1}] disabled!", "SITE_START_ANTI_STEALING_LINK": "Hotlink Protection for site [{1}] enabled!" } diff --git a/BTPanel/static/language/Simplified_Chinese/public.json b/BTPanel/static/language/Simplified_Chinese/public.json index e5eb1767..8df097bf 100644 --- a/BTPanel/static/language/Simplified_Chinese/public.json +++ b/BTPanel/static/language/Simplified_Chinese/public.json @@ -111,7 +111,7 @@ "SITE_STOP_SUCCESS":"Site stopped", "SITE_NETLIMIT_ERR":"Site Traffic Control only supports Nginx Web Server!", "SITE_NETLIMIT_CLOSE_SUCCESS":"Site Traffic Control has been turned off!", - "SITE_ADD_BINDING":"Domain and Name of Subdirectory cannot be empty!", + "SITE_ADD_BINDING":"Domain and Name of subdirectory cannot be empty!", "SITE_INDEX_ERR_FORMAT":"Default Document Format is invalid, e.g., index.html", "SITE_INDEX_ERR_EMPTY":"Default Document cannot be empty!", "SITE_PATH_ERR_RE":"Same as original directory, no need to change!", @@ -414,7 +414,7 @@ "UNINSTALL_FIRST": "Please uninstall [{1}] first", "DEP_PAGE": "Depends on the following software, please install [{1}] first", "MINIMUM_CPU_REQUIRED": "At least [{1}] CPU cores are required to install", - "MINIMUM_MEM_REQUIRED": "At least [{1}MB] memory is required to install", + "MINIMUM_MEM_REQUIRED": "At least [{1}MB] RAM is required to install", "ALL": "All", "ONLY_SUP_SYS": "Only the [{1}] system is supported", "CHECK_FILE_HASH": "File hash verification failed, stop installation!", @@ -762,7 +762,7 @@ "DNS_CANT_USE":"Current DNS is NOT available", "DISK_SPACE_NOT_ENOUGH":"Failed, disk space is not enough, currently available space:", "USERNAME_CANT_EMPTY":"Username cannot be empty", - "MEM_DISK_SET_ERR":"Max capacity of the memory disk cannot exceed 50% of physical memory!", + "MEM_DISK_SET_ERR":"Max capacity of the RAM disk cannot exceed 50% of physical memory!", "INPUT_ABSOLUTE_PATH":"Please input an absolute path", "DIR_EXIST_ERR":"Directory already has files, please change another directory", "INPUT_ARGS_ERR":"Please input correct parameters", @@ -781,7 +781,7 @@ "REDIS_CONF_TIPS4": "Max num of connections", "REDIS_CONF_TIPS5": "Number of databases", "REDIS_CONF_TIPS6": "redis password, leaving blank means no password is set", - "REDIS_CONF_TIPS7": "MB, max memory usage, 0 means no limit", + "REDIS_CONF_TIPS7": "MB, max RAM usage, 0 means no limit", "RDB_ERR": "Please enter an integer for the RDB parameter", "SYS_DB_CANT_DEL": "System database, cannot be deleted", "SAVE_CONF": "Configuration has been saved", diff --git a/BTPanel/static/language/Simplified_Chinese/template.json b/BTPanel/static/language/Simplified_Chinese/template.json index cfb99f3f..a46e7a93 100644 --- a/BTPanel/static/language/Simplified_Chinese/template.json +++ b/BTPanel/static/language/Simplified_Chinese/template.json @@ -22,7 +22,7 @@ "T2":"Connection Manager", "T3":"Task Manager", "P1":"CPU Usage", - "P2":"Memory Usage", + "P2":"RAM Usage", "P3":"Release Memory", "P4":"Software", "NET1":"Network Traffic", @@ -80,7 +80,7 @@ "TH1":"User", "TH2":"Password", "TH3":"Status", - "TH4":"Root Directory", + "TH4":"Document Root", "TH5":"Notes", "TH6":"Action", "JS1":"Pls Install Prue-Ftpd first!", @@ -143,7 +143,7 @@ "CY2":"Suggested range of port: 8888 - 65535", "CY3":"Binding a Domain to bind Panel;Warning:If a domain is bound to Panel, you'll have to access panel with Domain ONLY!", "CY4":"Set Authorized Access IP,Using (,) to split multiple IP;Warning:If Authorized IP is set, ONLY the PC with Authorized IP can access the Panel!", - "CY5":"New Created Site will be saved to Subdirectory by default!", + "CY5":"New Created Site will be saved to subdirectory by default!", "CY6":"Directory of Site and Database Backup!", "CY7":"Defualt IP is Internet IP. If you need use local virtual machine to test, please input Intranet IP of virtual machine!", "CY8":"Sync", @@ -219,7 +219,7 @@ "T1":"Task type", "T2":"Name of Task", "T3":"Period", - "T4":"Script Content", + "T4":"Script content", "T5":"Add Task", "TT1":"Shell Script", "TT2":"Backup Site", diff --git a/BTPanel/templates/default/config.html b/BTPanel/templates/default/config.html index de30fe9a..0d921976 100644 --- a/BTPanel/templates/default/config.html +++ b/BTPanel/templates/default/config.html @@ -111,12 +111,19 @@ {{data['lan']['BASICAUTH_TIPS1']}}
                              - Message channel + Notification
                              Set
                              +
                              + Login panel alarm +
                              + + Set +
                              +
                              {{data['lan']['CT3']}} diff --git a/BTPanel/templates/default/files.html b/BTPanel/templates/default/files.html index dbf18c94..a05dadd3 100644 --- a/BTPanel/templates/default/files.html +++ b/BTPanel/templates/default/files.html @@ -34,7 +34,7 @@
                              - +
                              @@ -55,6 +55,7 @@ diff --git a/BTPanel/templates/default/firewall.html b/BTPanel/templates/default/firewall.html index 772dbc26..03c24cea 100644 --- a/BTPanel/templates/default/firewall.html +++ b/BTPanel/templates/default/firewall.html @@ -78,13 +78,6 @@
                              {{data['lan']['H1']}}/{{data['lan']['H2']}}
                              -
                              @@ -149,10 +142,17 @@
                              -
                              -

                              {{data['lan']['H4']}}

                              - {{data['lan']['BTN5']}} - {{data['lan']['PANEL_LOG']}} +
                              +
                              + +
                              +
                              +

                              {{data['lan']['H4']}}

                              + {{data['lan']['BTN5']}} + {{data['lan']['PANEL_LOG']}} +
                              @@ -175,7 +175,10 @@ var firewall = { ssl_scanning_list: [], //扫描列表 - get_init:function(){ + on_search:function(){ + firewall.get_log_list(1,$('.search_input').val()); + }, + get_init:function(){ firewall.flush_init(); firewall.get_list(); firewall.get_log_list(); diff --git a/BTPanel/templates/default/index.html b/BTPanel/templates/default/index.html index 5656b521..6ad3774e 100644 --- a/BTPanel/templates/default/index.html +++ b/BTPanel/templates/default/index.html @@ -1,6 +1,73 @@ {% extends "layout.html" %} {% block content %} +
                              @@ -16,7 +83,8 @@ {{data['lan']['S1']}} {{data['lan']['S2']}}  {{data['lan']['S3']}} {{data['lan']['S4']}}
                              - {{session['version']}} + {{data['pd']|safe}} + {{session['version']}} {{data['lan']['UPDATE']}} {{data['lan']['FIX']}} {{data['lan']['RESTART']}} @@ -31,7 +99,7 @@

                              {{data['lan']['STATUS']}}

                              -
                                + +
                                  +
                                • +
                                  + {{data['lan']['LOAD_STATUS']}} + ? +
                                  +
                                  +
                                  0%
                                  +
                                  +
                                  {{data['lan']['S2']}}
                                  +
                                • +
                                • +
                                  {{data['lan']['P1']}}
                                  +
                                  +
                                  0%
                                  +
                                  +
                                  {{data['lan']['S2']}}
                                  +
                                • +
                                • +
                                  {{data['lan']['P2']}}
                                  +
                                  +
                                  0%
                                  +
                                  +
                                  {{data['lan']['S2']}}
                                  +
                                • +
                              @@ -115,20 +209,39 @@
                              -
                              -
                              -
                              {{data['lan']['FLOW']}}
                              -
                              +
                              +
                              +
                              + {{data['lan']['FLOW']}} + Disk IO +
                              + + +
                              +
                              +
                              +
                              +

                              {{data['lan']['UPLOAD']}}

                              {{data['lan']['S2']}}

                              {{data['lan']['DOWNLOAD']}}

                              {{data['lan']['S2']}}

                              {{data['lan']['TOTAL_TX']}}

                              {{data['lan']['S2']}}

                              {{data['lan']['TOTAL_RX']}}

                              {{data['lan']['S2']}}
                              +
                              +
                              -
                              -
                              -
                              + +
                              +
                              +
                              -
                              @@ -143,7 +256,7 @@ diff --git a/BTPanel/templates/default/login.html b/BTPanel/templates/default/login.html index fece54b9..1c207fd1 100644 --- a/BTPanel/templates/default/login.html +++ b/BTPanel/templates/default/login.html @@ -1,539 +1,323 @@ + - - - - - - {{g.title}} - - - + } else if (isEdge) { // edge + + return 'edge' + } else if (isIE11) { // IE11 + return 11 + } else { // 不是ie浏览器 + return -1 + } + } + if (IEVersion() > -1 && IEVersion() < 9) { + window.location.href = '/tips'; + } + + -
                              -