19573659990f9690288ac53966aa2341.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?php /*a:2:{s:67:"D:\phpstudy_pro\WWW\caiping\app\admin\view\database\backuplist.html";i:1723541257;s:59:"D:\phpstudy_pro\WWW\caiping\app\admin\view\common\base.html";i:1723541257;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="360-site-verification" content="a7c876fae8b6e3175a52ea9f19543f51" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
  10. <script src="/static/dist/xm-select.js"></script>
  11. <link rel="mobile-prefetch" href=""/>
  12. <title><?php echo get_system_config('web','admin_title'); ?></title>
  13. <meta name="keywords" content="<?php echo get_system_config('web','keywords'); ?>"/>
  14. <meta name="description" content="<?php echo get_system_config('web','desc'); ?>"/>
  15. <link rel="stylesheet" href="/static/assets/gougu/css/gougu.css?v=<?php echo get_system_config('web','version'); ?>" media="all">
  16. <style>
  17. .footer{
  18. width: 100%;
  19. height: 25px;
  20. text-align: center;
  21. position: fixed;
  22. bottom: 0;
  23. }
  24. </style>
  25. </head>
  26. <body class="main-body">
  27. <!-- 主体 -->
  28. <div class="p-3">
  29. <div class="gg-form-bar border-t border-x" style="background-color:#FAFAFA">
  30. <h3>数据还原</h3>
  31. </div>
  32. <table cellspacing="0" cellpadding="0" border="0" class="layui-table layui-table-form">
  33. <tr>
  34. <th style=" text-align: center; font-weight: 800;"><span>文件名称</span></th>
  35. <th style=" text-align: center; font-weight: 800;"><span>文件格式</span></th>
  36. <th style=" text-align: center; font-weight: 800;"><span>分隔符</span></th>
  37. <th style=" text-align: center; font-weight: 800;"><span>文件总大小</span></th>
  38. <th style=" text-align: center; font-weight: 800;"><span>分卷总数</span></th>
  39. <th style=" text-align: center; font-weight: 800; width:222px"><span>操作</span></th>
  40. </tr>
  41. <?php if(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty())): ?>
  42. <tr>
  43. <td colspan="6" align="center">暂无备份数据</td>
  44. </tr>
  45. <?php endif; if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $k = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?>
  46. <tr style="background-color: #fafafa;">
  47. <td><strong>备份时间:<?php echo htmlentities($vo['time']); ?></strong><?php if($vo['timespan'] == $lock_time): ?><span
  48. style="color:red; margin-left:20px;">该备份不是完整备份,请删除重新备份</span><?php endif; ?></td>
  49. <td align="center"><span>.sql</span></td>
  50. <td align="center"><span><?php echo htmlentities($vo['data']['compress']); ?></span></td>
  51. <td align="center"><span><?php echo format_bytes($vo['data']['size']); ?></span></td>
  52. <td align="center"><span><?php echo htmlentities($vo['data']['part']); ?></span></td>
  53. <td align="center">
  54. <div class="layui-btn-group" data-time='<?php echo htmlentities($vo['timespan']); ?>'>
  55. <?php if($vo['timespan'] == $lock_time): ?>
  56. <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="reset">清除不完整的备份</a>
  57. <?php else: ?>
  58. <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="import">数据还原</a>
  59. <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">备份删除</a>
  60. <?php endif; ?>
  61. </div>
  62. </td>
  63. </tr>
  64. <?php $__FOR_START_1438983047__=0;$__FOR_END_1438983047__=$vo['data']['part'];for($i=$__FOR_START_1438983047__;$i < $__FOR_END_1438983047__;$i+=1){ ?>
  65. <tr>
  66. <td colspan="5">
  67. <?php echo date("Ymd",$vo['timespan']); ?><?php echo htmlentities($vo['data']['compress']); ?><?php echo date("His",$vo['timespan']); ?><?php echo htmlentities($vo['data']['compress']); ?><?php echo htmlentities($i+1); ?>.sql
  68. </td>
  69. <td align="center">
  70. <a class="layui-btn layui-btn-xs"
  71. href='/admin/database/downfile?time=<?php echo htmlentities($vo['data']['time']); ?>&part=<?php echo htmlentities($i+1); ?>'>下载备份(分卷<?php echo htmlentities($i+1); ?>)</a>
  72. </td>
  73. </tr>
  74. <?php } ?>
  75. <?php endforeach; endif; else: echo "" ;endif; ?>
  76. </table>
  77. </div>
  78. <!-- /主体 -->
  79. <!-- 底部 -->
  80. <div class="footer">
  81. 逸管工程项目管理系统 © www.yiguanfep.com
  82. <img src="/static/home/images/police.png" alt="" style="width:14.5px;height:16px;">
  83. <a href="https://beian.mps.gov.cn/#/query/websearch?code=45030202000160 " rel="\&quot;noreferrer'target=\”blank\&quot;" onclick="window.open(this.href); return false;">桂公网安备45030202000160号</a>
  84. <a href="https://beian.miit.gov.cn/#/Integrated/index" onclick="window.open(this.href); return false;">桂ICP备17000971号</a>
  85. </div>
  86. <!-- /底部 -->
  87. <!-- 脚本 -->
  88. <script>
  89. function gouguInit() {
  90. function importData(data) {
  91. if (data.code == 0) {
  92. console.log(data.msg);
  93. layer.closeAll();
  94. layer.msg(data.msg, { time: 200000 });
  95. if ($.isPlainObject(data.data)) {
  96. $.ajax({
  97. url: "/admin/database/import",
  98. type: 'get',
  99. data: { "part": data.data.part, "start": data.data.start, time: data.data.time },
  100. success: function (res) {
  101. importData(res);
  102. }
  103. })
  104. } else {
  105. layer.msg(data.msg);
  106. window.onbeforeunload = function () { return null; }
  107. }
  108. } else {
  109. layer.msg(data.msg);
  110. }
  111. }
  112. //监听行工具事件
  113. $('[lay-event="import"]').on('click', function () {
  114. var time = $(this).parent().data('time');
  115. layer.confirm('确认要还原该备份吗?', {
  116. icon: 3,
  117. title: '提示'
  118. }, function (index) {
  119. layer.msg("数据还原中...", { time: 200000 });
  120. $.ajax({
  121. url: "/admin/database/import?time=" + time,
  122. type: 'post',
  123. success: function (res) {
  124. importData(res);
  125. }
  126. })
  127. window.onbeforeunload = function () { return "正在还原数据库,请不要关闭!" }
  128. layer.close(index);
  129. });
  130. return false;
  131. })
  132. $('[lay-event="del"]').on('click', function () {
  133. var time = $(this).parent().data('time');
  134. layer.confirm('确认要删除该备份吗?', {
  135. icon: 3,
  136. title: '提示'
  137. }, function (index) {
  138. $.ajax({
  139. url: "/admin/database/del",
  140. data: { 'time': time },
  141. success: function (res) {
  142. layer.msg(res.msg);
  143. if (res.code == 0) {
  144. setTimeout(function () {
  145. location.reload();
  146. }, 2000)
  147. }
  148. }
  149. })
  150. layer.close(index);
  151. });
  152. return false;
  153. })
  154. $('[lay-event="reset"]').on('click', function () {
  155. var time = $(this).parent().data('time');
  156. layer.confirm('确认要清除该备份吗?', {
  157. icon: 3,
  158. title: '提示'
  159. }, function (index) {
  160. $.ajax({
  161. url: "/admin/database/del",
  162. data: { 'time': time, 'lock': 1 },
  163. success: function (res) {
  164. layer.msg(res.msg);
  165. if (res.code == 0) {
  166. setTimeout(function () {
  167. location.reload();
  168. }, 2000)
  169. }
  170. }
  171. })
  172. layer.close(index);
  173. });
  174. return false;
  175. })
  176. }
  177. </script>
  178. <!-- /脚本 -->
  179. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  180. <script src="/static/assets/layui/layui.js"></script>
  181. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  182. <script src="/static/assets/gougu/gouguInit.js"></script>
  183. <script src="https://unpkg.com/pinyin-pro"></script>
  184. <script>
  185. var { pinyin } = pinyinPro;
  186. </script>
  187. <!-- 统计代码 -->
  188. <!-- /统计代码 -->
  189. </body>
  190. </html>