+
+ Realm
+
+ {astarte.realm}
+
+ Connected devices
+
+
+ {devicesStatsFetcher.value != null
+ ? `${devicesStatsFetcher.value.connectedDevices} / ${devicesStatsFetcher.value.totalDevices}`
+ : '-'}
+
+
+ Registered devices
+
+
+ {devicesStatsFetcher.value != null
+ ? deviceRegistrationLimitFetcher.value != null
+ ? `${devicesStatsFetcher.value.totalDevices} / ${deviceRegistrationLimitFetcher.value}`
+ : devicesStatsFetcher.value.totalDevices
+ : '-'}
+
+
+ API Status
+
+
+
+ {isApiHealthy ? 'Up and running' : 'Degraded'}
+
+
+ );
+};
interface SidebarAppInfoProps {
appVersion: string;
diff --git a/src/astarte-client/client.ts b/src/astarte-client/client.ts
index 5204ab08..223be04e 100644
--- a/src/astarte-client/client.ts
+++ b/src/astarte-client/client.ts
@@ -176,6 +176,7 @@ class AstarteClient {
this.listeners = {};
this.getConfigAuth = this.getConfigAuth.bind(this);
+ this.getDeviceRegistrationLimit = this.getDeviceRegistrationLimit.bind(this);
this.getBlocks = this.getBlocks.bind(this);
this.getDeviceData = this.getDeviceData.bind(this);
this.getDevicesStats = this.getDevicesStats.bind(this);
@@ -198,6 +199,7 @@ class AstarteClient {
this.apiConfig = {
realmManagementHealth: astarteAPIurl`${config.realmManagementApiUrl}health`,
auth: astarteAPIurl`${config.realmManagementApiUrl}v1/${'realm'}/config/auth`,
+ deviceRegistrationLimit: astarteAPIurl`${config.realmManagementApiUrl}v1/${'realm'}/config/device_registration_limit`,
interfaces: astarteAPIurl`${config.realmManagementApiUrl}v1/${'realm'}/interfaces`,
interfaceMajors: astarteAPIurl`${config.realmManagementApiUrl}v1/${'realm'}/interfaces/${'interfaceName'}`,
interface: astarteAPIurl`${config.realmManagementApiUrl}v1/${'realm'}/interfaces/${'interfaceName'}/${'interfaceMajor'}`,
@@ -268,6 +270,11 @@ astarteAPIurl`${config.realmManagementApiUrl}v1/${'realm'}/interfaces/${'interfa
});
}
+ async getDeviceRegistrationLimit(): Promise