123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Aisky-Sixth</title>
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <!-- 新 Bootstrap4 核心 CSS 文件 -->
- <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
- <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
- <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
- <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
- <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
- <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
- <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
- <!--可用來建立使用者小圖示-->
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
- <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">-->
- <!--<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">-->
- <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>-->
- <!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>-->
- <!--<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>-->
- <style>
- body {
- margin:0;
- <!--background-color: #4d4d4d;-->
- }
- .navbar-dark .navbar-nav .nav-link {
- color: white;
- cursor: pointer;
- text-decoration:none;
- width: 110px;
- height: 46px;
- }
- .nav-top {
- line-height:40px;
- background-color: #C4C4C4;
- }
- .website_title{
- font-family: Roboto;
- font-style: normal;
- font-weight: normal;
- font-size: 30px;
- color: #000000;
- }
- .navbar-nav > li{
- float: none;
- display: inline-block;
- width: 110px;
- margin: 0 auto;
- text-align: center;
- }
- .navbar-nav > li a{
- font-size: 20px;
- }
- .main-page {
- margin-top: 200px;
- }
- .page-title {
- font-family: Roboto;
- font-style: normal;
- font-weight: bold;
- font-size: 36px;
- }
- .flex {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: center;
- }
- .node {
- height: auto;
- border: 2px solid #E5E5E5;
- border-radius: 5px;
- margin-top:35px;
- }
- .node-opt {
- font-size: 21px;
- }
- ol {
- list-style-type: disc;
- font-size: 17px;
- }
- .set-link {
- display: inline-block;
- width: 350px;
- height: 100px;
- line-height: 100px;
- background: #008CBA;
- border: 1px solid #CFCFCF;
- box-sizing: border-box;
- color: #FFFFFF;
- border-radius: 10px;
- font-size: 36px;
- }
- .fa{
- display: inline-block;
- font: normal normal normal 14px/1 FontAwesome;
- font-size: inherit;
- text-rendering: auto;
- -webkit-font-smoothing: antialiased;
- }
- .fa-user-o:before{
- content: "\f2c0";
- }
- .abc {background:lightgreen;border:1px #000 solid;cursor:move;padding:10px 5px;}
- .draggable {min-width:50px;height:45px;display:inline-block;font-size:.9em;z-index:1;text-align:center;}
- @media(max-width:373px){
- .card {
- margin-right: 0px;
- }
- }
- @media(max-width:577px){
- }
- @media(min-width:576px){
- }
- @media(min-width:768px){
- .navbar-nav > li {
- margin-left: 0px;
- }
- .navbar-nav .li-block {
- display:none;
- }
- }
- @media(min-width:991px){
- .navbar-nav > li {
- margin-left: 20px;
- }
- .navbar-nav .li-block {
- display:none;
- }
- }
- @media(min-width:1200px){
- .navbar-nav > li {
- margin-left: 50px;
- }
- .navbar-nav .li-block {
- display: inline-block;
- width: 20px;
- }
- }
- @media(min-width:1400px){
- .navbar-nav .li-block {
- display: inline-block;
- width: 100px;
- }
- }
- @media(min-width:1689px) {
- .navbar-nav > li {
- margin-left: 50px;
- }
- .navbar-nav .li-block {
- display: inline-block;
- width: 450px;
- }
- }
- </style>
- <script>
- $(function(){
- var list = {{params.sort_L|tojson}};
- var list_div = document.getElementById('order-list');
- var sensor_list = "";
- $.each({{params.sensor_list|tojson}},function(index, obj){
- sensor_list += "if(obj == '" + obj.en_name + "'){Module('" + obj.ch_name + obj.version + "',monitor,'" + obj.en_name + "',i);};";
- });
- $.each(list, function(index, obj){
- var json = JSON.parse(obj);
- var div = document.createElement('div');
- var html = '';
- function Module(module, monitor, module_name, i){
- html += '<div class="col-6">';
- html += '<li>';
- html += '' + module;
- html += '</li>';
- html += '<input type="text" class="module-number" name="node' + i + '-' + monitor + '-' + module_name + '" placeholder="序號" style="width:170px;">';
- html += '</div>';
- };
- function TraverseModule(arr, monitor, i){
- $.each(arr, function(index, obj){
- <!--if(obj == 'airTem'){-->
- <!--Module('空氣溫度', monitor, 'airtem', i);-->
- <!--}else if(obj == 'airHum'){-->
- <!--Module('空氣濕度', monitor, 'airHum', i);-->
- <!--}else if(obj == 'dewPoint'){-->
- <!--Module('露點', monitor, 'dewPoint', i);-->
- <!--}else if(obj == 'sun'){-->
- <!--Module('日照', monitor, 'sun', i);-->
- <!--}else if(obj == 'soilHum'){-->
- <!--Module('土壤含水率', monitor, 'soilHum', i);-->
- <!--}else if(obj == 'soilTem'){-->
- <!--Module('土壤溫度', monitor, 'soilTem', i);-->
- <!--}else if(obj == 'soilEC'){-->
- <!--Module('土壤EC值', monitor, 'soilEC', i);-->
- <!--}else if(obj == 'windSpd'){-->
- <!--Module('風速', monitor, 'windSpd', i);-->
- <!--}else if(obj == 'windDin'){-->
- <!--Module('風向', monitor, 'windDin', i);-->
- <!--}else if(obj == 'rain'){-->
- <!--Module('降雨量', monitor, 'rain', i);-->
- <!--}else if(obj == 'atmosphere'){-->
- <!--Module('大氣壓', monitor, 'atmosphere', i);-->
- <!--};-->
- eval(sensor_list);
- });
- };
- var title_num = 1;
- html += '<h2 class="item-title text-center">' + '節點' + (index+1) + '</h2>';
- html += '<div class="row node-opt">';
- html += '<div class="col-1"></div>';
- html += '<div class="col-10">';
- if(json.weather){
- html += '<span>' + title_num + '.氣象站</span>';
- html += '<ol>';
- html += '<div class="row">';
- TraverseModule(json.weather, 'weather', (index+1));
- html += '<div class="col-6"></div>';
- html += '</div>';
- html += '</ol>';
- title_num ++;
- };
- if(json.irrigation){
- html += '<span>' + title_num + '.灌溉</span>';
- html += '<ol>';
- html += '<div class="row">';
- TraverseModule(json.irrigation, 'irrigation', (index+1));
- html += '<div class="col-6"></div>';
- html += '</div>';
- html += '</ol>';
- title_num ++;
- };
- if(json.water){
- html += '<span>' + title_num + '.水質</span>';
- html += '<ol>';
- html += '<div class="row">';
- TraverseModule(json.water, 'water', (index+1));
- html += '<div class="col-6"></div>';
- html += '</div>';
- html += '</ol>';
- };
- html += '</div>';
- html += '<div class="col-1"></div>';
- html += '</div>';
- div.innerHTML = html;
- div.setAttribute('class', 'node col-6');
- list_div.appendChild(div);
- });
- var register_form = document.getElementById('register_form');
- var loading = document.getElementById('loading');
- register_form.onsubmit = function(){
- loading.style.display = 'block';
- };
- });
- </script>
- </head>
- <body>
- <nav class="fixed-top">
- <nav class="navbar navbar-expand-md nav-top justify-content-center">
- <div>
- <span class="website_title">序號登記</span>
- </div>
- </nav>
- <nav class="navbar navbar-expand-md bg-dark navbar-dark nav-bottom">
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
- <span class="navbar-toggler-icon"></span>
- </button>
- <div class="collapse navbar-collapse" id="collapsibleNavbar">
- <ul class="navbar-nav">
- <li class="nav-item">
- <a class="nav-link" href="/">序號登記</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">排程設定</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">報表輸出</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">RMA</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">故障紀錄</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="#">求助</a>
- </li>
- <li class="li-block"></li>
- <li class="nav-item">
- <a class="nav-link" href="#"><i class="fa fa-user-o"></i> {{params.username}}</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="/logout">Logout</a>
- </li>
- </ul>
- </div>
- </nav>
- </nav>
- <div class="main-page">
- <form id="register_form" method="post" action="/register_number" enctype="multipart/form-data">
- <div class="container">
- <div class="row">
- <div class="col flex" style="margin: auto; ">
- <div class="col-12" style="margin-top:30px;">
- <h1>Step1:</h1>
- </div>
- <div class="col-2"></div>
- <div class="col-10">
- <label style="color:black;font-size:20px;">Please choose one of the following two/下列兩項請擇一選擇</label>
- </div>
- <div class="col-2"></div>
- <div class="col-10">
- <label style="color:black;font-size:20px;">1. Please enter your location/請輸入案場地址:</label>
- <input type="text" name="location" style="width:300px;">
- </div>
- <div class="col-2"></div>
- <div class="col-10">
- <label style="color:black;font-size:20px;">2. Please select farm image/或請選擇農場圖片</label>
- </div>
- <div class="col-3"></div>
- <div class="col-9">
- <input type="file" style="margin:10px 150px 50px 80px;width:40%;color:white;background-color:red;" name="filename" id="filename" onchange="readURL(this);" accept="image/gif, image/jpeg, image/png">
- </div>
- <div class="col-12" style="background-color:black;height:2px;margin-bottom:20px;"></div>
- <div class="col-12" style="margin-top:30px;">
- <h1>Step2:</h1>
- </div>
- <div class="col-2"></div>
- <div class="col-10">
- <label style="color:black;font-size:20px;">Please check your order list/請確認您的購買清單</label>
- </div>
- <div class="col-2"></div>
- <div class="col-10">
- <label style="color:black;font-size:20px;">Please enter serial number and paste the sticker/輸入相對應的序號並貼上貼紙</label>
- </div>
- <div id="order-list" class="col-12 row"></div>
- <div class="col-12" style="background-color:black;height:2px;margin-bottom:20px;margin-top:50px;"></div>
- <div id="loading" class="col-12" style="color:red;display:none;text-align:center;">
- <h1>載入中,請稍後...</h1>
- <!--<img src="../static/img/loading.gif" style="height:200px;width:200px;">-->
- </div>
- <div class="col-xs-2 col-xs-offset-2">
- <input type="reset" class="btn btn-secondary" style="margin:0 20px;font-weight:bold;" data-dismiss="modal" value="Reset/重設">
- </div>
- <div class="col-xs-2 col-xs-offset-3">
- <input type="submit" class="btn btn-success" style="margin:0 20px;font-weight:bold;color:black;" data-toggle="modal" data-target="#123" value="Save changes/設定完成">
- </div>
- <div class="col-12" style="height:70px;"></div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </body>
- </html>
|