Skip to content

Commit

Permalink
Add MQTT Client info to stats endpoint and Admin overview
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Nov 5, 2024
1 parent af2c6e5 commit aa7e28b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion forge/routes/api/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ module.exports = async function (app) {
if (Object.hasOwn(license, 'devices')) {
result.maxDevices = license.devices
}
if (app.license.active()) {
const { mqttClients } = await app.license.usage('mqttClients')
result.maxMqttClients = mqttClients.limit
result.mqttClientCount = mqttClients.count
}
userCount.forEach(u => {
result.userCount += u.count
if (u.admin === 1) {
if (u.admin) {
result.adminCount = u.count
}
})
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/pages/admin/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
<td>{{ stats.instanceCount + stats.deviceCount }} / {{ stats.maxInstances }}</td>
</tr>
</template>
<template v-if="stats.maxMqttClients">
<tr>
<td class="w-40">Team MQTT Clients</td>
<td>{{ stats.mqttClientCount }} / {{ stats.maxMqttClients }}</td>
</tr>
</template>
</table>
</div>
<div>
Expand Down

0 comments on commit aa7e28b

Please sign in to comment.