123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607 |
- <!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>
- <!-- 引入 echarts.js -->
- <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
- <!--可用來建立使用者小圖示-->
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
- <style>
- body {
- margin:0;
- }
- .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;
- }
- .div-title {
- font-family: Roboto;
- font-style: normal;
- font-weight: bold;
- font-size: 36px;
- }
- .sensor {
- margin-top: 50px;
- }
- .flex {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: center;
- }
- .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;
- }
- .td_in {
- margin-top:10%;
- border-radius: 15px;
- text-align: center;
- background-color:#C4C4C4;
- width:150px;
- height: 100px;
- margin:auto;
- }
- .td_in:hover {
- cursor:pointer;
- }
- .sensor_status {
- width: 200px;
- height: 170px;
- background: #FFFFFF;
- border: 1px solid #CFCFCF;
- box-sizing: border-box;
- color: #000000;
- border-radius: 5px;
- font-size: 24px;
- margin:auto;
- }
- .show-info{
- position: absolute;
- background-color: #FFFFFF;
- border: 1px solid #949494;
- box-sizing: border-box;
- }
- .show-info > h1 {
- text-align: center;
- }
- .show-chart {
- height: 500px;
- border: 2px solid #FFF;
- background: #C4C4C4;
- }
- .btn-input input{
- background: #008CBA;
- border: 1px solid #CFCFCF;
- box-sizing: border-box;
- border-radius: 5px;
- width: 120px;
- height: 58px;
- text-align: center;
- line-height: 58px;
- font-size: 20px;
- margin-top: 50px;
- color: #FFFFFF;
- }
- .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";
- }
- @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;
- }
- .sensor {
- margin-right: 40px;
- }
- .btn-input input:last-child{
- margin-left:100px;
- }
- }
- @media(min-width:1200px){
- .navbar-nav > li {
- margin-left: 35px;
- }
- .navbar-nav .li-block {
- display: inline-block;
- width: 100px;
- }
- .sensor {
- margin-right: 40px;
- }
- .btn-input input:last-child{
- margin-left:100px;
- }
- }
- @media(min-width:1400px){
- .navbar-nav .li-block {
- display: inline-block;
- width: 200px;
- }
- .sensor {
- margin-right: 40px;
- }
- .btn-input input:last-child{
- margin-left:100px;
- }
- }
- @media(min-width:1689px) {
- .navbar-nav > li {
- margin-left: 50px;
- }
- .navbar-nav .li-block {
- display: inline-block;
- width: 500px;
- }
- .sensor {
- margin-right: 40px;
- }
- .btn-input input:last-child{
- margin-left:100px;
- }
- }
- </style>
- <script>
- function Echart(evt){
- $("#" + evt + "-div").css('display','block');
- //基於準備好的dom,初始化echarts例項
- var myChart = echarts.init(document.getElementsByClassName('' + evt)[0]);
- //指定圖表的配置項和資料
- var option = {
- xAxis: {
- type: 'category',
- data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021']
- },
- yAxis: {
- type: 'value'
- },
- series: [{
- data: [820, 932, 901, 934, 1290, 1330, 1320],
- type: 'line'
- }]
- };
- //使用剛指定的配置項和資料顯示圖表
- myChart.setOption(option);
- };
- function downloadFile() {
- //藉型別陣列建構的 blob 來建立 URL
- let fileName = "fileName.csv";
- const data = getRandomData();
- let blob = new Blob([data], {
- type: "application/octet-stream"
- });
- var href = URL.createObjectURL(blob);
- // 從 Blob 取出資料
- var link = document.createElement("a");
- document.body.appendChild(link);
- link.href = href;
- link.download = fileName;
- link.click();
- };
- //假資料
- function getRandomData() {
- var header = "RandomHeader";
- var data = "";
- for (let i = 0; i < 5; i++) {
- for (var j = 0; j < 2; j++) {
- if (j > 0) {
- data = data + ",";
- }
- data = data + "Item" + i + "_" + j;
- }
- }
- return header + data;
- };
- $(function(){
- $(".airTem-cancel").click(function(){
- $("#airTem-div").css('display','none');
- });
- $(".airHum-cancel").click(function(){
- $("#airHum-div").css('display','none');
- });
- //監聽airTem匯出
- let airTemdownloadBtn = document.querySelector(".airTemdownloadBtn");
- airTemdownloadBtn.addEventListener("click", downloadFile);
- //監聽airHum匯出
- let airHumdownloadBtn = document.querySelector(".airHumdownloadBtn");
- airHumdownloadBtn.addEventListener("click", downloadFile);
- $("#airTem").click(function(){
- $("#airTem-div").css('display', 'block');
- });
- $("#airHum").click(function(){
- $("#airHum-div").css('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="#">聯絡方法</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="/map">案場地圖</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" href="/system_status">環境資訊</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 method="" action="">
- <div class="container-fluid">
- <div class="row">
- <div class="col flex">
- <div class="col-12 text-center">
- <h1 style="color:#008CBA;">節點1</h1>
- </div>
- <div class="row">
- <div class="col-1"></div>
- <div class="col-10 flex">
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>空氣溫度</label>
- </div>
- <div id="airTem" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>空氣濕度</label>
- </div>
- <div id="airHum" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>露點</label>
- </div>
- <div id="dewPoint" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>日照</label>
- </div>
- <div id="sun" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>土壤含水率</label>
- </div>
- <div id="soilHum" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>土壤溫度</label>
- </div>
- <div id="soilTem" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>土壤EC值</label>
- </div>
- <div id="soilEC" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>風速</label>
- </div>
- <div id="windSpd" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>風向</label>
- </div>
- <div id="windDin" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>降雨量</label>
- </div>
- <div id="rain" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>大氣壓</label>
- </div>
- <div id="atmosphere" class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label>RF</label>
- </div>
- <div class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">
- <div class="div-title text-center">
- <div class="sensor_status">
- <div class="sensor_title" style="">
- <label><img src="../static/img/battery.png" style="width:40px;"></label>
- </div>
- <div class="td_in" style=""></div>
- </div>
- </div>
- </div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;"></div>
- <div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;"></div>
- <div id="airTem-div" class="show-info col-xl-10 col-lg-10 col-md-10 col-sm-10 col-xs-10" style="display: none;">
- <br>
- <h1>空氣溫度</h1>
- <center>
- <select name="airTem-day" class="text-right">
- <option value="year">year</option>
- <option value="month">month</option>
- <option value="day">day</option>
- </select>
- <span>從</span>
- <label for="airTem-start"></label><input id="airTem-start" type="date">
- <span>到</span>
- <label for="airTem-end"></label><input id="airTem-end" type="date">
- <span>為止</span>
- <input type="button" value="查詢" onclick="Echart('airTem');">
- </center>
- <div class="row">
- <div class="col-1"></div>
- <div class="col-10 airTem show-chart" style="margin-top: 10px;text-align:center;"></div>
- <div class="col-1"></div>
- </div>
- <div class="btn-input" style="text-align:center;">
- <input type="button" value="關閉" style="margin-left:0px;" class="airTem-cancel">
- <input class="airTemdownloadBtn" type="button" value="匯出">
- </div>
- </div>
- <div id="airHum-div" class="show-info col-xl-10 col-lg-10 col-md-10 col-sm-10 col-xs-10" style="display: none;">
- <br>
- <h1>空氣濕度</h1>
- <center>
- <select name="airHum-day" class="text-right">
- <option value="year">year</option>
- <option value="month">month</option>
- <option value="day">day</option>
- </select>
- <span>從</span>
- <label for="airHum-start"></label><input id="airHum-start" type="date">
- <span>到</span>
- <label for="airHum-end"></label><input id="airHum-end" type="date">
- <span>為止</span>
- <input type="button" value="查詢" onclick="Echart('airHum');">
- </center>
- <div class="row">
- <div class="col-1"></div>
- <div class="col-10 airHum show-chart" style="margin-top: 10px;text-align:center;"></div>
- <div class="col-1"></div>
- </div>
- <div class="btn-input" style="text-align:center;">
- <input type="button" value="關閉" style="margin-left:0px;" class="airHum-cancel">
- <input class="airHumdownloadBtn" type="button" value="匯出">
- </div>
- </div>
- </div>
- <div class="col-1"></div>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </body>
- </html>
|