Skip to content

MongocampServerStatus ​

A compact block that says which server the app talks to and how it is doing: a coloured dot, the server's name, the MongoCamp and MongoDB versions, connections in use and the uptime. Made for the foot of a sidebar. For the full picture use MongocampServerInfo.

Usage ​

vue
<template>
  <MongocampServerStatus />
</template>

In a sidebar that can collapse, show only the dot:

vue
<MongocampServerStatus :collapsed="collapsed" />

The component brings no padding or border — set them with class.

Props ​

PropTypeDefaultDescription
collapsedbooleanfalseShow only the coloured dot; the health text is its tooltip and its accessible name
autoRefreshnumber30Reload every N seconds; 0 turns it off. Pauses while the browser tab is hidden and slows down while the server does not answer
detailsPathstringmodule option paths.serverWhere the block links to. '' removes the link

What it shows ​

HealthDotWhen
Server reachablegreenEverything that was asked answered
Server reachable, some details unavailableamberA request failed or the server refused it, or the load came without connection numbers (the database user lacks MongoDB's clusterMonitor role)
Server not reachableredNo request got any answer (network error, timeout)

The health is always there as text too (visually hidden next to the dot), so it does not depend on colour.

As a link, the block is named by what it shows (so voice control can use the visible server name), followed by visually hidden "Server status details".

What appears depends on who is looking:

ViewerShownRequests
Not signed inServer name and MongoCamp version (from the runtime plugin)none
Signed in, not an administratorname, MongoCamp version and the MongoDB major version; ok while the server answersGET /system/capabilities (every user may read it)
Administrator, or server proxy modeplus connections, a usage meter and the uptime; the block is a link to the server pageGET /system/info, GET /system/stats

Server 2.11: the block also asks /health/ready (no login needed, so a signed-out page gets a status too). A 503 — a failing check such as migrations — makes it partial and names the check in the health text ("not ready: migrations"); no answer from anything is down. useMongocampConnection().check() (the offline option) asks /health/live.

Both /system/info and /system/stats are for administrators only, so a known non-administrator is not asked for them. A refused request (the server answered with an error) makes the health partial: the block then shows the name and version and "some details unavailable"; only no answer at all is down.

Exposed ​

MethodDescription
refresh()Load again now. Never rejects

Released under the MIT License.