You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
3.4 KiB

<!DOCTYPE html>
<html>
<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;
background: linear-gradient(#141e30,#243b55);
}
h1, h2 {
text-align: center;
margin-top: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
form {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 20px;
}
label, input, button {
margin: 10px 0;
}
input[type="text"] {
padding: 10px;
width: 100%;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding: 10px 20px;
background-color: #add8e6;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #0056b3;
}
ul {
list-style-type: none;
padding: 0;
}
li {
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f9f9f9;
}
li strong {
margin-right: 10px;
}
li span {
font-style: italic;
color: #777;
}
li img {
vertical-align: middle;
margin-right: 10px;
}
</style>
</head>
<body>
<div class="container">
<h1>指挥者</h1>
<h2>发送攻击坐标</h2>
<form action="{{ url_for('send_attack') }}" method="post">
<label for="coordinate">攻击坐标:</label>
<input type="text" id="coordinate" name="coordinate" required>
<button type="submit">发送消息</button>
</form>
<h2>攻击坐标状态</h2>
<ul class="white-text">
{% if attacks %}
{% for attack in attacks %}
<li>
<strong>坐标:</strong> {{ attack.coordinate }}
- <em>{{ attack.created_at }}</em>
- <span>{% if attack.attacked %}已完成打击{% else %}等待打击{% endif %}</span>
</li>
{% endfor %}
{% else %}
<li>No attack coordinates available.</li>
{% endif %}
</ul>
<h2>查看照片</h2>
<ul>
{% if media_items %}
{% for filename in media_items %}
<li>
<a href="{{ url_for('uploaded_file', filename=filename) }}" target="_blank">
<img src="{{ url_for('uploaded_file', filename=filename) }}" width="100">
</a>
</li>
{% endfor %}
{% else %}
<li>No images found in the directory.</li>
{% endif %}
</ul>
</div>
</body>
</html>