diff --git a/packages/manager/modules/vrack/src/dashboard/translations/Messages_de_DE.json b/packages/manager/modules/vrack/src/dashboard/translations/Messages_de_DE.json index b3cec604798e..c0d1c3fa464b 100644 --- a/packages/manager/modules/vrack/src/dashboard/translations/Messages_de_DE.json +++ b/packages/manager/modules/vrack/src/dashboard/translations/Messages_de_DE.json @@ -49,5 +49,6 @@ "vrack_add_dialog_modal_title": "Einen oder mehrere Dienst(e) hinzufügen", "vrack_add_dialog_modal_description": "Sind Sie sicher, dass Sie {{ services }} zu Ihrem vRack hinzufügen möchten?", "vrack_delete_dialog_modal_title": "Einen oder mehrere Dienst(e) entfernen", - "vrack_delete_dialog_modal_description": "Sind Sie sicher, dass Sie {{ services }} aus Ihrem vRack entfernen möchten?" + "vrack_delete_dialog_modal_description": "Sind Sie sicher, dass Sie {{ services }} aus Ihrem vRack entfernen möchten?", + "vrack_service_type_ovhcloudconnect": "OVHcloud Connect" } diff --git a/packages/manager/modules/vrack/src/dashboard/translations/Messages_en_GB.json b/packages/manager/modules/vrack/src/dashboard/translations/Messages_en_GB.json index bb6ac6cf0feb..f9b264244f47 100644 --- a/packages/manager/modules/vrack/src/dashboard/translations/Messages_en_GB.json +++ b/packages/manager/modules/vrack/src/dashboard/translations/Messages_en_GB.json @@ -49,5 +49,6 @@ "vrack_add_dialog_modal_title": "Add one or more services", "vrack_add_dialog_modal_description": "Are you sure you want to add {{ services }} to your vRack?", "vrack_delete_dialog_modal_title": "Remove one or more services", - "vrack_delete_dialog_modal_description": "Are you sure you want to remove {{ services }} from your vRack?" + "vrack_delete_dialog_modal_description": "Are you sure you want to remove {{ services }} from your vRack?", + "vrack_service_type_ovhcloudconnect": "OVHcloud Connect" } diff --git a/packages/manager/modules/vrack/src/dashboard/translations/Messages_es_ES.json b/packages/manager/modules/vrack/src/dashboard/translations/Messages_es_ES.json index 8f3d09cafede..db0d7a4da707 100644 --- a/packages/manager/modules/vrack/src/dashboard/translations/Messages_es_ES.json +++ b/packages/manager/modules/vrack/src/dashboard/translations/Messages_es_ES.json @@ -49,5 +49,6 @@ "vrack_add_dialog_modal_title": "Añadir uno o varios servicios", "vrack_add_dialog_modal_description": "¿Seguro que quiere añadir {{ services }} a su vRack?", "vrack_delete_dialog_modal_title": "Eliminar uno o varios servicios", - "vrack_delete_dialog_modal_description": "¿Seguro que quiere eliminar {{ services }} de su vRack?" + "vrack_delete_dialog_modal_description": "¿Seguro que quiere eliminar {{ services }} de su vRack?", + "vrack_service_type_ovhcloudconnect": "OVHcloud Connect" } diff --git a/packages/manager/modules/vrack/src/dashboard/translations/Messages_fr_CA.json b/packages/manager/modules/vrack/src/dashboard/translations/Messages_fr_CA.json index 434b3c28623c..1822e41389a2 100644 --- a/packages/manager/modules/vrack/src/dashboard/translations/Messages_fr_CA.json +++ b/packages/manager/modules/vrack/src/dashboard/translations/Messages_fr_CA.json @@ -36,6 +36,7 @@ "vrack_menu_add": "Créer un vRack", "vrack_menu_project_num": "Vrack {{num}}", "vrack_service_type_dedicatedserver": "Serveur dédié", + "vrack_service_type_ovhcloudconnect": "OVHcloud Connect", "vrack_service_type_dedicatedcloud": "Hosted Private Cloud", "vrack_service_type_managedbaremetal": "Managed Bare Metal", "vrack_service_type_dedicatedconnect": "Dedicated connect", diff --git a/packages/manager/modules/vrack/src/dashboard/translations/Messages_fr_FR.json b/packages/manager/modules/vrack/src/dashboard/translations/Messages_fr_FR.json index 434b3c28623c..1822e41389a2 100644 --- a/packages/manager/modules/vrack/src/dashboard/translations/Messages_fr_FR.json +++ b/packages/manager/modules/vrack/src/dashboard/translations/Messages_fr_FR.json @@ -36,6 +36,7 @@ "vrack_menu_add": "Créer un vRack", "vrack_menu_project_num": "Vrack {{num}}", "vrack_service_type_dedicatedserver": "Serveur dédié", + "vrack_service_type_ovhcloudconnect": "OVHcloud Connect", "vrack_service_type_dedicatedcloud": "Hosted Private Cloud", "vrack_service_type_managedbaremetal": "Managed Bare Metal", "vrack_service_type_dedicatedconnect": "Dedicated connect", diff --git a/packages/manager/modules/vrack/src/dashboard/translations/Messages_it_IT.json b/packages/manager/modules/vrack/src/dashboard/translations/Messages_it_IT.json index dde856fd0306..6d63de2dc554 100644 --- a/packages/manager/modules/vrack/src/dashboard/translations/Messages_it_IT.json +++ b/packages/manager/modules/vrack/src/dashboard/translations/Messages_it_IT.json @@ -49,5 +49,6 @@ "vrack_add_dialog_modal_title": "Aggiungere uno o più servizi", "vrack_add_dialog_modal_description": "Vuoi davvero aggiungere {{ services }} alla tua vRack?", "vrack_delete_dialog_modal_title": "Rimuovere uno o più servizi", - "vrack_delete_dialog_modal_description": "Vuoi davvero rimuovere {{ services }} dalla tua vRack?" + "vrack_delete_dialog_modal_description": "Vuoi davvero rimuovere {{ services }} dalla tua vRack?", + "vrack_service_type_ovhcloudconnect": "OVHcloud Connect" } diff --git a/packages/manager/modules/vrack/src/dashboard/translations/Messages_pl_PL.json b/packages/manager/modules/vrack/src/dashboard/translations/Messages_pl_PL.json index e39e490285fe..5d6e068a6e80 100644 --- a/packages/manager/modules/vrack/src/dashboard/translations/Messages_pl_PL.json +++ b/packages/manager/modules/vrack/src/dashboard/translations/Messages_pl_PL.json @@ -49,5 +49,6 @@ "vrack_add_dialog_modal_title": "Dodaj jedną lub kilka usług", "vrack_add_dialog_modal_description": "Czy na pewno chcesz dodać {{services}} do Twojej sieci vRack?", "vrack_delete_dialog_modal_title": "Usuń jedną lub kilka usług", - "vrack_delete_dialog_modal_description": "Czy na pewno chcesz usunąć {{services}} z Twojej usługi vRack?" + "vrack_delete_dialog_modal_description": "Czy na pewno chcesz usunąć {{services}} z Twojej usługi vRack?", + "vrack_service_type_ovhcloudconnect": "OVHcloud Connect" } diff --git a/packages/manager/modules/vrack/src/dashboard/translations/Messages_pt_PT.json b/packages/manager/modules/vrack/src/dashboard/translations/Messages_pt_PT.json index 99259ff003d0..b3fff3650fd1 100644 --- a/packages/manager/modules/vrack/src/dashboard/translations/Messages_pt_PT.json +++ b/packages/manager/modules/vrack/src/dashboard/translations/Messages_pt_PT.json @@ -49,5 +49,6 @@ "vrack_add_dialog_modal_title": "Adicionar um ou vários serviços", "vrack_add_dialog_modal_description": "Quer mesmo adicionar {{ services }} do seu vRack?", "vrack_delete_dialog_modal_title": "Retirar um ou vários serviços", - "vrack_delete_dialog_modal_description": "Quer mesmo retirar {{ services }} do seu vRack?" + "vrack_delete_dialog_modal_description": "Quer mesmo retirar {{ services }} do seu vRack?", + "vrack_service_type_ovhcloudconnect": "OVHcloud Connect" } diff --git a/packages/manager/modules/vrack/src/dashboard/vrack.constant.js b/packages/manager/modules/vrack/src/dashboard/vrack.constant.js index cc2e4b42c837..34d3ca63a9d3 100644 --- a/packages/manager/modules/vrack/src/dashboard/vrack.constant.js +++ b/packages/manager/modules/vrack/src/dashboard/vrack.constant.js @@ -37,6 +37,7 @@ export const FEATURE_NAMES = { legacyVrack: 'vrack', managedBareMetal: 'managed-bare-metal', managedBareMetalDatacenter: 'managed-bare-metal', + ovhCloudConnect: 'cloud-connect', }; export const POLLING_INTERVAL = 3000; @@ -65,6 +66,7 @@ export const TYPE_SERVICE = { ip: 'ip', legacyVrack: 'legacyVrack', ipv6: 'ipv6', + ovhCloudConnect: 'ovhCloudConnect', }; // ALL ELIGIBLE SERVICES FOR VRACK diff --git a/packages/manager/modules/vrack/src/dashboard/vrack.controller.js b/packages/manager/modules/vrack/src/dashboard/vrack.controller.js index 5cfcb53b18e4..1dff2c0b969d 100644 --- a/packages/manager/modules/vrack/src/dashboard/vrack.controller.js +++ b/packages/manager/modules/vrack/src/dashboard/vrack.controller.js @@ -546,6 +546,18 @@ export default class VrackMoveDialogCtrl { this.updateLegacyVrackServiceInfo(); } break; + case TYPE_SERVICE.ovhCloudConnect: + // Update ovhcloudconnect + if ( + !this.data.eligibleServices?.ovhCloudConnect?.length !== + services.ovhCloudConnect.length + ) { + this.data.eligibleServices.ovhCloudConnect = + services.ovhCloudConnect; + // Update ovhcloudconnect + this.updateOvhCloudConnect(); + } + break; default: this.updateExcludedServices(); break; @@ -565,14 +577,30 @@ export default class VrackMoveDialogCtrl { } updateExcludedServices() { - if (this.data.eligibleServices?.ovhCloudConnect?.length > 0) { - this.data.eligibleServices.ovhCloudConnect = []; - } if (this.data.eligibleServices?.vrackServices?.length > 0) { this.data.eligibleServices.vrackServices = []; } } + updateOvhCloudConnect() { + return this.$q + .all( + this.data.eligibleServices.ovhCloudConnect.map((serviceId) => { + return this.vrackService + .getOvhCloudConnectServer(serviceId) + .then(({ data }) => { + const occ = VrackMoveDialogCtrl.getOvhCloudConnectServerNiceName( + data, + ); + return occ; + }); + }), + ) + .then((ovhCloudConnect) => { + this.data.eligibleServices.ovhCloudConnect = ovhCloudConnect; + }); + } + getEligibleServices() { return this.vrackService .getEligibleServices(this.serviceName) @@ -626,6 +654,11 @@ export default class VrackMoveDialogCtrl { this.updateIpLoadbalancingServiceInfo(); } break; + case TYPE_SERVICE.ovhCloudConnect: + if (this.data.eligibleServices?.ovhCloudConnect?.length > 0) { + this.updateOvhCloudConnect(); + } + break; default: this.updateExcludedServices(); break; @@ -1177,6 +1210,12 @@ export default class VrackMoveDialogCtrl { }, ).$promise; break; + case 'ovhCloudConnect': + task = this.vrackService.associateOvhCloudConnectToVrack( + this.serviceName, + service.id, + ); + break; default: break; } @@ -1318,6 +1357,12 @@ export default class VrackMoveDialogCtrl { ipLoadbalancing: service.id, }).$promise; break; + case 'ovhCloudConnect': + task = this.vrackService.dissociateOvhCloudConnectFromVrack( + this.serviceName, + service.id, + ); + break; default: break; } @@ -1408,6 +1453,16 @@ export default class VrackMoveDialogCtrl { return formattedService; } + static getOvhCloudConnectServerNiceName(service) { + const formattedService = { + ...service, + id: service.uuid, + niceName: service.uuid, + trueServiceType: 'ovhCloudConnect', + }; + return formattedService; + } + static getDedicatedServerInterfaceNiceName(service) { const formattedService = VrackMoveDialogCtrl.getDedicatedServerNiceName( service.dedicatedServer, @@ -1503,6 +1558,13 @@ export default class VrackMoveDialogCtrl { trueServiceType: 'ip', }; break; + case 'ovhCloudConnect': + formattedService = { + id: service, + niceName: service, + trueServiceType: 'ovhCloudConnect', + }; + break; case 'cloudProject': formattedService = VrackMoveDialogCtrl.getCloudProjectNiceName(service); break; diff --git a/packages/manager/modules/vrack/src/dashboard/vrack.service.js b/packages/manager/modules/vrack/src/dashboard/vrack.service.js index 8f373dcc73e0..4a898053a122 100644 --- a/packages/manager/modules/vrack/src/dashboard/vrack.service.js +++ b/packages/manager/modules/vrack/src/dashboard/vrack.service.js @@ -30,6 +30,10 @@ export default class Vrack { return this.$http.get(`/dedicated/server/${serviceName}`); } + getOvhCloudConnectServer(serviceName) { + return this.$http.get(`/ovhCloudConnect/${serviceName}`); + } + getDedicatedCloud(serviceName) { return this.$http.get(`/dedicatedCloud/${serviceName}`); } @@ -41,4 +45,18 @@ export default class Vrack { getIpLoadbalancing(serviceName) { return this.$http.get(`/ipLoadbalancing/${serviceName}`); } + + associateOvhCloudConnectToVrack(serviceName, ovhCloudConnectId) { + return this.$http + .post(`/vrack/${serviceName}/ovhCloudConnect`, { + ovhCloudConnect: ovhCloudConnectId, + }) + .then(({ data }) => data); + } + + dissociateOvhCloudConnectFromVrack(serviceName, ovhCloudConnectId) { + return this.$http + .delete(`/vrack/${serviceName}/ovhCloudConnect/${ovhCloudConnectId}`) + .then(({ data }) => data); + } } diff --git a/packages/manager/modules/vrack/src/partials/available.html b/packages/manager/modules/vrack/src/partials/available.html index 86be1e006268..2415f4ae34b3 100644 --- a/packages/manager/modules/vrack/src/partials/available.html +++ b/packages/manager/modules/vrack/src/partials/available.html @@ -29,7 +29,8 @@
'ovh-font ovh-font-ip': serviceType === 'ip', 'ovh-font ovh-font-server': serviceType === 'dedicatedServer' || serviceType === 'dedicatedServerInterface', 'ovh-font ovh-font-network': serviceType === 'dedicatedConnect', - 'ovh-font ovh-font-vRack': serviceType === 'legacyVrack'}" + 'ovh-font ovh-font-vRack': serviceType === 'legacyVrack', + 'oui-icon oui-icon-line-communicating_concept': serviceType === 'ovhCloudConnect'}" > @@ -96,6 +97,24 @@ +