fix: mobile card — no phone, show ordersTotal badge, cache-control headers

Mobile: removed phone + buildGroupSummary, kept name + type badge + status +
  order numbers + count badge (N сч.)
Caddyfile: Cache-Control immutable for assets, no-cache for HTML+SW
SW v7→v8
This commit is contained in:
root 2026-06-18 17:56:37 +00:00
parent 7b773dd4aa
commit 28ccb655d3
3 changed files with 18 additions and 8 deletions

View File

@ -2,12 +2,19 @@
root * /usr/share/caddy
@static path /assets/* /icons/* /manifest.webmanifest /service-worker.js
@static path /assets/* /icons/* /manifest.webmanifest
handle @static {
header Cache-Control "public, max-age=31536000, immutable"
file_server
}
handle /service-worker.js {
header Cache-Control "no-cache, no-store, must-revalidate"
file_server
}
handle {
header Cache-Control "no-cache, no-store, must-revalidate"
try_files {path} /index.html
file_server
}

View File

@ -1,8 +1,8 @@
const isLocalhost = self.location.hostname === "localhost" || self.location.hostname === "127.0.0.1";
if (!isLocalhost) {
const STATIC_CACHE = "construction-delivery-static-v7";
const RUNTIME_CACHE = "construction-delivery-runtime-v7";
const STATIC_CACHE = "construction-delivery-static-v8";
const RUNTIME_CACHE = "construction-delivery-runtime-v8";
const APP_SHELL_URLS = ["/", "/index.html", "/manifest.webmanifest", "/icons/icon-192.png", "/icons/icon-512.png"];
self.addEventListener("install", (event) => {

View File

@ -147,13 +147,16 @@ export const OrdersTable = ({
</Badge>
</div>
</div>
<div className="text-sm text-[var(--color-text-muted)]">
{group.customerPhone || ""}
</div>
</div>
<div className="mt-3 text-sm text-[var(--color-text-muted)]">{buildGroupSummary(group)}</div>
<div className="mt-2 text-sm text-[var(--color-text-muted)]">{renderMobileOrderNumbers(group)}</div>
<div className="mt-2 flex flex-wrap items-center gap-2 text-sm text-[var(--color-text-muted)]">
{renderMobileOrderNumbers(group)}
{(group.ordersTotal || 0) > 1 && (
<span className="rounded-full bg-[var(--color-surface)] px-2 py-0.5 text-xs">
{group.ordersTotal} сч.
</span>
)}
</div>
{group.hasDeliveryProblem && (
<div className="mt-2 rounded-lg border border-[var(--color-warning)] bg-[var(--color-warning-soft)] px-2 py-1 text-xs">
<span className="font-medium text-[var(--color-warning)]"> Проблема с доставкой</span>