114 lines
4.1 KiB
HTML
114 lines
4.1 KiB
HTML
<include file="Inc:header"/>
|
|
<style>
|
|
.table-bordered .icon-ok{ color:#468847}
|
|
.table-bordered .icon-remove{ color:#ff0000}
|
|
/*备份样式*/
|
|
.bakeing{ width: 100%; background: rgba(0,0,0,0.7); position:fixed; height: 100%; top:0px; left:0px; z-index: 9999; display: none;}
|
|
.bakeing .progress{ margin-top: 300px; width: 60%; margin-left: auto; margin-right:auto; }
|
|
.progress{ height: 40px; border-radius:20px;}
|
|
.progress .bar{font-size:20px;line-height: 40px;}
|
|
</style>
|
|
<div class="container-fluid">
|
|
<div class="main_head">
|
|
<div class="main_h1"><h1>{$pagetitle}</h1></div>
|
|
<div class="main_add">
|
|
<a class="btn btn-inverse" href="{:U('Database/index')}" style="margin-left:10px;">返回列表</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="text-align:right; float:right"></div>
|
|
|
|
<div class="row-fluid">
|
|
<div class="span12">
|
|
<div class="widget-box">
|
|
<div class="widget-content nopadding">
|
|
<form method="post" action="__SELF__" onsubmit="return save_form2(this);" class="modelIndex">
|
|
<table class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th width="30%">备份名称</th>
|
|
<th width="10%">卷数</th>
|
|
<th width="10%">数据大小</th>
|
|
<th width="10%">是否备份成功</th>
|
|
<th width="10%">备注</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<foreach name="data" item="v" >
|
|
<tr>
|
|
<td class="center">{$v.name}</td>
|
|
<td class="center">{$v.file_num}</td>
|
|
<td class="center">{$v.file_size|format_bytes}</td>
|
|
<td class="center">
|
|
<if condition="$v.file_size gt 1 ">
|
|
<span class="label label-success">备份成功</span>
|
|
<else />
|
|
<span class="label">备份失败</span>
|
|
</if>
|
|
</td>
|
|
<td class="center">
|
|
<a onclick="set_recovery('{$v.name}')" class="btn btn-primary btn-mini">恢复</a>
|
|
<a href="{:U('delete',array("name"=>$v['name']))}" class="btn btn-danger btn-mini ajax_del">删除</a>
|
|
</td>
|
|
</tr>
|
|
</foreach>
|
|
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<include file="Inc/footer"/>
|
|
<script>
|
|
function set_recovery(name){
|
|
if(confirm("在恢复数据的时候不能刷新或者关闭浏览器,否则会造成数据丢失!")==true){
|
|
//初始化
|
|
var progress='<div class="bakeing"><div class="progress progress-striped active"><div class="bar" id="database_bar" style="width:1%;">1%</div></div></div>';
|
|
$("body").append(progress);
|
|
$(".bakeing").show();
|
|
$("body").css("overflow","hidden");
|
|
window.onbeforeunload = function(){ return "正在恢复数据库,请不要关闭!" }
|
|
//
|
|
var param={
|
|
"name":name,
|
|
"table_index":0,
|
|
"p":1,
|
|
};
|
|
rebake(param);
|
|
|
|
return false;
|
|
}
|
|
}
|
|
//正式恢复数据
|
|
function rebake(param){
|
|
$.get("{:U('import')}",param, function(result){
|
|
if(result.status){
|
|
var data=result.info;
|
|
$("#database_bar").html(data.progress+"%");
|
|
$("#database_bar").css("width",data.progress+"%");
|
|
if(data.progress==100){
|
|
layer.alert("数据完成");
|
|
window.onbeforeunload = function(){ return null }
|
|
layer.msg("数据恢复成功",function(){
|
|
history.go(0);
|
|
});
|
|
|
|
return;
|
|
}else{
|
|
rebake(data);
|
|
}
|
|
}else{
|
|
alert(result.info);
|
|
}
|
|
},"json");
|
|
|
|
}
|
|
|
|
|
|
</script> |