set_liquid.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>LandGreen</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. <!-- 新 Bootstrap4 核心 CSS 文件 -->
  8. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
  9. <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  10. <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  11. <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
  12. <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
  13. <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
  14. <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
  15. <script src="../static/js/set_liquid.js"></script>
  16. <link rel="stylesheet" href="../static/css/set_liquid.css">
  17. <script>
  18. $(function(){
  19. {% if params.tank1_duration1 %}
  20. if({{params.tank1_from_hr1}} != '00' && {{params.tank1_to_hr1}} != '00'){
  21. var tank1 = $(".set-schedule")[0];
  22. var tank1_div = $("#tank1_div");
  23. tank1.style.display = 'none';
  24. tank1_div.css('visibility','visible');
  25. $('select[name=tank1_duration1]').val('{{params.tank1_duration1}}');
  26. $('select[name=tank1_from_hr1]').val('{{params.tank1_from_hr1}}');
  27. $('select[name=tank1_from_min1]').val('{{params.tank1_from_min1}}');
  28. $('select[name=tank1_to_hr1]').val('{{params.tank1_to_hr1}}');
  29. $('select[name=tank1_to_min1]').val('{{params.tank1_to_min1}}');
  30. };
  31. {% endif %}
  32. {% if params.tank1_duration2 %}
  33. var add = document.getElementById('tank1_add1');
  34. Add(add);
  35. $('select[name=tank1_duration' + i + ']').val('{{params.tank1_duration2}}');
  36. $('select[name=' + 'tank1_from_hr' + i + ']').val('{{params.tank1_from_hr2}}');
  37. $('select[name=' + 'tank1_from_min' + i + ']').val('{{params.tank1_from_min2}}');
  38. $('select[name=' + 'tank1_to_hr' + i + ']').val('{{params.tank1_to_hr2}}');
  39. $('select[name=' + 'tank1_to_min' + i + ']').val('{{params.tank1_to_min2}}');
  40. {% endif %}
  41. {% if params.tank1_duration3 %}
  42. var add = document.getElementById('tank1_add' + i);
  43. Add(add);
  44. $('select[name=tank1_duration' + i + ']').val('{{params.tank1_duration3}}');
  45. $('select[name=' + 'tank1_from_hr' + i + ']').val('{{params.tank1_from_hr3}}');
  46. $('select[name=' + 'tank1_from_min' + i + ']').val('{{params.tank1_from_min3}}');
  47. $('select[name=' + 'tank1_to_hr' + i + ']').val('{{params.tank1_to_hr3}}');
  48. $('select[name=' + 'tank1_to_min' + i + ']').val('{{params.tank1_to_min3}}');
  49. {% endif %}
  50. {% if params.tank2_duration1 %}
  51. if({{params.tank2_from_hr1}} != '00' && {{params.tank2_to_hr1}} != '00'){
  52. var tank2 = $(".set-schedule")[1];
  53. var tank2_div = $("#tank2_div");
  54. tank2.style.display = 'none';
  55. tank2_div.css('visibility','visible');
  56. $('select[name=tank2_duration1]').val('{{params.tank2_duration1}}');
  57. $('select[name=tank2_from_hr1]').val('{{params.tank2_from_hr1}}');
  58. $('select[name=tank2_from_min1]').val('{{params.tank2_from_min1}}');
  59. $('select[name=tank2_to_hr1]').val('{{params.tank2_to_hr1}}');
  60. $('select[name=tank2_to_min1]').val('{{params.tank2_to_min1}}');
  61. };
  62. {% endif %}
  63. {% if params.tank2_duration2 %}
  64. var add = document.getElementById('tank2_add1');
  65. Add(add);
  66. $('select[name=tank2_duration' + i + ']').val('{{params.tank2_duration2}}');
  67. $('select[name=' + 'tank2_from_hr' + i + ']').val('{{params.tank2_from_hr2}}');
  68. $('select[name=' + 'tank2_from_min' + i + ']').val('{{params.tank2_from_min2}}');
  69. $('select[name=' + 'tank2_to_hr' + i + ']').val('{{params.tank2_to_hr2}}');
  70. $('select[name=' + 'tank2_to_min' + i + ']').val('{{params.tank2_to_min2}}');
  71. {% endif %}
  72. {% if params.tank2_duration3 %}
  73. var add = document.getElementById('tank2_add' + i);
  74. Add(add);
  75. $('select[name=tank2_duration' + i + ']').val('{{params.tank1_duration3}}');
  76. $('select[name=' + 'tank2_from_hr' + i + ']').val('{{params.tank2_from_hr3}}');
  77. $('select[name=' + 'tank2_from_min' + i + ']').val('{{params.tank2_from_min3}}');
  78. $('select[name=' + 'tank2_to_hr' + i + ']').val('{{params.tank2_to_hr3}}');
  79. $('select[name=' + 'tank2_to_min' + i + ']').val('{{params.tank2_to_min3}}');
  80. {% endif %}
  81. });
  82. </script>
  83. </head>
  84. <body>
  85. <nav class="fixed-top">
  86. <nav class="navbar navbar-expand-md nav-top justify-content-center">
  87. <div>
  88. <span class="website_title">Fitolab Formula-G1</span>
  89. </div>
  90. </nav>
  91. <nav class="navbar navbar-expand-md bg-dark navbar-dark nav-bottom">
  92. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
  93. <span class="navbar-toggler-icon"></span>
  94. </button>
  95. <div class="collapse navbar-collapse" id="collapsibleNavbar">
  96. <ul class="navbar-nav">
  97. <li class="nav-item">
  98. <a class="nav-link" href="/online_fitolab">Online Fitolab</a>
  99. </li>
  100. <li class="nav-item">
  101. <a class="nav-link" href="#">About Fitolab</a>
  102. </li>
  103. <li class="nav-item">
  104. <a class="nav-link" href="#">Contact Us</a>
  105. </li>
  106. <li class="li-block"></li>
  107. <li class="nav-item">
  108. <a class="nav-link" href="#">{{params.username}}</a>
  109. </li>
  110. <li class="nav-item">
  111. <a class="nav-link" href="/logout">Logout</a>
  112. </li>
  113. </ul>
  114. </div>
  115. </nav>
  116. </nav>
  117. <div class="main-page">
  118. <div class="page-title text-center">
  119. Settings parametrs of liquid
  120. </div>
  121. <form method="post" action="/setting_liquid">
  122. <div class="container-fluid">
  123. <div class="row">
  124. <div class="col flex">
  125. <div class="tank1 col-xl-5 col-lg-5 col-md-5 col-sm-8 col-xs-8">
  126. <h2 class="item-title">Water cycle from Tank1</h2>
  127. <input class="set-schedule" type="button" value="Set up the schedule">
  128. <br>
  129. <div id="tank1_div" class="row" style="visibility:hidden;">
  130. <div class="col-12 row">
  131. <div class="col-xl-5 col-lg-5 col-md-4 col-sm-12 col-xs-12" style="margin-top:10px;">
  132. <span>Duration</span>
  133. <select name="tank1_duration1" class="duration">
  134. <option selected value="30min">30 min</option>
  135. <option value="60min">60 min</option>
  136. <option value="90min">90 min</option>
  137. <option value="120min">120 min</option>
  138. <option value="150min">150 min</option>
  139. </select>
  140. </div>
  141. <div class="from-to col-xl-7 col-lg-7 col-md-8 col-sm-12 col-xs-12" style="margin-top:10px;">
  142. <div>
  143. <div class="from row">
  144. <div class="col-xs-3">
  145. <span>From</span>
  146. </div>
  147. <div class="col-xs-6">
  148. <select name="tank1_from_hr1">
  149. {% for hr in range(0, 24) %}
  150. {% if hr < 10 %}
  151. <option value="0{{hr}}">0{{hr}}</option>
  152. {% else %}
  153. <option value="{{hr}}">{{hr}}</option>
  154. {% endif %}
  155. {% endfor %}
  156. </select>
  157. :<select name="tank1_from_min1">
  158. {% for min in range(0, 60) %}
  159. {% if min < 10 %}
  160. <option value="0{{min}}">0{{min}}</option>
  161. {% else %}
  162. <option value="{{min}}">{{min}}</option>
  163. {% endif %}
  164. {% endfor %}
  165. </select>
  166. </div>
  167. <div class="col-xs-3">
  168. <input id="tank1_del1" class="delete" type="button" value="Delete" onclick="Delete(tank1_del1);">
  169. </div>
  170. </div>
  171. <div class="to row">
  172. <div class="col-xs-3">
  173. <span style="margin-left: 23px;">To</span>
  174. </div>
  175. <div class="col-xs-6">
  176. <select name="tank1_to_hr1">
  177. {% for hr in range(0, 24) %}
  178. {% if hr < 10 %}
  179. <option value="0{{hr}}">0{{hr}}</option>
  180. {% else %}
  181. <option value="{{hr}}">{{hr}}</option>
  182. {% endif %}
  183. {% endfor %}
  184. </select>
  185. :<select name="tank1_to_min1">
  186. {% for min in range(0, 60) %}
  187. {% if min < 10 %}
  188. <option value="0{{min}}">0{{min}}</option>
  189. {% else %}
  190. <option value="{{min}}">{{min}}</option>
  191. {% endif %}
  192. {% endfor %}
  193. </select><br>
  194. <input id="tank1_add1" class="add" type="button" value="Add" onclick="Add(tank1_add1);">
  195. </div>
  196. <div class="col-xs-3"></div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. <div style="width:35px;"></div>
  204. <div class="tank2 col-xl-5 col-lg-5 col-md-5 col-sm-8 col-xs-8">
  205. <h2 class="item-title">Water cycle from Tank2</h2>
  206. <input class="set-schedule" type="button" value="Set up the schedule">
  207. <br>
  208. <div id="tank2_div" class="row" style="visibility:hidden;">
  209. <div class="col-12 row">
  210. <div class="col-xl-5 col-lg-5 col-md-4" style="margin-top:10px;">
  211. <span>Duration</span>
  212. <select name="tank2_duration1" class="duration">
  213. <option selected value="30min">30 min</option>
  214. <option value="60min">60 min</option>
  215. <option value="90min">90 min</option>
  216. <option value="120min">120 min</option>
  217. <option value="150min">150 min</option>
  218. </select>
  219. </div>
  220. <div class="from-to col-xl-7 col-lg-7 col-md-8" style="margin-top:10px;">
  221. <div>
  222. <div class="from row">
  223. <div class="col-xs-3">
  224. <span>From</span>
  225. </div>
  226. <div class="col-xs-6">
  227. <select name="tank2_from_hr1">
  228. {% for hr in range(0, 24) %}
  229. {% if hr < 10 %}
  230. <option value="0{{hr}}">0{{hr}}</option>
  231. {% else %}
  232. <option value="{{hr}}">{{hr}}</option>
  233. {% endif %}
  234. {% endfor %}
  235. </select>
  236. :<select name="tank2_from_min1">
  237. {% for min in range(0, 60) %}
  238. {% if min < 10 %}
  239. <option value="0{{min}}">0{{min}}</option>
  240. {% else %}
  241. <option value="{{min}}">{{min}}</option>
  242. {% endif %}
  243. {% endfor %}
  244. </select>
  245. </div>
  246. <div class="col-xs-3">
  247. <input id="tank2_del1" class="delete" type="button" value="Delete" onclick="Delete(tank2_del1);">
  248. </div>
  249. </div>
  250. <div class="to row">
  251. <div class="col-xs-3">
  252. <span style="margin-left: 23px;">To</span>
  253. </div>
  254. <div class="col-xs-6">
  255. <select name="tank2_to_hr1">
  256. {% for hr in range(0, 24) %}
  257. {% if hr < 10 %}
  258. <option value="0{{hr}}">0{{hr}}</option>
  259. {% else %}
  260. <option value="{{hr}}">{{hr}}</option>
  261. {% endif %}
  262. {% endfor %}
  263. </select>
  264. :<select name="tank2_to_min1">
  265. {% for min in range(0, 60) %}
  266. {% if min < 10 %}
  267. <option value="0{{min}}">0{{min}}</option>
  268. {% else %}
  269. <option value="{{min}}">{{min}}</option>
  270. {% endif %}
  271. {% endfor %}
  272. </select><br>
  273. <input id="tank2_add1" class="add" type="button" value="Add" onclick="Add(tank2_add1);">
  274. </div>
  275. <div class="col-xs-3"></div>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. </div>
  283. </div>
  284. <div class="row page-bottom">
  285. <div class="col"></div>
  286. <div class="col-xl-4 col-lg-6 col-md-8 col-sm-10 col-xs-10" style="text-align:center;">
  287. <div class="form-group">
  288. <input type="button" class="form-control" value="Cancel">
  289. <input type="submit" class="form-control" value="Confirm">
  290. </div>
  291. </div>
  292. <div class="col"></div>
  293. </div>
  294. </div>
  295. </form>
  296. </div>
  297. </body>
  298. </html>