Compare commits
No commits in common. 'bd36728c066727f6b95451064339e24c706c4219' and 'e5321d77532819863149e46e10550dd9a6ab42a0' have entirely different histories.
bd36728c06
...
e5321d7753
@ -1,3 +0,0 @@
|
|||||||
# 默认忽略的文件
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" default="true" project-jdk-name="22" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/玉米病虫害识别系统.iml" filepath="$PROJECT_DIR$/.idea/玉米病虫害识别系统.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 414 KiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 5.5 MiB |
Before Width: | Height: | Size: 1.6 MiB |
Before Width: | Height: | Size: 534 KiB |
Before Width: | Height: | Size: 3.7 MiB |
Before Width: | Height: | Size: 128 KiB |
@ -1,58 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>{{ book.title }}</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
background-color: #f4f4f4;
|
|
||||||
margin: 20px;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
max-width: 800px;
|
|
||||||
margin: auto;
|
|
||||||
background: white;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.author {
|
|
||||||
font-size: 1.2em;
|
|
||||||
margin: 10px 0;
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
margin: 20px 0;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
display: inline-block;
|
|
||||||
margin-top: 20px;
|
|
||||||
padding: 10px 15px;
|
|
||||||
background-color: #4CAF50;
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
background-color: #45a049;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<h1>{{ book.title }}</h1>
|
|
||||||
<p class="author"><strong>作者:</strong>{{ book.author }}</p>
|
|
||||||
<div class="content">
|
|
||||||
<strong>内容:</strong>
|
|
||||||
<p>书籍的内容将在这里展示...</p>
|
|
||||||
<!-- 可以在这里添加书籍的详细内容 -->
|
|
||||||
</div>
|
|
||||||
<a href="{{ url_for('re_reading') }}">返回书籍列表</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,172 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>评论区</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
min-height: 100vh;
|
|
||||||
background-image: url('{{ url_for('static', filename='images/2.jpg') }}');
|
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
}
|
|
||||||
.back-button {
|
|
||||||
position: absolute; /* 定位返回按钮 */
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 10px 30px;
|
|
||||||
background-color: green; /* Set button color to green */
|
|
||||||
color: white; /* Set text color to white for better visibility */
|
|
||||||
border: none; /* Optional: Remove border */
|
|
||||||
cursor: pointer; /* Optional: Change cursor on hover */
|
|
||||||
}
|
|
||||||
.comment-section {
|
|
||||||
background-color: rgba(255, 255, 255, 0.9);
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
|
|
||||||
max-width: 800px;
|
|
||||||
margin: 50px auto;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.comment-header {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.comment-body {
|
|
||||||
margin: 10px 0;
|
|
||||||
}
|
|
||||||
.comment-time {
|
|
||||||
font-size: 0.8em;
|
|
||||||
color: #aaa;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reply-btn, .submit-btn, .logout-btn, .toggle-replies-btn {
|
|
||||||
background-color: #28a745;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
padding: 6px 12px;
|
|
||||||
border-radius: 20px;
|
|
||||||
cursor: pointer;
|
|
||||||
margin-top: 10px;
|
|
||||||
transition: background-color 0.3s;
|
|
||||||
}
|
|
||||||
.reply-btn:hover, .submit-btn:hover, .logout-btn:hover, .toggle-replies-btn:hover {
|
|
||||||
background-color: #218838;
|
|
||||||
}
|
|
||||||
.reply-form {
|
|
||||||
margin-top: 10px;
|
|
||||||
display: none;
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
.welcome-message {
|
|
||||||
text-align: right;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.comment {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 10px;
|
|
||||||
background-color: rgba(240, 240, 240, 0.9);
|
|
||||||
transition: background-color 0.3s;
|
|
||||||
}
|
|
||||||
.comment:hover {
|
|
||||||
background-color: rgba(240, 240, 240, 1);
|
|
||||||
}
|
|
||||||
.sub-reply {
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-left: 40px;
|
|
||||||
padding: 10px;
|
|
||||||
border-left: 3px solid #28a745;
|
|
||||||
background-color: rgba(220, 240, 220, 0.8);
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
.reply-header {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
function toggleReplies(commentId) {
|
|
||||||
const repliesContainer = document.getElementById('replies-' + commentId);
|
|
||||||
const toggleButton = document.getElementById('toggle-replies-btn-' + commentId);
|
|
||||||
if (repliesContainer.style.display === 'none' || repliesContainer.style.display === '') {
|
|
||||||
repliesContainer.style.display = 'block';
|
|
||||||
toggleButton.innerText = '隐藏回复评论';
|
|
||||||
} else {
|
|
||||||
repliesContainer.style.display = 'none';
|
|
||||||
toggleButton.innerText = '查看回复评论';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<button class="back-button" onclick="window.location.href='/main';">返回</button>
|
|
||||||
<h2 style="text-align: center; color: #333;">评论区</h2>
|
|
||||||
|
|
||||||
<div class="comment-section">
|
|
||||||
<div class="welcome-message">
|
|
||||||
{% if session.username %}
|
|
||||||
<span>欢迎,{{ session.username }}!</span>
|
|
||||||
<a href="{{ url_for('logout') }}" class="logout-btn">退出登录</a>
|
|
||||||
{% else %}
|
|
||||||
<a href="{{ url_for('login') }}">登录</a> | <a href="{{ url_for('signup') }}">注册</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% for comment in comments %}
|
|
||||||
<div class="comment">
|
|
||||||
<div class="comment-header">{{ comment.username }}</div>
|
|
||||||
<div class="comment-body">
|
|
||||||
<p>{{ comment.content }}</p>
|
|
||||||
</div>
|
|
||||||
<span class="comment-time">{{ comment.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</span>
|
|
||||||
{% if session.username %}
|
|
||||||
<button class="reply-btn" onclick="document.getElementById('reply-form-{{ comment.id }}').style.display='block'">回复</button>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div id="reply-form-{{ comment.id }}" class="reply-form">
|
|
||||||
{% if session.username %}
|
|
||||||
<form action="{{ url_for('submit_reply', comment_id=comment.id) }}" method="post">
|
|
||||||
<textarea name="content" placeholder="输入你的回复评论..." required></textarea>
|
|
||||||
<button type="submit" class="submit-btn">提交回复评论</button>
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
<p>请登录以回复评论。</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<input type="hidden" name="comment_id" value="{{ comment.id }}">
|
|
||||||
</form>
|
|
||||||
<button id="toggle-replies-btn-{{ comment.id }}" class="toggle-replies-btn" onclick="toggleReplies({{ comment.id }})">查看子评论</button>
|
|
||||||
<div id="replies-{{ comment.id }}" class="replies" style="display: none;">
|
|
||||||
{% for reply in comment.replies %}
|
|
||||||
<div class="sub-reply">
|
|
||||||
<div class="reply-header">@{{ reply.username }} 回复:</div>
|
|
||||||
<p>{{ reply.content }}</p>
|
|
||||||
<span class="comment-time">{{ reply.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</span>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% if session.username %}
|
|
||||||
<form action="{{ url_for('submit_comment') }}" method="post">
|
|
||||||
<span>{{ session.username }}</span>
|
|
||||||
<textarea name="content" placeholder="输入你的评论..." required style="width: 100%; height: 100px;"></textarea>
|
|
||||||
<button type="submit" class="submit-btn">提交评论</button>
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
<p>请登录以发表评论。</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,111 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh-CN">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>玉米病虫害图形识别</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
background-image: url('{{ url_for('static', filename='images/3.png') }}');
|
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
background-repeat: no-repeat; /* 防止背景图片重复 */
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 100vh;
|
|
||||||
margin: 0;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.button {
|
|
||||||
padding: 10px 20px;
|
|
||||||
font-size: 16px;
|
|
||||||
color: white;
|
|
||||||
background-color: #4CAF50;
|
|
||||||
border: none;
|
|
||||||
border-radius: 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.back-button {
|
|
||||||
background-color: #4CAF50;
|
|
||||||
}
|
|
||||||
.file-label {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 10px 20px;
|
|
||||||
cursor: pointer;
|
|
||||||
background-color: #4CAF50;
|
|
||||||
color: white;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
#result-content {
|
|
||||||
margin-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center; /* 使结果内容居中 */
|
|
||||||
}
|
|
||||||
#result {
|
|
||||||
width: 250%; /* 调整宽度 */
|
|
||||||
height: 250px; /* 保持高度 */
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 16px;
|
|
||||||
resize: none;
|
|
||||||
margin-top: 10px; /* 添加顶部间距 */
|
|
||||||
}
|
|
||||||
.back-button {
|
|
||||||
position: absolute; /* 定位返回按钮 */
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 10px 30px;
|
|
||||||
background-color: green; /* Set button color to green */
|
|
||||||
color: white; /* Set text color to white for better visibility */
|
|
||||||
border: none; /* Optional: Remove border */
|
|
||||||
cursor: pointer; /* Optional: Change cursor on hover */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<h1>玉米病虫害图形识别</h1>
|
|
||||||
|
|
||||||
<button class="button back-button" type="button" onclick="window.location.href='{{ url_for('main') }}';">返回</button>
|
|
||||||
<div id="upload-form">
|
|
||||||
<form action="/re_image_recognition" method="post" enctype="multipart/form-data" onsubmit="return checkFile();">
|
|
||||||
<div class="button-group">
|
|
||||||
<label for="file-input" class="file-label">选择图片</label>
|
|
||||||
<input type="file" name="file" id="file-input" accept="image/*" onchange="handleFileChange();" style="display: none;">
|
|
||||||
<input type="submit" value="上传并分析" class="button">
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 结果输出框 -->
|
|
||||||
<div id="result-content">
|
|
||||||
<h2>分析结果</h2>
|
|
||||||
<textarea id="result" readonly>{{ result }}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function checkFile() {
|
|
||||||
var fileInput = document.getElementById('file-input');
|
|
||||||
if (fileInput.files.length === 0) {
|
|
||||||
alert('请选择一个图片文件上传。');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleFileChange() {
|
|
||||||
var fileInput = document.getElementById('file-input');
|
|
||||||
var fileLabel = document.querySelector('.file-label');
|
|
||||||
fileLabel.textContent = fileInput.files[0].name;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,82 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>登录</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 100vh;
|
|
||||||
margin: 0;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
background-image: url('{{ url_for('static', filename='images/background.jpg') }}'); /* 背景图的路径 */
|
|
||||||
background-size: cover; /* 填满整个网页 */
|
|
||||||
background-position: center; /* 居中显示 */
|
|
||||||
background-repeat: no-repeat; /* 不重复 */
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
background: rgba(255, 255, 255, 0.9);
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
||||||
width: 300px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
margin: 10px 0;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #28a745;
|
|
||||||
border: none;
|
|
||||||
color: white;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
background-color: #218838;
|
|
||||||
}
|
|
||||||
.message {
|
|
||||||
color: red;
|
|
||||||
margin-top: 10px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<h2>用户登录</h2>
|
|
||||||
<form action="{{ url_for('login') }}" method="post">
|
|
||||||
<label for="username">用户名:</label>
|
|
||||||
<input type="text" id="username" name="username" required>
|
|
||||||
<label for="password">密码:</label>
|
|
||||||
<input type="password" id="password" name="password" required>
|
|
||||||
<button type="submit">登录</button>
|
|
||||||
</form>
|
|
||||||
<p>还没有账户? <a href="{{ url_for('signup') }}">注册</a></p>
|
|
||||||
|
|
||||||
{% with messages = get_flashed_messages() %}
|
|
||||||
{% if messages %}
|
|
||||||
<div class="message">
|
|
||||||
<ul>
|
|
||||||
{% for message in messages %}
|
|
||||||
<li>{{ message }}</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,92 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>查询界面</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
background-image: url('{{ url_for('static', filename='images/4.png') }}');
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
width: 800px;
|
|
||||||
margin: auto;
|
|
||||||
position: relative; /* 为返回按钮定位 */
|
|
||||||
}
|
|
||||||
#result {
|
|
||||||
height: 500px;
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 20px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 10px;
|
|
||||||
overflow-y: scroll;
|
|
||||||
text-align: left;
|
|
||||||
background-color: #333; /* 假设您希望背景颜色不是白色,以便白色字体更明显 */
|
|
||||||
}
|
|
||||||
.button {
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 10px 30px;
|
|
||||||
background-color: green; /* Set button color to green */
|
|
||||||
color: white; /* Set text color to white for better visibility */
|
|
||||||
border: none; /* Optional: Remove border */
|
|
||||||
cursor: pointer; /* Optional: Change cursor on hover */
|
|
||||||
}
|
|
||||||
.back-button {
|
|
||||||
position: absolute; /* 定位返回按钮 */
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
.field-name {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
.dark-font {
|
|
||||||
color: #fff; /* 将字体颜色改为白色 */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<button class="button back-button" type="button" onclick="window.location.href='{{ url_for('main') }}';">返回</button>
|
|
||||||
<h1>查询界面</h1>
|
|
||||||
<form id="searchForm" method="POST">
|
|
||||||
<input type="text" id="inputEntry" name="inputEntry" placeholder="请输入玉米病虫害名称" style="width: 500px; padding: 10px;">
|
|
||||||
<button class="button" type="submit">查询</button>
|
|
||||||
</form>
|
|
||||||
<div id="result"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
document.getElementById('searchForm').onsubmit = function(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
var formData = new FormData(this);
|
|
||||||
var query = formData.get('inputEntry');
|
|
||||||
|
|
||||||
fetch('/diseasequery', {
|
|
||||||
method: 'POST',
|
|
||||||
body: formData
|
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.error) {
|
|
||||||
document.getElementById('result').innerText = '查询结果:' + data.error;
|
|
||||||
} else {
|
|
||||||
document.getElementById('result').innerHTML = `
|
|
||||||
<p class="field-name">病虫害名称:<span class="dark-font">${data.PestName}</span></p>
|
|
||||||
<p class="field-name">致病原因:<span class="dark-font">${data.PestCause}</span></p>
|
|
||||||
<p class="field-name">发病症状:<span class="dark-font">${data.Symptoms}</span></p>
|
|
||||||
<p class="field-name">防护措施:<span class="dark-font">${data.Solution}</span></p>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('Error:', error);
|
|
||||||
document.getElementById('result').innerText = '查询失败,请稍后再试。';
|
|
||||||
});
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,88 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="zh">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>注册</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 100vh;
|
|
||||||
margin: 0;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
background-image: url('{{ url_for('static', filename='static/images/background.jpg') }}');
|
|
||||||
background-size: cover;
|
|
||||||
background-position: center;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
background: rgba(255, 255, 255, 0.9);
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
||||||
width: 300px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
margin: 10px 0;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
width: 100%;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #28a745;
|
|
||||||
border: none;
|
|
||||||
color: white;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
background-color: #218838;
|
|
||||||
}
|
|
||||||
.error-message {
|
|
||||||
color: red;
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: #007bff;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
<h2>欢迎注册</h2>
|
|
||||||
<form action="{{ url_for('signup') }}" method="post">
|
|
||||||
<label for="new_username">用户名:</label>
|
|
||||||
<input type="text" name="new_username" id="new_username" required><br>
|
|
||||||
<label for="new_password">密码:</label>
|
|
||||||
<input type="password" name="new_password" id="new_password" required minlength="6" placeholder="至少6位"><br>
|
|
||||||
<label for="confirm_password">确认密码:</label>
|
|
||||||
<input type="password" name="confirm_password" id="confirm_password" required><br>
|
|
||||||
<button type="submit">注册</button>
|
|
||||||
</form>
|
|
||||||
<p>已有账户? <a href="/">登录</a></p>
|
|
||||||
|
|
||||||
{% with messages = get_flashed_messages() %}
|
|
||||||
{% if messages %}
|
|
||||||
<ul class="error-message">
|
|
||||||
{% for message in messages %}
|
|
||||||
<li>{{ message }}</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
{% endif %}
|
|
||||||
{% endwith %}
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 223 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 12 KiB |