209 lines
6.1 KiB
Plaintext
209 lines
6.1 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="zh">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
|
<title>猫眼|数据备份管理-${title!""}</title>
|
|
<#include "../common/header.ftl"/>
|
|
<style>
|
|
td{
|
|
vertical-align:middle;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="lyear-layout-web">
|
|
<div class="lyear-layout-container">
|
|
<!--左侧导航-->
|
|
<aside class="lyear-layout-sidebar">
|
|
|
|
<!-- logo -->
|
|
<div id="logo" class="sidebar-header">
|
|
<a href="index.html"><img src="/admin/images/logo.png" title="猫眼" alt="猫眼" /></a>
|
|
</div>
|
|
<div class="lyear-layout-sidebar-scroll">
|
|
<#include "../common/left-menu.ftl"/>
|
|
</div>
|
|
|
|
</aside>
|
|
<!--End 左侧导航-->
|
|
|
|
<#include "../common/header-menu.ftl"/>
|
|
|
|
<!--页面主要内容-->
|
|
<main class="lyear-layout-content">
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="card">
|
|
<div class="card-toolbar clearfix">
|
|
|
|
<#include "../common/third-menu.ftl"/>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
<label class="lyear-checkbox checkbox-primary">
|
|
<input type="checkbox" id="check-all"><span></span>
|
|
</label>
|
|
</th>
|
|
<th>备份文件</th>
|
|
<th>存放路径</th>
|
|
<th>操作时间</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<#if pageBean.content?size gt 0>
|
|
<#list pageBean.content as databaseBak>
|
|
<tr>
|
|
<td style="vertical-align:middle;">
|
|
<label class="lyear-checkbox checkbox-primary">
|
|
<input type="checkbox" name="ids[]" value="${databaseBak.id}"><span></span>
|
|
</label>
|
|
</td>
|
|
<td style="vertical-align:middle;">${databaseBak.filename}</td>
|
|
<td align="center">${databaseBak.filepath}</td>
|
|
<td style="vertical-align:middle;"><font class="text-success">${databaseBak.createTime}</font></td>
|
|
</tr>
|
|
</#list>
|
|
<#else>
|
|
<tr align="center"><td colspan="4">这里空空如也!</td></tr>
|
|
</#if>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<#if pageBean.total gt 0>
|
|
<ul class="pagination">
|
|
<#if pageBean.currentPage == 1>
|
|
<li class="disabled"><span>«</span></li>
|
|
<#else>
|
|
<li><a href="list?currentPage=1">«</a></li>
|
|
</#if>
|
|
<#list pageBean.currentShowPage as showPage>
|
|
<#if pageBean.currentPage == showPage>
|
|
<li class="active"><span>${showPage}</span></li>
|
|
<#else>
|
|
<li><a href="list?currentPage=${showPage}">${showPage}</a></li>
|
|
</#if>
|
|
</#list>
|
|
<#if pageBean.currentPage == pageBean.totalPage>
|
|
<li class="disabled"><span>»</span></li>
|
|
<#else>
|
|
<li><a href="list?currentPage=${pageBean.totalPage}">»</a></li>
|
|
</#if>
|
|
<li><span>共${pageBean.totalPage}页,${pageBean.total}条数据</span></li>
|
|
</ul>
|
|
</#if>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
<!--End 页面主要内容-->
|
|
</div>
|
|
</div>
|
|
<#include "../common/footer.ftl"/>
|
|
<script type="text/javascript" src="/admin/js/perfect-scrollbar.min.js"></script>
|
|
<script type="text/javascript" src="/admin/js/main.min.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
|
|
});
|
|
function del(url){
|
|
if($("input[type='checkbox']:checked").length < 1){
|
|
showWarningMsg('请至少选择一条数据进行删除!');
|
|
return;
|
|
}
|
|
var ids = '';
|
|
$("input[type='checkbox']:checked").each(function(i,e){
|
|
if($(e).attr('id') != 'check-all'){
|
|
ids += $(e).val() + ',';
|
|
}
|
|
});
|
|
if(ids != ''){
|
|
ids = ids.substring(0,ids.length-1);
|
|
}
|
|
$.confirm({
|
|
title: '确定删除?',
|
|
content: '删除后数据不可恢复,请慎重!',
|
|
buttons: {
|
|
confirm: {
|
|
text: '确认',
|
|
action: function(){
|
|
deleteReq(ids,url);
|
|
}
|
|
},
|
|
cancel: {
|
|
text: '关闭',
|
|
action: function(){
|
|
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
//备份操作
|
|
function add(url){
|
|
ajaxRequest(url,'post',{},function(rst){
|
|
if(rst.code == 0){
|
|
showSuccessMsg('备份成功!',function(){
|
|
window.location.reload();
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
//还原操作
|
|
function restore(url){
|
|
if($("input[type='checkbox']:checked").length != 1){
|
|
showWarningMsg('请选择一条数据进行还原!');
|
|
return;
|
|
}
|
|
var id = $("input[type='checkbox']:checked").val();
|
|
ajaxRequest(url,'post',{id:id},function(rst){
|
|
if(rst.code == 0){
|
|
showSuccessMsg('还原成功!',function(){
|
|
window.location.reload();
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
//调用删除方法
|
|
function deleteReq(ids,url){
|
|
$.ajax({
|
|
url:url,
|
|
type:'POST',
|
|
data:{ids:ids},
|
|
dataType:'json',
|
|
success:function(data){
|
|
if(data.code == 0){
|
|
showSuccessMsg('数据备份删除成功!',function(){
|
|
window.location.reload();
|
|
//$("input[type='checkbox']:checked").parents("tr").remove();
|
|
})
|
|
}else{
|
|
showErrorMsg(data.msg);
|
|
}
|
|
},
|
|
error:function(data){
|
|
alert('网络错误!');
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |