function getType(e){var a="";switch(e){case"zip":case"rar":case"7z":a="file_zip";break;case"jpg":case"png":case"bmp":case"gif":case"ico":a="file_img";break;case"htm":case"html":a="file_html";break;case"php":case"css":case"jsp":case"js":a="file_code";break;case"exe":a="file_exe";break;case"docx":case"doc":a="file_word";break;case"xlsx":case"xls":a="file_excel";break;case"pptx":case"ppt":a="file_ppt";break;case"pdf":a="file_pdf";break;case"psd":a="file_psd";break;case"mp4":a="file_video";break;case"mp3":a="file_music";break;case"txt":a="file_txt";break;case"wjj":a="folder";break;default:a="file"}return a}function getList(e,a,t){if(layer.load(0,{shade:!1}),""==e)var s="";else if("nav"==e)s=a;else s=a+$(e).text()+"/";$.ajax({url:"Ajax.php?act=getList&dir="+s,dataType:"json",error:function(){$("#list").html('<th class="text-center" colspan="4">请求错误</th>'),layer.closeAll("loading")},success:function(a){$("title,.navbar-brand").prepend(a.name);var i="";$("#list").html("");for(var c=a.data,n=0,r=c.length;n<r;n++){if("wjj"==c[n].type)var l='<a href="javascript:;" onclick="getList(this,\''+s+"')\">"+c[n].name+"</a>";else l='<a href="javascript:;" onclick="Preview(\''+c[n].type+"','"+c[n].name+"', '"+s+c[n].name+"')\">"+c[n].name+"</a>";i+='<tr><td><svg class="icon" aria-hidden="true"><use xlink:href="#icon-'+getType(c[n].type)+'"></use></svg></td><td>'+l+'</td><td class ="text-right">'+c[n].size+'</td><td class ="text-center">'+c[n].time+"</td></tr>"}if(""==e&&$("#nav").html(""),"nav"!=e){var o='<a  class="breadcrumb-item" href="javascript:;"  onclick="getList(\'nav\',\''+s+"',this)\">"+$(e).text()+"</a>";$("#nav").append(o)}else $(t).nextAll().detach();$("#list").append(i),layer.closeAll("loading")}})}function DownFlie(e){$.ajax({url:"Ajax.php?act=getUrl&dir="+e,dataType:"json",success:function(e){e.msg?window.location.href=e.url:layer.alert("错误代码：<br>"+e.msg,{icon:2})}})}function Preview(e,a,t){$.ajax({url:"Ajax.php?act=getUrl&dir="+t,dataType:"json",success:function(s){var i;switch(e){case"mp3":i='<audio width="100%" height="100%" controls><source src="'+s.url+'" type="audio/mpeg">您的浏览器不支持该音频格式。</audio>';break;case"mp4":i='<video width="100%" height="100%" controls><source src="'+s.url+'" type="video/mp4">您的浏览器不支持该视频格式。</video>';break;case"jpg":case"png":case"bmp":case"gif":case"ico":i='<img src="'+s.url+'" class="img-fluid">';break;default:return void DownFlie(t)}layer.open({type:1,title:a+" - 文件预览",area:["80%","70%"],shadeClose:!0,shade:.8,content:'<div class="container"><br><div class="text-center">'+i+'</div><br><div class="text-right"><button type="button" class="btn btn-outline-secondary btn-sm"><a class="dropdown-item" target="_blank" href="'+s.url+'"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-down"></use></svg>下载</a></button><p> </p></div></div>'})}})}function login(){var e=layer.msg("登录验证中，请稍候",{icon:16,time:!1,shade:.8}),a=$("#indexpass").val();return $.ajax({url:"Ajax.php?act=login",type:"post",dataType:"json",data:{indexpass:a},success:function(a){a.msg?setTimeout(function(){layer.closeAll(),layer.msg("登录成功",{icon:1,time:1e3}),getList("")},500):setTimeout(function(){layer.close(e),layer.msg("密码错误！",{icon:2,time:1e3})},500)}}),!1}$(function(){$.ajax({url:"Ajax.php?act=getConfig",dataType:"json",success:function(e){e.install?($("title,.navbar-brand").prepend(e.name),$("#record").text(e.record),e.log?getList(""):layer.open({type:1,title:"请输入查看密码",area:["350px","auto"],content:'<div class="container text-right"><br><form onsubmit="return login();"><div class="input-group mb-3"><div class="input-group-prepend"><span class="input-group-text">密码：</span></div><input type="text" class="form-control" id="indexpass"></div><input type="submit" class="btn btn-primary" value="确认"><div><p></p></div></form></div>'})):layer.open({title:"提示",content:"你还没有安装程序，点击确定安装",icon:2,yes:function(){window.location.href="install/index.php"}})}})}),console.log("%c Amoli私有云 - 帮助您快速搭建私有云盘系统 官网地址：https://www.amoli.co","font-size:20px;");