Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

restore.htm 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
  3. <div id="append_parent"></div>
  4. <div id="ajaxwaitid"></div>
  5. <div class="page min-hg-c-10">
  6. {include file="tools/bar" /}
  7. <!-- 操作说明 -->
  8. <div id="explanation" class="explanation">
  9. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  10. <h4 title="提示相关设置操作时应注意的要点">提示</h4>
  11. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  12. </div>
  13. <ul>
  14. <li> 数据还原, 点击恢复选项进行数据库导入.</li>
  15. <li> 导入的SQL文件语句必须按照MYSQL的语法编写</li>
  16. </ul>
  17. </div>
  18. <div class="flexigrid">
  19. <div class="hDiv">
  20. <div class="hDivBox">
  21. <table cellspacing="0" cellpadding="0" style="width: 100%">
  22. <thead>
  23. <tr>
  24. <th class="sign w40" axis="col0">
  25. <div class="tc"><input type="checkbox" autocomplete="off" class="checkAll"></div>
  26. </th>
  27. <th abbr="article_title" axis="col3" class="">
  28. <div class="tl text-l10">文件名称</div>
  29. </th>
  30. <th abbr="article_show" axis="col5" class="w100">
  31. <div class="tc">系统版本</div>
  32. </th>
  33. <th abbr="ac_id" axis="col4" class="w40">
  34. <div class="tc">卷号</div>
  35. </th>
  36. <th abbr="article_show" axis="col5" class="w60">
  37. <div class="tc">压缩</div>
  38. </th>
  39. <th abbr="article_time" axis="col6" class="w100">
  40. <div class="tc">数据大小</div>
  41. </th>
  42. <th abbr="article_show" axis="col7" class="w160">
  43. <div class="tc">备份时间</div>
  44. </th>
  45. <th axis="col1" class="w160">
  46. <div class="tc">操作</div>
  47. </th>
  48. </tr>
  49. </thead>
  50. </table>
  51. </div>
  52. </div>
  53. <div class="bDiv" style="height: auto;">
  54. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  55. <table style="width: 100%">
  56. <tbody>
  57. {empty name="list"}
  58. <tr>
  59. <td class="no-data" align="center" axis="col0" colspan="50">
  60. <div class="no_row">
  61. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  62. </div>
  63. </td>
  64. </tr>
  65. {else/}
  66. {foreach name="list" item="vo" key="k" }
  67. <tr data-id="{$vo.basename}">
  68. <td class="sign">
  69. <div class="w40 tc"><input type="checkbox" autocomplete="off" name="ids[]" value="{$vo.time}"></div>
  70. </td>
  71. <td style="width: 100%">
  72. <div class="tl text-l10" >{$vo.basename}</div>
  73. </td>
  74. <td>
  75. <div class="w100 tc">{$vo.version}</div>
  76. </td>
  77. <td class="">
  78. <div class="w40 tc">{$vo.part}</div>
  79. </td>
  80. <td>
  81. <div class="w60 tc">{$vo.compress}</div>
  82. </td>
  83. <td>
  84. <div class="w100 tc">{$vo.size|format_bytes}</div>
  85. </td>
  86. <td>
  87. <div class="w160 tc">{$vo.time|date="Y-m-d H:i:s",###}</div>
  88. </td>
  89. <td class="operation">
  90. <div class="w160 tc">
  91. {eq name="$Think.const.CONTROLLER_NAME.'@new_import'|is_check_access" value="1"}
  92. <a href="javascript:void(0);" data-url="{:U('Tools/new_import', array('time'=>$vo['time']))}" class="btn blue db-import">恢复</a>
  93. {/eq}
  94. {eq name="$Think.const.CONTROLLER_NAME.'@downFile'|is_check_access" value="1"}
  95. <i></i>
  96. <a href="{:U('Tools/downFile',array('time'=>$vo['time']))}" class="btn green">下载</a>
  97. {/eq}
  98. {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
  99. <i></i>
  100. <a class="btn red" href="javascript:void(0);" data-url="{:U('Tools/del')}" data-id="{$vo.time}" onClick="delfun(this);">删除</a>
  101. {/eq}
  102. </div>
  103. </td>
  104. </tr>
  105. {/foreach}
  106. {/empty}
  107. </tbody>
  108. </table>
  109. </div>
  110. <div class="iDiv" style="display: none;"></div>
  111. </div>
  112. <div class="tDiv">
  113. <div class="tDiv2">
  114. <div class="fbutton checkboxall">
  115. <input type="checkbox" autocomplete="off" class="checkAll">
  116. </div>
  117. {eq name="$Think.const.CONTROLLER_NAME.'@del'|is_check_access" value="1"}
  118. <div class="fbutton">
  119. <a onclick="batch_del(this, 'ids');" data-url="{:U('Tools/del')}" class="layui-btn layui-btn-primary">
  120. <span>批量删除</span>
  121. </a>
  122. </div>
  123. {/eq}
  124. {eq name="$Think.const.CONTROLLER_NAME.'@restoreUpload'|is_check_access" value="1"}
  125. <div class="fbutton" style="display: none;">
  126. <form class="navbar-form form-inline" action="{:U('Tools/restoreUpload')}" name="change_System" id="change_System" method="post" enctype="multipart/form-data">
  127. <a href="javascript:void(0);" class="a-upload"><input type="file" name="sqlfile" id="sqlfile" title="请选择…"><i class="fa fa-upload"></i>上传执行sql文件</a>
  128. </form>
  129. </div>
  130. {/eq}
  131. <div class="fbuttonr" style="margin-right: 15px;">
  132. <div class="total">
  133. <h5>备份文件数量:{$filenum},占空间大小:{$total|format_bytes}</h5>
  134. </div>
  135. </div>
  136. </div>
  137. <div style="clear:both"></div>
  138. </div>
  139. </div>
  140. </div>
  141. <form class="none" name="form_tmp" id="form_tmp" action="" method="POST">
  142. </form>
  143. <script>
  144. $(function(){
  145. $('input[name*=ids]').click(function(){
  146. if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
  147. $('.checkAll').prop('checked','checked');
  148. } else {
  149. $('.checkAll').prop('checked', false);
  150. }
  151. });
  152. $('input[type=checkbox].checkAll').click(function(){
  153. $('input[type=checkbox]').prop('checked',this.checked);
  154. });
  155. });
  156. $(document).ready(function(){
  157. // 表格行点击选中切换
  158. $('#flexigrid > table>tbody >tr').click(function(){
  159. $(this).toggleClass('trSelected');
  160. });
  161. // 点击刷新数据
  162. $('.fa-refresh').click(function(){
  163. location.href = location.href;
  164. });
  165. $('#sqlfile').change(function(){
  166. restoreUpload();
  167. });
  168. function restoreUpload()
  169. {
  170. var sqlfile = $('input[name=sqlfile]').val();
  171. var ext = sqlfile.substr(sqlfile.lastIndexOf('.')).toLowerCase();
  172. if ($.trim(sqlfile) == '' || ext != '.sql') {
  173. showErrorMsg('请上传sql文件!');
  174. return false;
  175. }
  176. layer.confirm('确认执行?', {
  177. shade: layer_shade,
  178. area: ['480px', '190px'],
  179. move: false,
  180. title: '提示',
  181. btnAlign:'r',
  182. closeBtn: 3,
  183. btn: ['确定', '取消'] ,//按钮
  184. success: function () {
  185. $(".layui-layer-content").css('text-align', 'left');
  186. }
  187. }, function () {
  188. layer_loading('正在处理');
  189. $('#change_System').submit();
  190. return false;
  191. }, function (index) {
  192. $('#sqlfile').val('');
  193. layer.closeAll();
  194. return false;
  195. });
  196. }
  197. });
  198. $(".db-import").click(function(){
  199. var url = $(this).attr('data-url');
  200. $('#form_tmp').attr('action', url);
  201. layer.confirm('恢复数据不可逆,确定执行?', {
  202. shade: layer_shade,
  203. area: ['480px', '190px'],
  204. move: false,
  205. title: '提示',
  206. btnAlign:'r',
  207. closeBtn: 3,
  208. btn: ['确定', '取消'] ,//按钮
  209. success: function () {
  210. $(".layui-layer-content").css('text-align', 'left');
  211. }
  212. }, function () {
  213. layer_loading('正在处理');
  214. $('#form_tmp').submit();
  215. return false;
  216. }, function (index) {
  217. layer.closeAll();
  218. return false;
  219. });
  220. });
  221. </script>
  222. {include file="public/footer" /}