@antelopejs/dms-api 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,13 +19,16 @@
19
19
  - **API settings**: the routes the console watches, retention, captured
20
20
  headers and the slow threshold.
21
21
 
22
- It requires `@antelopejs/dms` `>=0.7.13 <0.8.0` (`@antelopejs/interface-dms`
23
- 0.5.8) and `@antelopejs/dms-frontend` `>=0.5.2 <0.6.0`. These DMS releases
22
+ It requires `@antelopejs/dms` `>=0.9.0 <1.0.0` (`@antelopejs/interface-dms`
23
+ 0.7.0) and `@antelopejs/dms-frontend` `>=0.6.0 <0.7.0`. The frontend server
24
+ serves no tester route of its own: this module's `dms.server.ts` serves
25
+ `POST /api/_dms-api/tester`. These DMS releases
24
26
  bring the pieces the console is built on: the row side panel, the page's
25
27
  Live / Pause state and its holds, the refresh the console's own blocks share
26
28
  with the DMS blocks, the period kept in the URL, the column tones, the
27
- `Guard` block, the form API its settings fields use and the redirect of
28
- `/modules/api` to the Overview.
29
+ `Guard` block, the form API its settings fields use, the redirect of
30
+ `/modules/api` to the Overview, and `useApiData`, which renders the console's
31
+ data on the server.
29
32
 
30
33
  The Overview, the Request logs and Routes have the DMS **Live / Pause**
31
34
  toggle (the L key). Live, the default, the page follows new requests as the
@@ -177,7 +177,7 @@ function requestTable(options) {
177
177
  missedLabel: "$api.live_mode.new_requests",
178
178
  },
179
179
  rowClick: "single",
180
- fetchRowUrl: `${DETAIL_URLS[page]}/{id}`,
180
+ fetchRowUrl: `${DETAIL_URLS[page]}/{{row.id}}`,
181
181
  capabilities: { search: true, sort: true, paginate: true, filter: true },
182
182
  periodScope: period_1.PERIOD_SCOPE,
183
183
  rowActions: { custom: [requestPanelAction(page)] },
@@ -1 +1 @@
1
- {"version":3,"file":"request-table.js","sourceRoot":"","sources":["../../src/pages/request-table.ts"],"names":[],"mappings":";;AAsOA,oCA8DC;AApSD,2FAA2F;AAC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C,CACL,CAAC;IACF,OAAO,sBAAS,CAAC,UAAU,CAAC;QAC1B,GAAG,IAAI;QACP,OAAO,EAAE,MAAM;QACf,QAAQ;QACR,QAAQ,EAAE,KAAK;QAMf,aAAa,EAAE,2BAAmB;QAClC,QAAQ,EAAE,QAAQ,IAAI;YACpB,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,6BAA6B;SAC3C;QACD,QAAQ,EAAE,QAAQ;QAElB,WAAW,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,aAAa;QAC9C,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QAExE,WAAW,EAAE,qBAAY;QACzB,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,EAAE;QAElD,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC"}
@@ -160,8 +160,10 @@ const { formatLocale: locale } = useRegionalFormat({ locale: 'format' })
160
160
  const dateFormat = useDateFormat()
161
161
  const toast = useToast()
162
162
  const { isLive } = usePageLive()
163
- const { data, error, pending, receivedAt, refresh } =
164
- useApiResource<HealthPayload>(() => props.fetchUrl)
163
+ const { data, error, pending, refresh } = useApiData<HealthPayload>(
164
+ () => props.fetchUrl,
165
+ { refreshOnPageRefresh: false },
166
+ )
165
167
 
166
168
  // Read again on the live feed at the page's pace, and after a quiet minute:
167
169
  // the verdict judges time too. Never while paused.
@@ -244,7 +246,7 @@ function heldFor(health: HealthPayload): string {
244
246
  // A failed refresh keeps the last figures on screen: they are no longer live.
245
247
  const stale = computed(() => !!error.value && !!data.value)
246
248
  const staleSince = computed(() =>
247
- receivedAt.value ? formatClock(receivedAt.value, dateFormat.value) : '',
249
+ data.value ? formatClock(data.value.checkedAt, dateFormat.value) : '',
248
250
  )
249
251
 
250
252
  const look = computed(() => (data.value ? LOOKS[data.value.verdict] : null))
@@ -337,6 +339,10 @@ const incident = computed(() => {
337
339
  }
338
340
  })
339
341
 
342
+ // The tooltip of the duration waits for the browser: it writes a weekday,
343
+ // which the server's ICU may punctuate otherwise.
344
+ const incidentTitle = useClientValue(() => incident.value?.title)
345
+
340
346
  // One time only: once stale, the banner says when the figures date from.
341
347
  const checked = computed(() =>
342
348
  data.value && !stale.value
@@ -431,7 +437,7 @@ const metrics = computed<HeroMetric[]>(() => {
431
437
  :aria-busy="pending"
432
438
  :aria-label="t('api.health.label')"
433
439
  >
434
- <DmsCard v-if="pending" :padded="false" class="px-6 py-6">
440
+ <DmsCard v-if="pending && !data" :padded="false" class="px-6 py-6">
435
441
  <div class="flex items-center gap-6">
436
442
  <USkeleton class="size-16 rounded-full" />
437
443
  <div class="flex flex-col gap-2">
@@ -554,7 +560,7 @@ const metrics = computed<HeroMetric[]>(() => {
554
560
  <time
555
561
  v-if="incident"
556
562
  :datetime="incident.datetime"
557
- :title="incident.title"
563
+ :title="incidentTitle"
558
564
  >
559
565
  {{ incident.text }}
560
566
  </time>
@@ -41,8 +41,9 @@ const { formatLocale: locale, formatNumber } = useRegionalFormat({
41
41
  locale: 'format',
42
42
  })
43
43
  const dateFormat = useDateFormat()
44
- const { data, error, pending, refresh } = useApiResource<LivePayload>(
44
+ const { data, error, pending, refresh } = useApiData<LivePayload>(
45
45
  () => props.fetchUrl,
46
+ { refreshOnPageRefresh: false },
46
47
  )
47
48
 
48
49
  // The paused state is the browser's (the DMS remembers it per page), the
@@ -239,7 +240,7 @@ const share = (part: number, bar: { heights: Record<string, number> }) => {
239
240
  </template>
240
241
 
241
242
  <div class="px-3 pb-2 pt-1">
242
- <div v-if="pending" class="flex h-[112px] items-end gap-[2px] px-2">
243
+ <div v-if="pending && !data" class="flex h-[112px] items-end gap-[2px] px-2">
243
244
  <USkeleton
244
245
  v-for="index in 60"
245
246
  :key="index"
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { computed, nextTick, ref, watch } from 'vue'
2
+ import { computed, nextTick, onMounted, ref, watch } from 'vue'
3
3
  import { byteLength, formatMs } from '../../utils/format'
4
+ import { errorStatus } from '../../utils/http'
4
5
  import {
5
6
  durationScale,
6
7
  fullDateTime,
@@ -128,16 +129,20 @@ const page = computed(() => {
128
129
  : ''
129
130
  })
130
131
 
131
- const {
132
- data: log,
133
- error,
134
- pending,
135
- refresh,
136
- } = useApiResource<RequestLog>(() =>
137
- requestId.value && isRequestId(requestId.value)
138
- ? `${props.detailUrl}/${encodeURIComponent(requestId.value)}`
139
- : null,
132
+ const logRead = useApiData<RequestLog>(
133
+ () =>
134
+ requestId.value && isRequestId(requestId.value)
135
+ ? `${props.detailUrl}/${encodeURIComponent(requestId.value)}`
136
+ : null,
137
+ // A request's log never changes once captured.
138
+ { refreshOnPageRefresh: false },
140
139
  )
140
+ const { error, refresh } = logRead
141
+ // Another request shows nothing until its log is in.
142
+ const log = computed(() =>
143
+ logRead.placeholder.value ? null : logRead.data.value,
144
+ )
145
+ const pending = computed(() => logRead.pending.value && !log.value)
141
146
  const apiOrigin = useApiOrigin(() => log.value?.apiOrigin)
142
147
 
143
148
  const tab = ref('overview')
@@ -308,33 +313,30 @@ const seeAlso = computed(() => {
308
313
  })
309
314
 
310
315
  // A log stored without the reason of a missing body: the body capture turned
311
- // off says it. Read once per session, only then, and by an owner only: a
312
- // refusal leaves the generic reason.
313
- // Null until asked, false once refused.
314
- const settingsSummary = useDmsState<
315
- { requestLogMaxBodyKb?: number } | false | null
316
- >('dms-api:settings-summary', () => null)
317
- const { $authFetch } = useAuthFetch()
318
-
319
- watch(
320
- log,
321
- (value) => {
322
- if (!value || settingsSummary.value !== null) return
323
- const unexplained =
324
- (!value.requestBody && !value.requestBodyOmitted) ||
325
- (!value.responseBody && !value.responseBodyOmitted)
326
- if (!unexplained) return
327
- settingsSummary.value = false
328
- $authFetch<{ requestLogMaxBodyKb?: number }>(SETTINGS_SUMMARY_API)
329
- .then((summary) => (settingsSummary.value = summary))
330
- .catch(() => undefined)
331
- },
332
- { immediate: true },
316
+ // off says it. Read once per session, only then, in the browser, and by an
317
+ // owner only: a refusal leaves the generic reason.
318
+ const settingsSummary = useApiData<{ requestLogMaxBodyKb?: number }>(
319
+ SETTINGS_SUMMARY_API,
320
+ { immediate: false, server: false, refreshOnPageRefresh: false },
321
+ )
322
+
323
+ onMounted(() =>
324
+ watch(
325
+ log,
326
+ (value) => {
327
+ if (!value || settingsSummary.status.value !== 'idle') return
328
+ const unexplained =
329
+ (!value.requestBody && !value.requestBodyOmitted) ||
330
+ (!value.responseBody && !value.responseBodyOmitted)
331
+ if (unexplained) void settingsSummary.execute()
332
+ },
333
+ { immediate: true },
334
+ ),
333
335
  )
334
336
 
335
337
  function omission(reason: string | null | undefined) {
336
338
  if (reason) return reason
337
- const summary = settingsSummary.value
339
+ const summary = settingsSummary.data.value
338
340
  return summary && summary.requestLogMaxBodyKb === 0 ? 'disabled' : null
339
341
  }
340
342
 
@@ -1,5 +1,12 @@
1
1
  <script setup lang="ts">
2
- import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
2
+ import {
3
+ computed,
4
+ onBeforeUnmount,
5
+ onMounted,
6
+ ref,
7
+ shallowRef,
8
+ watch,
9
+ } from 'vue'
3
10
  import {
4
11
  createRetentionGuard,
5
12
  isLowered,
@@ -39,7 +46,6 @@ const PREVIOUS_PERIOD_DAYS = 30
39
46
 
40
47
  const { t } = useI18n()
41
48
  const { confirm } = useConfirm()
42
- const { $authFetch } = useAuthFetch()
43
49
  const form = useEnclosingForm()
44
50
  const { formatNumber } = useRegionalFormat({ locale: 'format' })
45
51
 
@@ -88,14 +94,16 @@ watch(
88
94
  )
89
95
  onBeforeUnmount(() => clearTimeout(impactTimer))
90
96
 
91
- const impactResource = useApiResource<RetentionImpact>(() =>
97
+ const impactRead = useApiData<RetentionImpact>(() =>
92
98
  impactDays.value == null || !props.id
93
99
  ? null
94
100
  : impactUrlOf(props.id, impactDays.value),
95
101
  )
96
102
  const impact = computed(() =>
97
- lowered.value && impactDays.value === model.value
98
- ? impactResource.data.value
103
+ lowered.value &&
104
+ impactDays.value === model.value &&
105
+ !impactRead.placeholder.value
106
+ ? impactRead.data.value
99
107
  : null,
100
108
  )
101
109
 
@@ -139,25 +147,48 @@ function pendingChange(): RetentionChange | null {
139
147
  }
140
148
 
141
149
  /**
142
- * What a change deletes, read when the dialog opens: a save sent right after
143
- * the change, before the field's own count came back, still says it.
150
+ * What each change deletes, read when the dialog opens: a save sent right
151
+ * after the change, before the field's own count came back, still says it.
152
+ * A count that cannot be read is left out of the dialog.
144
153
  */
145
- async function deletedRequests(change: RetentionChange) {
146
- try {
147
- const read = await $authFetch<RetentionImpact>(
148
- impactUrlOf(change.field, change.to),
149
- )
150
- return t('api.settings.retention.confirm_requests', {
151
- requests: formatNumber(read.requests),
152
- })
153
- } catch {
154
- return undefined
155
- }
156
- }
154
+ const confirmed = shallowRef<RetentionChange[]>([])
155
+ const deletedCounts = useApiData<Array<number | undefined>>(
156
+ () =>
157
+ confirmed.value.length
158
+ ? `dms-api:retention-confirm:${confirmed.value
159
+ .map((change) => impactUrlOf(change.field, change.to))
160
+ .join(' ')}`
161
+ : null,
162
+ ({ $authFetch, signal }) =>
163
+ Promise.all(
164
+ confirmed.value.map((change) =>
165
+ $authFetch<RetentionImpact>(impactUrlOf(change.field, change.to), {
166
+ signal,
167
+ }).then(
168
+ (impact) => impact.requests,
169
+ () => undefined,
170
+ ),
171
+ ),
172
+ ),
173
+ {
174
+ immediate: false,
175
+ server: false,
176
+ watch: false,
177
+ refreshOnPageRefresh: false,
178
+ },
179
+ )
157
180
 
158
181
  /** One dialog for every lowered retention of the form, with what each deletes. */
159
182
  async function askToConfirm(changes: RetentionChange[]): Promise<boolean> {
160
- const counts = await Promise.all(changes.map(deletedRequests))
183
+ confirmed.value = changes
184
+ await deletedCounts.execute()
185
+ const counts = (deletedCounts.data.value ?? []).map((requests) =>
186
+ requests === undefined
187
+ ? undefined
188
+ : t('api.settings.retention.confirm_requests', {
189
+ requests: formatNumber(requests),
190
+ }),
191
+ )
161
192
  return confirm({
162
193
  title: t('api.settings.retention.confirm_title'),
163
194
  description: t('api.settings.retention.confirm_description'),
@@ -1,5 +1,14 @@
1
1
  <script setup lang="ts">
2
- import { computed, onBeforeUnmount, reactive, ref, useId, watch } from 'vue'
2
+ import {
3
+ computed,
4
+ onBeforeUnmount,
5
+ onMounted,
6
+ reactive,
7
+ ref,
8
+ shallowRef,
9
+ useId,
10
+ watch,
11
+ } from 'vue'
3
12
  import {
4
13
  byteLength,
5
14
  formatBytes,
@@ -9,6 +18,7 @@ import {
9
18
  } from '../../utils/format'
10
19
  import {
11
20
  acceptsRequestBody,
21
+ errorStatus,
12
22
  isWritingMethod,
13
23
  pathSegments,
14
24
  statusText,
@@ -111,6 +121,20 @@ interface CapturedRow {
111
121
 
112
122
  type CapturedState = 'idle' | 'loading' | 'found' | 'missing' | 'error'
113
123
 
124
+ /** A backend read of the tester's own flows (a replay, a capture lookup). */
125
+ type ReadJson = <R>(url: string) => Promise<R>
126
+
127
+ /**
128
+ * A read the tester runs when it needs it (a replay, a lookup after a call),
129
+ * in the browser only and never again on the page's refreshes.
130
+ */
131
+ const ON_DEMAND = {
132
+ immediate: false,
133
+ server: false,
134
+ watch: false,
135
+ refreshOnPageRefresh: false,
136
+ } as const
137
+
114
138
  // The tester's own reads of the request logs: by its permission, not the
115
139
  // request logs page's.
116
140
  const LOGS_API = '/api/monitoring/logs/tester'
@@ -159,7 +183,7 @@ const { formatLocale: locale } = useRegionalFormat({ locale: 'format' })
159
183
  const dateFormat = useDateFormat()
160
184
  const toast = useToast()
161
185
  const { confirm } = useConfirm()
162
- const { loggedIn } = useUserSession()
186
+ const { loggedIn } = useDmsUserSession()
163
187
  const currentRoute = useDmsRoute()
164
188
  const router = useDmsRouter()
165
189
  const { $authFetch } = useAuthFetch()
@@ -170,6 +194,8 @@ const {
170
194
  } = useRouteDetail(props.fetchUrl, props.queryKey)
171
195
  const apiOrigin = useApiOrigin(() => route.value?.apiOrigin)
172
196
  const blockerId = useId()
197
+ // Not a `useApiData` read: each call mints a short-lived token, which must
198
+ // never be shared between calls, cached or handed over with the page.
173
199
  const sourceTokens = createSourceTokens(() =>
174
200
  $authFetch<TesterSourceToken>(TESTER_SOURCE_URL),
175
201
  )
@@ -202,6 +228,9 @@ const capturedLog = ref<CapturedRequest | null>(null)
202
228
 
203
229
  // The route the fields belong to, the call in flight and its route.
204
230
  let activeRef: string | null = null
231
+ // The route the fields were filled for: they come from this browser's drafts,
232
+ // history and headers, so the tester shows once mounted, never on a server.
233
+ const filledRef = ref<string | null>(null)
205
234
  let inFlight: { controller: AbortController; ref: string } | null = null
206
235
  let confirming = false
207
236
  let unmounted = false
@@ -612,6 +641,7 @@ function loadRoute(next: string) {
612
641
  sending.value = false
613
642
  }
614
643
  activeRef = next
644
+ filledRef.value = next
615
645
  history.value = loadHistory(next)
616
646
  const draft = loadDraft(next)
617
647
  if (draft) {
@@ -626,12 +656,14 @@ function loadRoute(next: string) {
626
656
  if (typeof replayId === 'string' && replayId) void replay(replayId, next)
627
657
  }
628
658
 
629
- watch(
630
- () => route.value?.ref,
631
- (next) => {
632
- if (next) loadRoute(next)
633
- },
634
- { immediate: true },
659
+ onMounted(() =>
660
+ watch(
661
+ () => route.value?.ref,
662
+ (next) => {
663
+ if (next) loadRoute(next)
664
+ },
665
+ { immediate: true },
666
+ ),
635
667
  )
636
668
 
637
669
  // --- Replay ---
@@ -642,13 +674,23 @@ function dropReplayParam() {
642
674
  return router.replace({ query: rest })
643
675
  }
644
676
 
677
+ const replayedId = shallowRef<string | null>(null)
678
+ const replayRead = useApiData<CapturedRequest>(
679
+ () =>
680
+ replayedId.value
681
+ ? `${LOGS_API}/${encodeURIComponent(replayedId.value)}`
682
+ : null,
683
+ ON_DEMAND,
684
+ )
685
+
645
686
  async function replay(id: string, ref: string) {
646
687
  void dropReplayParam()
647
688
  try {
648
- const log = await $authFetch<CapturedRequest>(
649
- `${LOGS_API}/${encodeURIComponent(id)}`,
650
- )
651
- if (activeRef !== ref) return
689
+ replayedId.value = id
690
+ await replayRead.execute()
691
+ if (replayRead.error.value) throw replayRead.error.value
692
+ const log = replayRead.data.value
693
+ if (activeRef !== ref || !log) return
652
694
  const capturedRef = log.route
653
695
  if (capturedRef !== ref) {
654
696
  toast.add({
@@ -904,10 +946,11 @@ function commit(
904
946
  const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
905
947
 
906
948
  async function findCaptured(
949
+ read: ReadJson,
907
950
  target: TesterResult,
908
951
  ): Promise<CapturedRequest | null> {
909
952
  const id = target.requestId as string
910
- const page = await $authFetch<{ results: CapturedRow[] }>(
953
+ const page = await read<{ results: CapturedRow[] }>(
911
954
  `${LOGS_API}?${new URLSearchParams({ requestId: id })}`,
912
955
  )
913
956
  // Only the call sent: a list that ignored the filter is no answer.
@@ -923,29 +966,44 @@ async function findCaptured(
923
966
  (found.route && activeRef && found.route !== activeRef)
924
967
  )
925
968
  return null
926
- return $authFetch<CapturedRequest>(
927
- `${LOGS_API}/${encodeURIComponent(found._id)}`,
928
- )
969
+ return read<CapturedRequest>(`${LOGS_API}/${encodeURIComponent(found._id)}`)
929
970
  }
930
971
 
972
+ const capturedTarget = shallowRef<TesterResult | null>(null)
973
+ const captured = useApiData<CapturedRequest | null>(
974
+ () =>
975
+ capturedTarget.value?.requestId
976
+ ? `dms-api:tester-captured:${capturedTarget.value.requestId}`
977
+ : null,
978
+ ({ $authFetch, signal }) =>
979
+ findCaptured(
980
+ (url) => $authFetch(url, { signal }),
981
+ capturedTarget.value as TesterResult,
982
+ ),
983
+ ON_DEMAND,
984
+ )
985
+
931
986
  async function lookUpCaptured(target: TesterResult, retry: boolean) {
932
987
  const id = target.requestId
933
988
  if (!id) return
934
989
  capturedState.value = 'loading'
990
+ const current = () =>
991
+ result.value?.requestId === id && capturedTarget.value?.requestId === id
935
992
  for (const delay of retry ? CAPTURE_DELAYS_MS : [0]) {
936
993
  if (delay) await wait(delay)
937
994
  if (result.value?.requestId !== id) return
938
- try {
939
- const log = await findCaptured(target)
940
- if (result.value?.requestId !== id) return
941
- if (log) {
942
- capturedLog.value = log
943
- capturedState.value = 'found'
944
- keepCaptured(id, log)
945
- return
946
- }
947
- } catch {
948
- if (result.value?.requestId === id) capturedState.value = 'error'
995
+ capturedTarget.value = target
996
+ await captured.execute()
997
+ if (!current()) return
998
+ if (captured.error.value) {
999
+ capturedState.value = 'error'
1000
+ return
1001
+ }
1002
+ const log = captured.data.value
1003
+ if (log) {
1004
+ capturedLog.value = log
1005
+ capturedState.value = 'found'
1006
+ keepCaptured(id, log)
949
1007
  return
950
1008
  }
951
1009
  }
@@ -1204,7 +1262,7 @@ const shortcut = computed(() =>
1204
1262
 
1205
1263
  <template>
1206
1264
  <div v-if="!selection.ref.value" />
1207
- <USkeleton v-else-if="pending" class="h-72" />
1265
+ <USkeleton v-else-if="pending || (route && !filledRef)" class="h-72" />
1208
1266
  <div
1209
1267
  v-else-if="route"
1210
1268
  class="flex flex-col gap-4"
@@ -81,13 +81,13 @@ const { formatLocale: locale, formatNumber } = useRegionalFormat({
81
81
  locale: 'format',
82
82
  })
83
83
  const selection = useRouteSelection(props.queryKey)
84
- const { data, error, pending, refresh } = useApiResource<{
84
+ const { data, error, pending, refresh } = useApiData<{
85
85
  routes: RouteRow[]
86
86
  /** Minutes of traffic each state is judged on. */
87
87
  healthWindowMinutes?: number
88
88
  /** Minutes of traffic each request count covers. */
89
89
  requestsWindowMinutes?: number
90
- }>(() => props.fetchUrl)
90
+ }>(() => props.fetchUrl, { refreshOnPageRefresh: false })
91
91
 
92
92
  // Live, the states and counts are read again in place, at the page's pace:
93
93
  // the list keeps its order, its scroll and the focus.
@@ -377,13 +377,13 @@ const count = (value: number) =>
377
377
  <template>
378
378
  <DmsCard
379
379
  :padded="false"
380
- class="flex flex-col overflow-hidden @5xl:max-h-[calc(100dvh-2rem)] @5xl:min-h-[24rem]"
380
+ class="@5xl:max-h-[calc(100dvh-2rem)] @5xl:min-h-[24rem] flex flex-col overflow-hidden"
381
381
  >
382
382
  <!-- Stacked above the detail, the list folds to the route it shows. -->
383
383
  <button
384
384
  ref="foldToggle"
385
385
  type="button"
386
- class="hover:bg-elevated flex items-center gap-2 px-3 py-2.5 text-left text-[13px] @5xl:hidden"
386
+ class="hover:bg-elevated @5xl:hidden flex items-center gap-2 px-3 py-2.5 text-left text-[13px]"
387
387
  :aria-expanded="listOpen"
388
388
  aria-controls="api-route-list"
389
389
  @click="listOpen = !listOpen"
@@ -407,7 +407,7 @@ const count = (value: number) =>
407
407
 
408
408
  <div
409
409
  id="api-route-list"
410
- class="border-default flex min-h-0 flex-1 flex-col @max-5xl:border-t"
410
+ class="border-default @max-5xl:border-t flex min-h-0 flex-1 flex-col"
411
411
  :class="!listOpen && '@max-5xl:hidden'"
412
412
  >
413
413
  <div class="border-default flex flex-col gap-2.5 border-b p-3">
@@ -461,7 +461,7 @@ const count = (value: number) =>
461
461
 
462
462
  <div
463
463
  ref="scroller"
464
- class="relative min-h-0 flex-1 overflow-y-auto py-1.5 @max-5xl:max-h-[50vh]"
464
+ class="@max-5xl:max-h-[50vh] relative min-h-0 flex-1 overflow-y-auto py-1.5"
465
465
  >
466
466
  <p
467
467
  v-if="healthWindow && routes.length"
@@ -469,7 +469,7 @@ const count = (value: number) =>
469
469
  >
470
470
  {{ t('api.routes.tree.window', { window: healthWindow }) }}
471
471
  </p>
472
- <div v-if="pending" class="flex flex-col gap-2 px-3 py-2">
472
+ <div v-if="pending && !data" class="flex flex-col gap-2 px-3 py-2">
473
473
  <USkeleton v-for="index in 8" :key="index" class="h-6 w-full" />
474
474
  </div>
475
475
  <DmsEmptyState
@@ -668,8 +668,8 @@ const count = (value: number) =>
668
668
  @click="toggleAll"
669
669
  />
670
670
  </UTooltip>
671
- <UKbd value="↑" size="sm" class="shrink-0 @max-5xl:hidden" />
672
- <UKbd value="↓" size="sm" class="shrink-0 @max-5xl:hidden" />
671
+ <UKbd value="↑" size="sm" class="@max-5xl:hidden shrink-0" />
672
+ <UKbd value="↓" size="sm" class="@max-5xl:hidden shrink-0" />
673
673
  </div>
674
674
  </div>
675
675
  </DmsCard>
@@ -25,8 +25,9 @@ const props = defineProps<{
25
25
 
26
26
  const { t } = useI18n()
27
27
  const { formatNumber } = useRegionalFormat({ locale: 'format' })
28
- const summary = useApiResource<{ scope: Scope; routes: number }>(
28
+ const summary = useApiData<{ scope: Scope; routes: number }>(
29
29
  () => props.fetchUrl,
30
+ { refreshOnPageRefresh: false },
30
31
  )
31
32
 
32
33
  const scope = computed(() => summary.data.value?.scope ?? props.scope ?? 'own')
@@ -44,27 +45,30 @@ const label = computed(() =>
44
45
  */
45
46
  const REFRESH_INTERVAL_MS = 60_000
46
47
 
47
- // When the chip last asked, so that a failing read is not retried each tick.
48
+ // When the chip last asked (the mount reads it), so that a failing read is
49
+ // not retried each tick.
48
50
  let lastAskedAt = Date.now()
49
51
 
50
- function refreshIfStale() {
51
- const last = Math.max(lastAskedAt, summary.receivedAt.value ?? 0)
52
- if (Date.now() - last < REFRESH_INTERVAL_MS) return
52
+ function read() {
53
53
  lastAskedAt = Date.now()
54
54
  void summary.refresh()
55
55
  }
56
56
 
57
+ function refreshIfStale() {
58
+ if (Date.now() - lastAskedAt >= REFRESH_INTERVAL_MS) read()
59
+ }
60
+
57
61
  usePageLiveRefresh(refreshIfStale)
58
62
  if (props.realtimeTopic) useLiveMissedErrors(props.realtimeTopic)
59
63
 
60
64
  function refreshWhenShown() {
61
- if (document.visibilityState === 'visible') void summary.refresh()
65
+ if (document.visibilityState === 'visible') read()
62
66
  }
63
67
 
64
68
  // The first activation follows the mount, which already read the scope.
65
69
  let activated = false
66
70
  onActivated(() => {
67
- if (activated) void summary.refresh()
71
+ if (activated) read()
68
72
  activated = true
69
73
  })
70
74