mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-ui.git
synced 2025-10-29 18:02:31 +00:00
Merge pull request #28 from stephb9959/main
Fixing device list if we receive 0 devices
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ucentral-client",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ucentral-client",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"dependencies": {
|
||||
"@coreui/coreui": "^3.4.0",
|
||||
"@coreui/icons": "^2.0.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ucentral-client",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.1",
|
||||
"dependencies": {
|
||||
"@coreui/coreui": "^3.4.0",
|
||||
"@coreui/icons": "^2.0.1",
|
||||
|
||||
@@ -170,6 +170,7 @@
|
||||
"configuration": {
|
||||
"add_configuration": "Konfiguration hinzufügen",
|
||||
"add_new_block": "Neuen Konfigurationsblock hinzufügen",
|
||||
"add_or_link": "Verlinken oder hinzufügen",
|
||||
"cannot_delete": "Diese Konfiguration kann nicht gelöscht werden, da sie von mindestens einer Entität, einem Veranstaltungsort oder einem Gerät verwendet wird",
|
||||
"choose_section": "Welchen Abschnitt soll dieser Block enthalten?",
|
||||
"configuration_browser": "Konfigurationsbrowser",
|
||||
|
||||
@@ -170,6 +170,7 @@
|
||||
"configuration": {
|
||||
"add_configuration": "Add Configuration",
|
||||
"add_new_block": "Add new Configuration Block",
|
||||
"add_or_link": "Link or Add",
|
||||
"cannot_delete": "This configuration cannot be deleted because it is being used by at least one entity, venue or device",
|
||||
"choose_section": "Which section you would like this block to contain?",
|
||||
"configuration_browser": "Configuration Browser",
|
||||
|
||||
@@ -170,6 +170,7 @@
|
||||
"configuration": {
|
||||
"add_configuration": "Agregar configuración",
|
||||
"add_new_block": "Agregar nuevo bloque de configuración",
|
||||
"add_or_link": "Vincular o agregar",
|
||||
"cannot_delete": "Esta configuración no se puede eliminar porque está siendo utilizada por al menos una entidad, lugar o dispositivo",
|
||||
"choose_section": "Qué sección le gustaría que contenga este bloque?",
|
||||
"configuration_browser": "Navegador de configuración",
|
||||
|
||||
@@ -170,6 +170,7 @@
|
||||
"configuration": {
|
||||
"add_configuration": "Ajouter une configuration",
|
||||
"add_new_block": "Ajouter un nouveau bloc de configuration",
|
||||
"add_or_link": "Lier ou ajouter",
|
||||
"cannot_delete": "Cette configuration ne peut pas être supprimée car elle est utilisée par au moins une entité, un lieu ou un appareil",
|
||||
"choose_section": "Quelle section souhaitez-vous que ce bloc contienne?",
|
||||
"configuration_browser": "Navigateur de configuration",
|
||||
|
||||
@@ -170,6 +170,7 @@
|
||||
"configuration": {
|
||||
"add_configuration": "Adicionar configuração",
|
||||
"add_new_block": "Adicionar novo bloco de configuração",
|
||||
"add_or_link": "Link ou adicionar",
|
||||
"cannot_delete": "Esta configuração não pode ser excluída porque está sendo usada por pelo menos uma entidade, local ou dispositivo",
|
||||
"choose_section": "Qual seção você gostaria que este bloco contivesse?",
|
||||
"configuration_browser": "Navegador de configuração",
|
||||
|
||||
@@ -77,25 +77,30 @@ const DeviceList = () => {
|
||||
fullDevices = response.data.devicesWithStatus;
|
||||
const serialsToGet = fullDevices.map((device) => device.serialNumber);
|
||||
|
||||
if (serialsToGet.length === 0) {
|
||||
return null;
|
||||
}
|
||||
return axiosInstance.get(
|
||||
`${endpoints.owfms}/api/v1/firmwareAge?select=${serialsToGet}`,
|
||||
options,
|
||||
);
|
||||
})
|
||||
.then((response) => {
|
||||
fullDevices = fullDevices.map((device, index) => {
|
||||
const foundAgeDate = response.data.ages[index].age !== undefined;
|
||||
if (foundAgeDate) {
|
||||
return {
|
||||
...device,
|
||||
firmwareInfo: {
|
||||
age: response.data.ages[index].age,
|
||||
latest: response.data.ages[index].latest,
|
||||
},
|
||||
};
|
||||
}
|
||||
return device;
|
||||
});
|
||||
if (response !== null) {
|
||||
fullDevices = fullDevices.map((device, index) => {
|
||||
const foundAgeDate = response.data.ages[index].age !== undefined;
|
||||
if (foundAgeDate) {
|
||||
return {
|
||||
...device,
|
||||
firmwareInfo: {
|
||||
age: response.data.ages[index].age,
|
||||
latest: response.data.ages[index].latest,
|
||||
},
|
||||
};
|
||||
}
|
||||
return device;
|
||||
});
|
||||
}
|
||||
setDevices(fullDevices);
|
||||
setLoading(false);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user