Skip to content

MongocampServerOverview ​

What an admin wants to see first: how much the server holds and where. Stat cards, the biggest collections (a chart and a ranked list that links to each collection), the share of storage, the databases, the cluster and the next scheduled jobs. Read-only.

Usage ​

vue
<template>
  <MongocampServerOverview
    info-path="/admin/collections"
    data-path="/admin/collections"
    jobs-path="/admin/jobs"
    :auto-refresh="60"
  />
</template>

Props ​

PropTypeDefaultDescription
infoPathstring/secured/admin/collectionsBase path of the page rendering MongocampCollectionInfos (<infoPath>/<name>)
dataPathstring/secured/admin/collectionsBase path of the data pages (<dataPath>/<name>/data)
jobsPathstring/secured/admin/jobsTarget of All jobs
topNnumber10How many collections the ranking and the chart show
maxCollectionsnumber200Read at most this many collections
autoRefreshnumber0Reload every N seconds (at least 1; 0 = off) through useMongocampAutoRefresh: pauses in a hidden tab, backs off after failures; a failed background reload keeps the numbers on screen
hideChartsbooleanfalseThe cards and lists only, no charts
hideHeadingbooleanfalseHide the component's own heading, e.g. when the page around it already shows a title. The toolbar stays. The subtitle goes with it.
hideRefreshbooleanfalseHide the component's own reload button, e.g. when the page calls the exposed refresh() from its own header.

In a page with its own header ​

The component can hand its toolbar to the page around it:

  • refresh() is exposed — call it through a template ref from your own reload button, and set hideRefresh to drop the built-in one.
  • toolbar slot — your own buttons, placed beside the built-in ones.
vue
<script setup lang="ts">
const list = useTemplateRef<{ refresh: () => void }>('list')
</script>

<template>
  <header>
    <h1>My title</h1>
    <UButton icon="i-lucide-refresh-cw" @click="list?.refresh()" />
  </header>
  <MongocampServerOverview ref="list" hide-heading hide-refresh>
    <template #toolbar>
      <UButton>Mine</UButton>
    </template>
  </MongocampServerOverview>
</template>

What it shows ​

PartContent
Stat cardsdatabases (with the size on disk), collections, documents, storage of the collections, index weight (and its share of the size on disk)
Biggest collectionsRank by storage on disk, documents, average document size or index size; a bar chart and a ranked list (info link on the name, a data link per row)
Share of storagea donut: the five biggest collections and one slice for all the others
Databasessize on disk per database (a bar chart when there are several) and a list, empty marked
Clusterthe members, with Coordinator and Site master badges
Next jobsthe next five scheduled runs, soonest first; a job with no next run is left out

MongoCamp's own mc_* collections are not counted. GridFS buckets are: their .files and .chunks collections hold the bytes.

Requests, limits and failures ​

  • One request for all collections (GET /mongodb/collections/info, server 1.7.0).
  • Capped at maxCollections (200). If there are more, the overview says 4 of 6 collections were read; 2 were left out.
  • Every part stands on its own. If the databases, the cluster or the jobs cannot be read, a warning names the part with Try again and the rest still shows. A collection the server lists as unavailable is named (1 collections could not be read: users).

The charts are MongocampChart and have a text description and a table alternative.

Released under the MIT License.