install.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title>{:__('Installing FastAdmin')}</title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
  8. <meta name="renderer" content="webkit">
  9. <style>
  10. body {
  11. background: #f1f6fd;
  12. margin: 0;
  13. padding: 0;
  14. line-height: 1.5;
  15. -webkit-font-smoothing: antialiased;
  16. -moz-osx-font-smoothing: grayscale;
  17. }
  18. body, input, button {
  19. font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, 'Microsoft Yahei', Arial, sans-serif;
  20. font-size: 14px;
  21. color: #7E96B3;
  22. }
  23. .container {
  24. max-width: 480px;
  25. margin: 0 auto;
  26. padding: 20px;
  27. text-align: center;
  28. }
  29. a {
  30. color: #4e73df;
  31. text-decoration: none;
  32. }
  33. a:hover {
  34. text-decoration: underline;
  35. }
  36. h1 {
  37. margin-top: 0;
  38. margin-bottom: 10px;
  39. }
  40. h2 {
  41. font-size: 28px;
  42. font-weight: normal;
  43. color: #3C5675;
  44. margin-bottom: 0;
  45. margin-top: 0;
  46. }
  47. form {
  48. margin-top: 40px;
  49. }
  50. .form-group {
  51. margin-bottom: 20px;
  52. }
  53. .form-group .form-field:first-child input {
  54. border-top-left-radius: 4px;
  55. border-top-right-radius: 4px;
  56. }
  57. .form-group .form-field:last-child input {
  58. border-bottom-left-radius: 4px;
  59. border-bottom-right-radius: 4px;
  60. }
  61. .form-field input {
  62. background: #fff;
  63. margin: 0 0 2px;
  64. border: 2px solid transparent;
  65. transition: background 0.2s, border-color 0.2s, color 0.2s;
  66. width: 100%;
  67. padding: 15px 15px 15px 180px;
  68. box-sizing: border-box;
  69. }
  70. .form-field input:focus {
  71. border-color: #4e73df;
  72. background: #fff;
  73. color: #444;
  74. outline: none;
  75. }
  76. .form-field label {
  77. float: left;
  78. width: 160px;
  79. text-align: right;
  80. margin-right: -160px;
  81. position: relative;
  82. margin-top: 15px;
  83. font-size: 14px;
  84. pointer-events: none;
  85. opacity: 0.7;
  86. }
  87. button, .btn {
  88. background: #3C5675;
  89. color: #fff;
  90. border: 0;
  91. font-weight: bold;
  92. border-radius: 4px;
  93. cursor: pointer;
  94. padding: 15px 30px;
  95. -webkit-appearance: none;
  96. }
  97. button[disabled] {
  98. opacity: 0.5;
  99. }
  100. .form-buttons {
  101. height: 52px;
  102. line-height: 52px;
  103. }
  104. .form-buttons .btn {
  105. margin-right: 5px;
  106. }
  107. #error, .error, #success, .success, #warmtips, .warmtips {
  108. background: #D83E3E;
  109. color: #fff;
  110. padding: 15px 20px;
  111. border-radius: 4px;
  112. margin-bottom: 20px;
  113. }
  114. #success {
  115. background: #3C5675;
  116. }
  117. #error a, .error a {
  118. color: white;
  119. text-decoration: underline;
  120. }
  121. #warmtips {
  122. background: #ffcdcd;
  123. font-size: 14px;
  124. color: #e74c3c;
  125. }
  126. #warmtips a {
  127. background: #ffffff7a;
  128. display: block;
  129. height: 30px;
  130. line-height: 30px;
  131. margin-top: 10px;
  132. color: #e21a1a;
  133. border-radius: 3px;
  134. }
  135. </style>
  136. </head>
  137. <body>
  138. <div class="container">
  139. <h1>
  140. <svg width="80px" height="96px" viewBox="0 0 768 830" version="1.1" xmlns="http://www.w3.org/2000/svg"
  141. xmlns:xlink="http://www.w3.org/1999/xlink">
  142. <g id="logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
  143. <path d="M64.433651,605.899968 C20.067302,536.265612 0,469.698785 0,389.731348 C0,174.488668 171.922656,0 384,0 C596.077344,0 768,174.488668 768,389.731348 C768,469.698785 747.932698,536.265612 703.566349,605.899968 C614.4,753.480595 441.6,870.4 384,870.4 C326.4,870.4 153.6,753.480595 64.433651,605.899968 L64.433651,605.899968 Z"
  144. id="body" fill="#4e73df"></path>
  145. <path d="M429.648991,190.816 L430.160991,190.816 L429.648991,190.816 L429.648991,190.816 Z M429.648991,156 L427.088991,156 C419.408991,157.024 411.728991,160.608 404.560991,168.8 L403.024991,170.848 L206.928991,429.92 C198.736991,441.184 197.712991,453.984 204.368991,466.784 C210.512991,478.048 222.288991,485.728 235.600991,485.728 L336.464991,486.24 L304.208991,673.632 C301.648991,689.504 310.352991,705.376 325.200991,712.032 C329.808991,714.08 334.416991,714.592 339.536991,714.592 C349.776991,714.592 358.992991,709.472 366.160991,700.256 L561.744991,419.168 C569.936991,407.904 570.960991,395.104 564.304991,382.304 C557.648991,369.504 547.408991,363.36 533.072991,363.36 L432.208991,363.36 L463.952991,199.008 C464.464991,196.448 464.976991,193.376 464.976991,190.816 C464.976991,171.872 449.104991,156 431.184991,156 L429.648991,156 L429.648991,156 Z"
  146. id="flash" fill="#FFFFFF"></path>
  147. </g>
  148. </svg>
  149. </h1>
  150. <h2>{:__('Installing FastAdmin')}</h2>
  151. <div>
  152. <form method="post">
  153. {if $errInfo}
  154. <div class="error">
  155. {$errInfo}
  156. </div>
  157. {/if}
  158. <div id="error" style="display:none"></div>
  159. <div id="success" style="display:none"></div>
  160. <div id="warmtips" style="display:none"></div>
  161. <div class="form-group">
  162. <div class="form-field">
  163. <label>{:__('Mysql Hostname')}</label>
  164. <input type="text" name="mysqlHostname" value="127.0.0.1" required="">
  165. </div>
  166. <div class="form-field">
  167. <label>{:__('Mysql Database')}</label>
  168. <input type="text" name="mysqlDatabase" value="" required="">
  169. </div>
  170. <div class="form-field">
  171. <label>{:__('Mysql Username')}</label>
  172. <input type="text" name="mysqlUsername" value="root" required="">
  173. </div>
  174. <div class="form-field">
  175. <label>{:__('Mysql Password')}</label>
  176. <input type="password" name="mysqlPassword">
  177. </div>
  178. <div class="form-field">
  179. <label>{:__('Mysql Prefix')}</label>
  180. <input type="text" name="mysqlPrefix" value="fa_">
  181. </div>
  182. <div class="form-field">
  183. <label>{:__('Mysql Hostport')}</label>
  184. <input type="number" name="mysqlHostport" value="3306">
  185. </div>
  186. </div>
  187. <div class="form-group">
  188. <div class="form-field">
  189. <label>{:__('Admin Username')}</label>
  190. <input name="adminUsername" value="admin" required=""/>
  191. </div>
  192. <div class="form-field">
  193. <label>{:__('Admin Email')}</label>
  194. <input name="adminEmail" value="admin@admin.com" required="">
  195. </div>
  196. <div class="form-field">
  197. <label>{:__('Admin Password')}</label>
  198. <input type="password" name="adminPassword" required="">
  199. </div>
  200. <div class="form-field">
  201. <label>{:__('Repeat Password')}</label>
  202. <input type="password" name="adminPasswordConfirmation" required="">
  203. </div>
  204. </div>
  205. <div class="form-group">
  206. <div class="form-field">
  207. <label>{:__('Website')}</label>
  208. <input type="text" name="siteName" value="{:__('My Website')}" required=""/>
  209. </div>
  210. </div>
  211. <div class="form-buttons">
  212. <!--@formatter:off-->
  213. <button type="submit" {:$errInfo?'disabled':''}>{:__('Install now')}</button>
  214. <!--@formatter:on-->
  215. </div>
  216. </form>
  217. <!-- jQuery -->
  218. <script src="https://cdn.staticfile.org/jquery/2.1.4/jquery.min.js"></script>
  219. <script>
  220. $(function () {
  221. $('form :input:first').select();
  222. $('form').on('submit', function (e) {
  223. e.preventDefault();
  224. var form = this;
  225. var $error = $("#error");
  226. var $success = $("#success");
  227. var $button = $(this).find('button')
  228. .text("{:__('Installing')}")
  229. .prop('disabled', true);
  230. $.ajax({
  231. url: "",
  232. type: "POST",
  233. dataType: "json",
  234. data: $(this).serialize(),
  235. success: function (ret) {
  236. if (ret.code == 1) {
  237. var data = ret.data;
  238. $error.hide();
  239. $(".form-group", form).remove();
  240. $button.remove();
  241. $("#success").text(ret.msg).show();
  242. $buttons = $(".form-buttons", form);
  243. $("<a class='btn' href='./'>{:__('Home')}</a>").appendTo($buttons);
  244. if (typeof data.adminName !== 'undefined') {
  245. var url = location.href.replace(/install\.php/, data.adminName);
  246. $("#warmtips").html("{:__('Security tips')}" + '<a href="' + url + '">' + url + '</a>').show();
  247. $('<a class="btn" href="' + url + '" id="btn-admin" style="background:#4e73df">' + "{:__('Dashboard')}" + '</a>').appendTo($buttons);
  248. }
  249. localStorage.setItem("fastep", "installed");
  250. } else {
  251. $error.show().text(ret.msg);
  252. $button.prop('disabled', false).text("{:__('Install now')}");
  253. $("html,body").animate({
  254. scrollTop: 0
  255. }, 500);
  256. }
  257. },
  258. error: function (xhr) {
  259. $error.show().text(xhr.responseText);
  260. $button.prop('disabled', false).text("{:__('Install now')}");
  261. $("html,body").animate({
  262. scrollTop: 0
  263. }, 500);
  264. }
  265. });
  266. return false;
  267. });
  268. });
  269. </script>
  270. </div>
  271. </div>
  272. </body>
  273. </html>