| 12345678910111213141516171819202122232425262728293031 |
- import { fetchBaseArchives } from '../../../src/modules/cockpit/services/infrastructureApi.js'
- import { fetchMapSnapshot } from '../../../src/modules/cockpit/services/mapApi.js'
- import { requestCockpitJson } from '../../../src/modules/cockpit/services/cockpitApi.js'
- const base = 'http://192.168.110.96:8301/api/cockpit/v1'
- const config = { dataSource: 'real', api: { baseUrl: base } }
- const raw = await requestCockpitJson('/infrastructure/base-archives', { config })
- console.log('--- requestCockpitJson 原始返回 ---')
- console.log(JSON.stringify({
- ok: raw.ok, status: raw.status, mode: raw.mode,
- payloadTopLevelKeys: Object.keys(raw.data || {}),
- hasTotals: !!(raw.data && raw.data.totals),
- totalsFacilityCount: raw.data && raw.data.totals && raw.data.totals.facilityCount,
- }, null, 2))
- const section = await fetchBaseArchives({ config })
- console.log('--- fetchBaseArchives 分区结果 ---')
- console.log(JSON.stringify({
- state: section.state, reason: section.reason, mode: section.mode,
- facilityCount: section.data && section.data.facilityCount,
- dataKeys: section.data ? Object.keys(section.data) : null,
- missing: section.data ? section.data.missing : null,
- }, null, 2))
- const map = await fetchMapSnapshot({ config, pageSize: 1000 })
- console.log('--- fetchMapSnapshot 分区结果 ---')
- console.log(JSON.stringify({
- state: map.state, total: map.data && map.data.total, snapshotAt: map.data && map.data.snapshotAt,
- objectCount: map.data && map.data.objects ? map.data.objects.length : null,
- }, null, 2))
|