()
| 10 | let started = false |
| 11 | |
| 12 | function 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 | |
| 34 | export function useControlInfo() { |
| 35 | probe() |
no test coverage detected