mirror of https://gitee.com/zhang_1334717033/kiftd
重大更新,至版本v1.0.1
parent
30784612f7
commit
04acc9d24d
10
README.md
10
README.md
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
本应用的作者 _青阳龙野@kohgylw_ 相信:不仅仅是他本人,而是还有很多人都需要在局域网内自己搭建起一个属于个人或团体的网盘服务器系统,这样就可以让所有在同一局域网内的朋友、同事或学生去访问、上传或下载自己网盘上的文件--无论是不足1MB的doc文本,还是超过4GB的1080p视频。而且这种网盘的安装必须十分简单快速,界面要使用中文,且能够完全兼容Windows/Linux/Unix(包括Mac OS X)系统。
|
本应用的作者 _青阳龙野@kohgylw_ 相信:不仅仅是他本人,而是还有很多人都需要在局域网内自己搭建起一个属于个人或团体的网盘服务器系统,这样就可以让所有在同一局域网内的朋友、同事或学生去访问、上传或下载自己网盘上的文件--无论是不足1MB的doc文本,还是超过4GB的1080p视频。而且这种网盘的安装必须十分简单快速,界面要使用中文,且能够完全兼容Windows/Linux/Unix(包括Mac OS X)系统。
|
||||||
|
|
||||||
此外,这个网盘还应该想主流的免费网盘一样支持Mp4视频直接在线播放、pdf文档直接预览、图片直接查看功能。
|
此外,这个网盘还应该像主流的免费网盘一样支持Mp4视频直接在线播放、pdf文档直接预览、图片直接查看功能。
|
||||||
|
|
||||||
--实际上,作者最初编写kift的目的就是为了能实现上述功能,毕竟作为老师的他需要时常在班级里分享文件给学生。在他成功弄丢了几次U盘之后,便萌生了利用闲暇时间设计一款这样的应用的想法。
|
--实际上,作者最初编写kift的目的就是为了能实现上述功能,毕竟作为老师的他需要时常在班级里分享文件给学生。在他成功弄丢了几次U盘之后,便萌生了利用闲暇时间设计一款这样的应用的想法。
|
||||||
|
|
||||||
|
|
@ -27,6 +27,14 @@ _注:kift的解压即用版就叫做kiftd_
|
||||||
* 开源免费,您还在担心隐藏代码偷偷挖矿?kift是完全开源的,您可以很轻松地查看它的源代码,也可以将其拷贝下来自行编译部署。爱护用户平台硬件,从开源做起。此外,它不会产生任何遗留,能够做到轻轻地走就如轻轻地来,卸载时绝对不会和你卖萌。
|
* 开源免费,您还在担心隐藏代码偷偷挖矿?kift是完全开源的,您可以很轻松地查看它的源代码,也可以将其拷贝下来自行编译部署。爱护用户平台硬件,从开源做起。此外,它不会产生任何遗留,能够做到轻轻地走就如轻轻地来,卸载时绝对不会和你卖萌。
|
||||||
* 使用方便,kiftd的目标是让最小白的用户也能顺利使用它,并避免国外软件带来的文字障碍。
|
* 使用方便,kiftd的目标是让最小白的用户也能顺利使用它,并避免国外软件带来的文字障碍。
|
||||||
-------------------
|
-------------------
|
||||||
|
最新讯息:
|
||||||
|
### kift重大更新:v1.0.1
|
||||||
|
_这是kift完全具备完整功能的第一个版本,推荐所有用户更新并体验。_
|
||||||
|
新的内容包括:
|
||||||
|
+ 新增登录控制功能。现在您终于可以设定用户是直接访问主页还是需要先进入登录页面登录后才可访问主页了。本人经过思考后觉得这项功能对于个人用户而言十分重要,能够为个人用户提供更强的隐私性。感谢之前使用邮件提出此建议的使用者。详见《说明文档》。
|
||||||
|
+ 新增高效的批量上传、批量下载和批量删除功能。很多kift的用户经常需要大规模地上传、下载文件,现在,kift能够批量上传多个文件,此外也可以对多个文件进行打包下载。当然,还可以将选中的文件一次性删除。详见《说明文档》
|
||||||
|
+ 更新版本并保留原有文件的方法现已加入《说明文档》,您可以按照上面的指示来进行更新并保留网盘中原有的文件。
|
||||||
|
-------------------
|
||||||
### 只需抽出3分钟时间,您就可以在您自己的电脑上搭建出一个专业快捷的网盘服务器了。
|
### 只需抽出3分钟时间,您就可以在您自己的电脑上搭建出一个专业快捷的网盘服务器了。
|
||||||
|
|
||||||
* 马上下载本网盘服务器?请点击右上方绿色按钮“Clone or Download”,之后选择“Download ZIP”进行下载。
|
* 马上下载本网盘服务器?请点击右上方绿色按钮“Clone or Download”,之后选择“Download ZIP”进行下载。
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
||||||
#Generated by Maven Integration for Eclipse
|
#Generated by Maven Integration for Eclipse
|
||||||
#Sun Mar 11 14:57:13 CST 2018
|
#Thu Mar 22 15:10:21 CST 2018
|
||||||
version=0.0.1-SNAPSHOT
|
version=0.0.1-SNAPSHOT
|
||||||
groupId=kohgylw
|
groupId=kohgylw
|
||||||
m2e.projectName=KohgylwIFT
|
m2e.projectName=KohgylwIFT
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -18,6 +18,17 @@
|
||||||
</filter-mapping>
|
</filter-mapping>
|
||||||
<!-- end VC -->
|
<!-- end VC -->
|
||||||
|
|
||||||
|
<!-- 用户身份检查 -->
|
||||||
|
<filter>
|
||||||
|
<filter-name>MastLoginFilter</filter-name>
|
||||||
|
<filter-class>kohgylw.filter.MastLoginFilter</filter-class>
|
||||||
|
</filter>
|
||||||
|
<filter-mapping>
|
||||||
|
<filter-name>MastLoginFilter</filter-name>
|
||||||
|
<url-pattern>/*</url-pattern>
|
||||||
|
</filter-mapping>
|
||||||
|
<!-- end 用户身份检查 -->
|
||||||
|
|
||||||
<!-- spring MVC 配置 -->
|
<!-- spring MVC 配置 -->
|
||||||
|
|
||||||
<!-- 配置spring配置文件所在路径 -->
|
<!-- 配置spring配置文件所在路径 -->
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
@charset "UTF-8";
|
@charset "UTF-8";
|
||||||
|
|
||||||
.titlebox{
|
.titlebox {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height:30px;
|
line-height: 30px;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
padding-bottom: 5px;
|
padding-bottom: 5px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
|
@ -11,30 +11,45 @@
|
||||||
bottom: -7px;
|
bottom: -7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.titletext{
|
.titletext {
|
||||||
color:#000000;
|
color: #000000;
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graytext{
|
.graytext {
|
||||||
color:#8b8b8b;
|
color: #8b8b8b;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subtitle{
|
.subtitle {
|
||||||
color:#5cacee;
|
color: #5cacee;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rightbtn{
|
.rightbtn {
|
||||||
border-right:10px;
|
border-right: 10px;
|
||||||
float: right;
|
float: right;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.heading{
|
.heading {
|
||||||
height:8px;
|
height: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.centerText{
|
.centerText {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uploadstatusbox {
|
||||||
|
color: #9C9C9C;
|
||||||
|
font-size: 4px;
|
||||||
|
height: 48px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
@ -29,6 +29,14 @@ auth.admin = cudr
|
||||||
#authOverall = none
|
#authOverall = none
|
||||||
authOverall = l
|
authOverall = l
|
||||||
|
|
||||||
|
#[Login and browse home page]
|
||||||
|
#This setting means visitor could browse file list if not login
|
||||||
|
#If you want any visitor must log in to entry the home page,you can set this value is N
|
||||||
|
#(N = no;O = off)
|
||||||
|
#Example:
|
||||||
|
#mustLogin = N
|
||||||
|
mustLogin = O
|
||||||
|
|
||||||
#[Set the size of the buffer memory for file download by byte]
|
#[Set the size of the buffer memory for file download by byte]
|
||||||
#This value depending on your network speed and your memory size
|
#This value depending on your network speed and your memory size
|
||||||
#Example:
|
#Example:
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>KIFT</title>
|
<title>KIFT</title>
|
||||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="css/overrall.min.css">
|
<link rel="stylesheet" href="css/overrall.css">
|
||||||
<link rel="icon" type="image/x-icon" href="css/icon.png" />
|
<link rel="icon" type="image/x-icon" href="css/icon.png" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
@ -45,15 +45,15 @@
|
||||||
<p class="subtitle">
|
<p class="subtitle">
|
||||||
OS:<span id="serverOS"><span class="graytext">加载中...</span></span>
|
OS:<span id="serverOS"><span class="graytext">加载中...</span></span>
|
||||||
</p>
|
</p>
|
||||||
<div class="panel panel-default">
|
<div id="filetable" class="panel panel-default">
|
||||||
<!-- Default panel contents -->
|
<!-- Default panel contents -->
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<p class="heading" id="parentlistbox"></p>
|
<p class="heading" id="parentlistbox"></p>
|
||||||
</div>
|
</div>
|
||||||
<table class="table">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>文件名</th>
|
<th onclick="checkallfile()">文件名</th>
|
||||||
<th>创建日期</th>
|
<th>创建日期</th>
|
||||||
<th>大小</th>
|
<th>大小</th>
|
||||||
<th>创建者</th>
|
<th>创建者</th>
|
||||||
|
|
@ -235,9 +235,9 @@
|
||||||
</div>
|
</div>
|
||||||
<%-- end 修改文件夹模态框 --%>
|
<%-- end 修改文件夹模态框 --%>
|
||||||
<%-- 上传文件模态框 --%>
|
<%-- 上传文件模态框 --%>
|
||||||
<div class="modal fade bs-example-modal-sm" id="uploadFileModal"
|
<div class="modal fade" id="uploadFileModal" tabindex="-1"
|
||||||
tabindex="-1" role="dialog" aria-labelledby="uploadFileMolderTitle">
|
role="dialog" aria-labelledby="uploadFileMolderTitle">
|
||||||
<div class="modal-dialog modal-sm" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
|
|
@ -249,24 +249,33 @@
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<h5>选择文件:</h5>
|
<h5>选择文件:<span id="selectcount"></span></h5>
|
||||||
<input type="text" id="filepath" class="form-control"
|
<input type="text" id="filepath" class="form-control"
|
||||||
onclick="checkpath()" onfocus="this.blur()"
|
onclick="checkpath()" onfocus="this.blur()"
|
||||||
placeholder="请点击选择要上传的文件……"> <input type="file"
|
placeholder="请点击选择要上传的文件……"> <input type="file"
|
||||||
id="uploadfile" style="display: none;" onchange="showfilepath()">
|
id="uploadfile" style="display: none;" onchange="showfilepath()"
|
||||||
<br />
|
multiple="multiple"> <br />
|
||||||
<h5>上传进度:</h5>
|
<h5>
|
||||||
|
上传进度:<span id="filecount"></span>
|
||||||
|
</h5>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div id="pros" class="progress-bar" role="progressbar"
|
<div id="pros" class="progress-bar" role="progressbar"
|
||||||
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"
|
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"
|
||||||
style="width: 0%;">
|
style="width: 0%;">
|
||||||
<span class="sr-only">0% Complete</span>
|
<span class="sr-only"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h5>上传状态:</h5>
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="uploadstatus" class="uploadstatusbox"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="uploadFileAlert" role="alert"></div>
|
<div id="uploadFileAlert" role="alert"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" onclick='abortUpload()'>取消</button>
|
<button type="button" class="btn btn-default"
|
||||||
|
onclick='abortUpload()'>取消</button>
|
||||||
<button id="umbutton" type='button' class='btn btn-primary'
|
<button id="umbutton" type='button' class='btn btn-primary'
|
||||||
onclick='checkUploadFile()'>开始上传</button>
|
onclick='checkUploadFile()'>开始上传</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -362,5 +371,5 @@
|
||||||
</body>
|
</body>
|
||||||
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
|
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
|
||||||
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
||||||
<script type="text/javascript" src="js/home.min.js"></script>
|
<script type="text/javascript" src="js/home.js"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -8,6 +8,16 @@ var parentpath = "null";
|
||||||
$(function() {
|
$(function() {
|
||||||
getServerOS();
|
getServerOS();
|
||||||
showFolderView('root');
|
showFolderView('root');
|
||||||
|
// 阻止右键菜单
|
||||||
|
$(document).bind("contextmenu", function(e) {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
// 右键取消选中文件
|
||||||
|
$('body').mousedown(function(e) {
|
||||||
|
if (3 == e.which) {
|
||||||
|
$(".filerow").removeClass("info");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取服务器操作系统
|
// 获取服务器操作系统
|
||||||
|
|
@ -20,6 +30,9 @@ function getServerOS() {
|
||||||
},
|
},
|
||||||
url : "homeController/getServerOS.ajax",
|
url : "homeController/getServerOS.ajax",
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
|
if (result == "mustLogin") {
|
||||||
|
window.location.href = "login.jsp";
|
||||||
|
}
|
||||||
$("#serverOS").text(result);
|
$("#serverOS").text(result);
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
|
|
@ -38,13 +51,17 @@ function showFolderView(fid) {
|
||||||
},
|
},
|
||||||
url : 'homeController/getFolderView.ajax',
|
url : 'homeController/getFolderView.ajax',
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
var folderView = eval("(" + result + ")");
|
if (result == "mustLogin") {
|
||||||
locationpath = folderView.folder.folderId;
|
window.location.href = "login.jsp";
|
||||||
parentpath = folderView.folder.folderParent;
|
} else {
|
||||||
showParentList(folderView);
|
var folderView = eval("(" + result + ")");
|
||||||
showAccountView(folderView);
|
locationpath = folderView.folder.folderId;
|
||||||
showPublishTime(folderView);
|
parentpath = folderView.folder.folderParent;
|
||||||
showFolderTable(folderView);
|
showParentList(folderView);
|
||||||
|
showAccountView(folderView);
|
||||||
|
showPublishTime(folderView);
|
||||||
|
showFolderTable(folderView);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>");
|
$("#tb").html("<span class='graytext'>获取失败,请尝试刷新</span>");
|
||||||
|
|
@ -128,7 +145,7 @@ function showParentList(folderView) {
|
||||||
var f = folderView.folder;
|
var f = folderView.folder;
|
||||||
var index = 0;
|
var index = 0;
|
||||||
$.each(folderView.parentList, function(n, val) {
|
$.each(folderView.parentList, function(n, val) {
|
||||||
if (index <= 6) {
|
if (index <= 3) {
|
||||||
$("#parentlistbox").append(
|
$("#parentlistbox").append(
|
||||||
"<button onclick='entryFolder(" + '"' + val.folderId + '"'
|
"<button onclick='entryFolder(" + '"' + val.folderId + '"'
|
||||||
+ ")' class='btn btn-link btn-xs'>"
|
+ ")' class='btn btn-link btn-xs'>"
|
||||||
|
|
@ -137,7 +154,7 @@ function showParentList(folderView) {
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (index > 6) {
|
if (index > 3) {
|
||||||
$("#parentlistbox").append("... / ");
|
$("#parentlistbox").append("... / ");
|
||||||
}
|
}
|
||||||
$("#parentlistbox").append(f.folderName);
|
$("#parentlistbox").append(f.folderName);
|
||||||
|
|
@ -171,6 +188,16 @@ function showAccountView(folderView) {
|
||||||
.append(
|
.append(
|
||||||
"<button onclick='showUploadFileModel()' class='btn btn-link btn-xs rightbtn'><span class='glyphicon glyphicon-cloud-upload'></span> 上传文件</button>");
|
"<button onclick='showUploadFileModel()' class='btn btn-link btn-xs rightbtn'><span class='glyphicon glyphicon-cloud-upload'></span> 上传文件</button>");
|
||||||
}
|
}
|
||||||
|
if (checkAuth(authList, "L")) {
|
||||||
|
$("#parentlistbox")
|
||||||
|
.append(
|
||||||
|
"<button onclick='showDownloadAllCheckedModel()' class='btn btn-link btn-xs rightbtn'><span class='glyphicon glyphicon-cloud-download'></span> 打包下载</button>");
|
||||||
|
}
|
||||||
|
if (checkAuth(authList, "D")) {
|
||||||
|
$("#parentlistbox")
|
||||||
|
.append(
|
||||||
|
"<button onclick='showDeleteAllCheckedModel()' class='btn btn-link btn-xs rightbtn'><span class='glyphicon glyphicon-trash'></span> 批量删除</button>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,7 +248,7 @@ function showFolderTable(folderView) {
|
||||||
if (parentpath != null && parentpath != "null") {
|
if (parentpath != null && parentpath != "null") {
|
||||||
$("#foldertable")
|
$("#foldertable")
|
||||||
.append(
|
.append(
|
||||||
"<tr><td><button onclick='returnPF()' class='btn btn-link btn-xs'>../</button></td><td>--</td><td>--</td><td>--</td><td>--</td></tr>");
|
"<tr onclick='returnPF()'><td><button onclick='returnPF()' class='btn btn-link btn-xs'>../</button></td><td>--</td><td>--</td><td>--</td><td>--</td></tr>");
|
||||||
}
|
}
|
||||||
var authList = folderView.authList;
|
var authList = folderView.authList;
|
||||||
var aD = false;
|
var aD = false;
|
||||||
|
|
@ -277,10 +304,12 @@ function showFolderTable(folderView) {
|
||||||
.each(
|
.each(
|
||||||
folderView.fileList,
|
folderView.fileList,
|
||||||
function(n, fi) {
|
function(n, fi) {
|
||||||
var fileRow = "<tr><td>" + fi.fileName + "</td><td>"
|
var fileRow = "<tr onclick='checkfile(" + '"'
|
||||||
+ fi.fileCreationDate + "</td><td>"
|
+ fi.fileId + '"' + ")' id='" + fi.fileId
|
||||||
+ fi.fileSize + "MB</td><td>" + fi.fileCreator
|
+ "' class='filerow'><td>" + fi.fileName
|
||||||
+ "</td><td>";
|
+ "</td><td>" + fi.fileCreationDate
|
||||||
|
+ "</td><td>" + fi.fileSize + "MB</td><td>"
|
||||||
|
+ fi.fileCreator + "</td><td>";
|
||||||
if (aL) {
|
if (aL) {
|
||||||
fileRow = fileRow
|
fileRow = fileRow
|
||||||
+ "<button onclick='showDownloadModel("
|
+ "<button onclick='showDownloadModel("
|
||||||
|
|
@ -377,20 +406,24 @@ function createfolder() {
|
||||||
},
|
},
|
||||||
url : "homeController/newFolder.ajax",
|
url : "homeController/newFolder.ajax",
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
if (result == "noAuthorized") {
|
if (result == "mustLogin") {
|
||||||
showFolderAlert("提示:您的操作未被授权,创建文件夹失败");
|
window.location.href = "login.jsp";
|
||||||
} else if (result == "errorParameter") {
|
|
||||||
showFolderAlert("提示:参数不正确,创建文件夹失败");
|
|
||||||
} else if (result == "cannotCreateFolder") {
|
|
||||||
showFolderAlert("提示:出现意外错误,可能未能创建文件夹");
|
|
||||||
} else if (result == "folderAlreadyExist") {
|
|
||||||
showFolderAlert("提示:该文件夹已经存在,请更换文件夹名称");
|
|
||||||
} else if (result == "createFolderSuccess") {
|
|
||||||
$('#newFolderModal').modal('hide');
|
|
||||||
showFolderView(locationpath);
|
|
||||||
} else {
|
} else {
|
||||||
$('#newFolderModal').modal('hide');
|
if (result == "noAuthorized") {
|
||||||
showFolderView(locationpath);
|
showFolderAlert("提示:您的操作未被授权,创建文件夹失败");
|
||||||
|
} else if (result == "errorParameter") {
|
||||||
|
showFolderAlert("提示:参数不正确,创建文件夹失败");
|
||||||
|
} else if (result == "cannotCreateFolder") {
|
||||||
|
showFolderAlert("提示:出现意外错误,可能未能创建文件夹");
|
||||||
|
} else if (result == "folderAlreadyExist") {
|
||||||
|
showFolderAlert("提示:该文件夹已经存在,请更换文件夹名称");
|
||||||
|
} else if (result == "createFolderSuccess") {
|
||||||
|
$('#newFolderModal').modal('hide');
|
||||||
|
showFolderView(locationpath);
|
||||||
|
} else {
|
||||||
|
$('#newFolderModal').modal('hide');
|
||||||
|
showFolderView(locationpath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
|
|
@ -439,21 +472,25 @@ function deleteFolder(folderId) {
|
||||||
},
|
},
|
||||||
url : "homeController/deleteFolder.ajax",
|
url : "homeController/deleteFolder.ajax",
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
if (result == "noAuthorized") {
|
if (result == "mustLogin") {
|
||||||
$('#deleteFolderMessage').text("提示:您的操作未被授权,删除文件夹失败");
|
window.location.href = "login.jsp";
|
||||||
$("#dmbutton").attr('disabled', false);
|
|
||||||
} else if (result == "errorParameter") {
|
|
||||||
$('#deleteFolderMessage').text("提示:参数不正确,删除文件夹失败");
|
|
||||||
$("#dmbutton").attr('disabled', false);
|
|
||||||
} else if (result == "cannotDeleteFolder") {
|
|
||||||
$('#deleteFolderMessage').text("提示:出现意外错误,可能未能删除文件夹");
|
|
||||||
$("#dmbutton").attr('disabled', false);
|
|
||||||
} else if (result == "deleteFolderSuccess") {
|
|
||||||
$('#deleteFolderModal').modal('hide');
|
|
||||||
showFolderView(locationpath);
|
|
||||||
} else {
|
} else {
|
||||||
$('#deleteFolderMessage').text("提示:出现意外错误,可能未能删除文件夹");
|
if (result == "noAuthorized") {
|
||||||
$("#dmbutton").attr('disabled', false);
|
$('#deleteFolderMessage').text("提示:您的操作未被授权,删除文件夹失败");
|
||||||
|
$("#dmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "errorParameter") {
|
||||||
|
$('#deleteFolderMessage').text("提示:参数不正确,删除文件夹失败");
|
||||||
|
$("#dmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "cannotDeleteFolder") {
|
||||||
|
$('#deleteFolderMessage').text("提示:出现意外错误,可能未能删除文件夹");
|
||||||
|
$("#dmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "deleteFolderSuccess") {
|
||||||
|
$('#deleteFolderModal').modal('hide');
|
||||||
|
showFolderView(locationpath);
|
||||||
|
} else {
|
||||||
|
$('#deleteFolderMessage').text("提示:出现意外错误,可能未能删除文件夹");
|
||||||
|
$("#dmbutton").attr('disabled', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
|
|
@ -476,6 +513,7 @@ function showRenameFolderModel(folderId, folderName) {
|
||||||
$("#renameFolderModal").modal('toggle');
|
$("#renameFolderModal").modal('toggle');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 执行重命名文件夹
|
||||||
function renameFolder(folderId) {
|
function renameFolder(folderId) {
|
||||||
var newName = $("#newfoldername").val();
|
var newName = $("#newfoldername").val();
|
||||||
var reg = new RegExp("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$", "g");
|
var reg = new RegExp("^[0-9a-zA-Z_\\u4E00-\\u9FFF]+$", "g");
|
||||||
|
|
@ -497,17 +535,21 @@ function renameFolder(folderId) {
|
||||||
},
|
},
|
||||||
url : "homeController/renameFolder.ajax",
|
url : "homeController/renameFolder.ajax",
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
if (result == "noAuthorized") {
|
if (result == "mustLogin") {
|
||||||
showRenameFolderAlert("提示:您的操作未被授权,重命名失败");
|
window.location.href = "login.jsp";
|
||||||
} else if (result == "errorParameter") {
|
|
||||||
showRenameFolderAlert("提示:参数不正确,重命名失败");
|
|
||||||
} else if (result == "cannotRenameFolder") {
|
|
||||||
showRenameFolderAlert("提示:出现意外错误,可能未能重命名文件夹");
|
|
||||||
} else if (result == "renameFolderSuccess") {
|
|
||||||
$('#renameFolderModal').modal('hide');
|
|
||||||
showFolderView(locationpath);
|
|
||||||
} else {
|
} else {
|
||||||
showRenameFolderAlert("提示:出现意外错误,可能未能重命名文件夹");
|
if (result == "noAuthorized") {
|
||||||
|
showRenameFolderAlert("提示:您的操作未被授权,重命名失败");
|
||||||
|
} else if (result == "errorParameter") {
|
||||||
|
showRenameFolderAlert("提示:参数不正确,重命名失败");
|
||||||
|
} else if (result == "cannotRenameFolder") {
|
||||||
|
showRenameFolderAlert("提示:出现意外错误,可能未能重命名文件夹");
|
||||||
|
} else if (result == "renameFolderSuccess") {
|
||||||
|
$('#renameFolderModal').modal('hide');
|
||||||
|
showFolderView(locationpath);
|
||||||
|
} else {
|
||||||
|
showRenameFolderAlert("提示:出现意外错误,可能未能重命名文件夹");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
|
|
@ -529,10 +571,6 @@ function showRenameFolderAlert(txt) {
|
||||||
|
|
||||||
// 显示上传文件模态框
|
// 显示上传文件模态框
|
||||||
function showUploadFileModel() {
|
function showUploadFileModel() {
|
||||||
$("#umbutton").attr('disabled', false);
|
|
||||||
$("#uploadfile").val("");
|
|
||||||
$("#filepath").val("");
|
|
||||||
$("#pros").width("0%");
|
|
||||||
$("#uploadFileAlert").removeClass("alert");
|
$("#uploadFileAlert").removeClass("alert");
|
||||||
$("#uploadFileAlert").removeClass("alert-danger");
|
$("#uploadFileAlert").removeClass("alert-danger");
|
||||||
$("#uploadFileAlert").text("");
|
$("#uploadFileAlert").text("");
|
||||||
|
|
@ -546,8 +584,20 @@ function checkpath() {
|
||||||
|
|
||||||
// 文件选中后自动回填文件路径
|
// 文件选中后自动回填文件路径
|
||||||
function showfilepath() {
|
function showfilepath() {
|
||||||
var fp = $("#uploadfile").val();
|
var fs = $("#uploadfile").get(0).files;
|
||||||
$("#filepath").val(fp);
|
var filename = "";
|
||||||
|
for (var i = 0; i < fs.length; i++) {
|
||||||
|
filename = filename + fs[i].name;
|
||||||
|
if (i < (fs.length - 1)) {
|
||||||
|
filename = filename + "、";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fs.length <= 1) {
|
||||||
|
$("#selectcount").text("");
|
||||||
|
} else {
|
||||||
|
$("#selectcount").text("(共" + fs.length + "个)");
|
||||||
|
}
|
||||||
|
$("#filepath").val(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查是否能够上传
|
// 检查是否能够上传
|
||||||
|
|
@ -559,27 +609,37 @@ function checkUploadFile() {
|
||||||
$("#uploadFileAlert").removeClass("alert-danger");
|
$("#uploadFileAlert").removeClass("alert-danger");
|
||||||
$("#uploadFileAlert").text("");
|
$("#uploadFileAlert").text("");
|
||||||
|
|
||||||
var filename = $("#filepath").val().replace(/^.+?\\([^\\]+?)?$/gi, "$1");
|
var fs = $("#uploadfile").get(0).files;
|
||||||
|
var filenames = new Array();
|
||||||
|
for (var i = 0; i < fs.length; i++) {
|
||||||
|
filenames[i] = fs[i].name.replace(/^.+?\\([^\\]+?)?$/gi, "$1");
|
||||||
|
}
|
||||||
|
var namelist = JSON.stringify(filenames);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : "POST",
|
type : "POST",
|
||||||
dataType : "text",
|
dataType : "text",
|
||||||
data : {
|
data : {
|
||||||
folderId : locationpath,
|
folderId : locationpath,
|
||||||
filename : filename
|
namelist : namelist
|
||||||
},
|
},
|
||||||
url : "homeController/checkUploadFile.ajax",
|
url : "homeController/checkUploadFile.ajax",
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
if (result == "errorParameter") {
|
if (result == "mustLogin") {
|
||||||
showUploadFileAlert("提示:参数不正确,无法开始上传");
|
window.location.href = "login.jsp";
|
||||||
} else if (result == "noAuthorized") {
|
|
||||||
showUploadFileAlert("提示:您的操作未被授权,无法开始上传");
|
|
||||||
} else if (result == "duplicationFileName") {
|
|
||||||
showUploadFileAlert("提示:存在重命名文件,无法开始上传");
|
|
||||||
} else if (result == "permitUpload") {
|
|
||||||
doupload();
|
|
||||||
} else {
|
} else {
|
||||||
showUploadFileAlert("提示:出现意外错误,无法开始上传");
|
if (result == "errorParameter") {
|
||||||
|
showUploadFileAlert("提示:参数不正确,无法开始上传");
|
||||||
|
} else if (result == "noAuthorized") {
|
||||||
|
showUploadFileAlert("提示:您的操作未被授权,无法开始上传");
|
||||||
|
} else if (result.startsWith("duplicationFileName:")) {
|
||||||
|
showUploadFileAlert("提示:本路径下已存在同名的文件:["
|
||||||
|
+ result.substring(20) + "],无法开始上传");
|
||||||
|
} else if (result == "permitUpload") {
|
||||||
|
doupload(1);
|
||||||
|
} else {
|
||||||
|
showUploadFileAlert("提示:出现意外错误,无法开始上传");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
|
|
@ -591,13 +651,21 @@ function checkUploadFile() {
|
||||||
var xhr;
|
var xhr;
|
||||||
|
|
||||||
// 执行文件上传并实现上传进度显示
|
// 执行文件上传并实现上传进度显示
|
||||||
function doupload() {
|
function doupload(count) {
|
||||||
|
|
||||||
|
var fs = $("#uploadfile").get(0).files;
|
||||||
|
var fcount = fs.length;
|
||||||
$("#pros").width("0%");// 先将进度条置0
|
$("#pros").width("0%");// 先将进度条置0
|
||||||
|
var uploadfile = fs[count - 1];// 获取要上传的文件
|
||||||
var uploadfile = $("#uploadfile").get(0).files[0];// 获取要上传的文件
|
|
||||||
|
|
||||||
if (uploadfile != null) {
|
if (uploadfile != null) {
|
||||||
|
|
||||||
|
var fname = uploadfile.name;
|
||||||
|
if (fcount > 1) {
|
||||||
|
$("#filecount").text("(" + count + "/" + fcount + ")");// 显示当前进度
|
||||||
|
}
|
||||||
|
$("#uploadstatus").prepend(
|
||||||
|
"<p>" + fname + "<span id='uls_" + count
|
||||||
|
+ "'>[正在上传...]</span></p>");
|
||||||
xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
|
xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
|
||||||
|
|
||||||
var fd = new FormData();// 用于封装文件数据的对象
|
var fd = new FormData();// 用于封装文件数据的对象
|
||||||
|
|
@ -618,20 +686,38 @@ function doupload() {
|
||||||
// TODO 上传成功
|
// TODO 上传成功
|
||||||
var result = xhr.responseText;
|
var result = xhr.responseText;
|
||||||
if (result == "uploadsuccess") {
|
if (result == "uploadsuccess") {
|
||||||
$('#uploadFileModal').modal('hide');
|
$("#uls_" + count).text("[已完成]");
|
||||||
$("#umbutton").attr('disabled', false);
|
if (count < fcount) {
|
||||||
showFolderView(locationpath);
|
doupload(count + 1);
|
||||||
|
} else {
|
||||||
|
// 清空所有提示信息,还原上传窗口
|
||||||
|
$("#uploadfile").val("");
|
||||||
|
$("#filepath").val("");
|
||||||
|
$("#pros").width("0%");
|
||||||
|
$('#uploadFileModal').modal('hide');
|
||||||
|
$("#umbutton").attr('disabled', false);
|
||||||
|
showFolderView(locationpath);
|
||||||
|
$("#filecount").text("");
|
||||||
|
$("#uploadstatus").text("");
|
||||||
|
$("#selectcount").text("");
|
||||||
|
}
|
||||||
} else if (result == "uploaderror") {
|
} else if (result == "uploaderror") {
|
||||||
showUploadFileAlert("提示:出现意外错误,上传失败");
|
showUploadFileAlert("提示:出现意外错误,文件:[" + fname
|
||||||
|
+ "]上传失败,上传被中断。");
|
||||||
|
$("#uls_" + count).text("[失败]");
|
||||||
} else {
|
} else {
|
||||||
$('#uploadFileModal').modal('hide');
|
$('#uploadFileModal').modal('hide');
|
||||||
|
$("#uls_" + count).text("[失败]");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showUploadFileAlert("提示:出现意外错误,上传失败");
|
showUploadFileAlert("提示:出现意外错误,文件:[" + fname + "]上传失败,上传被中断。");
|
||||||
|
$("#uls_" + count).text("[失败]");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
showUploadFileAlert("提示:未选择任何文件");
|
showUploadFileAlert("提示:要上传的文件不存在。");
|
||||||
|
$("#uploadstatus").prepend(
|
||||||
|
"<p>未找到要上传的文件<span id='uls_" + count + "'>[失败]</span></p>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -694,21 +780,25 @@ function deleteFile(fileId) {
|
||||||
},
|
},
|
||||||
url : "homeController/deleteFile.ajax",
|
url : "homeController/deleteFile.ajax",
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
if (result == "noAuthorized") {
|
if (result == "mustLogin") {
|
||||||
$('#deleteFileMessage').text("提示:您的操作未被授权,删除失败");
|
window.location.href = "login.jsp";
|
||||||
$("#dfmbutton").attr('disabled', false);
|
|
||||||
} else if (result == "errorParameter") {
|
|
||||||
$('#deleteFileMessage').text("提示:参数不正确,删除失败");
|
|
||||||
$("#dfmbutton").attr('disabled', false);
|
|
||||||
} else if (result == "cannotDeleteFile") {
|
|
||||||
$('#deleteFileMessage').text("提示:出现意外错误,可能未能删除文件");
|
|
||||||
$("#dfmbutton").attr('disabled', false);
|
|
||||||
} else if (result == "deleteFileSuccess") {
|
|
||||||
$('#deleteFileModal').modal('hide');
|
|
||||||
showFolderView(locationpath);
|
|
||||||
} else {
|
} else {
|
||||||
$('#deleteFileMessage').text("提示:出现意外错误,可能未能删除文件");
|
if (result == "noAuthorized") {
|
||||||
$("#dfmbutton").attr('disabled', false);
|
$('#deleteFileMessage').text("提示:您的操作未被授权,删除失败");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "errorParameter") {
|
||||||
|
$('#deleteFileMessage').text("提示:参数不正确,删除失败");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "cannotDeleteFile") {
|
||||||
|
$('#deleteFileMessage').text("提示:出现意外错误,可能未能删除文件");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "deleteFileSuccess") {
|
||||||
|
$('#deleteFileModal').modal('hide');
|
||||||
|
showFolderView(locationpath);
|
||||||
|
} else {
|
||||||
|
$('#deleteFileMessage').text("提示:出现意外错误,可能未能删除文件");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
|
|
@ -747,17 +837,21 @@ function renameFile(fileId) {
|
||||||
},
|
},
|
||||||
url : "homeController/renameFile.ajax",
|
url : "homeController/renameFile.ajax",
|
||||||
success : function(result) {
|
success : function(result) {
|
||||||
if (result == "cannotRenameFile") {
|
if (result == "mustLogin") {
|
||||||
showRenameFolderAlert("提示:出现意外错误,可能未能重命名文件");
|
window.location.href = "login.jsp";
|
||||||
} else if (result == "renameFileSuccess") {
|
|
||||||
$('#renameFileModal').modal('hide');
|
|
||||||
showFolderView(locationpath);
|
|
||||||
} else if (result == "errorParameter") {
|
|
||||||
showRenameFolderAlert("提示:参数错误,重命名失败");
|
|
||||||
} else if (result == "noAuthorized") {
|
|
||||||
showRenameFolderAlert("提示:您的操作未被授权,重命名失败");
|
|
||||||
} else {
|
} else {
|
||||||
showRenameFolderAlert("提示:出现意外错误,可能未能重命名文件");
|
if (result == "cannotRenameFile") {
|
||||||
|
showRenameFolderAlert("提示:出现意外错误,可能未能重命名文件");
|
||||||
|
} else if (result == "renameFileSuccess") {
|
||||||
|
$('#renameFileModal').modal('hide');
|
||||||
|
showFolderView(locationpath);
|
||||||
|
} else if (result == "errorParameter") {
|
||||||
|
showRenameFolderAlert("提示:参数错误,重命名失败");
|
||||||
|
} else if (result == "noAuthorized") {
|
||||||
|
showRenameFolderAlert("提示:您的操作未被授权,重命名失败");
|
||||||
|
} else {
|
||||||
|
showRenameFolderAlert("提示:出现意外错误,可能未能重命名文件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
|
|
@ -787,8 +881,16 @@ function showRenameFolderAlert(txt) {
|
||||||
function abortUpload() {
|
function abortUpload() {
|
||||||
if (xhr != null) {
|
if (xhr != null) {
|
||||||
xhr.abort();
|
xhr.abort();
|
||||||
|
$("#umbutton").attr('disabled', false);
|
||||||
|
$("#pros").width("0%");
|
||||||
|
$("#filecount").text("");
|
||||||
}
|
}
|
||||||
|
$("#uploadfile").val("");
|
||||||
|
$("#filepath").val("");
|
||||||
|
$("#uploadstatus").html("");
|
||||||
|
$("#selectcount").text("");
|
||||||
$('#uploadFileModal').modal('hide');
|
$('#uploadFileModal').modal('hide');
|
||||||
|
showFolderView(locationpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取文件名的后缀名,以小写形式输出
|
// 获取文件名的后缀名,以小写形式输出
|
||||||
|
|
@ -813,3 +915,134 @@ function pdfView(fileId) {
|
||||||
function showPicture(fileId) {
|
function showPicture(fileId) {
|
||||||
window.open("homeController/showPicture.do?fileId=" + fileId);
|
window.open("homeController/showPicture.do?fileId=" + fileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 选中某一行文件
|
||||||
|
function checkfile(fileId) {
|
||||||
|
if ($("#" + fileId).hasClass("info")) {
|
||||||
|
$("#" + fileId).removeClass("info");
|
||||||
|
} else {
|
||||||
|
$("#" + fileId).addClass("info");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var checkAll = true;
|
||||||
|
|
||||||
|
// 切换全部文件行的选中或非选中
|
||||||
|
function checkallfile() {
|
||||||
|
if (checkAll) {
|
||||||
|
$(".filerow").addClass("info");
|
||||||
|
checkAll = false;
|
||||||
|
} else {
|
||||||
|
$(".filerow").removeClass("info");
|
||||||
|
checkAll = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function showDownloadAllCheckedModel() {
|
||||||
|
$("#downloadFileBox").html("");
|
||||||
|
var checkedfiles = $(".info").get();
|
||||||
|
if (checkedfiles.length == 0) {
|
||||||
|
$("#downloadFileName")
|
||||||
|
.text(
|
||||||
|
"提示:您还未选择任何文件,请先选中一些文件后再执行本操作(您可以通过点击某一文件行来选中/取消选中文件,也可以通过点击列表上的“文件名”一栏来选中/取消选中所有文件)");
|
||||||
|
} else {
|
||||||
|
$("#downloadFileName").text(
|
||||||
|
"提示:您确认要打包并下载这" + checkedfiles.length + "项么?");
|
||||||
|
$("#downloadFileBox")
|
||||||
|
.html(
|
||||||
|
"<button id='dlmbutton' type='button' class='btn btn-primary' onclick='downloadAllChecked()'>开始下载</button>");
|
||||||
|
$("#dlmbutton").attr('disabled', false);
|
||||||
|
}
|
||||||
|
$("#downloadModal").modal('toggle');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载选中的所有文件
|
||||||
|
function downloadAllChecked() {
|
||||||
|
var checkedfiles = $(".info").get();
|
||||||
|
var downloadIdArray = new Array();
|
||||||
|
for (var i = 0; i < checkedfiles.length; i++) {
|
||||||
|
downloadIdArray[i] = checkedfiles[i].id;
|
||||||
|
}
|
||||||
|
var strIdList = JSON.stringify(downloadIdArray);
|
||||||
|
$("#dlmbutton").attr('disabled', true);
|
||||||
|
$("#downloadFileName").text(
|
||||||
|
"提示:准备开始下载(共" + checkedfiles.length + "项),请稍候...");
|
||||||
|
var t = setTimeout("$('#downloadModal').modal('hide');", 1000);
|
||||||
|
// POST提交全部下载请求
|
||||||
|
var temp = document.createElement("form");
|
||||||
|
temp.action = 'homeController/downloadCheckedFiles.do';
|
||||||
|
temp.method = "post";
|
||||||
|
temp.style.display = "none";
|
||||||
|
var sl = document.createElement("input");
|
||||||
|
sl.name = 'strIdList';
|
||||||
|
sl.value = strIdList;
|
||||||
|
temp.appendChild(sl);
|
||||||
|
document.body.appendChild(temp);
|
||||||
|
temp.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除选中的所有文件
|
||||||
|
function showDeleteAllCheckedModel() {
|
||||||
|
$('#deleteFileBox').html("");
|
||||||
|
var checkedfiles = $(".info").get();
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
if (checkedfiles.length == 0) {
|
||||||
|
$('#deleteFileMessage')
|
||||||
|
.text(
|
||||||
|
"提示:您还未选择任何文件,请先选中一些文件后再执行本操作(您可以通过点击某一文件行来选中/取消选中文件,也可以通过点击列表上的“文件名”一栏来选中/取消选中所有文件)");
|
||||||
|
} else {
|
||||||
|
$('#deleteFileBox')
|
||||||
|
.html(
|
||||||
|
"<button id='dfmbutton' type='button' class='btn btn-danger' onclick='deleteAllChecked()'>全部删除</button>");
|
||||||
|
$('#deleteFileMessage').text(
|
||||||
|
"提示:确定要彻底删除这" + checkedfiles.length + "项么?该操作不可恢复");
|
||||||
|
}
|
||||||
|
$('#deleteFileModal').modal('toggle');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除选中的所有文件
|
||||||
|
function deleteAllChecked() {
|
||||||
|
// TODO 提交全部删除请求
|
||||||
|
var checkedfiles = $(".info").get();
|
||||||
|
var downloadIdArray = new Array();
|
||||||
|
for (var i = 0; i < checkedfiles.length; i++) {
|
||||||
|
downloadIdArray[i] = checkedfiles[i].id;
|
||||||
|
}
|
||||||
|
var strIdList = JSON.stringify(downloadIdArray);
|
||||||
|
$("#dfmbutton").attr('disabled', true);
|
||||||
|
$('#deleteFileMessage').text("提示:正在删除,请稍候...");
|
||||||
|
$.ajax({
|
||||||
|
type : "POST",
|
||||||
|
dataType : "text",
|
||||||
|
data : {
|
||||||
|
strIdList : strIdList
|
||||||
|
},
|
||||||
|
url : "homeController/deleteCheckedFiles.ajax",
|
||||||
|
success : function(result) {
|
||||||
|
if (result == "mustLogin") {
|
||||||
|
window.location.href = "login.jsp";
|
||||||
|
} else {
|
||||||
|
if (result == "noAuthorized") {
|
||||||
|
$('#deleteFileMessage').text("提示:您的操作未被授权,删除失败");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "errorParameter") {
|
||||||
|
$('#deleteFileMessage').text("提示:参数不正确,未能全部删除文件");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "cannotDeleteFile") {
|
||||||
|
$('#deleteFileMessage').text("提示:出现意外错误,可能未能删除全部文件");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
} else if (result == "deleteFileSuccess") {
|
||||||
|
$('#deleteFileModal').modal('hide');
|
||||||
|
showFolderView(locationpath);
|
||||||
|
} else {
|
||||||
|
$('#deleteFileMessage').text("提示:出现意外错误,可能未能删除全部文件");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error : function() {
|
||||||
|
$('#deleteFileMessage').text("提示:出现意外错误,可能未能删除全部文件");
|
||||||
|
$("#dfmbutton").attr('disabled', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
/**
|
||||||
|
* login.jsp
|
||||||
|
*/
|
||||||
|
|
||||||
|
function dologin() {
|
||||||
|
var accountid = $("#accountid").val();
|
||||||
|
var accountpwd = $("#accountpwd").val();
|
||||||
|
var check = "y";
|
||||||
|
if (accountid.length == 0) {
|
||||||
|
$("#accountidbox").addClass("has-error");
|
||||||
|
check = "n"
|
||||||
|
} else {
|
||||||
|
$("#accountidbox").removeClass("has-error");
|
||||||
|
}
|
||||||
|
if (accountpwd.length == 0) {
|
||||||
|
$("#accountpwdbox").addClass("has-error");
|
||||||
|
check = "n"
|
||||||
|
} else {
|
||||||
|
$("#accountpwdbox").removeClass("has-error");
|
||||||
|
}
|
||||||
|
if (check == "y") {
|
||||||
|
$.ajax({
|
||||||
|
type : "POST",
|
||||||
|
dataType : "text",
|
||||||
|
url : "homeController/doLogin.ajax",
|
||||||
|
data : {
|
||||||
|
accountid : accountid,
|
||||||
|
accountpwd : accountpwd
|
||||||
|
},
|
||||||
|
success : function(result) {
|
||||||
|
$("#alertbox").removeClass("alert");
|
||||||
|
$("#alertbox").removeClass("alert-danger");
|
||||||
|
$("#alertbox").text("");
|
||||||
|
if (result == "permitlogin") {
|
||||||
|
$("#accountidbox").removeClass("has-error");
|
||||||
|
$("#accountpwdbox").removeClass("has-error");
|
||||||
|
window.location.href = "home.jsp";
|
||||||
|
} else if (result == "accountnotfound") {
|
||||||
|
$("#accountidbox").addClass("has-error");
|
||||||
|
$("#accountpwdbox").removeClass("has-error");
|
||||||
|
$("#alertbox").addClass("alert");
|
||||||
|
$("#alertbox").addClass("alert-danger");
|
||||||
|
$("#alertbox").text("提示:登录失败,账户不存在或未设置");
|
||||||
|
} else if (result == "accountpwderror") {
|
||||||
|
$("#accountpwdbox").addClass("has-error");
|
||||||
|
$("#accountidbox").removeClass("has-error");
|
||||||
|
$("#alertbox").addClass("alert");
|
||||||
|
$("#alertbox").addClass("alert-danger");
|
||||||
|
$("#alertbox").text("提示:登录失败,密码错误或未设置");
|
||||||
|
} else {
|
||||||
|
$("#alertbox").addClass("alert");
|
||||||
|
$("#alertbox").addClass("alert-danger");
|
||||||
|
$("#alertbox").text("提示:无法登录,未知错误");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error : function() {
|
||||||
|
$("#alertbox").addClass("alert");
|
||||||
|
$("#alertbox").addClass("alert-danger");
|
||||||
|
$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8"%>
|
||||||
|
<%
|
||||||
|
String path = request.getContextPath();
|
||||||
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
||||||
|
+ path + "/";
|
||||||
|
%>
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<base href="<%=basePath%>">
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>KIFT</title>
|
||||||
|
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="css/overrall.min.css">
|
||||||
|
<link rel="icon" type="image/x-icon" href="css/icon.png" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<%-- 中央布局 --%>
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<%-- 头部 --%>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="titlebox">
|
||||||
|
<span class="titletext"><em> 青阳网络文件传输系统 <small><span
|
||||||
|
class="graytext">KIFT</span></small></em></span>
|
||||||
|
</div>
|
||||||
|
<hr />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%-- end 头部 --%>
|
||||||
|
|
||||||
|
<%-- 主体 --%>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 col-md-offset-4">
|
||||||
|
<p class="centerText" style="font-size: 30px;color: #4D4D4D">
|
||||||
|
<strong>欢迎使用青阳网络文件传输系统</strong><em>KIFT</em></p>
|
||||||
|
<p class="centerText" style="font-size: 18px;color: #9C9C9C">
|
||||||
|
<span class="glyphicon glyphicon-user"></span> 您需要登录以进入系统</p>
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<h3 class="panel-title">请登录</h3>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<form class="form-horizontal">
|
||||||
|
<div class="form-group" id="accountidbox">
|
||||||
|
<label for="accountid" id="accountidtitle"
|
||||||
|
class="col-sm-3 control-label">账户:</label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input type="text" class="form-control" id="accountid"
|
||||||
|
placeholder="请输入账户……">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" id="accountpwdbox">
|
||||||
|
<label for="accountpwd" id="accountpwdtitle"
|
||||||
|
class="col-sm-3 control-label">密码:</label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input type="password" class="form-control" id="accountpwd"
|
||||||
|
placeholder="请输入密码……">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div id="alertbox" role="alert"></div>
|
||||||
|
<input class="form-control btn-success" type="button" value="登录"
|
||||||
|
onclick="dologin()"> <br />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%-- end 主体 --%>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<%-- end 中央布局 --%>
|
||||||
|
</body>
|
||||||
|
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
||||||
|
<script type="text/javascript" src="js/login.js"></script>
|
||||||
|
</html>
|
||||||
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Generated by the Jasper component of Apache Tomcat
|
* Generated by the Jasper component of Apache Tomcat
|
||||||
* Version: Apache Tomcat/9.0.0.M17
|
* Version: Apache Tomcat/9.0.0.M17
|
||||||
* Generated at: 2018-02-23 05:54:41 UTC
|
* Generated at: 2018-03-22 07:13:38 UTC
|
||||||
* Note: The last modified time of this file was set to
|
* Note: The last modified time of this file was set to
|
||||||
* the last modified time of the source file after
|
* the last modified time of the source file after
|
||||||
* generation to assist with modification tracking.
|
* generation to assist with modification tracking.
|
||||||
|
|
@ -123,7 +123,7 @@ public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase
|
||||||
out.write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n");
|
out.write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n");
|
||||||
out.write("<title>KIFT</title>\n");
|
out.write("<title>KIFT</title>\n");
|
||||||
out.write("<link rel=\"stylesheet\" href=\"css/bootstrap.min.css\">\n");
|
out.write("<link rel=\"stylesheet\" href=\"css/bootstrap.min.css\">\n");
|
||||||
out.write("<link rel=\"stylesheet\" href=\"css/overrall.min.css\">\n");
|
out.write("<link rel=\"stylesheet\" href=\"css/overrall.css\">\n");
|
||||||
out.write("<link rel=\"icon\" type=\"image/x-icon\" href=\"css/icon.png\" />\n");
|
out.write("<link rel=\"icon\" type=\"image/x-icon\" href=\"css/icon.png\" />\n");
|
||||||
out.write("</head>\n");
|
out.write("</head>\n");
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
|
|
@ -159,15 +159,15 @@ public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase
|
||||||
out.write("\t\t\t\t<p class=\"subtitle\">\n");
|
out.write("\t\t\t\t<p class=\"subtitle\">\n");
|
||||||
out.write("\t\t\t\t\tOS:<span id=\"serverOS\"><span class=\"graytext\">加载中...</span></span>\n");
|
out.write("\t\t\t\t\tOS:<span id=\"serverOS\"><span class=\"graytext\">加载中...</span></span>\n");
|
||||||
out.write("\t\t\t\t</p>\n");
|
out.write("\t\t\t\t</p>\n");
|
||||||
out.write("\t\t\t\t<div class=\"panel panel-default\">\n");
|
out.write("\t\t\t\t<div id=\"filetable\" class=\"panel panel-default\">\n");
|
||||||
out.write("\t\t\t\t\t<!-- Default panel contents -->\n");
|
out.write("\t\t\t\t\t<!-- Default panel contents -->\n");
|
||||||
out.write("\t\t\t\t\t<div class=\"panel-heading\">\n");
|
out.write("\t\t\t\t\t<div class=\"panel-heading\">\n");
|
||||||
out.write("\t\t\t\t\t\t<p class=\"heading\" id=\"parentlistbox\"></p>\n");
|
out.write("\t\t\t\t\t\t<p class=\"heading\" id=\"parentlistbox\"></p>\n");
|
||||||
out.write("\t\t\t\t\t</div>\n");
|
out.write("\t\t\t\t\t</div>\n");
|
||||||
out.write("\t\t\t\t\t<table class=\"table\">\n");
|
out.write("\t\t\t\t\t<table class=\"table table-hover\">\n");
|
||||||
out.write("\t\t\t\t\t\t<thead>\n");
|
out.write("\t\t\t\t\t\t<thead>\n");
|
||||||
out.write("\t\t\t\t\t\t\t<tr>\n");
|
out.write("\t\t\t\t\t\t\t<tr>\n");
|
||||||
out.write("\t\t\t\t\t\t\t\t<th>文件名</th>\n");
|
out.write("\t\t\t\t\t\t\t\t<th onclick=\"checkallfile()\">文件名</th>\n");
|
||||||
out.write("\t\t\t\t\t\t\t\t<th>创建日期</th>\n");
|
out.write("\t\t\t\t\t\t\t\t<th>创建日期</th>\n");
|
||||||
out.write("\t\t\t\t\t\t\t\t<th>大小</th>\n");
|
out.write("\t\t\t\t\t\t\t\t<th>大小</th>\n");
|
||||||
out.write("\t\t\t\t\t\t\t\t<th>创建者</th>\n");
|
out.write("\t\t\t\t\t\t\t\t<th>创建者</th>\n");
|
||||||
|
|
@ -362,9 +362,9 @@ public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase
|
||||||
out.write('\n');
|
out.write('\n');
|
||||||
out.write(' ');
|
out.write(' ');
|
||||||
out.write("\n");
|
out.write("\n");
|
||||||
out.write("\t<div class=\"modal fade bs-example-modal-sm\" id=\"uploadFileModal\"\n");
|
out.write("\t<div class=\"modal fade\" id=\"uploadFileModal\" tabindex=\"-1\"\n");
|
||||||
out.write("\t\ttabindex=\"-1\" role=\"dialog\" aria-labelledby=\"uploadFileMolderTitle\">\n");
|
out.write("\t\trole=\"dialog\" aria-labelledby=\"uploadFileMolderTitle\">\n");
|
||||||
out.write("\t\t<div class=\"modal-dialog modal-sm\" role=\"document\">\n");
|
out.write("\t\t<div class=\"modal-dialog\" role=\"document\">\n");
|
||||||
out.write("\t\t\t<div class=\"modal-content\">\n");
|
out.write("\t\t\t<div class=\"modal-content\">\n");
|
||||||
out.write("\t\t\t\t<div class=\"modal-header\">\n");
|
out.write("\t\t\t\t<div class=\"modal-header\">\n");
|
||||||
out.write("\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\"\n");
|
out.write("\t\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\"\n");
|
||||||
|
|
@ -376,24 +376,33 @@ public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase
|
||||||
out.write("\t\t\t\t\t</h4>\n");
|
out.write("\t\t\t\t\t</h4>\n");
|
||||||
out.write("\t\t\t\t</div>\n");
|
out.write("\t\t\t\t</div>\n");
|
||||||
out.write("\t\t\t\t<div class=\"modal-body\">\n");
|
out.write("\t\t\t\t<div class=\"modal-body\">\n");
|
||||||
out.write("\t\t\t\t\t<h5>选择文件:</h5>\n");
|
out.write("\t\t\t\t\t<h5>选择文件:<span id=\"selectcount\"></span></h5>\n");
|
||||||
out.write("\t\t\t\t\t<input type=\"text\" id=\"filepath\" class=\"form-control\"\n");
|
out.write("\t\t\t\t\t<input type=\"text\" id=\"filepath\" class=\"form-control\"\n");
|
||||||
out.write("\t\t\t\t\t\tonclick=\"checkpath()\" onfocus=\"this.blur()\"\n");
|
out.write("\t\t\t\t\t\tonclick=\"checkpath()\" onfocus=\"this.blur()\"\n");
|
||||||
out.write("\t\t\t\t\t\tplaceholder=\"请点击选择要上传的文件……\"> <input type=\"file\"\n");
|
out.write("\t\t\t\t\t\tplaceholder=\"请点击选择要上传的文件……\"> <input type=\"file\"\n");
|
||||||
out.write("\t\t\t\t\t\tid=\"uploadfile\" style=\"display: none;\" onchange=\"showfilepath()\">\n");
|
out.write("\t\t\t\t\t\tid=\"uploadfile\" style=\"display: none;\" onchange=\"showfilepath()\"\n");
|
||||||
out.write("\t\t\t\t\t<br />\n");
|
out.write("\t\t\t\t\t\tmultiple=\"multiple\"> <br />\n");
|
||||||
out.write("\t\t\t\t\t<h5>上传进度:</h5>\n");
|
out.write("\t\t\t\t\t<h5>\n");
|
||||||
|
out.write("\t\t\t\t\t\t上传进度:<span id=\"filecount\"></span>\n");
|
||||||
|
out.write("\t\t\t\t\t</h5>\n");
|
||||||
out.write("\t\t\t\t\t<div class=\"progress\">\n");
|
out.write("\t\t\t\t\t<div class=\"progress\">\n");
|
||||||
out.write("\t\t\t\t\t\t<div id=\"pros\" class=\"progress-bar\" role=\"progressbar\"\n");
|
out.write("\t\t\t\t\t\t<div id=\"pros\" class=\"progress-bar\" role=\"progressbar\"\n");
|
||||||
out.write("\t\t\t\t\t\t\taria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\"\n");
|
out.write("\t\t\t\t\t\t\taria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\"\n");
|
||||||
out.write("\t\t\t\t\t\t\tstyle=\"width: 0%;\">\n");
|
out.write("\t\t\t\t\t\t\tstyle=\"width: 0%;\">\n");
|
||||||
out.write("\t\t\t\t\t\t\t<span class=\"sr-only\">0% Complete</span>\n");
|
out.write("\t\t\t\t\t\t\t<span class=\"sr-only\"></span>\n");
|
||||||
|
out.write("\t\t\t\t\t\t</div>\n");
|
||||||
|
out.write("\t\t\t\t\t</div>\n");
|
||||||
|
out.write("\t\t\t\t\t<h5>上传状态:</h5>\n");
|
||||||
|
out.write("\t\t\t\t\t<div class=\"panel panel-default\">\n");
|
||||||
|
out.write("\t\t\t\t\t\t<div class=\"panel-body\">\n");
|
||||||
|
out.write("\t\t\t\t\t\t\t<div id=\"uploadstatus\" class=\"uploadstatusbox\"></div>\n");
|
||||||
out.write("\t\t\t\t\t\t</div>\n");
|
out.write("\t\t\t\t\t\t</div>\n");
|
||||||
out.write("\t\t\t\t\t</div>\n");
|
out.write("\t\t\t\t\t</div>\n");
|
||||||
out.write("\t\t\t\t\t<div id=\"uploadFileAlert\" role=\"alert\"></div>\n");
|
out.write("\t\t\t\t\t<div id=\"uploadFileAlert\" role=\"alert\"></div>\n");
|
||||||
out.write("\t\t\t\t</div>\n");
|
out.write("\t\t\t\t</div>\n");
|
||||||
out.write("\t\t\t\t<div class=\"modal-footer\">\n");
|
out.write("\t\t\t\t<div class=\"modal-footer\">\n");
|
||||||
out.write("\t\t\t\t\t<button type=\"button\" class=\"btn btn-default\" onclick='abortUpload()'>取消</button>\n");
|
out.write("\t\t\t\t\t<button type=\"button\" class=\"btn btn-default\"\n");
|
||||||
|
out.write("\t\t\t\t\t\tonclick='abortUpload()'>取消</button>\n");
|
||||||
out.write("\t\t\t\t\t<button id=\"umbutton\" type='button' class='btn btn-primary'\n");
|
out.write("\t\t\t\t\t<button id=\"umbutton\" type='button' class='btn btn-primary'\n");
|
||||||
out.write("\t\t\t\t\t\tonclick='checkUploadFile()'>开始上传</button>\n");
|
out.write("\t\t\t\t\t\tonclick='checkUploadFile()'>开始上传</button>\n");
|
||||||
out.write("\t\t\t\t</div>\n");
|
out.write("\t\t\t\t</div>\n");
|
||||||
|
|
@ -496,7 +505,7 @@ public final class home_jsp extends org.apache.jasper.runtime.HttpJspBase
|
||||||
out.write("</body>\n");
|
out.write("</body>\n");
|
||||||
out.write("<script type=\"text/javascript\" src=\"js/jquery-3.3.1.min.js\"></script>\n");
|
out.write("<script type=\"text/javascript\" src=\"js/jquery-3.3.1.min.js\"></script>\n");
|
||||||
out.write("<script type=\"text/javascript\" src=\"js/bootstrap.min.js\"></script>\n");
|
out.write("<script type=\"text/javascript\" src=\"js/bootstrap.min.js\"></script>\n");
|
||||||
out.write("<script type=\"text/javascript\" src=\"js/home.min.js\"></script>\n");
|
out.write("<script type=\"text/javascript\" src=\"js/home.js\"></script>\n");
|
||||||
out.write("</html>");
|
out.write("</html>");
|
||||||
} catch (java.lang.Throwable t) {
|
} catch (java.lang.Throwable t) {
|
||||||
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
|
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue