Release 1.0.0
This commit is contained in:
+3651
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,81 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>{{ status_code }} — {{ title }} | WiFi GPS Mapper</title>
|
||||
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ url_for('static', filename='style.css') }}"
|
||||
>
|
||||
|
||||
<style>
|
||||
.error-page {
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.error-card {
|
||||
width: min(100%, 620px);
|
||||
padding: 36px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.error-code {
|
||||
margin: 0 0 18px;
|
||||
color: var(--accent);
|
||||
font-size: clamp(48px, 10vw, 88px);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.error-title {
|
||||
margin: 0 0 12px;
|
||||
font-size: clamp(24px, 4vw, 32px);
|
||||
}
|
||||
|
||||
.error-message {
|
||||
margin: 0 0 28px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.error-home {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 10px 18px;
|
||||
border-radius: 5px;
|
||||
background: var(--green);
|
||||
color: var(--bg);
|
||||
text-decoration: none;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.error-home:hover {
|
||||
filter: brightness(1.08);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main class="error-page">
|
||||
<section class="error-card">
|
||||
<p class="error-code">{{ status_code }}</p>
|
||||
|
||||
<h1 class="error-title">{{ title }}</h1>
|
||||
|
||||
<p class="error-message">{{ message }}</p>
|
||||
|
||||
<a
|
||||
class="error-home"
|
||||
href="{{ url_for('index') }}"
|
||||
>Вернуться на главную</a>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,98 @@
|
||||
from datetime import datetime
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
|
||||
TIMEZONES = (
|
||||
"Pacific/Honolulu",
|
||||
"America/Anchorage",
|
||||
"America/Los_Angeles",
|
||||
"America/Denver",
|
||||
"America/Chicago",
|
||||
"America/New_York",
|
||||
"America/St_Johns",
|
||||
"America/Sao_Paulo",
|
||||
"Atlantic/Azores",
|
||||
"Europe/London",
|
||||
"Europe/Berlin",
|
||||
"Europe/Kaliningrad",
|
||||
"Europe/Moscow",
|
||||
"Europe/Samara",
|
||||
"Asia/Yekaterinburg",
|
||||
"Asia/Omsk",
|
||||
"Asia/Novosibirsk",
|
||||
"Asia/Krasnoyarsk",
|
||||
"Asia/Irkutsk",
|
||||
"Asia/Yakutsk",
|
||||
"Asia/Vladivostok",
|
||||
"Asia/Sakhalin",
|
||||
"Asia/Magadan",
|
||||
"Asia/Srednekolymsk",
|
||||
"Asia/Kamchatka",
|
||||
"Asia/Dubai",
|
||||
"Asia/Kolkata",
|
||||
"Asia/Kathmandu",
|
||||
"Asia/Dhaka",
|
||||
"Asia/Bangkok",
|
||||
"Asia/Shanghai",
|
||||
"Asia/Tokyo",
|
||||
"Australia/Adelaide",
|
||||
"Australia/Sydney",
|
||||
"Pacific/Chatham",
|
||||
"Pacific/Auckland",
|
||||
"Pacific/Kiritimati",
|
||||
"Etc/UTC",
|
||||
)
|
||||
|
||||
|
||||
def get_timezone_options(current_timezone):
|
||||
|
||||
timezones = list(TIMEZONES)
|
||||
|
||||
if current_timezone not in timezones:
|
||||
timezones.append(current_timezone)
|
||||
|
||||
options = []
|
||||
|
||||
for timezone_name in timezones:
|
||||
|
||||
try:
|
||||
|
||||
timezone = ZoneInfo(timezone_name)
|
||||
|
||||
offset = datetime.now(
|
||||
timezone
|
||||
).utcoffset()
|
||||
|
||||
total_minutes = int(
|
||||
offset.total_seconds() // 60
|
||||
)
|
||||
|
||||
sign = "+" if total_minutes >= 0 else "-"
|
||||
|
||||
hours, minutes = divmod(
|
||||
abs(total_minutes),
|
||||
60
|
||||
)
|
||||
|
||||
options.append(
|
||||
{
|
||||
"value": timezone_name,
|
||||
"label": (
|
||||
f"{timezone_name} "
|
||||
f"UTC{sign}{hours:02d}:{minutes:02d}"
|
||||
),
|
||||
"offset": total_minutes
|
||||
}
|
||||
)
|
||||
|
||||
except Exception:
|
||||
continue
|
||||
|
||||
options.sort(
|
||||
key=lambda item: (
|
||||
item["offset"],
|
||||
item["value"]
|
||||
)
|
||||
)
|
||||
|
||||
return options
|
||||
Reference in New Issue
Block a user