65 lines
1.6 KiB
HTML
65 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>主页面</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
html,
|
|
body {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.container {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="top">
|
|
<div id="logo">
|
|
<img src="/logo.png" height="50px">
|
|
</div>
|
|
<div id="user_info"><span id="userName"></span>
|
|
<span class="logout" onclick="logout()">[登出]</span>
|
|
</div>
|
|
</div>
|
|
<div id="menu">
|
|
<h3>功能</h3>
|
|
<a href="green_house_info.html" target="content_frame" class="menu_item">大棚</a>
|
|
<a href="record_of_operations_history.html" target="content_frame" class="menu_item">历史操作</a>
|
|
</div>
|
|
<div class="container">
|
|
<iframe name="content_frame" id="info-frame" width="100%" height="100%"></iframe>
|
|
</div>
|
|
</div>
|
|
<div id="foot" style="text-align: botton;">
|
|
<b>版本所有@FLY-NOOB</b>
|
|
</div>
|
|
|
|
</body>
|
|
<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.nickname;
|
|
}
|
|
}
|
|
function logout() {
|
|
localStorage.clear();
|
|
open("/login.html", "_self");
|
|
}
|
|
</script>
|
|
|
|
</html> |