feat(manager): signage screens, schedules, the message of the day and the weather's town (platform-v2 step 5.6c)

Signage gets tabs:
- Screens: every paired signage TV with what it plays (a playlist, or a
  schedule that wins over it), its shape and rotation, a warning when a
  playlist was made for the other shape; a link to pair one in Devices.
- Schedules: lines (a playlist on days / between hours that may pass midnight /
  between dates, with a priority) and the playlist for the rest of the time;
  "now: …" per schedule; the screens on it.
- Message and weather: the message of the day for every screen; the
  weather's town from a search (°C / °F), now / fetched at, "no forecast"
  when the server can't reach the service, fetch now, remove; says the
  weather needs internet and the widget hides without it.
- e2e signage.mjs +6 (message saved, weather section, choosing a playlist and
  turning the picture move the TV, a schedule built in the manager plays what
  it picks now); a crash is reported as a failed check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 23:20:44 +02:00
co-authored by Claude Opus 5.5
parent 5f6b51fb8b
commit 6c982e3139
9 changed files with 518 additions and 8 deletions
@@ -0,0 +1,136 @@
// Signage → Schedules (plan step 5.6c): which playlist plays when. A schedule is lines (a playlist
// on some days, between some hours, between some dates, with a priority) and a playlist for the rest
// of the time. When two lines match, the higher priority wins, then the more specific (dates, then
// days, then hours). A TV with a schedule switches by itself, also while the server is down.
import { useCallback, useEffect, useMemo, useState } from 'react'
import toast from 'react-hot-toast'
import { Plus, Trash2 } from 'lucide-react'
import { errorMessage } from '@xenia/api'
import { useTranslation } from '@xenia/i18n'
import { Button, Dialog, EmptyState, Field, IconButton, Input, Select, Spinner } from '@xenia/ui'
import * as api from './signageApi'
const emptyEntry = playlistId => ({ playlist_id: playlistId, days: [], time_from: null, time_to: null, date_from: null, date_to: null, priority: 0 })
export default function SchedulesTab() {
const { t } = useTranslation('manager')
const [list, setList] = useState(null)
const [playlists, setPlaylists] = useState([])
const [current, setCurrent] = useState(null)
const [draft, setDraft] = useState(null)
const [busy, setBusy] = useState(false)
const [confirm, setConfirm] = useState(false)
const load = useCallback(async (pick) => {
try {
const [l, p] = await Promise.all([api.listSchedules(), api.listPlaylists()])
setList(l); setPlaylists(p)
const s = l.find(x => x.id === pick) || (pick === undefined ? l[0] : null)
setCurrent(s?.id ?? null)
setDraft(s ? { name: s.name, fallback_playlist_id: s.fallback_playlist_id, entries: s.entries } : null)
} catch (err) { toast.error(errorMessage(err, t)) }
}, [t])
useEffect(() => { load() }, [load])
const saved = list?.find(x => x.id === current)
const dirty = useMemo(() => !!(saved && draft && JSON.stringify({ name: saved.name, fallback_playlist_id: saved.fallback_playlist_id, entries: saved.entries }) !== JSON.stringify(draft)), [saved, draft])
if (!list) return <div className="flex justify-center p-6"><Spinner /></div>
const act = async (fn, done, pick = current) => {
setBusy(true)
try { const r = await fn(); toast.success(done); await load(r?.id ?? pick) } catch (err) { toast.error(errorMessage(err, t)) }
setBusy(false)
}
const plOptions = playlists.map(p => ({ value: String(p.id), label: p.name }))
const setEntry = (i, patch) => setDraft(d => ({ ...d, entries: d.entries.map((e, j) => (j === i ? { ...e, ...patch } : e)) }))
const toggleDay = (i, day) => setEntry(i, { days: draft.entries[i].days.includes(day) ? draft.entries[i].days.filter(x => x !== day) : [...draft.entries[i].days, day].sort() })
return (
<div className="grid gap-5 xl:grid-cols-[14rem_1fr]" data-testid="signage-schedules">
<nav className="grid gap-2 content-start">
<ul className="grid gap-1.5">
{list.map(s => (
<li key={s.id}>
<button type="button" onClick={() => { if (!dirty || window.confirm(t('signage.discard'))) load(s.id) }} aria-current={s.id === current ? 'true' : undefined}
data-testid="signage-schedule-item" data-name={s.name}
className={`w-full text-left px-3 py-2 rounded-control border transition-colors duration-fast grid
${s.id === current ? 'border-accent bg-accent-soft text-accent-ink' : 'border-line bg-surface hover:bg-surface-2 text-ink'}`}>
<span className="text-label font-medium truncate">{s.name}</span>
<span className="text-caption text-ink-3 truncate">{s.playing_now ? t('signage.schedules.nowPlaying', { name: s.playing_now.name }) : t('signage.schedules.nowNothing')}</span>
</button>
</li>
))}
</ul>
<Button variant="secondary" icon={<Plus size={16} />} disabled={!playlists.length || busy} data-testid="signage-new-schedule"
onClick={() => act(() => api.createSchedule({ name: t('signage.schedules.newName'), fallback_playlist_id: playlists[0]?.id ?? null, entries: [] }), t('signage.schedules.created'))}>
{t('signage.schedules.new')}</Button>
{!playlists.length && <p className="text-caption text-ink-3">{t('signage.schedules.needPlaylist')}</p>}
</nav>
{!draft ? <EmptyState title={t('signage.schedules.none')} description={t('signage.schedules.noneHint')} /> : (
<div className="grid gap-4 content-start" data-testid="signage-schedule-editor" data-id={current}>
<div className="flex flex-wrap items-end gap-2">
<Field label={t('signage.playlistName')} className="flex-1 min-w-[12rem]">
<Input value={draft.name} maxLength={80} onChange={e => setDraft(d => ({ ...d, name: e.target.value }))} data-testid="signage-schedule-name" />
</Field>
<IconButton variant="ghost" label={t('fees.delete')} onClick={() => setConfirm(true)} data-testid="signage-schedule-delete"><Trash2 size={16} /></IconButton>
</div>
<p className="text-caption text-ink-3">{t('signage.schedules.how')}</p>
<ol className="grid gap-3" data-testid="signage-schedule-entries">
{draft.entries.map((e, i) => (
<li key={i} className="rounded-card border border-line bg-surface p-3 grid gap-3" data-testid="signage-schedule-entry">
<div className="flex flex-wrap items-end gap-2">
<Field label={t('signage.schedules.plays')} className="flex-1 min-w-[10rem]">
<Select value={String(e.playlist_id)} onChange={ev => setEntry(i, { playlist_id: Number(ev.target.value) })} options={plOptions} data-testid="signage-entry-playlist" />
</Field>
<Field label={t('signage.schedules.priority')} hint={t('signage.schedules.priorityHint')}>
<Input inputMode="numeric" className="w-24" value={String(e.priority || 0)}
onChange={ev => setEntry(i, { priority: Math.min(100, Number(ev.target.value.replace(/\D/g, '')) || 0) })} data-testid="signage-entry-priority" />
</Field>
<IconButton variant="ghost" label={t('fees.delete')} onClick={() => setDraft(d => ({ ...d, entries: d.entries.filter((_, j) => j !== i) }))}><Trash2 size={16} /></IconButton>
</div>
<div className="flex flex-wrap gap-1.5" role="group" aria-label={t('signage.days')}>
{[0, 1, 2, 3, 4, 5, 6].map(d => (
<button key={d} type="button" aria-pressed={e.days.includes(d)} onClick={() => toggleDay(i, d)} data-testid={`signage-entry-day-${d}`}
className={`px-2.5 py-1 rounded-control border text-label transition-colors duration-fast
${e.days.includes(d) ? 'border-accent bg-accent-soft text-accent-ink' : 'border-line bg-surface-2 text-ink hover:bg-surface-3'}`}>
{t(`signage.weekdays.${d}`)}
</button>
))}
</div>
<div className="grid gap-3 grid-cols-2 lg:grid-cols-4">
<Field label={t('signage.timeFrom')}><Input type="time" value={e.time_from || ''} onChange={ev => setEntry(i, { time_from: ev.target.value || null })} data-testid="signage-entry-from" /></Field>
<Field label={t('signage.timeTo')}><Input type="time" value={e.time_to || ''} onChange={ev => setEntry(i, { time_to: ev.target.value || null })} data-testid="signage-entry-to" /></Field>
<Field label={t('signage.dateFrom')}><Input type="date" value={e.date_from || ''} onChange={ev => setEntry(i, { date_from: ev.target.value || null })} /></Field>
<Field label={t('signage.dateTo')}><Input type="date" value={e.date_to || ''} onChange={ev => setEntry(i, { date_to: ev.target.value || null })} /></Field>
</div>
</li>
))}
</ol>
<Button variant="secondary" icon={<Plus size={16} />} onClick={() => setDraft(d => ({ ...d, entries: [...d.entries, emptyEntry(playlists[0]?.id)] }))}
disabled={!playlists.length || draft.entries.length >= 100} data-testid="signage-add-entry">{t('signage.schedules.addLine')}</Button>
<Field label={t('signage.schedules.otherwise')} hint={t('signage.schedules.otherwiseHint')}>
<Select value={draft.fallback_playlist_id == null ? '' : String(draft.fallback_playlist_id)} data-testid="signage-schedule-fallback"
onChange={e => setDraft(d => ({ ...d, fallback_playlist_id: e.target.value ? Number(e.target.value) : null }))}
options={[{ value: '', label: t('signage.screens.nothing') }, ...plOptions]} />
</Field>
{saved?.screens?.length > 0 && <p className="text-label text-ink-3">{t('signage.playingOn', { names: saved.screens.map(s => s.name).join(', ') })}</p>}
<div className="flex gap-2 items-center">
<Button loading={busy} disabled={!dirty || !draft.name.trim()} data-testid="signage-schedule-save"
onClick={() => act(() => api.updateSchedule(current, { ...draft, name: draft.name.trim() }), t('settings.saved'))}>{t('fees.save')}</Button>
{dirty && <span className="text-label text-ink-3">{t('display.looks.unsaved')}</span>}
</div>
</div>
)}
{confirm && saved && (
<Dialog open size="sm" title={t('signage.schedules.deleteTitle', { name: saved.name })} onClose={() => setConfirm(false)}
footer={<>
<Button variant="secondary" onClick={() => setConfirm(false)}>{t('fees.cancel')}</Button>
<Button variant="danger" loading={busy} onClick={() => act(() => api.deleteSchedule(current), t('signage.schedules.deleted'), undefined).then(() => setConfirm(false))}>{t('fees.delete')}</Button>
</>}>
<p className="text-body text-ink-2">{t('signage.schedules.deleteBody')}</p>
</Dialog>
)}
</div>
)
}
@@ -0,0 +1,71 @@
// Signage → Screens (plan step 5.6c): every paired signage TV with what it plays (a playlist, or a
// schedule that wins over it), its shape and how its picture is turned; a warning when a playlist
// was made for the other shape. New TVs are paired in Devices.
import { useCallback, useEffect, useState } from 'react'
import toast from 'react-hot-toast'
import { Link } from 'react-router-dom'
import { AlertTriangle, Monitor } from 'lucide-react'
import { errorMessage } from '@xenia/api'
import { useTranslation } from '@xenia/i18n'
import { EmptyState, Field, Select, Spinner } from '@xenia/ui'
import * as api from './signageApi'
export default function ScreensTab() {
const { t } = useTranslation('manager')
const [screens, setScreens] = useState(null)
const [playlists, setPlaylists] = useState([])
const [schedules, setSchedules] = useState([])
const load = useCallback(async () => {
try {
const [s, p, c] = await Promise.all([api.listScreens(), api.listPlaylists(), api.listSchedules()])
setScreens(s); setPlaylists(p); setSchedules(c)
} catch (err) { toast.error(errorMessage(err, t)) }
}, [t])
useEffect(() => { load() }, [load])
const save = async (id, body) => {
try { const s = await api.updateScreen(id, body); setScreens(list => list.map(x => (x.id === id ? s : x))); toast.success(t('settings.saved')) }
catch (err) { toast.error(errorMessage(err, t)) }
}
if (!screens) return <div className="flex justify-center p-6"><Spinner /></div>
if (!screens.length) {
return <EmptyState title={t('signage.screens.none')} description={t('signage.screens.noneHint')}
action={<Link to="/devices?pair=signage" className="text-accent-ink font-medium">{t('signage.screens.pair')}</Link>} />
}
return (
<ul className="grid gap-3" data-testid="signage-screens">
{screens.map(s => (
<li key={s.id} className="rounded-card border border-line bg-surface p-4 grid gap-3" data-testid="signage-screen" data-id={s.id} data-name={s.name}>
<div className="flex items-center gap-2">
<Monitor size={18} className="text-ink-2" aria-hidden="true" />
<span className="text-body font-semibold text-ink flex-1">{s.name}</span>
{s.orientation_mismatch && (
<span className="text-caption text-warning-ink flex items-center gap-1" data-testid="signage-screen-mismatch">
<AlertTriangle size={14} aria-hidden="true" />{t('signage.screens.mismatch')}
</span>
)}
</div>
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
<Field label={t('signage.screens.playlist')}>
<Select value={s.playlist_id == null ? '' : String(s.playlist_id)} data-testid="signage-screen-playlist"
onChange={e => save(s.id, { playlist_id: e.target.value ? Number(e.target.value) : null })}
options={[{ value: '', label: t('signage.screens.nothing') }, ...playlists.map(p => ({ value: String(p.id), label: p.name }))]} />
</Field>
<Field label={t('signage.screens.schedule')} hint={t('signage.screens.scheduleHint')}>
<Select value={s.schedule_id == null ? '' : String(s.schedule_id)} data-testid="signage-screen-schedule"
onChange={e => save(s.id, { schedule_id: e.target.value ? Number(e.target.value) : null })}
options={[{ value: '', label: t('signage.screens.noSchedule') }, ...schedules.map(c => ({ value: String(c.id), label: c.name }))]} />
</Field>
<Field label={t('signage.orientation')}>
<Select value={s.orientation} onChange={e => save(s.id, { orientation: e.target.value })} data-testid="signage-screen-orientation"
options={['landscape', 'portrait'].map(o => ({ value: o, label: t(`signage.orientations.${o}`) }))} />
</Field>
<Field label={t('signage.screens.rotation')} hint={t('signage.screens.rotationHint')}>
<Select value={String(s.rotation)} onChange={e => save(s.id, { rotation: Number(e.target.value) })} data-testid="signage-screen-rotation"
options={[0, 90, 180, 270].map(r => ({ value: String(r), label: t(`signage.screens.rotations.${r}`) }))} />
</Field>
</div>
</li>
))}
</ul>
)
}
@@ -1,6 +1,6 @@
// Signage (plan steps 5.6a-c): the venue's playlists for its TVs. Pick one to edit its timeline
// and slides; make a new one for a landscape or a portrait screen. Which screen plays what, the
// schedules, the message of the day and the weather's place: the other tabs (5.6c).
// Signage (plan steps 5.6a-c): the venue's playlists for its TVs (pick one to edit its timeline and
// slides; make a new one for a landscape or a portrait screen), which screen plays what, the
// schedules, the message of the day and the weather's town: one tab each.
// Backend: /api/signage (routers/signage.py).
import { useCallback, useEffect, useState } from 'react'
import toast from 'react-hot-toast'
@@ -10,12 +10,18 @@ import { useTranslation } from '@xenia/i18n'
import { Button, Dialog, EmptyState, Field, Input, Select, Spinner } from '@xenia/ui'
import * as api from './signageApi'
import PlaylistEditor from './PlaylistEditor'
import SchedulesTab from './SchedulesTab'
import ScreensTab from './ScreensTab'
import SignageSettingsTab from './SignageSettingsTab'
const TABS = ['playlists', 'screens', 'schedules', 'settings']
export default function SignagePage() {
const { t } = useTranslation('manager')
const [list, setList] = useState(null)
const [current, setCurrent] = useState(null)
const [creating, setCreating] = useState(false)
const [tab, setTab] = useState('playlists')
const load = useCallback(async () => {
try { const l = await api.listPlaylists(); setList(l); return l } catch (err) { toast.error(errorMessage(err, t)); return null }
@@ -28,7 +34,19 @@ export default function SignagePage() {
<h1 className="text-heading font-semibold text-ink">{t('signage.pageTitle')}</h1>
<p className="text-body text-ink-2 max-w-3xl">{t('signage.intro')}</p>
</header>
{!list ? <div className="flex justify-center p-6"><Spinner /></div> : (
<div className="flex flex-wrap gap-1 border-b border-line" role="tablist" aria-label={t('signage.pageTitle')}>
{TABS.map(k => (
<button key={k} type="button" role="tab" aria-selected={tab === k} onClick={() => setTab(k)} data-testid={`signage-tab-${k}`}
className={`px-3 py-2 -mb-px border-b-2 text-label font-medium transition-colors duration-fast
${tab === k ? 'border-accent text-accent-ink' : 'border-transparent text-ink-2 hover:text-ink'}`}>
{t(`signage.tabs.${k}`)}
</button>
))}
</div>
{tab === 'screens' && <ScreensTab />}
{tab === 'schedules' && <SchedulesTab />}
{tab === 'settings' && <SignageSettingsTab />}
{tab !== 'playlists' ? null : !list ? <div className="flex justify-center p-6"><Spinner /></div> : (
<div className="grid gap-5 xl:grid-cols-[14rem_1fr]">
<nav className="grid gap-2 content-start" aria-label={t('signage.playlists')}>
<span className="text-label font-medium text-ink-2">{t('signage.playlists')}</span>
@@ -0,0 +1,93 @@
// Signage → Message and weather (plan step 5.6c): the message of the day (one place for every
// screen, at once) and the weather's town (picked from a search; the weather needs internet, and
// without it the widget is simply hidden on the TVs).
import { useCallback, useEffect, useState } from 'react'
import toast from 'react-hot-toast'
import { CloudOff, RefreshCw, Search } from 'lucide-react'
import { errorMessage } from '@xenia/api'
import { useFormat, useLanguage, useTranslation } from '@xenia/i18n'
import { Button, Field, Input, Select, Spinner } from '@xenia/ui'
import * as api from './signageApi'
export default function SignageSettingsTab() {
const { t } = useTranslation('manager')
const { formatDateTime } = useFormat()
const { language: lang } = useLanguage()
const [message, setMessage] = useState(null)
const [savedMessage, setSavedMessage] = useState('')
const [status, setStatus] = useState(null)
const [q, setQ] = useState('')
const [places, setPlaces] = useState(null)
const [units, setUnits] = useState('celsius')
const [busy, setBusy] = useState(false)
const load = useCallback(async () => {
try {
const [m, w] = await Promise.all([api.getMessage(), api.weatherStatus()])
setMessage(m.text || ''); setSavedMessage(m.text || ''); setStatus(w)
if (w.place?.units) setUnits(w.place.units)
} catch (err) { toast.error(errorMessage(err, t)) }
}, [t])
useEffect(() => { load() }, [load])
const act = async (fn, done) => {
setBusy(true)
try { const r = await fn(); if (done) toast.success(done); return r } catch (err) { toast.error(errorMessage(err, t)); return null } finally { setBusy(false) }
}
if (message === null) return <div className="flex justify-center p-6"><Spinner /></div>
const w = status?.weather
return (
<div className="grid gap-5 max-w-3xl" data-testid="signage-settings">
<section className="rounded-card border border-line bg-surface p-4 grid gap-3">
<h2 className="text-body font-semibold text-ink">{t('signage.settings.message')}</h2>
<p className="text-label text-ink-2">{t('signage.settings.messageHint')}</p>
<div className="flex gap-2 items-start">
<Input value={message} maxLength={200} onChange={e => setMessage(e.target.value)} className="flex-1" aria-label={t('signage.settings.message')} data-testid="signage-message" />
<Button disabled={busy || message.trim() === savedMessage.trim()} data-testid="signage-message-save"
onClick={() => act(() => api.putMessage(message.trim()), t('settings.saved')).then(r => { if (r) setSavedMessage(r.text || '') })}>{t('fees.save')}</Button>
</div>
</section>
<section className="rounded-card border border-line bg-surface p-4 grid gap-3" data-testid="signage-weather">
<h2 className="text-body font-semibold text-ink">{t('signage.settings.weather')}</h2>
<p className="text-label text-ink-2 flex items-start gap-1.5"><CloudOff size={16} className="shrink-0 mt-0.5" aria-hidden="true" />{t('signage.settings.weatherHint')}</p>
{status?.place ? (
<div className="grid gap-1 text-label" data-testid="signage-weather-place">
<span className="text-ink"><strong>{status.place.name}</strong> · {t(`signage.settings.units.${status.place.units}`)}</span>
{w ? <span className="text-ink-2" data-testid="signage-weather-now">{t('signage.settings.now', { temp: Math.round(w.temperature), unit: status.place.units === 'fahrenheit' ? '°F' : '°C', at: status.fetched_at ? formatDateTime(new Date(status.fetched_at * 1000)) : '' })}</span>
: <span className="text-warning-ink" data-testid="signage-weather-none">{t(status.error ? 'signage.settings.noForecast' : 'signage.settings.waiting')}</span>}
<div className="flex gap-2 pt-1">
<Button size="sm" variant="secondary" icon={<RefreshCw size={14} />} disabled={busy} onClick={() => act(api.refreshWeather).then(r => r && setStatus(r))}>{t('signage.settings.refresh')}</Button>
<Button size="sm" variant="ghost" disabled={busy} onClick={() => act(api.forgetWeatherPlace, t('settings.saved')).then(r => r && setStatus(r))}>{t('signage.settings.forget')}</Button>
</div>
</div>
) : <p className="text-label text-ink-3">{t('signage.settings.noPlace')}</p>}
<div className="grid gap-2">
<div className="flex gap-2 items-end flex-wrap">
<Field label={t('signage.settings.town')} className="flex-1 min-w-[12rem]">
<Input value={q} onChange={e => setQ(e.target.value)} placeholder={t('signage.settings.townPlaceholder')} data-testid="signage-weather-search" />
</Field>
<Field label={t('signage.settings.unitsLabel')}>
<Select value={units} onChange={e => setUnits(e.target.value)} options={['celsius', 'fahrenheit'].map(u => ({ value: u, label: t(`signage.settings.units.${u}`) }))} />
</Field>
<Button variant="secondary" icon={<Search size={16} />} disabled={busy || q.trim().length < 2} data-testid="signage-weather-find"
onClick={() => act(() => api.weatherPlaces(q.trim(), lang === 'el' ? 'el' : 'en')).then(r => r && setPlaces(r))}>{t('signage.settings.find')}</Button>
</div>
{places && (places.length === 0 ? <p className="text-label text-ink-3">{t('media.noMatch')}</p> : (
<ul className="grid gap-1" data-testid="signage-weather-places">
{places.map((p, i) => (
<li key={i}>
<button type="button" className="w-full text-left px-2 py-1.5 rounded-control hover:bg-surface-2 text-label text-ink" data-testid="signage-weather-place-pick"
onClick={() => act(() => api.setWeatherPlace({ name: p.name, latitude: p.latitude, longitude: p.longitude, units }), t('settings.saved'))
.then(r => { if (r) { setStatus(r); setPlaces(null); setQ('') } })}>
<strong>{p.name}</strong> <span className="text-ink-3">{[p.region, p.country].filter(Boolean).join(', ')}</span>
</button>
</li>
))}
</ul>
))}
</div>
</section>
</div>
)
}
@@ -18,3 +18,19 @@ export const duplicateSlide = id => client.post(`/api/signage/slides/${id}/dupli
export const previewVenue = () => client.get('/api/signage/venue').then(data)
export const previewMenu = content => client.post('/api/signage/preview/menu', { content }).then(data)
export const listScreens = () => client.get('/api/signage/screens').then(data)
export const updateScreen = (id, body) => client.put(`/api/signage/screens/${id}`, body).then(data)
export const listSchedules = () => client.get('/api/signage/schedules').then(data)
export const createSchedule = body => client.post('/api/signage/schedules', body).then(data)
export const updateSchedule = (id, body) => client.put(`/api/signage/schedules/${id}`, body).then(data)
export const deleteSchedule = id => client.delete(`/api/signage/schedules/${id}`)
export const getMessage = () => client.get('/api/signage/message').then(data)
export const putMessage = text => client.put('/api/signage/message', { text }).then(data)
export const weatherStatus = () => client.get('/api/signage/weather').then(data)
export const weatherPlaces = (q, language) => client.get('/api/signage/weather/places', { params: { q, language } }).then(data)
export const setWeatherPlace = body => client.put('/api/signage/weather/place', body).then(data)
export const forgetWeatherPlace = () => client.delete('/api/signage/weather/place').then(data)
export const refreshWeather = () => client.post('/api/signage/weather/refresh').then(data)