MCPcopy
hub / github.com/MetaCubeX/metacubexd / probe

Function probe

packages/ui/composables/useControlInfo.ts:12–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10let started = false
11
12function probe() {
13 if (started) return
14 started = true
15 const api = useControlApi()
16 api
17 .getInfo()
18 .then((res) => {
19 info.value = res
20 hasAgent.value = res.hasAgent === true
21 features.value = Array.isArray(res.features) ? res.features : []
22 })
23 .catch(() => {
24 // 404 or network error => plain remote panel mode (today's behaviour).
25 hasAgent.value = false
26 features.value = []
27 info.value = null
28 })
29 .finally(() => {
30 ready.value = true
31 })
32}
33
34export function useControlInfo() {
35 probe()

Callers 1

useControlInfoFunction · 0.70

Calls 1

useControlApiFunction · 0.90

Tested by

no test coverage detected