import.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <include file="Public:header" />
  2. <div id="main-content">
  3. <div id="top-alert" class="fixed alert alert-error" style="display: none;">
  4. <button class="close fixed" style="margin-top: 4px;">&times;</button>
  5. <div class="alert-content">警告内容</div>
  6. </div>
  7. <div id="main" class="main">
  8. <div class="main-title-h">
  9. <span class="h1-title">数据还原</span>
  10. </div>
  11. <div class="data-table table-striped">
  12. <table>
  13. <thead>
  14. <tr>
  15. <th width="200">备份名称</th>
  16. <th width="80">卷数</th>
  17. <th width="80">数据大小</th>
  18. <th width="200">备份时间</th>
  19. <th>状态</th>
  20. <th width="120">操作</th>
  21. </tr>
  22. </thead>
  23. <tbody>
  24. <volist name="list" id="data">
  25. <tr>
  26. <td>{$data.time|date='Ymd-His',###}</td>
  27. <td>{$data.part}</td>
  28. <td>{$data.size}</td>
  29. <td>{$data.key}</td>
  30. <td>-</td>
  31. <td class="action">
  32. <a class=" btn-xs btn-info" href="{:U('Tools/xiazai')}?file={$data.time|date='Ymd-His',###}-1.sql.gz">下载</a>
  33. <a class="db-import btn-primary btn-xs" href="{:U('Tools/import?time='.$data['time'])}">还原</a>
  34. <a class="ajax-get confirm btn-danger btn-xs" href="{:U('Tools/del?time='.$data['time'])}">删除</a>
  35. </td>
  36. </tr>
  37. </volist>
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. </div>
  43. <script type="text/javascript">
  44. $(".db-import").click(function(){
  45. var self = this, status = ".";
  46. $.get(self.href, success, "json");
  47. window.onbeforeunload = function(){ return "正在还原数据库,请不要关闭!" }
  48. return false;
  49. function success(data){
  50. if(data.status){
  51. if(data.gz){
  52. data.info += status;
  53. if(status.length === 5){
  54. status = ".";
  55. } else {
  56. status += ".";
  57. }
  58. }
  59. $(self).parent().prev().text(data.info);
  60. if(data.part){
  61. $.get(self.href,
  62. {"part" : data.part, "start" : data.start},
  63. success,
  64. "json"
  65. );
  66. } else {
  67. window.onbeforeunload = function(){ return null; }
  68. }
  69. } else {
  70. updateAlert(data.info,'alert-error');
  71. }
  72. }
  73. });
  74. </script>
  75. <script type="text/javascript">
  76. //主导航高亮
  77. $('.index-box').addClass('current');
  78. $('.index-import').addClass('current');
  79. </script>
  80. <include file="Public:footer" />