Files
cacto f7aa0ba88e Страница зоны со всеми её устройствами и live-статусом
Раньше зона в списке была просто строкой без возможности провалиться
внутрь — все устройства смотрелись только через общий плоский список
/devices с колонкой "Зона". Теперь клик по зоне открывает её страницу
с карточками устройств (иконка по категории, статус online/offline/
unknown точкой с пульсацией для online, external_id) — ровно то, что
просили: все устройства и их статус на одном экране при выборе зоны.

Заодно список зон переведён с голой таблицы на карточки для
консистентности с новой страницей — вся карточка кликабельна и ведёт
на show, кнопки изменить/удалить остаются только у owner.

ZonePolicy::view уже был публичным (true всем) — новый роут
zones.show использует его без изменений.
2026-08-13 13:07:01 +05:00

46 lines
1.5 KiB
JavaScript

// Single source of truth for the app's URLs on the JS side — mirrors
// routes/web.php. The route list here is small and stable enough that a
// full Ziggy (route-name-to-JS) integration would be more machinery than
// the app needs; if the route count grows a lot, revisit that.
export const routes = {
dashboard: '/dashboard',
zones: {
index: '/zones',
show: (id) => `/zones/${id}`,
create: '/zones/create',
store: '/zones',
edit: (id) => `/zones/${id}/edit`,
update: (id) => `/zones/${id}`,
destroy: (id) => `/zones/${id}`,
},
devices: {
index: '/devices',
show: (id) => `/devices/${id}`,
create: '/devices/create',
store: '/devices',
edit: (id) => `/devices/${id}/edit`,
update: (id) => `/devices/${id}`,
destroy: (id) => `/devices/${id}`,
turnOn: (id) => `/devices/${id}/turn-on`,
turnOff: (id) => `/devices/${id}/turn-off`,
setLevel: (id) => `/devices/${id}/set-level`,
},
automationRules: {
index: '/automation-rules',
create: '/automation-rules/create',
store: '/automation-rules',
edit: (id) => `/automation-rules/${id}/edit`,
update: (id) => `/automation-rules/${id}`,
destroy: (id) => `/automation-rules/${id}`,
},
profile: {
edit: '/profile',
update: '/profile',
destroy: '/profile',
},
password: {
update: '/password',
},
logout: '/logout',
};