restore.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.db_restore}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <!-- 操作说明 -->
  13. <div class="explanation" id="explanation">
  14. <div class="title" id="checkZoom">
  15. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  16. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  17. </div>
  18. <ul>
  19. <li> {$Think.lang.db_restore_help1}</li>
  20. <li> {$Think.lang.db_restore_help2}</li>
  21. </ul>
  22. </div>
  23. <div class="ds-search-form">
  24. <dl>
  25. <dt style="font-size:14px;color: #09C;">{$Think.lang.db_restore_file_list}({$Think.lang.db_backup_file_count}:{$filenum},{$Think.lang.db_backup_file_size}:{$total|format_bytes})</dt>
  26. </dl>
  27. <div title="{$Think.lang.db_restore_refresh}" class="btn"><i class="iconfont iconfont-refresh">&#xe6d1;</i></div>
  28. </div>
  29. <table class="ds-default-table">
  30. <thead>
  31. <tr>
  32. <th>
  33. <i class="ico-check"></i>
  34. </th>
  35. <th>{$Think.lang.db_restore_file_name}</th>
  36. <th>{$Think.lang.db_restore_volume_num}</th>
  37. <th>{$Think.lang.db_restore_compress}</th>
  38. <th>{$Think.lang.db_restore_data_size}</th>
  39. <th>{$Think.lang.db_restore_backup_time}</th>
  40. <th>{$Think.lang.db_restore_state}</th>
  41. <th class="handle">{$Think.lang.db_handle}</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. {foreach name="restore_list" item="vo" key="k" }
  46. <tr>
  47. <td class="sign">
  48. <i class="ico-check"></i>
  49. </td>
  50. <td>{$vo.basename}</td>
  51. <td>{$vo.part}</td>
  52. <td>{$vo.compress}</td>
  53. <td>{$vo.size|format_bytes}</td>
  54. <td>{$vo.time|date="Y-m-d H:i:s"}</td>
  55. <td class='state'>-</td>
  56. <td class="handle">
  57. <a value="{:url('Database/import',['time'=>$vo.time])}" href="javascript:void(0)" class="db-import"><i class="iconfont">&#xe6d1;</i>{$Think.lang.db_restore_restore}</a> |
  58. <a href="{:url('Database/downFile',['time'=>$vo.time])}"><i class="iconfont">&#xe6d1;</i>{$Think.lang.ds_download}</a> |
  59. <a href="{:url('Database/del',['time'=>$vo.time])}"><i class="iconfont">&#xe725;</i>{$Think.lang.ds_del}</a>
  60. </td>
  61. </tr>
  62. {/foreach}
  63. </tbody>
  64. </table>
  65. <script>
  66. $(document).ready(function() {
  67. // 点击刷新数据
  68. $('.iconfont-refresh').click(function() {
  69. location.href = location.href;
  70. });
  71. });
  72. $(".db-import").click(function() {
  73. var self = this, status = ".";
  74. $.get($(self).attr('value'), success, "json");
  75. // window.onbeforeunload = function() {
  76. // return "正在还原数据库,请不要关闭!"
  77. // }
  78. function success(data) {
  79. if (data.code) {
  80. if (data.gz) {
  81. data.info += status;
  82. if (status.length === 5) {
  83. status = ".";
  84. } else {
  85. status += ".";
  86. }
  87. }
  88. if (data.data) {
  89. $(self).parents('tr').find('td.state').text(data.msg);
  90. $.get($(self).attr('value'), {"part": data.data.part, "start": data.data.start}, success, "json");
  91. } else {
  92. $(self).parents('tr').find('td.state').text(data.msg);
  93. // window.onbeforeunload = function() {
  94. // return null;
  95. // }
  96. }
  97. } else {
  98. layer.alert(data.msg, {icon: 2});
  99. }
  100. }
  101. });
  102. </script>