feat(fed): add ural
This commit is contained in:
@@ -23,8 +23,14 @@ const STATUS_LABELS: Record<string, string> = {
|
||||
Failed: "ошибка"
|
||||
};
|
||||
|
||||
function formatStatus(value?: string): string {
|
||||
return STATUS_LABELS[value ?? ""] ?? value ?? "—";
|
||||
function sourceBanner(item: SourceItem): string {
|
||||
if (item.status === "Failed") {
|
||||
const detail = item.lastError?.trim();
|
||||
return detail
|
||||
? `Сборка «${item.name}» не удалась: ${detail}`
|
||||
: `Сборка «${item.name}» не удалась. Повтор — рестарт сервиса или POST /api/v1/sync/${item.id}.`;
|
||||
}
|
||||
return `Тайлы источника «${item.name}» ещё не готовы (${formatStatus(item.status)}). Первый прогон может занять часы.`;
|
||||
}
|
||||
|
||||
function formatDate(value?: string | null): string {
|
||||
@@ -179,11 +185,7 @@ export function App() {
|
||||
|
||||
styleKeyRef.current = styleKey;
|
||||
const pending = selectedSources.find((item) => item.status !== "Ready");
|
||||
setBanner(
|
||||
pending
|
||||
? `Тайлы источника «${pending.name}» ещё не готовы (${formatStatus(pending.status)}). Первый прогон может занять часы.`
|
||||
: ""
|
||||
);
|
||||
setBanner(pending ? sourceBanner(pending) : "");
|
||||
}, [access, personal, selectedSourceIds, sources, source, styleName, syncGotoFromMap, updateHud]);
|
||||
|
||||
const refresh = useCallback(async () => {
|
||||
|
||||
@@ -444,8 +444,8 @@ dd {
|
||||
.banner {
|
||||
position: absolute;
|
||||
z-index: var(--hud-z);
|
||||
left: var(--space);
|
||||
top: 5.4rem;
|
||||
right: var(--space);
|
||||
top: 10em;
|
||||
max-width: min(34rem, calc(100vw - 24px));
|
||||
background: rgba(42, 31, 18, 0.92);
|
||||
color: #ffe0c2;
|
||||
|
||||
Reference in New Issue
Block a user