diff --git a/messages/de.json b/messages/de.json index 09c65e00..e5b81100 100644 --- a/messages/de.json +++ b/messages/de.json @@ -175,6 +175,7 @@ "common_online": "Online", "common_offline": "Offline", "common_paused": "Pausiert", + "common_live": "Live", "common_resume": "Fortsetzen", "common_resuming": "Wird fortgesetzt...", "common_coming_soon": "(Demnächst)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Alle Steuerbefehle, die an deine Shocker gesendet wurden.", "shocker_logs_live_title": "Neue Einträge erscheinen in Echtzeit", "shocker_logs_paused_title": "Live-Updates pausieren beim Sortieren oder auf anderen Seiten als der ersten", - "shocker_logs_live": "Live", "shocker_logs_col_time": "Zeit", "shocker_logs_col_type": "Typ", "shocker_logs_col_by": "Von", diff --git a/messages/en.json b/messages/en.json index 3866eecc..1b5105d1 100644 --- a/messages/en.json +++ b/messages/en.json @@ -29,6 +29,7 @@ "sidebar_group_general": "General", "sidebar_home": "Home", "sidebar_shockers": "Shockers", + "sidebar_shocker_stats": "Shocker Stats", "sidebar_shared_shockers": "Shared Shockers", "sidebar_hubs": "Hubs", "sidebar_user_shares": "User Shares", @@ -175,12 +176,15 @@ "common_online": "Online", "common_offline": "Offline", "common_paused": "Paused", + "common_live": "Live", "common_resume": "Resume", "common_resuming": "Resuming...", "common_coming_soon": "(Coming soon)", "common_save_changes": "Save Changes", "common_danger_zone": "Danger Zone", "common_name": "Name", + "common_user": "User", + "common_owner": "Owner", "control_intensity": "Intensity", "control_duration": "Duration", "control_max_intensity": "Max Intensity", @@ -247,7 +251,6 @@ "shocker_logs_subtitle": "Every control command sent to your shockers.", "shocker_logs_live_title": "New logs appear in real time", "shocker_logs_paused_title": "Live updates pause when sorting or viewing a page other than the first", - "shocker_logs_live": "Live", "shocker_logs_col_time": "Time", "shocker_logs_col_type": "Type", "shocker_logs_col_by": "By", @@ -255,6 +258,36 @@ "shocker_logs_filter_placeholder": "Search shockers...", "shocker_logs_filter_all": "All shockers", "shocker_logs_filter_none": "No matching shockers", + "shockers_stats_label": "Stats", + "shocker_stats_title": "Shocker Stats", + "shocker_stats_subtitle": "How your shockers have been used, and how you used others'.", + "shocker_stats_range_7d": "Last 7 days", + "shocker_stats_range_30d": "Last 30 days", + "shocker_stats_range_90d": "Last 90 days", + "shocker_stats_range_365d": "Last year", + "shocker_stats_range_all": "All time", + "shocker_stats_range_custom": "Custom range", + "shocker_stats_from_label": "From", + "shocker_stats_to_label": "To", + "shocker_stats_range_separator": "to", + "shocker_stats_tab_received": "Received", + "shocker_stats_tab_given": "Given", + "shocker_stats_avg_intensity": "Avg intensity", + "shocker_stats_live_title": "Live control, counted as continuous bursts", + "shocker_stats_daily_title": "Daily activity", + "shocker_stats_metric_count": "Count", + "shocker_stats_daily_empty": "No activity in this period.", + "shocker_stats_by_shocker": "By shocker", + "shocker_stats_by_controller": "By controller", + "shocker_stats_by_owner": "By owner", + "shocker_stats_empty_shockers": "None of your shockers were controlled in this period.", + "shocker_stats_empty_controllers": "Nobody controlled your shockers in this period.", + "shocker_stats_empty_owners": "You did not control any shockers in this period.", + "shocker_stats_deleted_shockers": "Deleted shockers", + "shocker_stats_guests": "Guests (public shares)", + "shocker_stats_deleted_user": "Deleted user", + "shocker_stats_load_failed": "Failed to load stats.", + "shocker_stats_utc_fallback": "Your time zone ({{timeZone}}) is not known to the server, so days are shown in UTC.", "shocker_edit_title": "Edit Shocker", "shocker_edit_subtitle": "Change this shocker's details or remove it.", "shocker_edit_back": "Back to Shockers", diff --git a/messages/es.json b/messages/es.json index 3ab4f1ef..f6ef677d 100644 --- a/messages/es.json +++ b/messages/es.json @@ -175,6 +175,7 @@ "common_online": "En línea", "common_offline": "Sin conexión", "common_paused": "En pausa", + "common_live": "En directo", "common_resume": "Reanudar", "common_resuming": "Reanudando...", "common_coming_soon": "(Próximamente)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Todos los comandos de control enviados a tus shockers.", "shocker_logs_live_title": "Los nuevos registros aparecen en tiempo real", "shocker_logs_paused_title": "Las actualizaciones en directo se pausan al ordenar o al ver una página distinta de la primera", - "shocker_logs_live": "En directo", "shocker_logs_col_time": "Hora", "shocker_logs_col_type": "Tipo", "shocker_logs_col_by": "Por", diff --git a/messages/et.json b/messages/et.json index be18c120..b4075e5f 100644 --- a/messages/et.json +++ b/messages/et.json @@ -175,6 +175,7 @@ "common_online": "Võrgus", "common_offline": "Võrguühenduseta", "common_paused": "Peatatud", + "common_live": "Reaalajas", "common_resume": "Jätka", "common_resuming": "Jätkamine...", "common_coming_soon": "(Tulekul)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Kõik sinu shockeritele saadetud juhtkäsud.", "shocker_logs_live_title": "Uued logid ilmuvad reaalajas", "shocker_logs_paused_title": "Reaalajas uuendused peatuvad sortimisel või muu kui esimese lehe vaatamisel", - "shocker_logs_live": "Reaalajas", "shocker_logs_col_time": "Aeg", "shocker_logs_col_type": "Tüüp", "shocker_logs_col_by": "Saatja", diff --git a/messages/fi.json b/messages/fi.json index a51480e0..83b00122 100644 --- a/messages/fi.json +++ b/messages/fi.json @@ -175,6 +175,7 @@ "common_online": "Verkossa", "common_offline": "Ei verkossa", "common_paused": "Tauotettu", + "common_live": "Reaaliaikainen", "common_resume": "Jatka", "common_resuming": "Jatketaan...", "common_coming_soon": "(Tulossa pian)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Kaikki shockereillesi lähetetyt ohjauskomennot.", "shocker_logs_live_title": "Uudet lokit näkyvät reaaliajassa", "shocker_logs_paused_title": "Reaaliaikaiset päivitykset tauotetaan, kun lajittelet tai katsot muuta kuin ensimmäistä sivua", - "shocker_logs_live": "Reaaliaikainen", "shocker_logs_col_time": "Aika", "shocker_logs_col_type": "Tyyppi", "shocker_logs_col_by": "Lähettäjä", diff --git a/messages/fr.json b/messages/fr.json index 8332bd37..19f92a7f 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -175,6 +175,7 @@ "common_online": "En ligne", "common_offline": "Hors ligne", "common_paused": "En pause", + "common_live": "En direct", "common_resume": "Reprendre", "common_resuming": "Reprise...", "common_coming_soon": "(Bientôt disponible)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Toutes les commandes envoyées à vos shockers.", "shocker_logs_live_title": "Les nouveaux journaux apparaissent en temps réel", "shocker_logs_paused_title": "Les mises à jour en direct sont suspendues lors d'un tri ou sur une autre page que la première", - "shocker_logs_live": "En direct", "shocker_logs_col_time": "Heure", "shocker_logs_col_type": "Type", "shocker_logs_col_by": "Par", diff --git a/messages/ja.json b/messages/ja.json index 433eef9c..49fe349e 100644 --- a/messages/ja.json +++ b/messages/ja.json @@ -175,6 +175,7 @@ "common_online": "オンライン", "common_offline": "オフライン", "common_paused": "一時停止中", + "common_live": "ライブ", "common_resume": "再開", "common_resuming": "再開しています...", "common_coming_soon": "(近日公開)", @@ -246,7 +247,6 @@ "shocker_logs_subtitle": "ショッカーに送信されたすべての制御コマンドです。", "shocker_logs_live_title": "新しいログはリアルタイムで表示されます", "shocker_logs_paused_title": "並べ替え中または最初以外のページを表示中は、ライブ更新が一時停止します", - "shocker_logs_live": "ライブ", "shocker_logs_col_time": "時刻", "shocker_logs_col_type": "種類", "shocker_logs_col_by": "実行者", diff --git a/messages/nb.json b/messages/nb.json index 9feaeccf..e8db3d28 100644 --- a/messages/nb.json +++ b/messages/nb.json @@ -175,6 +175,7 @@ "common_online": "Tilkoblet", "common_offline": "Frakoblet", "common_paused": "Satt på pause", + "common_live": "Direkte", "common_resume": "Fortsett", "common_resuming": "Fortsetter...", "common_coming_soon": "(Kommer snart)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Alle styringskommandoer som er sendt til shockerne dine.", "shocker_logs_live_title": "Nye logger vises i sanntid", "shocker_logs_paused_title": "Loggen oppdateres ikke automatisk når du sorterer eller blar til en annen side", - "shocker_logs_live": "Direkte", "shocker_logs_col_time": "Tidspunkt", "shocker_logs_col_type": "Type", "shocker_logs_col_by": "Sendt av", diff --git a/messages/nl.json b/messages/nl.json index 1d8ce4d0..008fd897 100644 --- a/messages/nl.json +++ b/messages/nl.json @@ -175,6 +175,7 @@ "common_online": "Online", "common_offline": "Offline", "common_paused": "Gepauzeerd", + "common_live": "Live", "common_resume": "Hervatten", "common_resuming": "Hervatten...", "common_coming_soon": "(Binnenkort)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Alle besturingsopdrachten die naar je shockers zijn gestuurd.", "shocker_logs_live_title": "Nieuwe logs verschijnen in realtime", "shocker_logs_paused_title": "Live-updates pauzeren tijdens sorteren of op een andere pagina dan de eerste", - "shocker_logs_live": "Live", "shocker_logs_col_time": "Tijd", "shocker_logs_col_type": "Type", "shocker_logs_col_by": "Door", diff --git a/messages/sv.json b/messages/sv.json index 65bdc95d..65926ced 100644 --- a/messages/sv.json +++ b/messages/sv.json @@ -175,6 +175,7 @@ "common_online": "Ansluten", "common_offline": "Frånkopplad", "common_paused": "Pausad", + "common_live": "Live", "common_resume": "Återuppta", "common_resuming": "Återupptar...", "common_coming_soon": "(Kommer snart)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Alla styrkommandon som har skickats till dina shockers.", "shocker_logs_live_title": "Nya loggar visas i realtid", "shocker_logs_paused_title": "Liveuppdateringar pausas när du sorterar eller visar en annan sida än den första", - "shocker_logs_live": "Live", "shocker_logs_col_time": "Tid", "shocker_logs_col_type": "Typ", "shocker_logs_col_by": "Av", diff --git a/messages/uk.json b/messages/uk.json index 2510bc0a..e4342bb7 100644 --- a/messages/uk.json +++ b/messages/uk.json @@ -175,6 +175,7 @@ "common_online": "Онлайн", "common_offline": "Офлайн", "common_paused": "Призупинено", + "common_live": "Наживо", "common_resume": "Відновити", "common_resuming": "Відновлюємо...", "common_coming_soon": "(Незабаром)", @@ -249,7 +250,6 @@ "shocker_logs_subtitle": "Усі команди керування, надіслані твоїм шокерам.", "shocker_logs_live_title": "Нові записи з'являються в реальному часі", "shocker_logs_paused_title": "Оновлення наживо зупиняються під час сортування або на будь-якій сторінці, крім першої", - "shocker_logs_live": "Наживо", "shocker_logs_col_time": "Час", "shocker_logs_col_type": "Тип", "shocker_logs_col_by": "Хто", diff --git a/messages/uwu.json b/messages/uwu.json index 5fd926b0..b4ac5393 100644 --- a/messages/uwu.json +++ b/messages/uwu.json @@ -175,6 +175,7 @@ "common_online": "Awake ✨", "common_offline": "Sleepy 💤", "common_paused": "Napping~", + "common_live": "Live ✨", "common_resume": "Wake up!", "common_resuming": "Waking up... *yawn*", "common_coming_soon": "(Coming soon, hehe~)", @@ -247,7 +248,6 @@ "shocker_logs_subtitle": "Every little boop your zappy fwiends got~", "shocker_logs_live_title": "New boops show up the moment they happen!", "shocker_logs_paused_title": "Live updates nap while you sort or peek past the first page~", - "shocker_logs_live": "Live ✨", "shocker_logs_col_time": "When", "shocker_logs_col_type": "What", "shocker_logs_col_by": "Who", diff --git a/messages/zh-Hans.json b/messages/zh-Hans.json index 408e392b..06f59f47 100644 --- a/messages/zh-Hans.json +++ b/messages/zh-Hans.json @@ -175,6 +175,7 @@ "common_online": "在线", "common_offline": "离线", "common_paused": "已暂停", + "common_live": "实时", "common_resume": "恢复", "common_resuming": "正在恢复...", "common_coming_soon": "(即将推出)", @@ -246,7 +247,6 @@ "shocker_logs_subtitle": "发送到你的电击器的所有控制指令。", "shocker_logs_live_title": "新日志会实时显示", "shocker_logs_paused_title": "排序或查看第一页以外的页面时,实时更新会暂停", - "shocker_logs_live": "实时", "shocker_logs_col_time": "时间", "shocker_logs_col_type": "类型", "shocker_logs_col_by": "操作者", diff --git a/messages/zh-Hant.json b/messages/zh-Hant.json index e179483f..393252a3 100644 --- a/messages/zh-Hant.json +++ b/messages/zh-Hant.json @@ -175,6 +175,7 @@ "common_online": "上線", "common_offline": "離線", "common_paused": "已暫停", + "common_live": "即時", "common_resume": "繼續", "common_resuming": "正在繼續...", "common_coming_soon": "(即將推出)", @@ -246,7 +247,6 @@ "shocker_logs_subtitle": "所有傳送到你的電擊器的控制指令。", "shocker_logs_live_title": "新的記錄會即時顯示", "shocker_logs_paused_title": "排序或檢視第一頁以外的頁面時,即時更新會暫停", - "shocker_logs_live": "即時", "shocker_logs_col_time": "時間", "shocker_logs_col_type": "類型", "shocker_logs_col_by": "操作者", diff --git a/scripts/integration-stack.mjs b/scripts/integration-stack.mjs index ae7c2aec..38df73f7 100644 --- a/scripts/integration-stack.mjs +++ b/scripts/integration-stack.mjs @@ -20,7 +20,10 @@ import { GenericContainer, Network, Wait } from 'testcontainers'; const API_IMAGE = process.env.INTEGRATION_API_IMAGE ?? 'ghcr.io/openshock/api:develop'; -const POSTGRES_IMAGE = process.env.INTEGRATION_POSTGRES_IMAGE ?? 'postgres:18'; +// The API keeps control logs in a TimescaleDB hypertable, so plain postgres:18 fails its migrations. +const POSTGRES_IMAGE = + process.env.INTEGRATION_POSTGRES_IMAGE ?? + 'ghcr.io/openshock/postgres-timescaledb:2.32.1-18.7-trixie'; const DRAGONFLY_IMAGE = process.env.INTEGRATION_DRAGONFLY_IMAGE ?? 'ghcr.io/dragonflydb/dragonfly:latest'; const MAILPIT_IMAGE = process.env.INTEGRATION_MAILPIT_IMAGE ?? 'axllent/mailpit:latest'; diff --git a/src/lib/api/internal/generated/sdk.gen.ts b/src/lib/api/internal/generated/sdk.gen.ts index 35ee57c8..dd8a84eb 100644 --- a/src/lib/api/internal/generated/sdk.gen.ts +++ b/src/lib/api/internal/generated/sdk.gen.ts @@ -1414,11 +1414,8 @@ export const publicGetPublicShare = ( * Returns the lifetime totals of every requested user whose stats changed since the given cursor. * * Requires an automation token granting `ControlStatsRead`. "Changed since" is answered from when each - * stats row was last written rather than the time it covers, so live control stats written late (e.g. after a - * database outage) are still picked up. Rows deleted along with their owner lower the totals of everyone who - * controlled them without leaving a row behind, those are picked up from ControlStatRemoval. The - * lookback is widened by TimeSpan IntegrationsController.ChangeOverlap to cover writes still committing while the previous call - * read, so a user can be reported again although nothing changed. + * control log was written, so late writes are still picked up. The lookback is widened by + * TimeSpan IntegrationsController.ChangeOverlap, so a user can be reported again although nothing changed. */ export const integrationsGetControlStatChanges = ( options: Options @@ -1444,52 +1441,6 @@ export const integrationsGetControlStatChanges = ( - options?: Options -): RequestResult< - DeviceGetLiveControlGatewayV2Responses, - DeviceGetLiveControlGatewayV2Errors, - ThrowOnError, - 'data' -> => - (options?.client ?? client).get< - DeviceGetLiveControlGatewayV2Responses, - DeviceGetLiveControlGatewayV2Errors, - ThrowOnError, - 'data' - >({ - responseStyle: 'data', - url: '/2/device/assignLCG', - ...options, - }); - -/** - * Gets information about the authenticated device. - */ -export const deviceGetSelf = ( - options?: Options -): RequestResult => - (options?.client ?? client).get({ - responseStyle: 'data', - url: '/1/device/self', - ...options, - }); - -/** - * Pair a device with a pair code. - */ -export const devicePair = ( - options: Options -): RequestResult => - (options.client ?? client).get({ - responseStyle: 'data', - url: '/1/device/pair/{pairCode}', - ...options, - }); - /** * Gets the OTA update history for a device */ @@ -1678,6 +1629,52 @@ export const devicesGetShockers = ( ...options, }); +/** + * Gets the best suited LCG node for the client + */ +export const deviceGetLiveControlGatewayV2 = ( + options?: Options +): RequestResult< + DeviceGetLiveControlGatewayV2Responses, + DeviceGetLiveControlGatewayV2Errors, + ThrowOnError, + 'data' +> => + (options?.client ?? client).get< + DeviceGetLiveControlGatewayV2Responses, + DeviceGetLiveControlGatewayV2Errors, + ThrowOnError, + 'data' + >({ + responseStyle: 'data', + url: '/2/device/assignLCG', + ...options, + }); + +/** + * Gets information about the authenticated device. + */ +export const deviceGetSelf = ( + options?: Options +): RequestResult => + (options?.client ?? client).get({ + responseStyle: 'data', + url: '/1/device/self', + ...options, + }); + +/** + * Pair a device with a pair code. + */ +export const devicePair = ( + options: Options +): RequestResult => + (options.client ?? client).get({ + responseStyle: 'data', + url: '/1/device/pair/{pairCode}', + ...options, + }); + /** * Lists all automation tokens */ diff --git a/src/lib/api/internal/generated/types.gen.ts b/src/lib/api/internal/generated/types.gen.ts index 551af75d..886e4543 100644 --- a/src/lib/api/internal/generated/types.gen.ts +++ b/src/lib/api/internal/generated/types.gen.ts @@ -62,28 +62,6 @@ export type AdminOnlineGatewayResponse = { connectedHubs: number; }; -export type AdminUsersView = { - id: string; - name: string; - email: string; - passwordHashType: null | PasswordHashingAlgorithm; - roles: Array; - createdAt: Temporal.Instant; - activatedAt: null | Temporal.Instant; - createdByAutomationTokenId: null | string; - deactivatedAt: null | Temporal.Instant; - deactivatedByUserId: null | string; - apiTokenCount: number; - passwordResetCount: number; - shockerUserShareCount: number; - shockerPublicShareCount: number; - emailChangeRequestCount: number; - nameChangeRequestCount: number; - deviceCount: number; - shockerCount: number; - shockerControlLogCount: number; -}; - export type AdminUserView = { id: string; name: string; @@ -166,6 +144,28 @@ export type AdminUserViewUserRef = { name: string; }; +export type AdminUsersView = { + id: string; + name: string; + email: string; + passwordHashType: null | PasswordHashingAlgorithm; + roles: Array; + createdAt: Temporal.Instant; + activatedAt: null | Temporal.Instant; + createdByAutomationTokenId: null | string; + deactivatedAt: null | Temporal.Instant; + deactivatedByUserId: null | string; + apiTokenCount: number; + passwordResetCount: number; + shockerUserShareCount: number; + shockerPublicShareCount: number; + emailChangeRequestCount: number; + nameChangeRequestCount: number; + deviceCount: number; + shockerCount: number; + shockerControlLogCount: number; +}; + export const AuditAction = { Login: 'Login', Logout: 'Logout', @@ -315,17 +315,17 @@ export type AuditMetadataAutomationTokenUsedMetadata = { flow: string; }; +export type AuditMetadataEmailChangeRequestedMetadata = { + t?: 'emailChangeRequested'; + newEmail: string; +}; + export type AuditMetadataEmailChangedMetadata = { t?: 'emailChanged'; old: string; new: string; }; -export type AuditMetadataEmailChangeRequestedMetadata = { - t?: 'emailChangeRequested'; - newEmail: string; -}; - export type AuditMetadataLoginMetadata = { t?: 'login'; sessionId: string; @@ -555,17 +555,6 @@ export type ControlStatChangesResponse = { users: Array; }; -export type ControlStatsResponse = { - /** - * Activity on shockers you own. - */ - received: ReceivedControlStats; - /** - * Activity you sent to shockers, your own included. - */ - given: GivenControlStats; -}; - /** * Aggregated activity of one control type, split by whether it was live control. */ @@ -584,6 +573,17 @@ export type ControlStatTotals = { maxIntensity: number; }; +export type ControlStatsResponse = { + /** + * Activity on shockers you own. + */ + received: ReceivedControlStats; + /** + * Activity you sent to shockers, your own included. + */ + given: GivenControlStats; +}; + export const ControlType = { Stop: 'Stop', Shock: 'Shock', @@ -604,17 +604,6 @@ export type CreateAutomationTokenDto = { autoCleanupAfter?: null | string; }; -export type CreatedAutomationTokenDto = { - id: string; - name: string; - secret: string; - types: Array; - createdAt: Temporal.Instant; - lastRotatedAt?: null | Temporal.Instant; - autoCleanupUsers?: boolean; - autoCleanupAfter?: null | string; -}; - export type CreateShareRequest = { shockers: Array; user?: null | string; @@ -630,6 +619,17 @@ export type CreateTokenRequestV2 = { shockerControl: ShockerControlSettings; }; +export type CreatedAutomationTokenDto = { + id: string; + name: string; + secret: string; + types: Array; + createdAt: Temporal.Instant; + lastRotatedAt?: null | Temporal.Instant; + autoCleanupUsers?: boolean; + autoCleanupAfter?: null | string; +}; + export type DailyControlStats = { /** * Day in the requested time zone. @@ -835,14 +835,14 @@ export type LegacyDataResponseOfArrayOfLogEntry = { data: Array; }; -export type LegacyDataResponseOfArrayOfOwnerShockerResponse = { +export type LegacyDataResponseOfArrayOfOwnPublicShareResponse = { message: string; - data: Array; + data: Array; }; -export type LegacyDataResponseOfArrayOfOwnPublicShareResponse = { +export type LegacyDataResponseOfArrayOfOwnerShockerResponse = { message: string; - data: Array; + data: Array; }; export type LegacyDataResponseOfArrayOfShareCodeInfo = { @@ -865,11 +865,6 @@ export type LegacyDataResponseOfBackendInfoResponse = { data: BackendInfoResponse; }; -export type LegacyDataResponseOfboolean = { - message: string; - data: boolean; -}; - export type LegacyDataResponseOfDeviceSelfResponse = { message: string; data: DeviceSelfResponse; @@ -927,6 +922,11 @@ export type LegacyDataResponseOfStatsResponse = { data: StatsResponse; }; +export type LegacyDataResponseOfboolean = { + message: string; + data: boolean; +}; + export type LegacyDataResponseOfstring = { message: string; data: string; @@ -1067,18 +1067,18 @@ export const OtaUpdateStatus = { export type OtaUpdateStatus = (typeof OtaUpdateStatus)[keyof typeof OtaUpdateStatus]; -export type OwnerShockerResponse = { +export type OwnPublicShareResponse = { id: string; name: string; - image: string; - devices: Array; + createdOn: Temporal.Instant; + expiresOn?: null | Temporal.Instant; }; -export type OwnPublicShareResponse = { +export type OwnerShockerResponse = { id: string; name: string; - createdOn: Temporal.Instant; - expiresOn?: null | Temporal.Instant; + image: string; + devices: Array; }; /** @@ -1324,20 +1324,6 @@ export type ShareCodeInfo = { createdOn: Temporal.Instant; }; -export type SharedDevice = { - id: string; - name: string; - shockers: Array; -}; - -export type SharedShocker = { - id: string; - name: string; - isPaused: boolean; - permissions: ShockerPermissions; - limits: ShockerLimits; -}; - export type ShareInfo = { sharedWith: BasicUserInfo; createdOn: Temporal.Instant; @@ -1354,6 +1340,20 @@ export type ShareInviteBaseDetails = { sharedWith: null | BasicUserInfo; }; +export type SharedDevice = { + id: string; + name: string; + shockers: Array; +}; + +export type SharedShocker = { + id: string; + name: string; + isPaused: boolean; + permissions: ShockerPermissions; + limits: ShockerLimits; +}; + /** * Per-token shocker control configuration: a toggle plus min/max limits for intensity and duration. */ @@ -1389,13 +1389,6 @@ export const ShockerModelType = { export type ShockerModelType = (typeof ShockerModelType)[keyof typeof ShockerModelType]; -export type ShockerPermissions = { - vibrate: boolean; - sound: boolean; - shock: boolean; - live?: boolean; -}; - export type ShockerPermLimitPair = { permissions: ShockerPermissions; limits: ShockerLimits; @@ -1414,6 +1407,13 @@ export type ShockerPermLimitPairWithIdAndName = { limits: ShockerLimits; }; +export type ShockerPermissions = { + vibrate: boolean; + sound: boolean; + shock: boolean; + live?: boolean; +}; + export type ShockerResponse = { name: string; isPaused: boolean; @@ -1482,15 +1482,6 @@ export type TokenResponseV2 = { shockerControl: ShockerControlSettings; }; -export type UserControlStats = { - /** - * Null for guests (public shares). - */ - userId: null | string; - user: null | BasicUserInfo; - stats: Array; -}; - /** * Lifetime totals of one user, the same views as ControlStatsResponse without breakdowns. */ @@ -1506,13 +1497,14 @@ export type UserControlStatTotals = { given: Array; }; -export const UsernameAvailability = { - Available: 'Available', - Taken: 'Taken', - Invalid: 'Invalid', -} as const; - -export type UsernameAvailability = (typeof UsernameAvailability)[keyof typeof UsernameAvailability]; +export type UserControlStats = { + /** + * Null for guests (public shares). + */ + userId: null | string; + user: null | BasicUserInfo; + stats: Array; +}; export type UserNameBlacklistDto = { id: string; @@ -1521,27 +1513,6 @@ export type UserNameBlacklistDto = { createdAt: Temporal.Instant; }; -export type UsernameCheckResponse = { - availability: UsernameAvailability; - error?: null | UsernameError; -}; - -export type UsernameError = { - message: string; - type: UsernameErrorType; -}; - -export const UsernameErrorType = { - TooShort: 'TooShort', - TooLong: 'TooLong', - StartOrEndWithWhitespace: 'StartOrEndWithWhitespace', - ResembleEmail: 'ResembleEmail', - ObnoxiousCharacters: 'ObnoxiousCharacters', - Blacklisted: 'Blacklisted', -} as const; - -export type UsernameErrorType = (typeof UsernameErrorType)[keyof typeof UsernameErrorType]; - export type UserPatchDto = { name?: null | string; email?: null | string; @@ -1577,6 +1548,35 @@ export type UserShareInfo = { paused: number; }; +export const UsernameAvailability = { + Available: 'Available', + Taken: 'Taken', + Invalid: 'Invalid', +} as const; + +export type UsernameAvailability = (typeof UsernameAvailability)[keyof typeof UsernameAvailability]; + +export type UsernameCheckResponse = { + availability: UsernameAvailability; + error?: null | UsernameError; +}; + +export type UsernameError = { + message: string; + type: UsernameErrorType; +}; + +export const UsernameErrorType = { + TooShort: 'TooShort', + TooLong: 'TooLong', + StartOrEndWithWhitespace: 'StartOrEndWithWhitespace', + ResembleEmail: 'ResembleEmail', + ObnoxiousCharacters: 'ObnoxiousCharacters', + Blacklisted: 'Blacklisted', +} as const; + +export type UsernameErrorType = (typeof UsernameErrorType)[keyof typeof UsernameErrorType]; + export type V2UserShares = { outgoing: Array; incoming: Array; @@ -2961,85 +2961,6 @@ export type IntegrationsGetControlStatChangesResponses = { export type IntegrationsGetControlStatChangesResponse = IntegrationsGetControlStatChangesResponses[keyof IntegrationsGetControlStatChangesResponses]; -export type DeviceGetLiveControlGatewayV2Data = { - body?: never; - path?: never; - query?: { - version?: number; - }; - url: '/2/device/assignLCG'; -}; - -export type DeviceGetLiveControlGatewayV2Errors = { - /** - * Bad Request - */ - 400: OpenShockProblem; - /** - * Unable to find suitable LCG node - */ - 503: OpenShockProblem; -}; - -export type DeviceGetLiveControlGatewayV2Error = - DeviceGetLiveControlGatewayV2Errors[keyof DeviceGetLiveControlGatewayV2Errors]; - -export type DeviceGetLiveControlGatewayV2Responses = { - /** - * Successfully assigned LCG node - */ - 200: LcgNodeResponseV2; -}; - -export type DeviceGetLiveControlGatewayV2Response = - DeviceGetLiveControlGatewayV2Responses[keyof DeviceGetLiveControlGatewayV2Responses]; - -export type DeviceGetSelfData = { - body?: never; - path?: never; - query?: never; - url: '/1/device/self'; -}; - -export type DeviceGetSelfResponses = { - /** - * The device information was successfully retrieved. - */ - 200: LegacyDataResponseOfDeviceSelfResponse; -}; - -export type DeviceGetSelfResponse = DeviceGetSelfResponses[keyof DeviceGetSelfResponses]; - -export type DevicePairData = { - body?: never; - path: { - /** - * The pair code to pair with. - */ - pairCode: string; - }; - query?: never; - url: '/1/device/pair/{pairCode}'; -}; - -export type DevicePairErrors = { - /** - * No such pair code exists - */ - 404: OpenShockProblem; -}; - -export type DevicePairError = DevicePairErrors[keyof DevicePairErrors]; - -export type DevicePairResponses = { - /** - * Successfully assigned LCG node - */ - 200: LegacyDataResponseOfstring; -}; - -export type DevicePairResponse = DevicePairResponses[keyof DevicePairResponses]; - export type DevicesOtaGetOtaUpdateHistoryData = { body?: never; path: { @@ -3312,6 +3233,85 @@ export type DevicesGetShockersResponses = { export type DevicesGetShockersResponse = DevicesGetShockersResponses[keyof DevicesGetShockersResponses]; +export type DeviceGetLiveControlGatewayV2Data = { + body?: never; + path?: never; + query?: { + version?: number; + }; + url: '/2/device/assignLCG'; +}; + +export type DeviceGetLiveControlGatewayV2Errors = { + /** + * Bad Request + */ + 400: OpenShockProblem; + /** + * Unable to find suitable LCG node + */ + 503: OpenShockProblem; +}; + +export type DeviceGetLiveControlGatewayV2Error = + DeviceGetLiveControlGatewayV2Errors[keyof DeviceGetLiveControlGatewayV2Errors]; + +export type DeviceGetLiveControlGatewayV2Responses = { + /** + * Successfully assigned LCG node + */ + 200: LcgNodeResponseV2; +}; + +export type DeviceGetLiveControlGatewayV2Response = + DeviceGetLiveControlGatewayV2Responses[keyof DeviceGetLiveControlGatewayV2Responses]; + +export type DeviceGetSelfData = { + body?: never; + path?: never; + query?: never; + url: '/1/device/self'; +}; + +export type DeviceGetSelfResponses = { + /** + * The device information was successfully retrieved. + */ + 200: LegacyDataResponseOfDeviceSelfResponse; +}; + +export type DeviceGetSelfResponse = DeviceGetSelfResponses[keyof DeviceGetSelfResponses]; + +export type DevicePairData = { + body?: never; + path: { + /** + * The pair code to pair with. + */ + pairCode: string; + }; + query?: never; + url: '/1/device/pair/{pairCode}'; +}; + +export type DevicePairErrors = { + /** + * No such pair code exists + */ + 404: OpenShockProblem; +}; + +export type DevicePairError = DevicePairErrors[keyof DevicePairErrors]; + +export type DevicePairResponses = { + /** + * Successfully assigned LCG node + */ + 200: LegacyDataResponseOfstring; +}; + +export type DevicePairResponse = DevicePairResponses[keyof DevicePairResponses]; + export type AdminListAutomationTokensData = { body?: never; path?: never; diff --git a/src/lib/utils/controlStats.test.ts b/src/lib/utils/controlStats.test.ts new file mode 100644 index 00000000..2bdd1b97 --- /dev/null +++ b/src/lib/utils/controlStats.test.ts @@ -0,0 +1,134 @@ +import type { ControlStatTotals } from '#lib/api/index.js'; +import { describe, expect, it } from 'vitest'; +import { + MaxDailyPoints, + dailySeries, + durationAxisUnit, + formatStatDuration, + summarizeByType, + totalCount, + totalDurationMs, +} from './controlStats'; + +function row( + type: ControlStatTotals['type'], + live: boolean, + count: number, + durationMs: number, + averageIntensity: number, + maxIntensity: number +): ControlStatTotals { + return { + type, + live, + count: BigInt(count), + durationMs: BigInt(durationMs), + averageIntensity, + maxIntensity, + }; +} + +describe('summarizeByType', () => { + it('returns an empty summary for every charted type', () => { + const summaries = summarizeByType([]); + expect(summaries.map((s) => s.type)).toEqual(['Shock', 'Vibrate', 'Sound']); + expect(summaries.every((s) => s.count === 0 && s.averageIntensity === 0)).toBe(true); + }); + + it('folds live and non-live rows and weights the average by duration', () => { + const [shock] = summarizeByType([ + row('Shock', false, 3, 1000, 20, 40), + row('Shock', true, 1, 3000, 60, 80), + ]); + expect(shock).toEqual({ + type: 'Shock', + count: 4, + durationMs: 4000, + averageIntensity: 50, + maxIntensity: 80, + liveCount: 1, + liveDurationMs: 3000, + }); + }); + + it('ignores Stop rows', () => { + const summaries = summarizeByType([row('Stop', false, 5, 0, 0, 0)]); + expect(summaries.every((s) => s.count === 0)).toBe(true); + }); +}); + +describe('totalCount and totalDurationMs', () => { + it('sum every type except Stop', () => { + const rows = [ + row('Shock', false, 2, 500, 10, 10), + row('Vibrate', true, 3, 1500, 10, 10), + row('Stop', false, 7, 0, 0, 0), + ]; + expect(totalCount(rows)).toBe(5); + expect(totalDurationMs(rows)).toBe(2000); + }); +}); + +describe('dailySeries', () => { + it('fills days without activity with zeroes', () => { + const from = Temporal.PlainDate.from('2026-10-01'); + const to = Temporal.PlainDate.from('2026-10-03'); + const series = dailySeries( + [ + { + date: Temporal.PlainDate.from('2026-10-02'), + stats: [row('Shock', false, 2, 500, 10, 10), row('Shock', true, 1, 100, 10, 10)], + }, + ], + 'count', + from, + to + ); + expect(series).toEqual([ + { date: '2026-10-01', Shock: 0, Vibrate: 0, Sound: 0 }, + { date: '2026-10-02', Shock: 3, Vibrate: 0, Sound: 0 }, + { date: '2026-10-03', Shock: 0, Vibrate: 0, Sound: 0 }, + ]); + }); + + it('caps the series at the most recent days', () => { + const to = Temporal.PlainDate.from('2026-10-03'); + const series = dailySeries([], 'count', Temporal.PlainDate.from('0001-01-01'), to); + expect(series).toHaveLength(MaxDailyPoints); + expect(series.at(-1)?.date).toBe('2026-10-03'); + }); + + it('can chart duration instead of count', () => { + const day = Temporal.PlainDate.from('2026-10-02'); + const series = dailySeries( + [{ date: day, stats: [row('Sound', false, 2, 750, 10, 10)] }], + 'durationMs', + day, + day + ); + expect(series[0].Sound).toBe(750); + }); +}); + +describe('durationAxisUnit', () => { + it.each([ + [0, 's'], + [90_000, 's'], + [600_000, 'm'], + [7_200_000, 'h'], + ])('charts a %d ms maximum in %s', (ms, suffix) => { + expect(durationAxisUnit(ms).suffix).toBe(suffix); + }); +}); + +describe('formatStatDuration', () => { + it.each([ + [4200, '4.2s'], + [65_000, '1m 5s'], + [2.05 * 60_000, '2m 3s'], + [8_040_000, '2h 14m'], + [97_200_000, '1d 3h'], + ])('formats %d ms as %s', (ms, expected) => { + expect(formatStatDuration(ms)).toBe(expected); + }); +}); diff --git a/src/lib/utils/controlStats.ts b/src/lib/utils/controlStats.ts new file mode 100644 index 00000000..710fadb6 --- /dev/null +++ b/src/lib/utils/controlStats.ts @@ -0,0 +1,151 @@ +import { ControlType, type ControlStatTotals, type DailyControlStats } from '#lib/api/index.js'; + +/** Control types that carry activity worth charting, Stop is only ever a command. */ +export const StatControlTypes = [ + ControlType.Shock, + ControlType.Vibrate, + ControlType.Sound, +] as const; +export type StatControlType = (typeof StatControlTypes)[number]; + +export interface ControlTypeSummary { + type: StatControlType; + count: number; + durationMs: number; + averageIntensity: number; + maxIntensity: number; + liveCount: number; + liveDurationMs: number; +} + +function emptySummary(type: StatControlType): ControlTypeSummary { + return { + type, + count: 0, + durationMs: 0, + averageIntensity: 0, + maxIntensity: 0, + liveCount: 0, + liveDurationMs: 0, + }; +} + +function isStatControlType(type: ControlType): type is StatControlType { + return (StatControlTypes as readonly ControlType[]).includes(type); +} + +/** + * Folds the live and non-live rows of each control type into one summary per type. + * The average intensity stays weighted by duration, matching how the API computes it per row. + */ +export function summarizeByType(totals: ControlStatTotals[]): ControlTypeSummary[] { + const summaries = new Map(StatControlTypes.map((type) => [type, emptySummary(type)])); + const weightedIntensity = new Map(); + + for (const row of totals) { + if (!isStatControlType(row.type)) continue; + const summary = summaries.get(row.type)!; + const count = Number(row.count); + const durationMs = Number(row.durationMs); + + summary.count += count; + summary.durationMs += durationMs; + summary.maxIntensity = Math.max(summary.maxIntensity, row.maxIntensity); + if (row.live) { + summary.liveCount += count; + summary.liveDurationMs += durationMs; + } + weightedIntensity.set( + row.type, + (weightedIntensity.get(row.type) ?? 0) + row.averageIntensity * durationMs + ); + } + + for (const summary of summaries.values()) { + if (summary.durationMs > 0) { + summary.averageIntensity = weightedIntensity.get(summary.type)! / summary.durationMs; + } + } + + return [...summaries.values()]; +} + +/** Sum of counts across the given control types, Stop excluded. */ +export function totalCount(totals: ControlStatTotals[]): number { + return totals.reduce( + (sum, row) => (isStatControlType(row.type) ? sum + Number(row.count) : sum), + 0 + ); +} + +/** Sum of durations across the given control types, Stop excluded. */ +export function totalDurationMs(totals: ControlStatTotals[]): number { + return totals.reduce( + (sum, row) => (isStatControlType(row.type) ? sum + Number(row.durationMs) : sum), + 0 + ); +} + +export type DailyPoint = { date: string } & Record; + +/** Upper bound on chart points, ten years of days, so a far-off start can't stall the page. */ +export const MaxDailyPoints = 3660; + +/** + * Turns the sparse daily breakdown into one point per day between `from` and `to`, both inclusive. + * Days without activity are filled with zeroes so the chart keeps an even time axis. + * At most the last {@link MaxDailyPoints} days are returned. + */ +export function dailySeries( + days: DailyControlStats[], + metric: 'count' | 'durationMs', + from: Temporal.PlainDate, + to: Temporal.PlainDate +): DailyPoint[] { + const byDate = new Map(days.map((day) => [day.date.toString(), day.stats])); + const points: DailyPoint[] = []; + const earliest = to.subtract({ days: MaxDailyPoints - 1 }); + const start = Temporal.PlainDate.compare(from, earliest) < 0 ? earliest : from; + + for (let date = start; Temporal.PlainDate.compare(date, to) <= 0; date = date.add({ days: 1 })) { + const point = { date: date.toString(), Shock: 0, Vibrate: 0, Sound: 0 }; + for (const row of byDate.get(date.toString()) ?? []) { + if (!isStatControlType(row.type)) continue; + point[row.type] += Number(metric === 'count' ? row.count : row.durationMs); + } + points.push(point); + } + + return points; +} + +export interface DurationUnit { + ms: number; + suffix: 's' | 'm' | 'h'; +} + +/** + * Unit to chart durations in, picked so axis ticks land on round values of it + * instead of round milliseconds such as `6m 40s`. + */ +export function durationAxisUnit(maxMs: number): DurationUnit { + if (maxMs < 2 * 60_000) return { ms: 1000, suffix: 's' }; + if (maxMs < 2 * 3_600_000) return { ms: 60_000, suffix: 'm' }; + return { ms: 3_600_000, suffix: 'h' }; +} + +/** Formats a duration in milliseconds as the two most significant units, e.g. `2h 14m` or `4.2s`. */ +export function formatStatDuration(durationMs: number): string { + // Durations are whole milliseconds, rounding drops float error such as 2.05 * 60_000 = 122999.99... + const totalSeconds = Math.round(durationMs) / 1000; + if (totalSeconds < 60) return `${Math.round(totalSeconds * 10) / 10}s`; + + const seconds = Math.floor(totalSeconds) % 60; + const minutes = Math.floor(totalSeconds / 60) % 60; + const hours = Math.floor(totalSeconds / 3600) % 24; + const days = Math.floor(totalSeconds / 86400); + + if (days > 0) return `${days}d ${hours}h`; + if (hours > 0) return `${hours}h ${minutes}m`; + return `${minutes}m ${seconds}s`; +} diff --git a/src/routes/(app)/shockers/logs/+page.svelte b/src/routes/(app)/shockers/logs/+page.svelte index ea16f3b2..000a313e 100644 --- a/src/routes/(app)/shockers/logs/+page.svelte +++ b/src/routes/(app)/shockers/logs/+page.svelte @@ -242,7 +242,7 @@ : 'bg-muted-foreground'}" > - {liveUpdatesActive ? m.shocker_logs_live() : m.common_paused()} + {liveUpdatesActive ? m.common_live() : m.common_paused()}
diff --git a/src/routes/(app)/shockers/own/+page.svelte b/src/routes/(app)/shockers/own/+page.svelte index 74795b48..9870e105 100644 --- a/src/routes/(app)/shockers/own/+page.svelte +++ b/src/routes/(app)/shockers/own/+page.svelte @@ -3,7 +3,7 @@ import { PUBLIC_DISABLE_SHOCKER_MAP } from '$app/env/public'; import { shockerPauseShocker, shockerRegisterShocker } from '#lib/api/index.js'; import type { NewShocker } from '#lib/api/index.js'; - import { Layers, LogsIcon, Plus, RotateCcw, Settings, Zap } from '@lucide/svelte'; + import { ChartColumn, Layers, LogsIcon, Plus, RotateCcw, Settings, Zap } from '@lucide/svelte'; import { resolve } from '$app/paths'; import { Container, EmptyState, PageHeader } from '@openshock/svelte-core/components'; import { Spinner } from '@openshock/svelte-core/components/ui/spinner'; @@ -284,6 +284,12 @@ aria-label={m.shockers_logs_label()} href={resolve('shockers/logs')}> +
diff --git a/src/routes/(app)/shockers/stats/+page.svelte b/src/routes/(app)/shockers/stats/+page.svelte new file mode 100644 index 00000000..9090c6ff --- /dev/null +++ b/src/routes/(app)/shockers/stats/+page.svelte @@ -0,0 +1,282 @@ + + + + + {#if isFetching} + + {/if} + + +
+
+ + {ranges[range].label()} + + {#each Object.entries(ranges) as [key, option] (key)} + {option.label()} + {/each} + + + {#if range === 'custom'} + filters.from ?? '', (v) => (filters.from = v || undefined)} + /> + {m.shocker_stats_range_separator()} + filters.to ?? '', (v) => (filters.to = v || undefined)} + /> + {/if} +
+ + {#if timeZone !== browserTimeZone} +

+ {m.shocker_stats_utc_fallback({ timeZone: browserTimeZone })} +

+ {/if} + + {#if stats} + + + {m.shocker_stats_tab_received()} + {m.shocker_stats_tab_given()} + + + + + +
+ + +
+
+ + + + + +
+ {:else if isFetching} +
+ {:else if loadFailed} +

{m.shocker_stats_load_failed()}

+ {/if} +
+
diff --git a/src/routes/(app)/shockers/stats/breakdown-table.svelte b/src/routes/(app)/shockers/stats/breakdown-table.svelte new file mode 100644 index 00000000..506c0205 --- /dev/null +++ b/src/routes/(app)/shockers/stats/breakdown-table.svelte @@ -0,0 +1,92 @@ + + + + + + + {title} + + + {#if summarized.length === 0} +

{emptyText}

+ {:else} + + + + {nameHeader} + {#each StatControlTypes as type (type)} + {controlTypeLabels[type]()} + {/each} + {m.control_duration()} + {m.control_max_intensity()} + + + + {#each summarized as row (row.key)} + + + {row.name} + + {#each row.byType as summary (summary.type)} + + {numberFormat.format(summary.count)} + + {/each} + + {formatStatDuration(row.durationMs)} + + {row.maxIntensity}% + + {/each} + + + {/if} +
+
diff --git a/src/routes/(app)/shockers/stats/colors.ts b/src/routes/(app)/shockers/stats/colors.ts new file mode 100644 index 00000000..865247af --- /dev/null +++ b/src/routes/(app)/shockers/stats/colors.ts @@ -0,0 +1,14 @@ +import { m } from '#lib/paraglide/messages.js'; +import type { StatControlType } from '#lib/utils/controlStats.js'; + +export const controlTypeColors: Record = { + Shock: { light: '#eb6834', dark: '#d95926' }, + Vibrate: { light: '#2a78d6', dark: '#3987e5' }, + Sound: { light: '#a9489f', dark: '#bf5ab8' }, +}; + +export const controlTypeLabels: Record string> = { + Shock: m.control_type_shock, + Vibrate: m.control_type_vibrate, + Sound: m.control_type_sound, +}; diff --git a/src/routes/(app)/shockers/stats/daily-chart.svelte b/src/routes/(app)/shockers/stats/daily-chart.svelte new file mode 100644 index 00000000..83cc85af --- /dev/null +++ b/src/routes/(app)/shockers/stats/daily-chart.svelte @@ -0,0 +1,140 @@ + + + + + {m.shocker_stats_daily_title()} +
+ + +
+
+ + {#if !hasActivity} +

+ {m.shocker_stats_daily_empty()} +

+ {:else} + + + {#snippet tooltip()} + + {#snippet formatter({ value, item })} +
+
+ {item.label} + + {formatValue(Number(value))} + +
+ {/snippet} +
+ {/snippet} +
+
+ {/if} +
+
diff --git a/src/routes/(app)/shockers/stats/totals-cards.svelte b/src/routes/(app)/shockers/stats/totals-cards.svelte new file mode 100644 index 00000000..2b7d1024 --- /dev/null +++ b/src/routes/(app)/shockers/stats/totals-cards.svelte @@ -0,0 +1,63 @@ + + +
+ {#each summaries as summary (summary.type)} + + + + {controlTypeLabels[summary.type]()} + + +
+ + {numberFormat.format(summary.count)} + + + {formatStatDuration(summary.durationMs)} + +
+
+
+
{m.shocker_stats_avg_intensity()}
+
+ {summary.count > 0 ? `${Math.round(summary.averageIntensity)}%` : '–'} +
+
+
+
{m.control_max_intensity()}
+
+ {summary.count > 0 ? `${summary.maxIntensity}%` : '–'} +
+
+
+
{m.common_live()}
+
+ {numberFormat.format(summary.liveCount)} +
+
+
+
+
+ {/each} +
diff --git a/src/routes/Sidebar.svelte b/src/routes/Sidebar.svelte index 0a14f1c6..ae7c4728 100644 --- a/src/routes/Sidebar.svelte +++ b/src/routes/Sidebar.svelte @@ -1,5 +1,6 @@