upgrade.html 8.3 KB

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