From 9b1938dedc24fe835b35f53f34d78a5507522625 Mon Sep 17 00:00:00 2001 From: mhelhali-soufien <159853039+mhelhali-soufien@users.noreply.github.com> Date: Fri, 18 Oct 2024 09:23:01 +0200 Subject: [PATCH] feat(dedicated): update add message error for vMac if 403 response (#12815) ref: MANAGER-14771 Signed-off-by: soufien mhelhali Co-authored-by: CDS Translator Agent --- .../add/ip-ip-virtual-mac-add.controller.js | 48 ++++++++++-- .../virtual-mac/ip-ip-virtual-mac.constant.js | 77 +++++++++++++++++++ .../virtual-mac/ip-ip-virtual-mac.service.js | 11 +-- .../app/ip/translations/Messages_de_DE.json | 4 +- .../app/ip/translations/Messages_en_GB.json | 4 +- .../app/ip/translations/Messages_es_ES.json | 4 +- .../app/ip/translations/Messages_fr_CA.json | 2 + .../app/ip/translations/Messages_fr_FR.json | 2 + .../app/ip/translations/Messages_it_IT.json | 4 +- .../app/ip/translations/Messages_pl_PL.json | 4 +- .../app/ip/translations/Messages_pt_PT.json | 4 +- 11 files changed, 144 insertions(+), 20 deletions(-) create mode 100644 packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/ip-ip-virtual-mac.constant.js diff --git a/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/add/ip-ip-virtual-mac-add.controller.js b/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/add/ip-ip-virtual-mac-add.controller.js index b80b82a89bab..271448b8c534 100644 --- a/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/add/ip-ip-virtual-mac-add.controller.js +++ b/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/add/ip-ip-virtual-mac-add.controller.js @@ -1,5 +1,11 @@ import get from 'lodash/get'; +import { + VMAC_CREATION_ERROR_403, + PROXMOX_LINKS, + WINDOWS_SERVER_LINKS, +} from '../ip-ip-virtual-mac.constant'; + export default /* @ngInject */ ( $http, $q, @@ -11,7 +17,18 @@ export default /* @ngInject */ ( IpVirtualMac, Alerter, atInternet, + ovhFeatureFlipping, + coreConfig, ) => { + let isVmacAvailable = false; + const { ovhSubsidiary } = coreConfig.getUser(); + + ovhFeatureFlipping + .checkFeatureAvailability(VMAC_CREATION_ERROR_403) + .then((feature) => { + isVmacAvailable = feature.isFeatureAvailable(VMAC_CREATION_ERROR_403); + }); + $scope.data = $scope.currentActionData; // service and sub atInternet.trackPage({ name: $scope.data?.tracking, @@ -62,13 +79,30 @@ export default /* @ngInject */ ( }), ); }) - .catch((reason) => { - Alerter.error(` - ${$translate.instant('ip_virtualmac_add_new_failure', { - t0: $scope.data.ip.ip, - })} -
- ${reason.message}`); + .catch(({ data, status }) => { + if (status === 403 && isVmacAvailable) { + Alerter.error(` + ${$translate.instant('ip_virtualmac_add_new_failure', { + t0: $scope.data.ip.ip, + })} +
+ ${$translate.instant('ip_virtualmac_not_available_failure')} +
+ ${$translate.instant('ip_virtualmac_not_available_failure_details', { + proxmoxLink: `Proxmox VE`, + windowsServerLink: `Windows Server`, + })}`); + } else { + Alerter.error(` + ${$translate.instant('ip_virtualmac_add_new_failure', { + t0: $scope.data.ip.ip, + })} +
+ ${data.message}`); + } }) .finally(() => { $scope.resetAction(); diff --git a/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/ip-ip-virtual-mac.constant.js b/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/ip-ip-virtual-mac.constant.js new file mode 100644 index 000000000000..ec7b55259cf6 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/ip-ip-virtual-mac.constant.js @@ -0,0 +1,77 @@ +export const PROXMOX_LINKS = { + FR: + 'https://help.ovhcloud.com/csm/fr-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043915', + DE: + 'https://help.ovhcloud.com/csm/de-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043914', + IE: + 'https://help.ovhcloud.com/csm/en-ie-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043909', + PL: + 'https://help.ovhcloud.com/csm/pl-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043916', + ES: + 'https://help.ovhcloud.com/csm/es-es-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043912', + IT: + 'https://help.ovhcloud.com/csm/it-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043917', + PT: + 'https://help.ovhcloud.com/csm/pt-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043918', + NL: + 'https://help.ovhcloud.com/csm/en-gb-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043899', + GB: + 'https://help.ovhcloud.com/csm/en-gb-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043899', + TN: + 'https://help.ovhcloud.com/csm/fr-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043915', + MA: + 'https://help.ovhcloud.com/csm/fr-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043915', + SN: + 'https://help.ovhcloud.com/csm/fr-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043915', + QC: + 'https://help.ovhcloud.com/csm/fr-ca-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043925', + CA: + 'https://help.ovhcloud.com/csm/en-ca-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043904', + US: + 'https://support.us.ovhcloud.com/hc/en-us/articles/30928201993619-Configuring-the-Network-on-Proxmox-VE-with-ADVANCE-Gen-3-Servers', + DEFAULT: + 'https://help.ovhcloud.com/csm/en-ie-dedicated-servers-proxmox-network-hg-scale?id=kb_article_view&sysparm_article=KB0043909', +}; + +export const WINDOWS_SERVER_LINKS = { + FR: + 'https://help.ovhcloud.com/csm/fr-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043590', + DE: + 'https://help.ovhcloud.com/csm/de-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043579', + IE: + 'https://help.ovhcloud.com/csm/en-ie-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043583', + PL: + 'https://help.ovhcloud.com/csm/pl-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043604', + ES: + 'https://help.ovhcloud.com/csm/es-es-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043584', + IT: + 'https://help.ovhcloud.com/csm/it-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043589', + PT: + 'https://help.ovhcloud.com/csm/pt-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043586', + NL: + 'https://help.ovhcloud.com/csm/en-gb-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043582', + GB: + 'https://help.ovhcloud.com/csm/en-gb-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043582', + MA: + 'https://help.ovhcloud.com/csm/fr-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043590', + SN: + 'https://help.ovhcloud.com/csm/fr-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043590', + TN: + 'https://help.ovhcloud.com/csm/fr-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043590', + CA: + 'https://help.ovhcloud.com/csm/en-ca-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043581', + QC: + 'https://help.ovhcloud.com/csm/fr-ca-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043588', + US: + 'https://support.us.ovhcloud.com/hc/en-us/articles/30937249373843-Configuring-the-Network-on-Windows-Server-with-Hyper-V-on-the-ADVANCE-Gen-3-Servers', + DEFAULT: + 'https://help.ovhcloud.com/csm/en-ie-dedicated-servers-hyperv-network-hg-scale?id=kb_article_view&sysparm_article=KB0043583', +}; + +export const VMAC_CREATION_ERROR_403 = 'ip:vmac-creation-error'; + +export default { + PROXMOX_LINKS, + WINDOWS_SERVER_LINKS, + VMAC_CREATION_ERROR_403, +}; diff --git a/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/ip-ip-virtual-mac.service.js b/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/ip-ip-virtual-mac.service.js index 7d0099f67cbb..70ef04946662 100644 --- a/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/ip-ip-virtual-mac.service.js +++ b/packages/manager/apps/dedicated/client/app/ip/components/list/virtual-mac/ip-ip-virtual-mac.service.js @@ -1,11 +1,6 @@ import set from 'lodash/set'; -export default /* @ngInject */ function IpVirtualMacService( - $http, - $q, - constants, - Poll, -) { +export default /* @ngInject */ function IpVirtualMacService($http, $q, Poll) { const swsIpPath = '2api/sws/module/ip'; const swsProxypassPath = 'apiv6'; @@ -41,7 +36,9 @@ export default /* @ngInject */ function IpVirtualMacService( }) .then( (data) => data.data, - (http) => $q.reject(http.data), + (http) => { + return $q.reject({ data: http.data, status: http.status }); + }, ); this.addIpToVirtualMac = ( diff --git a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_de_DE.json b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_de_DE.json index 173432cb89f6..a741b2ceb44c 100644 --- a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_de_DE.json +++ b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_de_DE.json @@ -771,5 +771,7 @@ "ip_byoip_delete_block_title": "Block löschen", "ip_byoip_delete_block_description": "Dieser IP-Block ist Teil eines größeren BYOIP-Blocks. Wenn Sie Ihren BYOIP-Dienst kündigen möchten, öffnen Sie Meine Dienste und wählen Sie die Option zum Kündigen aus.", "ip_table_manage_modify_ipv6block_reverse": "Reverse ändern", - "ip_filter_services_title_parking": "Parking" + "ip_filter_services_title_parking": "Parking", + "ip_virtualmac_not_available_failure": "Die virtuelle MAC wird ab Dezember 2024 auf diesem Server verfügbar sein.", + "ip_virtualmac_not_available_failure_details": "Weitere Informationen zur Verwaltung von IPs und virtuellen MACs mit OVHcloud finden Sie in den Guides zur Netzwerkkonfiguration unter {{proxmoxLink}} und {{windowsServerLink}}. In diesem Dokument wird erläutert, wie Sie Ihre OVHcloud Server für die Optimierung der Netzwerkleistung in virtualisierten Umgebungen mit Proxmox VE konfigurieren und dabei Techniken wie das Routing zusätzlicher IP-Adressen über das vRack verwenden​." } diff --git a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_en_GB.json b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_en_GB.json index 1ce8c98680e6..05537061e098 100644 --- a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_en_GB.json +++ b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_en_GB.json @@ -771,5 +771,7 @@ "ip_byoip_delete_block_title": "Delete block", "ip_byoip_delete_block_description": "This IP block is part of a larger BYOIP block. Please go to My Services and select “Cancel” if you would like to cancel your BYOIP service", "ip_table_manage_modify_ipv6block_reverse": "Modify the reverse path", - "ip_filter_services_title_parking": "Parking" + "ip_filter_services_title_parking": "Parking", + "ip_virtualmac_not_available_failure": "The virtual MAC address will be available on this server from December 2024", + "ip_virtualmac_not_available_failure_details": "For more information on managing IPs and virtual MACs with OVHcloud, please refer to the Network Configuration guides, here: {{proxmoxLink}} and here: {{windowsServerLink}}. This guide provides instructions for configuring your OVHcloud servers to optimise network performance in virtualised environments with Proxmox VE. This is done using techniques like routing additional IPs via the vRack​." } diff --git a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_es_ES.json b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_es_ES.json index bc4262fc194a..5705df468e04 100644 --- a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_es_ES.json +++ b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_es_ES.json @@ -771,5 +771,7 @@ "ip_byoip_delete_block_title": "Eliminar el bloque", "ip_byoip_delete_block_description": "Este bloque de IP forma parte de un bloque BYOIP más grande. Por favor, acceda a Mis servicios para cancelar su servicio BYOIP.", "ip_table_manage_modify_ipv6block_reverse": "Cambiar el registro inverso", - "ip_filter_services_title_parking": "Parking" + "ip_filter_services_title_parking": "Parking", + "ip_virtualmac_not_available_failure": "La MAC virtual estará disponible en este servidor a partir de diciembre de 2024.", + "ip_virtualmac_not_available_failure_details": "Para más información sobre la gestión de las IP y las MAC virtuales con OVHcloud, consulte la guía de configuración de red en {{proxmoxLink}} y {{windowsServerLink}}. Este documento explica cómo configurar los servidores de OVHcloud para optimizar el rendimiento de red en entornos virtualizados con Proxmox VE, utilizando técnicas como el enrutamiento de las IP adicionales a través del vRack​." } diff --git a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_fr_CA.json b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_fr_CA.json index 15ad58ef5da1..d56486371395 100644 --- a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_fr_CA.json +++ b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_fr_CA.json @@ -196,6 +196,8 @@ "ip_virtualmac_machinename": "Nom de la machine virtuelle", "ip_virtualmac_add_new_success": "Une nouvelle MAC virtuelle a été générée et sera disponible sur l'IP {{t0}} dans quelques minutes.", "ip_virtualmac_add_new_failure": "Une erreur est survenue lors de la génération d'une nouvelle MAC virtuelle sur l'IP {{t0}}", + "ip_virtualmac_not_available_failure": "La MAC virtuelle sera disponible sur ce serveur à partir de December 2024", + "ip_virtualmac_not_available_failure_details": "Pour plus d'informations sur la gestion des IP et des MAC virtuelles avec OVHcloud, nous vous invitons à consulter les Guide de configuration réseau sous {{proxmoxLink}} et {{windowsServerLink}}. Ce document explique comment configurer vos serveurs OVHcloud pour optimiser les performances réseau dans des environnements virtualisés avec Proxmox VE, en utilisant des techniques telles que le routage des IP supplémentaires via le vRack .", "ip_virtualmac_add_existing_success": "L'IP {{t0}} sera associée à la MAC virtuelle existante d'ici quelques minutes.", "ip_virtualmac_add_impossible_server": "Vous devez d'abord rattacher cette IP à un serveur", "ip_virtualmac_add_impossible_status": "Une opération est en cours", diff --git a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_fr_FR.json b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_fr_FR.json index 15ad58ef5da1..d56486371395 100644 --- a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_fr_FR.json +++ b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_fr_FR.json @@ -196,6 +196,8 @@ "ip_virtualmac_machinename": "Nom de la machine virtuelle", "ip_virtualmac_add_new_success": "Une nouvelle MAC virtuelle a été générée et sera disponible sur l'IP {{t0}} dans quelques minutes.", "ip_virtualmac_add_new_failure": "Une erreur est survenue lors de la génération d'une nouvelle MAC virtuelle sur l'IP {{t0}}", + "ip_virtualmac_not_available_failure": "La MAC virtuelle sera disponible sur ce serveur à partir de December 2024", + "ip_virtualmac_not_available_failure_details": "Pour plus d'informations sur la gestion des IP et des MAC virtuelles avec OVHcloud, nous vous invitons à consulter les Guide de configuration réseau sous {{proxmoxLink}} et {{windowsServerLink}}. Ce document explique comment configurer vos serveurs OVHcloud pour optimiser les performances réseau dans des environnements virtualisés avec Proxmox VE, en utilisant des techniques telles que le routage des IP supplémentaires via le vRack .", "ip_virtualmac_add_existing_success": "L'IP {{t0}} sera associée à la MAC virtuelle existante d'ici quelques minutes.", "ip_virtualmac_add_impossible_server": "Vous devez d'abord rattacher cette IP à un serveur", "ip_virtualmac_add_impossible_status": "Une opération est en cours", diff --git a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_it_IT.json b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_it_IT.json index 1a9a952650a3..56b018f02218 100644 --- a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_it_IT.json +++ b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_it_IT.json @@ -771,5 +771,7 @@ "ip_byoip_delete_block_title": "Eliminare il blocco", "ip_byoip_delete_block_description": "Questo blocco IP fa parte di un blocco BYOIP più grande. Accedi alla sezione I miei servizi e seleziona `Disattivare` per annullare il servizio BYOIP.", "ip_table_manage_modify_ipv6block_reverse": "Modificare il reverse", - "ip_filter_services_title_parking": "Parking" + "ip_filter_services_title_parking": "Parking", + "ip_virtualmac_not_available_failure": "Il MAC virtuale sarà disponibile su questo server a partire da dicembre 2024.", + "ip_virtualmac_not_available_failure_details": "Per maggiori informazioni sulla gestione degli IP e dei MAC virtuali con OVHcloud, consulta la guida alla configurazione di rete su {{proxmoxLink}} e {{windowsServerLink}}. Questo documento spiega come configurare i tuoi server OVHcloud per ottimizzare le prestazioni di rete in ambienti virtualizzati con Proxmox VE, utilizzando tecniche come il routing degli IP supplementari tramite la vRack." } diff --git a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_pl_PL.json b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_pl_PL.json index 075b664991ae..a5cbad1559bf 100644 --- a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_pl_PL.json +++ b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_pl_PL.json @@ -771,5 +771,7 @@ "ip_byoip_delete_block_title": "Usuń blok", "ip_byoip_delete_block_description": "Ten blok IP jest częścią większego bloku BYOIP. Przejdź do sekcji Moje usługi i wybierz opcję „Rezygnacja”, jeśli chcesz anulować usługę BYOIP.", "ip_table_manage_modify_ipv6block_reverse": "Zmień rewers", - "ip_filter_services_title_parking": "Parking" + "ip_filter_services_title_parking": "Parking", + "ip_virtualmac_not_available_failure": "Wirtualny adres MAC będzie dostępny na tym serwerze od grudnia 2024", + "ip_virtualmac_not_available_failure_details": "Aby uzyskać więcej informacji na temat zarządzania wirtualnymi adresami IP i MAC w OVHcloud, zapoznaj się z przewodnikami konfiguracji sieci: {{proxmoxLink}} i {{windowsServerLink}}. Dokument ten wyjaśnia, jak skonfigurować serwery OVHcloud w celu zoptymalizowania wydajności sieci w środowiskach zwirtualizowanych przy użyciu Proxmox VE, za pomocą technik, takich jak routing dodatkowych adresów IP przez vRack." } diff --git a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_pt_PT.json b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_pt_PT.json index ee1f95b3da7f..ef63d61d53f8 100644 --- a/packages/manager/apps/dedicated/client/app/ip/translations/Messages_pt_PT.json +++ b/packages/manager/apps/dedicated/client/app/ip/translations/Messages_pt_PT.json @@ -771,5 +771,7 @@ "ip_byoip_delete_block_title": "Eliminar o bloco", "ip_byoip_delete_block_description": "Este bloco de IP faz parte de um maior bloco BYOIP. Aceda a Os meus serviços e escolha a opção \"rescindir\" se pretender rescindir o seu serviço BYOIP", "ip_table_manage_modify_ipv6block_reverse": "Modificar a reverse", - "ip_filter_services_title_parking": "Parking" + "ip_filter_services_title_parking": "Parking", + "ip_virtualmac_not_available_failure": "O MAC virtual estará disponível neste servidor a partir de dezembro de 2024", + "ip_virtualmac_not_available_failure_details": "Para mais informações sobre a gestão dos IP e dos MAC virtuais com a OVHcloud, consulte os Guias de configuração de rede em {{proxmoxLink}} e {{windowsServerLink}}. Este documento explica como configurar os seus servidores OVHcloud para otimizar os desempenhos de rede em ambientes virtualizados com Proxmox VE, utilizando técnicas como o encaminhamento dos IP suplementares através do vRack." }