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 administratorplus the MongoDB versionGET /system/info
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

Both endpoints need MongoCamp server 1.9.0. An older server answers them with an error: the block then shows the name and version and "some details unavailable".

Exposed ​

MethodDescription
refresh()Load again now. Never rejects

Released under the MIT License.