install.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. {extend name="layout" /}
  2. {block name="content"}
  3. <div class="row">
  4. <div class="col-md-12">
  5. <div class="block">
  6. <div class="block-header bg-gray-lighter">
  7. <ul class="block-options">
  8. <li>
  9. <button type="button" data-toggle="block-option" data-action="fullscreen_toggle"></button>
  10. </li>
  11. <li>
  12. <button type="button" data-toggle="block-option" data-action="refresh_toggle" data-action-mode="demo"><i class="si si-refresh"></i></button>
  13. </li>
  14. <li>
  15. <button type="button" data-toggle="block-option" data-action="content_toggle"></button>
  16. </li>
  17. <li>
  18. <button type="button" data-toggle="block-option" data-action="close"><i class="si si-close"></i></button>
  19. </li>
  20. </ul>
  21. <h3 class="block-title">{$page_title|default=""}</h3>
  22. </div>
  23. <div class="block-content tab-content">
  24. <div class="tab-pane active">
  25. <div class="block-content">
  26. <form class="form-horizontal form-builder" action="{:url('install')}" method="get">
  27. <input type="hidden" name="name" value="{$name|default=''}">
  28. <input type="hidden" name="confirm" value="1">
  29. <div class="form-group">
  30. <h4 class="col-xs-12 push-10">模块依赖检查</h4>
  31. <div class="col-sm-5">
  32. {empty name="need_module"}
  33. <div class="form-control-static">无需依赖其他模块</div>
  34. {else/}
  35. <table class="table table-bordered table-striped">
  36. <thead>
  37. <tr>
  38. <th>模块</th>
  39. <th>唯一标识</th>
  40. <th style="width: 100px;">当前版本</th>
  41. <th style="width: 100px;">所需版本</th>
  42. <th class="text-center" style="width: 100px;">检查结果</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. {volist name="need_module" id="vo"}
  47. <tr>
  48. <td>{$vo.module}</td>
  49. <td><a href="http://www.dolphinphp.com" target="_blank" data-toggle="tooltip" title="到商城查看该模块">{$vo.identifier}</a></td>
  50. <td>{$vo.version}</td>
  51. <td>{$vo.version_need}</td>
  52. <td class="text-center">
  53. {$vo.result|raw}
  54. </td>
  55. </tr>
  56. {/volist}
  57. </tbody>
  58. </table>
  59. {/empty}
  60. </div>
  61. </div>
  62. <div class="form-group">
  63. <h4 class="col-xs-12 push-10">插件依赖检查</h4>
  64. <div class="col-sm-5">
  65. {empty name="need_plugin"}
  66. <div class="form-control-static">无需依赖其他插件</div>
  67. {else/}
  68. <table class="table table-bordered table-striped">
  69. <thead>
  70. <tr>
  71. <th>插件</th>
  72. <th>唯一标识</th>
  73. <th style="width: 100px;">当前版本</th>
  74. <th style="width: 100px;">所需版本</th>
  75. <th class="text-center" style="width: 100px;">检查结果</th>
  76. </tr>
  77. </thead>
  78. <tbody>
  79. {volist name="need_plugin" id="vo"}
  80. <tr>
  81. <td>{$vo.plugin}</td>
  82. <td><a href="http://www.dolphinphp.com" target="_blank" data-toggle="tooltip" title="到商城查看该插件">{$vo.identifier}</a></td>
  83. <td>{$vo.version}</td>
  84. <td>{$vo.version_need}</td>
  85. <td class="text-center">
  86. {$vo.result|raw}
  87. </td>
  88. </tr>
  89. {/volist}
  90. </tbody>
  91. </table>
  92. {/empty}
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <h4 class="col-xs-12 push-10">数据表检查</h4>
  97. <div class="col-sm-5">
  98. {empty name="table_check"}
  99. <div class="form-control-static">该模块不需要数据表</div>
  100. {else/}
  101. <table class="table table-bordered table-striped">
  102. <thead>
  103. <tr>
  104. <th>数据表</th>
  105. <th class="text-center" style="width: 100px;">检查结果</th>
  106. </tr>
  107. </thead>
  108. <tbody>
  109. {volist name="table_check" id="vo"}
  110. <tr>
  111. <td>{$vo.table}</td>
  112. <td class="text-center">
  113. {$vo.result|raw}
  114. </td>
  115. </tr>
  116. {/volist}
  117. </tbody>
  118. </table>
  119. {/empty}
  120. </div>
  121. </div>
  122. <div class="form-group " id="form_group_group">
  123. <h4 class="col-xs-12 push-10">是否清除旧数据</h4>
  124. <div class="col-xs-9">
  125. <label class="css-input css-radio css-radio-primary css-radio-sm push-10-r">
  126. <input type="radio" name="clear" id="clear1" value="0" checked="">
  127. <span></span> 否
  128. </label>
  129. <label class="css-input css-radio css-radio-primary css-radio-sm push-10-r">
  130. <input type="radio" name="clear" id="clear2" value="1">
  131. <span></span> 是
  132. </label>
  133. <div class="help-block">
  134. 选择“是”,将删除数据库中已存在的相同数据表
  135. </div>
  136. </div>
  137. </div>
  138. <div class="form-group">
  139. <div class="col-xs-12">
  140. <button class="btn btn-minw btn-primary" type="button" id="install">
  141. 安装
  142. </button>
  143. <button class="btn btn-default" type="button" onclick="javascript:history.back(-1);return false;">
  144. 返回
  145. </button>
  146. </div>
  147. </div>
  148. </form>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. {/block}
  156. {block name="script"}
  157. <script>
  158. $(document).ready(function(){
  159. $('#install').click(function () {
  160. var table_exists = false;
  161. if ($('.form-builder i.text-danger').length) {
  162. Dolphin.notify('缺少依赖模块或插件', 'danger');
  163. return false;
  164. }
  165. if ($('.form-builder span.text-danger').length) {
  166. table_exists = true;
  167. }
  168. if (table_exists && $('.form-builder input[name=clear]:checked').val() == 0) {
  169. Dolphin.notify('数据库表存在冲突,如果需要覆盖原有数据,请选择“清除旧数据”', 'danger');
  170. return false;
  171. }
  172. $('.form-builder').submit();
  173. });
  174. });
  175. </script>
  176. {/block}