smart-green-house-server-an.../html/index.html

172 lines
4.5 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="flykhan" />
<meta name="keywords" content="green house" />
<title>首页</title>
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
body {
display: flex;
flex-direction: column;
justify-content: space-between;
}
#top {
height: 60px;
background-color: rgb(150, 177, 186);
display: flex;
flex-direction: row;
justify-content: space-between;
justify-items: center;
align-items: center;
padding: 5px;
border-bottom: 1px solid lightgray;
}
#main {
height: 100%;
display: flex;
flex-direction: row;
/* background-color: lightgoldenrodyellow; */
}
#foot {
height: 40px;
background-color: lightblue;
border-top: 1px solid lightgray;
padding: 10px 0;
}
#logo>img {
width: 50px;
height: 50px;
/* width: 5%; */
/* height: 5%; */
}
#menu {
width: 200px;
border-right: 5px solid lightgray;
padding: 10px;
}
.menu_item {
margin: 10px;
}
#menu>a {
display: block;
text-decoration: none;
color: rgb(174, 255, 0);
padding: 10px 5px;
width: 80%;
border-radius: 30px;
background-color: cornflowerblue;
border: 1px solid cornflowerblue;
font-size: larger;
text-align: center;
}
#menu>a:hover {
background-color: blue;
color: white;
font-size: larger;
border-radius: 30px;
/* border-top-left-radius: 30px; */
/* border-top-right-radius: 20px; */
/* border-bottom-right-radius: 20px; */
width: 80%;
text-align: center;
}
.logout_btn {
background-color: cornflowerblue;
border: 1px solid cornflowerblue;
border-radius: 30px;
width: 80px;
height: 30px;
font-size: larger;
text-align: center;
}
.logout_btn:hover {
background-color: blue;
color: white;
font-size: larger;
border-radius: 30px;
/* border-top-left-radius: 30px; */
/* border-top-right-radius: 20px; */
/* border-bottom-right-radius: 20px; */
width: 80px;
height: 30px;
text-align: center;
}
span {
font-size: larger;
padding-right: 30px;
color: rebeccapurple;
}
</style>
</head>
<body>
<div id="top">
<div id="logo">
<img src="./logo.png" alt="logo" />
</div>
<div id="user_info">
<!-- <span>登录用户</span> -->
<span id="userName"></span>
<!-- <span class="logout" onclick="logout()">登出</span> -->
<input class="logout_btn" type="button" value="登出" onclick="logout()" />
</div>
</div>
<div id="main">
<div id="menu">
<a href="./green_house_info_show.html" target="content_frame" class="menu_item">大棚温湿度</a>
<a href="./green_house_settings.html" target="content_frame" class="menu_item">大棚控制</a>
<a href="./record_of_operations_history.html" target="content_frame" class="menu_item">历史操作</a>
</div>
<div id="content" style="width:100%;">
2023-10-28 14:26:40 +08:00
<iframe name="content_frame" width="100%" height="100%" overflow="auto"></iframe>
</div>
</div>
<div id="foot" style="text-align: center; ">
<b>版本所有@FLY-NOOB</b>
</div>
<script>
window.onload = function () {
if (localStorage.getItem("login_user") == null) {
open("./login.html", "_self");
} else {
let login_user_str = localStorage.getItem("login_user");
let login_user = JSON.parse(login_user_str);
userName.innerText = login_user.login_user_name;
}
}
function logout() {
localStorage.clear();
open("./login.html", "_self");
}
</script>
</body>
</html>