Site: no «free and open source» line; recent downloads without bots, long cells wrap
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-24 11:58:22 +03:00
parent 8b0d68f480
commit 78ef78fda1
9 changed files with 5 additions and 13 deletions

View file

@ -931,10 +931,10 @@ async fn stats(State(state): State<Shared>, headers: HeaderMap) -> Response {
);
let mut recent = String::from(
"<section class=wide><h2>Последние скачивания (все, включая отсеянные)</h2><table><tr><th>Время (UTC)</th><th>Файл</th><th>Версия</th><th>Где</th><th>Язык</th><th>Откуда</th><th>Кто</th></tr>",
"<section class=wide><h2>Последние скачивания (без ботов; ваши и из локальной сети — серым)</h2><table class=recent><tr><th>Время (UTC)</th><th>Файл</th><th>Версия</th><th>Где</th><th>Язык</th><th>Откуда</th><th>Кто</th></tr>",
);
if let Ok(mut stmt) = db.prepare(
"SELECT ts, platform, version, country, region, city, lang, referrer, kind, ua FROM downloads ORDER BY id DESC LIMIT 50",
"SELECT ts, platform, version, country, region, city, lang, referrer, kind, ua FROM downloads WHERE kind <> 'bot' ORDER BY id DESC LIMIT 50",
) {
let rows = stmt.query_map([], |r| {
(0..10)
@ -950,14 +950,13 @@ async fn stats(State(state): State<Shared>, headers: HeaderMap) -> Response {
.join(" · ");
let who = match row[8].as_str() {
"human" => "человек",
"bot" => "бот",
"owner" => "вы",
"local" => "локальная сеть",
other => other,
};
let class = if row[8] == "human" { "" } else { " class=muted" };
recent.push_str(&format!(
"<tr{class}><td>{}</td><td>{}</td><td>{}</td><td>{place}</td><td>{}</td><td>{}</td><td title=\"{}\">{who}</td></tr>",
"<tr{class}><td>{}</td><td>{}</td><td>{}</td><td class=wrap>{place}</td><td>{}</td><td class=wrap>{}</td><td title=\"{}\">{who}</td></tr>",
esc(&row[0].replace('T', " ").replace('Z', "")),
esc(platform_label(&row[1])),
esc(&row[2]),
@ -982,6 +981,7 @@ section.wide{{margin-top:16px}} h2{{font-size:15px;margin:0 0 10px}}
table{{border-collapse:collapse;width:100%}} td,th{{padding:4px 6px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}}
.summary td{{padding:10px 8px}} .summary td:first-child{{white-space:normal}} .big{{font-size:24px;font-weight:600}}
.grid td:first-child{{max-width:230px;overflow:hidden;text-overflow:ellipsis}} .num{{text-align:right;width:60px}} .bar{{width:40%}} .bar span{{display:block;height:8px;border-radius:4px;background:var(--accent)}}
.recent td.wrap{{white-space:normal;overflow-wrap:anywhere;min-width:120px}}
.muted{{color:var(--muted)}} .chart{{display:flex;gap:3px;height:150px}}
.chart div{{flex:1;display:flex;flex-direction:column;text-align:center}}
.chart p{{flex:1;margin:0;display:flex;align-items:flex-end;justify-content:center;gap:1px}}

View file

@ -33,7 +33,6 @@
"see_all": "Alle Downloads",
"platforms": "Plattformen",
"badge_macos": "macOS · Apple Silicon",
"free_line": "Kostenlos und Open Source. Kein Konto, keine Werbung, kein Tracking.",
"started": "Ihr Download hat begonnen.",
"try_again": "Nicht gestartet? Erneut versuchen",
"choose_another": "Andere Datei wählen",

View file

@ -33,7 +33,6 @@
"see_all": "See all downloads",
"platforms": "Platforms",
"badge_macos": "macOS · Apple silicon",
"free_line": "Free and open source. No account, no ads, no tracking.",
"started": "Your download has started.",
"try_again": "Didn't start? Try again",
"choose_another": "Choose another file",

View file

@ -33,7 +33,6 @@
"see_all": "Todas las descargas",
"platforms": "Plataformas",
"badge_macos": "macOS · Apple silicon",
"free_line": "Gratis y de código abierto. Sin cuenta, sin anuncios, sin rastreo.",
"started": "Tu descarga ha comenzado.",
"try_again": "¿No empezó? Inténtalo de nuevo",
"choose_another": "Elegir otro archivo",

View file

@ -33,7 +33,6 @@
"see_all": "Tous les téléchargements",
"platforms": "Plateformes",
"badge_macos": "macOS · Apple silicon",
"free_line": "Gratuit et open source. Sans compte, sans publicité, sans pistage.",
"started": "Votre téléchargement a commencé.",
"try_again": "Il n'a pas démarré ? Réessayer",
"choose_another": "Choisir un autre fichier",

View file

@ -33,7 +33,6 @@
"see_all": "Tutti i download",
"platforms": "Piattaforme",
"badge_macos": "macOS · Apple silicon",
"free_line": "Gratuito e open source. Niente account, niente pubblicità, niente tracciamento.",
"started": "Il download è iniziato.",
"try_again": "Non è partito? Riprova",
"choose_another": "Scegli un altro file",

View file

@ -33,7 +33,6 @@
"see_all": "Все загрузки",
"platforms": "Платформы",
"badge_macos": "macOS · Apple silicon",
"free_line": "Бесплатно и с открытым кодом. Без регистрации, рекламы и слежки.",
"started": "Загрузка началась.",
"try_again": "Не началась? Попробуйте ещё раз",
"choose_another": "Выбрать другой файл",

View file

@ -89,7 +89,6 @@
<li><a href="#download-linux-flatpak">Flatpak</a></li>
<li><a href="#download-android">Android</a></li>
</ul>
<p class="free">{{t:free_line}}</p>
<figure class="shot hero-shot">
<a href="/screenshots/01-game.png" data-shot="1">

View file

@ -84,10 +84,9 @@ p { margin: 0 0 12px; }
.cta .note.warn { color: var(--warn); }
.mobile p { color: var(--text-2); max-width: 52ch; }
.mobile .btn { margin-right: 16px; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 24px 0 8px; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 24px 0 56px; }
.badges a { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid var(--border); border-radius: 14px; font-size: 13px; color: var(--text-2); }
.badges a:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.free { font-size: 13px; color: var(--text-2); margin-bottom: 48px; }
@media (max-width: 639px) { .hero { padding-top: 48px; } .hero h1 { font-size: 32px; } .hero .sub { font-size: 17px; } }
.started { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 16px; max-width: 640px; position: relative; font-size: 15px; }