人人商城

upgrade.html 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. {template 'common/header'}
  2. <div class="upgrade-content">
  3. <div class="upgrade-heading we7-padding-vertical text-center">
  4. <img src="./resource/images/logo/logo-lg.png" alt="" class="we7-logo"/>
  5. <h2 class="upgrade-version">系统当前版本: {IMS_FAMILY}{IMS_VERSION}({IMS_RELEASE_DATE})</h2>
  6. </div>
  7. {if !empty($upgrade) && !empty($upgrade['upgrade'])}
  8. <form action="" class="form we7-form">
  9. <div class="upgrade-info we7-padding-bottom">
  10. <div class="panel we7-panel">
  11. <div class="panel-heading we7-padding">
  12. <span class="col-sm-2 we7-padding-none color-gray">最新版本</span>
  13. <span class="col-sm-7 we7-padding-none">微擎 {$upgrade['family']}{$upgrade['version']}【{$upgrade['release']}】版</span>
  14. </div>
  15. <div class="panel-body we7-padding">
  16. <div class="form-group">
  17. <label for="" class="control-label color-gray col-sm-2">需要更新文件</label>
  18. <div class="form-controls col-sm-7 form-control-static">{php echo count($upgrade['files'])} 个</div>
  19. <span class="color-default col-sm-3 text-right"><a href="#upgrade-file" data-toggle="modal" >查看</a></span>
  20. </div>
  21. <div class="form-group">
  22. <label for="" class="control-label color-gray col-sm-2">需要更新数据库</label>
  23. <div class="form-controls col-sm-7 form-control-static">{php echo count($upgrade['database'])} 项</div>
  24. <span class="color-default col-sm-3 text-right"><a href="#upgrade-databases" data-toggle="modal" >查看</a></span>
  25. </div>
  26. <div class="form-group">
  27. <label for="" class="control-label color-gray col-sm-2">需要更新脚本</label>
  28. <div class="form-controls col-sm-7 form-control-static">{php echo count($upgrade['scripts'])} 项</div>
  29. <span class="color-default col-sm-3 text-right"><a href="#upgrade-scripts" data-toggle="modal" >查看</a></span>
  30. </div>
  31. <div class="form-group we7-padding-none">
  32. <label for="" class="control-label color-gray col-sm-2">更新协议事项</label>
  33. <div class="form-controls col-sm-10 form-control-static">
  34. <div class="">
  35. <input id='agreement_0' type="checkbox" name='agreement_0' autocomplete="off" />
  36. <label for="agreement_0">更新时请注意备份网站数据和相关数据库文件!不强制要求用户跟随官方意愿进行更新尝试!</label>
  37. </div>
  38. <div class="">
  39. <input id='agreement_1' type="checkbox" name='agreement_1' autocomplete="off"/>
  40. <label for="agreement_1">已经做好了相关文件的备份工作,认同官方的更新行为并自愿承担更新所存在的风险</label>
  41. </div>
  42. <div class="">
  43. <input id='agreement_2' type="checkbox" name='agreement_2' autocomplete="off"/>
  44. <label for="agreement_2">认同“购买系统商业授权后进行商业化运营”的协议</label>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <div class="alert alert-danger">
  51. <i class="fa fa-exclamation-triangle"></i> 更新时请注意备份网站数据和相关数据库文件!官方不强制要求用户跟随官方意愿进行更新尝试!
  52. </div>
  53. <div class="text-center">
  54. <input type="button" name="" id="forward" value="一键更新" class="btn btn-danger" />
  55. <input name="rollback" type="button" value="撤回更新" class="btn btn-default" data-toggle="modal" data-target="#rollback-panel" />
  56. </div>
  57. </div>
  58. </form>
  59. {else}
  60. <form action="" method="post">
  61. <div class="upgrade-info we7-padding-bottom">
  62. <div class="alert we7-page-alert">
  63. <p><i class="wi wi-info-sign"></i>系统更新后,如果出现样式错误等,请自行更新缓存并“CTRL+F5”强行刷新</p>
  64. </div>
  65. <div class="text-center">
  66. <input name="submit" type="submit" value="立即检查新版本" class="btn btn-danger" />
  67. <input name="rollback" type="button" value="撤回更新" class="btn btn-default" data-toggle="modal" data-target="#rollback-panel" />
  68. <input type="hidden" name="token" value="{$_W['token']}" />
  69. </div>
  70. </div>
  71. </form>
  72. {/if}</div>
  73. <div class="modal fade" id="upgrade-file" tabindex="-1" role="dialog" aria-hidden="true">
  74. <div class="modal-dialog we7-modal-dialog">
  75. <div class="modal-content">
  76. <div class="modal-header">
  77. <button type="button" class="close" data-dismiss="modal">
  78. <span aria-hidden="true">&times;</span>
  79. <span class="sr-only">Close</span>
  80. </button>
  81. <h4 class="modal-title">更新文件</h4>
  82. </div>
  83. <div class="modal-body color-dark">
  84. {loop $upgrade['files'] $line}
  85. <div><span style="display:inline-block; width:30px;">{if is_file(IA_ROOT . $line)}M{else}A{/if}</span>{$line}</div>
  86. {/loop}
  87. </div>
  88. <div class="modal-footer">
  89. <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="modal fade" id="upgrade-databases" tabindex="-1" role="dialog" aria-hidden="true">
  95. <div class="modal-dialog we7-modal-dialog">
  96. <div class="modal-content">
  97. <div class="modal-header">
  98. <button type="button" class="close" data-dismiss="modal">
  99. <span aria-hidden="true">&times;</span>
  100. <span class="sr-only">Close</span>
  101. </button>
  102. <h4 class="modal-title">更新数据库</h4>
  103. </div>
  104. <div class="modal-body color-dark">
  105. {loop $upgrade['database'] $line}
  106. <div class="row">
  107. <div class="col-sm-2">表名:</div>
  108. <div class="col-sm-4">{$line['tablename']}</div>
  109. {if !empty($line['new'])}
  110. <div class="col-sm-6">New</div>
  111. {else}
  112. <div class="col-sm-6">{if !empty($line['fields'])}fields: {$line['fields']}; {/if}{if !empty($line['indexes'])}indexes: {$line['indexes']}{/if}</div>
  113. {/if}
  114. </div>
  115. {/loop}
  116. </div>
  117. <div class="modal-footer">
  118. <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="modal fade" id="upgrade-scripts" tabindex="-1" role="dialog" aria-hidden="true">
  124. <div class="modal-dialog we7-modal-dialog">
  125. <div class="modal-content">
  126. <div class="modal-header">
  127. <button type="button" class="close" data-dismiss="modal">
  128. <span aria-hidden="true">&times;</span>
  129. <span class="sr-only">Close</span>
  130. </button>
  131. <h4 class="modal-title">更新脚本</h4>
  132. </div>
  133. <div class="modal-body color-dark">
  134. {loop $upgrade['scripts'] $line}
  135. <div><span style="display:inline-block; width:100px;">{$line['release']}</span>{$line['message']}</div>
  136. {/loop}
  137. </div>
  138. <div class="modal-footer">
  139. <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="modal fade" id="rollback-panel" tabindex="-1" role="dialog" aria-labelledby="rollback-label">
  145. <div class="modal-dialog">
  146. <div class="modal-content">
  147. <div class="modal-header">
  148. <h4 class="modal-title">更新回滚列表</h4>
  149. </div>
  150. <div class="modal-body">
  151. <div class="alert alert-danger">
  152. 如果要恢复更早的记录请直接查看 <b>/data/patch/</b> 目录
  153. </div>
  154. <div class="alert alert-success">
  155. 恢复时,请手动将此目录中的文件上传至网站即可(选中全部文件和目录直接上传)
  156. </div>
  157. {if !empty($patchs)}
  158. <table class="table">
  159. <tr>
  160. <th style="width: 200px">日期</th>
  161. <th >路径</th>
  162. </tr>
  163. {loop $patchs $path}
  164. <tr>
  165. <td>{php echo date('Y-m-d')} {php echo substr($path, 0, 2)}:{php echo substr($path, 2, 2)}</td>
  166. <td>{$path}</td>
  167. </tr>
  168. {/loop}
  169. </table>
  170. {else}
  171. 今天暂无更新
  172. {/if}
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. {if !empty($upgrade) && !empty($upgrade['upgrade'])}
  178. <script type="text/javascript">
  179. $('#forward').click(function(){
  180. var a = $("#agreement_0").is(':checked');
  181. var b = $("#agreement_1").is(':checked');
  182. var c = $("#agreement_2").is(':checked');
  183. if(a && b && c) {
  184. if(confirm('更新将直接覆盖本地文件, 请注意备份文件和数据. \n\n**另注意** 更新过程中不要关闭此浏览器窗口.')) {
  185. location.href = '{url "cloud/process"}';
  186. }
  187. } else {
  188. util.message("抱歉,更新前请仔细阅读更新协议!", '', 'error');
  189. return false;
  190. }
  191. });
  192. </script>
  193. {/if}
  194. {template 'common/footer'}