From ac0398d8f37b9bb6a34dc214c124589c8eb9047c Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 1 Sep 2021 09:02:20 -0400 Subject: [PATCH 01/13] Modified endpoints to match new naming convention --- package.json | 4 +-- public/locales/de/translation.json | 27 +++++++++++++++++-- public/locales/en/translation.json | 27 +++++++++++++++++-- public/locales/es/translation.json | 27 +++++++++++++++++-- public/locales/fr/translation.json | 27 +++++++++++++++++-- public/locales/pt/translation.json | 27 +++++++++++++++++-- src/components/BlinkModal/index.js | 2 +- src/components/CommandHistory/index.js | 9 +++---- src/components/ConfigureModal/index.js | 2 +- src/components/CreateUserModal/index.js | 8 +++--- src/components/DeleteLogModal/index.js | 2 +- src/components/DeviceActionCard/index.js | 4 +-- src/components/DeviceConfiguration/index.js | 7 ++--- src/components/DeviceFirmwareModal/index.js | 4 +-- src/components/DeviceHealth/index.js | 2 +- src/components/DeviceListTable/index.js | 21 ++++++--------- src/components/DeviceLogs/index.js | 2 +- src/components/DeviceSearchBar/index.js | 4 +-- src/components/DeviceStatusCard/index.js | 4 +-- src/components/EditUserModal/index.js | 12 ++++----- src/components/EventQueueModal/index.js | 6 +---- src/components/FactoryResetModal/index.js | 2 +- src/components/FirmwareHistoryModal/index.js | 2 +- .../UpgradeWaitingBody.js | 7 ++--- src/components/FirmwareUpgradeModal/index.js | 8 +++--- .../LatestStatisticsModal.js | 2 +- .../StatisticsChartList.js | 2 +- src/components/LifetimeStatsModal/index.js | 2 +- src/components/RebootModal/index.js | 2 +- .../TraceModal/WaitingForTraceBody.js | 7 ++--- src/components/TraceModal/index.js | 4 +-- src/components/WifiScanModal/index.js | 2 +- src/layout/index.js | 2 +- src/pages/DeviceDashboard/index.js | 2 +- src/pages/FirmwareDashboard/index.js | 4 +-- src/pages/FirmwareListPage/index.js | 15 +++++------ src/pages/LoginPage/index.js | 2 +- src/pages/ProfilePage/index.js | 16 +++++------ src/pages/UserListPage/index.js | 8 +++--- src/pages/WifiAnalysisPage/index.js | 5 +--- 40 files changed, 205 insertions(+), 117 deletions(-) diff --git a/package.json b/package.json index e2d468d..f78e9b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ucentral-client", - "version": "2.1.0", + "version": "2.1.1", "dependencies": { "@coreui/coreui": "^3.4.0", "@coreui/icons": "^2.0.1", @@ -26,7 +26,7 @@ "react-tooltip": "^4.2.21", "react-widgets": "^5.1.1", "sass": "^1.35.1", - "ucentral-libs": "^0.8.82", + "ucentral-libs": "^0.8.93", "uuid": "^8.3.2" }, "main": "index.js", diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json index 8db1640..35d0636 100644 --- a/public/locales/de/translation.json +++ b/public/locales/de/translation.json @@ -81,6 +81,7 @@ "endpoint": "Endpunkt", "endpoints": "Endpunkte", "error": "Fehler", + "error_adding_note": "Fehler beim Hinzufügen einer Notiz", "execute_now": "Möchten Sie diesen Befehl jetzt ausführen?", "executed": "Ausgeführt", "exit": "Ausgang", @@ -136,6 +137,7 @@ "serial_number": "Seriennummer", "show_all": "Zeige alles", "start": "Start", + "stop_editing": "Stoppen Sie die Bearbeitung", "submit": "Absenden", "submitted": "Eingereicht", "success": "Erfolg", @@ -196,14 +198,20 @@ "add_failure": "Fehler, der Server hat zurückgegeben: {{error}}", "add_root": "Root-Entität hinzufügen", "add_success": "Entität erfolgreich erstellt!", + "assigned_inventory": "Zugewiesenes Inventar", "cannot_delete": "Entitäten mit untergeordneten Elementen können nicht gelöscht werden. Löschen Sie die untergeordneten Elemente dieser Entität, um sie löschen zu können.", "delete_success": "Entität erfolgreich gelöscht", "delete_warning": "Achtung: Dieser Vorgang kann nicht rückgängig gemacht werden", "edit_failure": "Aktualisierung fehlgeschlagen : {{error}}", "entities": "Entitäten", "entity": "Entität", + "error_fetch_entity": "Fehler beim Abrufen von Entitätsinformationen", + "error_fetching": "Fehler beim Abrufen von Entitäten", + "error_saving": "Fehler beim Speichern der Entität", + "not_assigned": "Nicht zugeordnet", "only_unassigned": "Nur nicht zugewiesen", - "valid_serial": "Muss eine gültige Seriennummer sein (12 HEX-Zeichen)" + "valid_serial": "Muss eine gültige Seriennummer sein (12 HEX-Zeichen)", + "venues": "Veranstaltungsorte" }, "factory_reset": { "redirector": "Gatewaykonfiguration beibehalten:", @@ -251,17 +259,32 @@ "title": "Gesundheitzustand" }, "inventory": { + "add_child": "Untergeordneten Veranstaltungsort hinzufügen", "add_child_venue": "Untergeordneten Veranstaltungsort zu {{entityName}}hinzufügen", - "add_tag": "Tag hinzufügen", + "add_tag": "Tag erstellen", "add_tag_to": "Inventar-Tag zu {{name}}hinzufügen", + "add_venue": "Veranstaltungsort hinzufügen", + "assign_entity_instructions": "Sie können die Entität, der dieses Tag zugewiesen werden soll, entweder über das Menü unten finden oder die UUID der Entität manuell in das Feld oben einfügen.", "assign_error": "Fehler beim Versuch, Tag zuzuweisen", "assign_to_entity": "Zu Entität zuweisen", + "close_entity_menu": "Menü \"Entität bearbeiten\" schließen", + "delete_tag": "Tag endgültig löschen", + "deletion_failure": "Löschfehler", + "error_create_venue": "Fehler beim Erstellen des Veranstaltungsortes", + "error_delete_tag": "Fehler beim Löschen des Inventar-Tags", + "error_get_venue": "Fehler beim Abrufen von Veranstaltungsorten", "error_retrieving": "Beim Abrufen von Inventar-Tags ist ein Fehler aufgetreten", "error_unassign": "Fehler beim Aufheben der Zuweisung", + "error_update_venue": "Fehler beim Aktualisieren des Veranstaltungsorts", + "error_venue_delete": "Fehler beim Löschen des Veranstaltungsortes", "subscriber": "Teilnehmer", "successful_assign": "Tag erfolgreich zugewiesen", + "successful_tag_delete": "Inventar-Tag erfolgreich gelöscht", "successful_tag_update": "Tag erfolgreich aktualisiert", "successful_unassign": "Vorgang zum Aufheben der Zuweisung war erfolgreich", + "successful_venue_create": "Erfolgreich erstellter Veranstaltungsort", + "successful_venue_delete": "Veranstaltungsort erfolgreich gelöscht", + "successful_venue_update": "Erfolgreich aktualisierter Veranstaltungsort", "tag_created": "Inventar-Tag erfolgreich erstellt", "tag_creation_error": "Fehler beim Versuch, Inventar-Tag zu erstellen", "tag_update_error": "Fehler beim Aktualisieren des Tags", diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index a6ab5bf..13ff8d0 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -81,6 +81,7 @@ "endpoint": "Endpoint", "endpoints": "Endpoints", "error": "Error", + "error_adding_note": "Error while adding note", "execute_now": "Would you like to execute this command now?", "executed": "Executed", "exit": "Exit", @@ -136,6 +137,7 @@ "serial_number": "Serial Number", "show_all": "Show All", "start": "Start", + "stop_editing": "Stop Editing", "submit": "Submit", "submitted": "Submitted", "success": "Success", @@ -196,14 +198,20 @@ "add_failure": "Error, the server returned : {{error}}", "add_root": "Add Root Entity", "add_success": "Entity Successfully Created!", + "assigned_inventory": "Assigned Inventory", "cannot_delete": "You cannot delete entities which have children. Delete this entity's children to be able to delete it.", "delete_success": "Entity Successfully Deleted", "delete_warning": "Warning: this operation cannot be reverted", "edit_failure": "Update unsuccessful : {{error}}", "entities": "Entities", "entity": "Entity", + "error_fetch_entity": "Error while fetching entity information", + "error_fetching": "Error while fetching entities", + "error_saving": "Error while saving entity", + "not_assigned": "Not Assigned", "only_unassigned": "Only Unassigned", - "valid_serial": "Needs to be a valid serial number (12 HEX characters)" + "valid_serial": "Needs to be a valid serial number (12 HEX characters)", + "venues": "Venues" }, "factory_reset": { "redirector": "Keep redirector: ", @@ -251,17 +259,32 @@ "title": "Health" }, "inventory": { + "add_child": "Add Child Venue", "add_child_venue": "Add Child Venue to {{entityName}}", - "add_tag": "Add Tag", + "add_tag": "Create Tag", "add_tag_to": "Add Inventory Tag to {{name}}", + "add_venue": "Add Venue", + "assign_entity_instructions": "You can either find the entity you want this tag to be assigned to by using the menu below, or you can manually paste the entity's UUID in the field above.", "assign_error": "Error while trying to assign tag", "assign_to_entity": "Assign to Entity", + "close_entity_menu": "Close Edit Entity Menu", + "delete_tag": "Permanently Delete Tag", + "deletion_failure": "Deletion error", + "error_create_venue": "Error while creating venue", + "error_delete_tag": "Error while deleting inventory tag", + "error_get_venue": "Error while retrieving venues", "error_retrieving": "Error occurred while retrieving inventory tags", "error_unassign": "Error during unassign operation", + "error_update_venue": "Error while updating venue", + "error_venue_delete": "Error while deleting venue", "subscriber": "Subscriber", "successful_assign": "Tag successfully assigned", + "successful_tag_delete": "Inventory Tag Successfully Deleted", "successful_tag_update": "Successfully updated tag", "successful_unassign": "Unassign operation was successful", + "successful_venue_create": "Successfully Created Venue", + "successful_venue_delete": "Venue successfully deleted", + "successful_venue_update": "Successfully Updated Venue", "tag_created": "Inventory tag successfully created", "tag_creation_error": "Error while trying to create inventory tag", "tag_update_error": "Error while updating tag", diff --git a/public/locales/es/translation.json b/public/locales/es/translation.json index f4f9818..0211983 100644 --- a/public/locales/es/translation.json +++ b/public/locales/es/translation.json @@ -81,6 +81,7 @@ "endpoint": "punto final", "endpoints": "Puntos finales", "error": "Error", + "error_adding_note": "Error al agregar una nota", "execute_now": "¿Le gustaría ejecutar este comando ahora?", "executed": "ejecutado", "exit": "salida", @@ -136,6 +137,7 @@ "serial_number": "Número de serie", "show_all": "Mostrar todo", "start": "comienzo", + "stop_editing": "Dejar de editar", "submit": "Enviar", "submitted": "Presentado", "success": "Éxito", @@ -196,14 +198,20 @@ "add_failure": "Error, el servidor devolvió: {{error}}", "add_root": "Agregar entidad raíz", "add_success": "¡Entidad creada con éxito!", + "assigned_inventory": "Inventario asignado", "cannot_delete": "No puede eliminar entidades que tienen hijos. Elimina los hijos de esta entidad para poder eliminarla.", "delete_success": "Entidad eliminada correctamente", "delete_warning": "Advertencia: esta operación no se puede revertir", "edit_failure": "Actualización fallida: {{error}}", "entities": "entidades", "entity": "Entidad", + "error_fetch_entity": "Error al obtener la información de la entidad", + "error_fetching": "Error al recuperar entidades", + "error_saving": "Error al guardar la entidad", + "not_assigned": "No asignado", "only_unassigned": "Solo sin asignar", - "valid_serial": "Debe ser un número de serie válido (12 caracteres HEX)" + "valid_serial": "Debe ser un número de serie válido (12 caracteres HEX)", + "venues": "Sedes" }, "factory_reset": { "redirector": "Mantener el redirector:", @@ -251,17 +259,32 @@ "title": "Salud" }, "inventory": { + "add_child": "Agregar lugar secundario", "add_child_venue": "Agregar lugar infantil a {{entityName}}", - "add_tag": "Añadir etiqueta", + "add_tag": "Crear etiqueta", "add_tag_to": "Agregar etiqueta de inventario a {{name}}", + "add_venue": "Agregar lugar", + "assign_entity_instructions": "Puede encontrar la entidad a la que desea que se asigne esta etiqueta utilizando el menú a continuación, o puede pegar manualmente el UUID de la entidad en el campo de arriba.", "assign_error": "Error al intentar asignar la etiqueta", "assign_to_entity": "Asignar a entidad", + "close_entity_menu": "Cerrar el menú Editar entidad", + "delete_tag": "Eliminar etiqueta permanentemente", + "deletion_failure": "Error de borrado", + "error_create_venue": "Error al crear el lugar", + "error_delete_tag": "Error al eliminar la etiqueta de inventario", + "error_get_venue": "Error al recuperar lugares", "error_retrieving": "Se produjo un error al recuperar las etiquetas de inventario", "error_unassign": "Error durante la operación de anulación de asignación", + "error_update_venue": "Error al actualizar el lugar", + "error_venue_delete": "Error al eliminar el lugar", "subscriber": "Abonado", "successful_assign": "Etiqueta asignada correctamente", + "successful_tag_delete": "Etiqueta de inventario eliminada correctamente", "successful_tag_update": "Etiqueta actualizada correctamente", "successful_unassign": "La operación de anulación de asignación se realizó correctamente", + "successful_venue_create": "Lugar creado con éxito", + "successful_venue_delete": "Lugar eliminado correctamente", + "successful_venue_update": "Lugar actualizado con éxito", "tag_created": "Etiqueta de inventario creada correctamente", "tag_creation_error": "Error al intentar crear una etiqueta de inventario", "tag_update_error": "Error al actualizar la etiqueta", diff --git a/public/locales/fr/translation.json b/public/locales/fr/translation.json index 13c0240..7bad7d9 100644 --- a/public/locales/fr/translation.json +++ b/public/locales/fr/translation.json @@ -81,6 +81,7 @@ "endpoint": "Point final", "endpoints": "Points de terminaison", "error": "Erreur", + "error_adding_note": "Erreur lors de l'ajout de la note", "execute_now": "Souhaitez-vous exécuter cette commande maintenant ?", "executed": "réalisé", "exit": "Sortie", @@ -136,6 +137,7 @@ "serial_number": "Numéro de série", "show_all": "Montre tout", "start": "Début", + "stop_editing": "Arrêter la modification", "submit": "Soumettre", "submitted": "Soumis", "success": "Succès", @@ -196,14 +198,20 @@ "add_failure": "Erreur, le serveur a renvoyé : {{error}}", "add_root": "Ajouter une entité racine", "add_success": "Entité créée avec succès !", + "assigned_inventory": "Inventaire assigné", "cannot_delete": "Vous ne pouvez pas supprimer des entités qui ont des enfants. Supprimez les enfants de cette entité pour pouvoir la supprimer.", "delete_success": "Entité supprimée avec succès", "delete_warning": "Attention : cette opération ne peut pas être annulée", "edit_failure": "Échec de la mise à jour : {{error}}", "entities": "Entités", "entity": "Entité", + "error_fetch_entity": "Erreur lors de la récupération des informations sur l'entité", + "error_fetching": "Erreur lors de la récupération des entités", + "error_saving": "Erreur lors de l'enregistrement de l'entité", + "not_assigned": "Non attribué", "only_unassigned": "Uniquement non attribué", - "valid_serial": "Doit être un numéro de série valide (12 caractères HEX)" + "valid_serial": "Doit être un numéro de série valide (12 caractères HEX)", + "venues": "Les lieux" }, "factory_reset": { "redirector": "Conserver le redirecteur :", @@ -251,17 +259,32 @@ "title": "Santé" }, "inventory": { + "add_child": "Ajouter un lieu enfant", "add_child_venue": "Ajouter un lieu enfant à {{entityName}}", - "add_tag": "Ajouter une étiquette", + "add_tag": "Créer un tag", "add_tag_to": "Ajouter une balise d'inventaire à {{name}}", + "add_venue": "Ajouter un lieu", + "assign_entity_instructions": "Vous pouvez soit trouver l'entité à laquelle vous souhaitez que cette balise soit attribuée en utilisant le menu ci-dessous, soit coller manuellement l'UUID de l'entité dans le champ ci-dessus.", "assign_error": "Erreur lors de la tentative d'attribution de balise", "assign_to_entity": "Affecter à l'entité", + "close_entity_menu": "Fermer le menu Modifier l'entité", + "delete_tag": "Supprimer définitivement la balise", + "deletion_failure": "Erreur de suppression", + "error_create_venue": "Erreur lors de la création du lieu", + "error_delete_tag": "Erreur lors de la suppression de la balise d'inventaire", + "error_get_venue": "Erreur lors de la récupération des lieux", "error_retrieving": "Une erreur s'est produite lors de la récupération des balises d'inventaire", "error_unassign": "Erreur lors de l'opération de désaffectation", + "error_update_venue": "Erreur lors de la mise à jour du lieu", + "error_venue_delete": "Erreur lors de la suppression du lieu", "subscriber": "Abonné", "successful_assign": "Tag attribué avec succès", + "successful_tag_delete": "Balise d'inventaire supprimée avec succès", "successful_tag_update": "Balise mise à jour avec succès", "successful_unassign": "L'opération de désaffectation a réussi", + "successful_venue_create": "Lieu créé avec succès", + "successful_venue_delete": "Lieu supprimé avec succès", + "successful_venue_update": "Lieu mis à jour avec succès", "tag_created": "Tag d'inventaire créé avec succès", "tag_creation_error": "Erreur lors de la tentative de création d'une balise d'inventaire", "tag_update_error": "Erreur lors de la mise à jour de la balise", diff --git a/public/locales/pt/translation.json b/public/locales/pt/translation.json index 64dbe6e..47788ad 100644 --- a/public/locales/pt/translation.json +++ b/public/locales/pt/translation.json @@ -81,6 +81,7 @@ "endpoint": "Ponto final", "endpoints": "Pontos finais", "error": "Erro", + "error_adding_note": "Erro ao adicionar nota", "execute_now": "Você gostaria de executar este comando agora?", "executed": "Executado", "exit": "Saída", @@ -136,6 +137,7 @@ "serial_number": "Número de série", "show_all": "mostre tudo", "start": "Começar", + "stop_editing": "Pare de editar", "submit": "Enviar", "submitted": "Submetido", "success": "Sucesso", @@ -196,14 +198,20 @@ "add_failure": "Erro, o servidor retornou: {{error}}", "add_root": "Adicionar Entidade Raiz", "add_success": "Entidade criada com sucesso!", + "assigned_inventory": "Estoque Atribuído", "cannot_delete": "Você não pode excluir entidades que têm filhos. Exclua os filhos desta entidade para poder excluí-la.", "delete_success": "Entidade excluída com sucesso", "delete_warning": "Aviso: esta operação não pode ser revertida", "edit_failure": "Atualização malsucedida: {{error}}", "entities": "Entidades", "entity": "Entidade", + "error_fetch_entity": "Erro ao buscar informações da entidade", + "error_fetching": "Erro ao buscar entidades", + "error_saving": "Erro ao salvar entidade", + "not_assigned": "Não atribuído", "only_unassigned": "Apenas não atribuídos", - "valid_serial": "Precisa ser um número de série válido (12 caracteres HEX)" + "valid_serial": "Precisa ser um número de série válido (12 caracteres HEX)", + "venues": "Locais" }, "factory_reset": { "redirector": "Manter redirecionador:", @@ -251,17 +259,32 @@ "title": "Saúde" }, "inventory": { + "add_child": "Adicionar local infantil", "add_child_venue": "Adicionar Local Infantil a {{entityName}}", - "add_tag": "Adicionar etiqueta", + "add_tag": "Criar tag", "add_tag_to": "Adicionar tag de estoque a {{name}}", + "add_venue": "Adicionar Local", + "assign_entity_instructions": "Você pode encontrar a entidade à qual deseja que esta tag seja atribuída usando o menu abaixo ou pode colar manualmente o UUID da entidade no campo acima.", "assign_error": "Erro ao tentar atribuir tag", "assign_to_entity": "Atribuir à Entidade", + "close_entity_menu": "Fechar Menu Editar Entidade", + "delete_tag": "Excluir tag permanentemente", + "deletion_failure": "Erro de exclusão", + "error_create_venue": "Erro ao criar local", + "error_delete_tag": "Erro ao excluir tag de inventário", + "error_get_venue": "Erro ao recuperar locais", "error_retrieving": "Ocorreu um erro ao recuperar as tags de inventário", "error_unassign": "Erro durante operação de cancelamento de atribuição", + "error_update_venue": "Erro ao atualizar o local", + "error_venue_delete": "Erro ao excluir local", "subscriber": "Assinante", "successful_assign": "Tag atribuída com sucesso", + "successful_tag_delete": "Tag de inventário excluída com sucesso", "successful_tag_update": "Tag atualizada com sucesso", "successful_unassign": "A operação de cancelamento da atribuição foi bem-sucedida", + "successful_venue_create": "Local criado com sucesso", + "successful_venue_delete": "Local excluído com sucesso", + "successful_venue_update": "Local atualizado com sucesso", "tag_created": "Tag de inventário criada com sucesso", "tag_creation_error": "Erro ao tentar criar etiqueta de inventário", "tag_update_error": "Erro ao atualizar tag", diff --git a/src/components/BlinkModal/index.js b/src/components/BlinkModal/index.js index fabfcc5..151539a 100644 --- a/src/components/BlinkModal/index.js +++ b/src/components/BlinkModal/index.js @@ -70,7 +70,7 @@ const BlinkModal = ({ show, toggleModal }) => { axiosInstance .post( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/leds`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/leds`, parameters, { headers }, ) diff --git a/src/components/CommandHistory/index.js b/src/components/CommandHistory/index.js index c8befb1..3127a9f 100644 --- a/src/components/CommandHistory/index.js +++ b/src/components/CommandHistory/index.js @@ -113,7 +113,7 @@ const DeviceCommands = () => { axiosInstance .get( - `${endpoints.ucentralgw}/api/v1/commands?serialNumber=${encodeURIComponent( + `${endpoints.owgw}/api/v1/commands?serialNumber=${encodeURIComponent( deviceSerialNumber, )}${extraParams}`, options, @@ -138,10 +138,7 @@ const DeviceCommands = () => { }; axiosInstance - .get( - `${endpoints.ucentralgw}/api/v1/file/${uuid}?serialNumber=${deviceSerialNumber}`, - options, - ) + .get(`${endpoints.owgw}/api/v1/file/${uuid}?serialNumber=${deviceSerialNumber}`, options) .then((response) => { const blob = new Blob([response.data], { type: 'application/octet-stream' }); const link = document.createElement('a'); @@ -162,7 +159,7 @@ const DeviceCommands = () => { }, }; return axiosInstance - .delete(`${endpoints.ucentralgw}/api/v1/command/${uuidDelete}`, options) + .delete(`${endpoints.owgw}/api/v1/command/${uuidDelete}`, options) .then(() => { deleteCommandFromList(uuidDelete); setUuidDelete(''); diff --git a/src/components/ConfigureModal/index.js b/src/components/ConfigureModal/index.js index 9a7038e..05677b0 100644 --- a/src/components/ConfigureModal/index.js +++ b/src/components/ConfigureModal/index.js @@ -83,7 +83,7 @@ const ConfigureModal = ({ show, toggleModal }) => { axiosInstance .post( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/configure`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/configure`, parameters, { headers }, ) diff --git a/src/components/CreateUserModal/index.js b/src/components/CreateUserModal/index.js index f0d778d..2f6607f 100644 --- a/src/components/CreateUserModal/index.js +++ b/src/components/CreateUserModal/index.js @@ -91,7 +91,7 @@ const CreateUserModal = ({ show, toggle, getUsers }) => { }; axiosInstance - .post(`${endpoints.ucentralsec}/api/v1/user/0`, parameters, { + .post(`${endpoints.owsec}/api/v1/user/0`, parameters, { headers, }) .then(() => { @@ -123,11 +123,11 @@ const CreateUserModal = ({ show, toggle, getUsers }) => { const getPasswordPolicy = () => { axiosInstance - .post(`${endpoints.ucentralsec}/api/v1/oauth2?requirements=true`, {}) + .post(`${endpoints.owsec}/api/v1/oauth2?requirements=true`, {}) .then((response) => { const newPolicies = response.data; - newPolicies.accessPolicy = `${endpoints.ucentralsec}${newPolicies.accessPolicy}`; - newPolicies.passwordPolicy = `${endpoints.ucentralsec}${newPolicies.passwordPolicy}`; + newPolicies.accessPolicy = `${endpoints.owsec}${newPolicies.accessPolicy}`; + newPolicies.passwordPolicy = `${endpoints.owsec}${newPolicies.passwordPolicy}`; setPolicies(response.data); }) .catch(() => {}); diff --git a/src/components/DeleteLogModal/index.js b/src/components/DeleteLogModal/index.js index 59a5c84..490e465 100644 --- a/src/components/DeleteLogModal/index.js +++ b/src/components/DeleteLogModal/index.js @@ -34,7 +34,7 @@ const DeleteLogModal = ({ show, toggle, object }) => { }, }; return axiosInstance - .delete(`${endpoints.ucentralgw}/api/v1/device/${deviceSerialNumber}/${object}`, options) + .delete(`${endpoints.owgw}/api/v1/device/${deviceSerialNumber}/${object}`, options) .then(() => {}) .catch(() => {}) .finally(() => { diff --git a/src/components/DeviceActionCard/index.js b/src/components/DeviceActionCard/index.js index 762d36e..76bfa4e 100644 --- a/src/components/DeviceActionCard/index.js +++ b/src/components/DeviceActionCard/index.js @@ -74,7 +74,7 @@ const DeviceActions = () => { axiosInstance .get( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/rtty`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/rtty`, options, ) .then((response) => { @@ -97,7 +97,7 @@ const DeviceActions = () => { }; axiosInstance - .get(`${endpoints.ucentralgw}/api/v1/device/${deviceSerialNumber}`, options) + .get(`${endpoints.owgw}/api/v1/device/${deviceSerialNumber}`, options) .then((response) => { setDevice(response.data); }) diff --git a/src/components/DeviceConfiguration/index.js b/src/components/DeviceConfiguration/index.js index 427b47d..4f5047a 100644 --- a/src/components/DeviceConfiguration/index.js +++ b/src/components/DeviceConfiguration/index.js @@ -57,10 +57,7 @@ const DeviceConfiguration = () => { }; axiosInstance - .get( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}`, - options, - ) + .get(`${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}`, options) .then((response) => { setDevice(response.data); }) @@ -82,7 +79,7 @@ const DeviceConfiguration = () => { axiosInstance .put( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}`, parameters, { headers }, ) diff --git a/src/components/DeviceFirmwareModal/index.js b/src/components/DeviceFirmwareModal/index.js index e8d9a8e..da82c01 100644 --- a/src/components/DeviceFirmwareModal/index.js +++ b/src/components/DeviceFirmwareModal/index.js @@ -25,7 +25,7 @@ const DeviceFirmwareModal = ({ }; axiosInstance - .get(`${endpoints.ucentralfms}/api/v1/firmwares?deviceType=${device.compatible}`, { + .get(`${endpoints.owfms}/api/v1/firmwares?deviceType=${device.compatible}`, { headers, }) .then((response) => { @@ -60,7 +60,7 @@ const DeviceFirmwareModal = ({ }; axiosInstance - .post(`${endpoints.ucentralgw}/api/v1/device/${device.serialNumber}/upgrade`, parameters, { + .post(`${endpoints.owgw}/api/v1/device/${device.serialNumber}/upgrade`, parameters, { headers, }) .then((response) => { diff --git a/src/components/DeviceHealth/index.js b/src/components/DeviceHealth/index.js index 9adec1b..c2531d4 100644 --- a/src/components/DeviceHealth/index.js +++ b/src/components/DeviceHealth/index.js @@ -85,7 +85,7 @@ const DeviceHealth = () => { axiosInstance .get( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent( + `${endpoints.owgw}/api/v1/device/${encodeURIComponent( deviceSerialNumber, )}/healthchecks${extraParams}`, options, diff --git a/src/components/DeviceListTable/index.js b/src/components/DeviceListTable/index.js index 569b804..58b840f 100644 --- a/src/components/DeviceListTable/index.js +++ b/src/components/DeviceListTable/index.js @@ -68,9 +68,7 @@ const DeviceList = () => { axiosInstance .get( - `${ - endpoints.ucentralgw - }/api/v1/devices?deviceWithStatus=true&limit=${devicePerPage}&offset=${ + `${endpoints.owgw}/api/v1/devices?deviceWithStatus=true&limit=${devicePerPage}&offset=${ devicePerPage * selectedPage + 1 }`, options, @@ -80,7 +78,7 @@ const DeviceList = () => { const serialsToGet = fullDevices.map((device) => device.serialNumber); return axiosInstance.get( - `${endpoints.ucentralfms}/api/v1/firmwareAge?select=${serialsToGet}`, + `${endpoints.owfms}/api/v1/firmwareAge?select=${serialsToGet}`, options, ); }) @@ -115,7 +113,7 @@ const DeviceList = () => { }; axiosInstance - .get(`${endpoints.ucentralgw}/api/v1/devices?countOnly=true`, { + .get(`${endpoints.owgw}/api/v1/devices?countOnly=true`, { headers, }) .then((response) => { @@ -149,7 +147,7 @@ const DeviceList = () => { axiosInstance .get( - `${endpoints.ucentralgw}/api/v1/devices?deviceWithStatus=true&select=${encodeURIComponent( + `${endpoints.owgw}/api/v1/devices?deviceWithStatus=true&select=${encodeURIComponent( serialNumber, )}`, options, @@ -203,7 +201,7 @@ const DeviceList = () => { axiosInstance .get( - `${endpoints.ucentralfms}/api/v1/firmwares?deviceType=${device.compatible}&latestOnly=true`, + `${endpoints.owfms}/api/v1/firmwares?deviceType=${device.compatible}&latestOnly=true`, options, ) .then((response) => { @@ -214,7 +212,7 @@ const DeviceList = () => { uri: response.data.uri, }; return axiosInstance.post( - `${endpoints.ucentralgw}/api/v1/device/${device.serialNumber}/upgrade`, + `${endpoints.owgw}/api/v1/device/${device.serialNumber}/upgrade`, parameters, options, ); @@ -259,10 +257,7 @@ const DeviceList = () => { }; axiosInstance - .get( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(serialNumber)}/rtty`, - options, - ) + .get(`${endpoints.owgw}/api/v1/device/${encodeURIComponent(serialNumber)}/rtty`, options) .then((response) => { const url = `https://${response.data.server}:${response.data.viewport}/connect/${response.data.connectionId}`; const newWindow = window.open(url, '_blank', 'noopener,noreferrer'); @@ -291,7 +286,7 @@ const DeviceList = () => { }; axiosInstance - .delete(`${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(serialNumber)}`, options) + .delete(`${endpoints.owgw}/api/v1/device/${encodeURIComponent(serialNumber)}`, options) .then(() => { addToast({ title: t('common.success'), diff --git a/src/components/DeviceLogs/index.js b/src/components/DeviceLogs/index.js index f55b01d..b62e57f 100644 --- a/src/components/DeviceLogs/index.js +++ b/src/components/DeviceLogs/index.js @@ -82,7 +82,7 @@ const DeviceLogs = () => { axiosInstance .get( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent( + `${endpoints.owgw}/api/v1/device/${encodeURIComponent( deviceSerialNumber, )}/logs${extraParams}`, options, diff --git a/src/components/DeviceSearchBar/index.js b/src/components/DeviceSearchBar/index.js index 26a39f1..ad64303 100644 --- a/src/components/DeviceSearchBar/index.js +++ b/src/components/DeviceSearchBar/index.js @@ -24,7 +24,7 @@ const DeviceSearchBar = () => { } } else if (socket.readyState !== WebSocket.CONNECTING) { setWaitingSearch(value); - setSocket(new WebSocket(`${endpoints.ucentralgw.replace('https', 'wss')}/api/v1/ws`)); + setSocket(new WebSocket(`${endpoints.owgw.replace('https', 'wss')}/api/v1/ws`)); } else { setWaitingSearch(value); } @@ -61,7 +61,7 @@ const DeviceSearchBar = () => { useEffect(() => { if (socket === null) { - setSocket(new WebSocket(`${endpoints.ucentralgw.replace('https', 'wss')}/api/v1/ws`)); + setSocket(new WebSocket(`${endpoints.owgw.replace('https', 'wss')}/api/v1/ws`)); } }, []); diff --git a/src/components/DeviceStatusCard/index.js b/src/components/DeviceStatusCard/index.js index 2e98b09..417663e 100644 --- a/src/components/DeviceStatusCard/index.js +++ b/src/components/DeviceStatusCard/index.js @@ -22,13 +22,13 @@ const DeviceStatusCard = () => { }; const lastStatsRequest = axiosInstance.get( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent( + `${endpoints.owgw}/api/v1/device/${encodeURIComponent( deviceSerialNumber, )}/statistics?lastOnly=true`, options, ); const statusRequest = axiosInstance.get( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/status`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/status`, options, ); diff --git a/src/components/EditUserModal/index.js b/src/components/EditUserModal/index.js index af9a863..cfa5ffc 100644 --- a/src/components/EditUserModal/index.js +++ b/src/components/EditUserModal/index.js @@ -61,11 +61,11 @@ const EditUserModal = ({ show, toggle, userId, getUsers }) => { const getPasswordPolicy = () => { axiosInstance - .post(`${endpoints.ucentralsec}/api/v1/oauth2?requirements=true`, {}) + .post(`${endpoints.owsec}/api/v1/oauth2?requirements=true`, {}) .then((response) => { const newPolicies = response.data; - newPolicies.accessPolicy = `${endpoints.ucentralsec}${newPolicies.accessPolicy}`; - newPolicies.passwordPolicy = `${endpoints.ucentralsec}${newPolicies.passwordPolicy}`; + newPolicies.accessPolicy = `${endpoints.owsec}${newPolicies.accessPolicy}`; + newPolicies.passwordPolicy = `${endpoints.owsec}${newPolicies.passwordPolicy}`; setPolicies(response.data); }) .catch(() => {}); @@ -80,7 +80,7 @@ const EditUserModal = ({ show, toggle, userId, getUsers }) => { }; axiosInstance - .get(`${endpoints.ucentralsec}/api/v1/user/${userId}`, options) + .get(`${endpoints.owsec}/api/v1/user/${userId}`, options) .then((response) => { const newUser = {}; @@ -134,7 +134,7 @@ const EditUserModal = ({ show, toggle, userId, getUsers }) => { }; axiosInstance - .put(`${endpoints.ucentralsec}/api/v1/user/${userId}`, parameters, options) + .put(`${endpoints.owsec}/api/v1/user/${userId}`, parameters, options) .then(() => { addToast({ title: t('user.update_success_title'), @@ -186,7 +186,7 @@ const EditUserModal = ({ show, toggle, userId, getUsers }) => { }; axiosInstance - .put(`${endpoints.ucentralsec}/api/v1/user/${userId}`, parameters, options) + .put(`${endpoints.owsec}/api/v1/user/${userId}`, parameters, options) .then(() => { getUser(); }) diff --git a/src/components/EventQueueModal/index.js b/src/components/EventQueueModal/index.js index b6fe606..9e499fb 100644 --- a/src/components/EventQueueModal/index.js +++ b/src/components/EventQueueModal/index.js @@ -28,11 +28,7 @@ const EventQueueModal = ({ show, toggle }) => { }; axiosInstance - .post( - `${endpoints.ucentralgw}/api/v1/device/${deviceSerialNumber}/eventqueue`, - parameters, - options, - ) + .post(`${endpoints.owgw}/api/v1/device/${deviceSerialNumber}/eventqueue`, parameters, options) .then((response) => { setResult(response.data); }) diff --git a/src/components/FactoryResetModal/index.js b/src/components/FactoryResetModal/index.js index 4622876..b0b96ec 100644 --- a/src/components/FactoryResetModal/index.js +++ b/src/components/FactoryResetModal/index.js @@ -64,7 +64,7 @@ const ConfigureModal = ({ show, toggleModal }) => { axiosInstance .post( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/factory`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/factory`, parameters, { headers }, ) diff --git a/src/components/FirmwareHistoryModal/index.js b/src/components/FirmwareHistoryModal/index.js index 43f8e9c..5985197 100644 --- a/src/components/FirmwareHistoryModal/index.js +++ b/src/components/FirmwareHistoryModal/index.js @@ -29,7 +29,7 @@ const FirmwareHistoryModal = ({ serialNumber, show, toggle }) => { }; axiosInstance - .get(`${endpoints.ucentralfms}/api/v1/revisionHistory/${serialNumber}`, options) + .get(`${endpoints.owfms}/api/v1/revisionHistory/${serialNumber}`, options) .then((response) => setData(response.data.history ?? [])) .catch(() => {}) .finally(() => setLoading(false)); diff --git a/src/components/FirmwareUpgradeModal/UpgradeWaitingBody.js b/src/components/FirmwareUpgradeModal/UpgradeWaitingBody.js index e3dc8cd..5a77c5c 100644 --- a/src/components/FirmwareUpgradeModal/UpgradeWaitingBody.js +++ b/src/components/FirmwareUpgradeModal/UpgradeWaitingBody.js @@ -22,10 +22,7 @@ const UpgradeWaitingBody = ({ serialNumber }) => { }; axiosInstance - .get( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(serialNumber)}/status`, - options, - ) + .get(`${endpoints.owgw}/api/v1/device/${encodeURIComponent(serialNumber)}/status`, options) .then((response) => response.data.connected) .catch(() => {}); }; @@ -39,7 +36,7 @@ const UpgradeWaitingBody = ({ serialNumber }) => { }; axiosInstance - .get(`${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(serialNumber)}`, options) + .get(`${endpoints.owgw}/api/v1/device/${encodeURIComponent(serialNumber)}`, options) .then((response) => response.data.firmware) .catch(() => {}); }; diff --git a/src/components/FirmwareUpgradeModal/index.js b/src/components/FirmwareUpgradeModal/index.js index 3a313c8..f9bb0b9 100644 --- a/src/components/FirmwareUpgradeModal/index.js +++ b/src/components/FirmwareUpgradeModal/index.js @@ -84,7 +84,7 @@ const FirmwareUpgradeModal = ({ show, toggleModal }) => { const isConnected = await getDeviceConnection( deviceSerialNumber, currentToken, - endpoints.ucentralgw, + endpoints.owgw, ); setDisableWaiting(!isConnected); setDeviceConnected(isConnected); @@ -110,7 +110,7 @@ const FirmwareUpgradeModal = ({ show, toggleModal }) => { }; axiosInstance .post( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/upgrade`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/upgrade`, parameters, { headers }, ) @@ -160,7 +160,7 @@ const FirmwareUpgradeModal = ({ show, toggleModal }) => { { setDate(newDate.toString())} diff --git a/src/components/InterfaceStatistics/LatestStatisticsModal.js b/src/components/InterfaceStatistics/LatestStatisticsModal.js index eeb858b..039a221 100644 --- a/src/components/InterfaceStatistics/LatestStatisticsModal.js +++ b/src/components/InterfaceStatistics/LatestStatisticsModal.js @@ -28,7 +28,7 @@ const LatestStatisticsModal = ({ show, toggle }) => { axiosInstance .get( - `${endpoints.ucentralgw}/api/v1/device/${deviceSerialNumber}/statistics?lastOnly=true`, + `${endpoints.owgw}/api/v1/device/${deviceSerialNumber}/statistics?lastOnly=true`, options, ) .then((response) => { diff --git a/src/components/InterfaceStatistics/StatisticsChartList.js b/src/components/InterfaceStatistics/StatisticsChartList.js index 619ed52..e50b616 100644 --- a/src/components/InterfaceStatistics/StatisticsChartList.js +++ b/src/components/InterfaceStatistics/StatisticsChartList.js @@ -128,7 +128,7 @@ const StatisticsChartList = () => { axiosInstance .get( - `${endpoints.ucentralgw}/api/v1/device/${deviceSerialNumber}/statistics?newest=true&limit=50`, + `${endpoints.owgw}/api/v1/device/${deviceSerialNumber}/statistics?newest=true&limit=50`, options, ) .then((response) => { diff --git a/src/components/LifetimeStatsModal/index.js b/src/components/LifetimeStatsModal/index.js index 3f5e856..77c3956 100644 --- a/src/components/LifetimeStatsModal/index.js +++ b/src/components/LifetimeStatsModal/index.js @@ -23,7 +23,7 @@ const LifetimeStatsModal = ({ show, toggle }) => { axiosInstance .get( - `${endpoints.ucentralgw}/api/v1/device/${deviceSerialNumber}/statistics?lifetime=true`, + `${endpoints.owgw}/api/v1/device/${deviceSerialNumber}/statistics?lifetime=true`, options, ) .then((response) => { diff --git a/src/components/RebootModal/index.js b/src/components/RebootModal/index.js index 876dfce..00aa3ba 100644 --- a/src/components/RebootModal/index.js +++ b/src/components/RebootModal/index.js @@ -64,7 +64,7 @@ const ActionModal = ({ show, toggleModal }) => { axiosInstance .post( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/reboot`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/reboot`, parameters, { headers }, ) diff --git a/src/components/TraceModal/WaitingForTraceBody.js b/src/components/TraceModal/WaitingForTraceBody.js index 8354a2f..03ad952 100644 --- a/src/components/TraceModal/WaitingForTraceBody.js +++ b/src/components/TraceModal/WaitingForTraceBody.js @@ -21,7 +21,7 @@ const WaitingForTraceBody = ({ serialNumber, commandUuid, toggle }) => { }; axiosInstance - .get(`${endpoints.ucentralgw}/api/v1/command/${encodeURIComponent(commandUuid)}`, options) + .get(`${endpoints.owgw}/api/v1/command/${encodeURIComponent(commandUuid)}`, options) .then((response) => { if (response.data.waitingForFile === 0) { setWaitingForFile(false); @@ -44,10 +44,7 @@ const WaitingForTraceBody = ({ serialNumber, commandUuid, toggle }) => { }; axiosInstance - .get( - `${endpoints.ucentralgw}/api/v1/file/${commandUuid}?serialNumber=${serialNumber}`, - options, - ) + .get(`${endpoints.owgw}/api/v1/file/${commandUuid}?serialNumber=${serialNumber}`, options) .then((response) => { const blob = new Blob([response.data], { type: 'application/octet-stream' }); const link = document.createElement('a'); diff --git a/src/components/TraceModal/index.js b/src/components/TraceModal/index.js index 20f6246..94812a5 100644 --- a/src/components/TraceModal/index.js +++ b/src/components/TraceModal/index.js @@ -80,7 +80,7 @@ const TraceModal = ({ show, toggleModal }) => { axiosInstance .post( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/trace`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/trace`, parameters, { headers }, ) @@ -108,7 +108,7 @@ const TraceModal = ({ show, toggleModal }) => { const isConnected = await getDeviceConnection( deviceSerialNumber, currentToken, - endpoints.ucentralgw, + endpoints.owgw, ); setIsDeviceConnected(isConnected); }; diff --git a/src/components/WifiScanModal/index.js b/src/components/WifiScanModal/index.js index 3bdd8ac..7d27340 100644 --- a/src/components/WifiScanModal/index.js +++ b/src/components/WifiScanModal/index.js @@ -98,7 +98,7 @@ const WifiScanModal = ({ show, toggleModal }) => { axiosInstance .post( - `${endpoints.ucentralgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/wifiscan`, + `${endpoints.owgw}/api/v1/device/${encodeURIComponent(deviceSerialNumber)}/wifiscan`, parameters, { headers }, ) diff --git a/src/layout/index.js b/src/layout/index.js index 3719a78..17c5e3f 100644 --- a/src/layout/index.js +++ b/src/layout/index.js @@ -89,7 +89,7 @@ const TheLayout = () => { -