-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dedicated.vmware): custom nsx edges sizing
ref: MANAGER-12763 Signed-off-by: Amandine Dectot <[email protected]>
- Loading branch information
Amandine Dectot
authored and
Thibaud Crespin
committed
Nov 25, 2024
1 parent
d78ddd9
commit d55be83
Showing
33 changed files
with
568 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...d/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import controller from './dedicatedCloud-datacenter-manage-nsx.controller'; | ||
import template from './dedicatedCloud-datacenter-manage-nsx.html'; | ||
|
||
export default { | ||
bindings: { | ||
goBack: '<', | ||
serviceName: '<', | ||
datacenterId: '<', | ||
setMessage: '<', | ||
nsxEdgeCurrentLevel: '<', | ||
nsxtEdgesScalingCapabilities: '<', | ||
datastoreOrderLink: '<', | ||
hostOrderLink: '<', | ||
trackClick: '<', | ||
trackPage: '<', | ||
trackingPrefix: '<', | ||
}, | ||
controller, | ||
template, | ||
}; |
30 changes: 30 additions & 0 deletions
30
...d/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.constants.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export const TRACKING_SUFFIX = { | ||
ADD_HOST: '::add-host', | ||
ORDER_HOST: '::add-storage', | ||
CONFIRM: '::confirm', | ||
CONFIRM_SUCCESS: '::nsx-success', | ||
CONFIRM_ERROR: '::nsx-error', | ||
}; | ||
|
||
export const NSX_RESOURCES = { | ||
MEDIUM: { | ||
cpu: 4, | ||
storage: 200, | ||
ram: 8, | ||
}, | ||
LARGE: { | ||
cpu: 8, | ||
storage: 200, | ||
ram: 32, | ||
}, | ||
XLARGE: { | ||
cpu: 16, | ||
storage: 200, | ||
ram: 32, | ||
}, | ||
}; | ||
|
||
export default { | ||
TRACKING_SUFFIX, | ||
NSX_RESOURCES, | ||
}; |
57 changes: 57 additions & 0 deletions
57
.../datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { | ||
NSX_RESOURCES, | ||
TRACKING_SUFFIX, | ||
} from './dedicatedCloud-datacenter-manage-nsx.constants'; | ||
import { EDGES_SIZES } from '../../../datacenters/datacenter.constants'; | ||
|
||
export default class { | ||
/* @ngInject */ | ||
constructor(DedicatedCloud, $translate, coreURLBuilder) { | ||
this.DedicatedCloud = DedicatedCloud; | ||
this.$translate = $translate; | ||
this.coreURLBuilder = coreURLBuilder; | ||
this.NSX_RESOURCES = NSX_RESOURCES; | ||
this.TRACKING_SUFFIX = TRACKING_SUFFIX; | ||
} | ||
|
||
$onInit() { | ||
this.loading = false; | ||
this.nsx_sizes = Object.keys(EDGES_SIZES); | ||
this.selectedNsxLevel = null; | ||
this.hasScalingCapabilities = | ||
this.nsxtEdgesScalingCapabilities.length === | ||
Object.keys(EDGES_SIZES).length; | ||
} | ||
|
||
isSizeAvailable(size) { | ||
return this.nsxtEdgesScalingCapabilities.indexOf(size) > -1; | ||
} | ||
|
||
changeNsxSize() { | ||
this.trackClick(this.TRACKING_SUFFIX.CONFIRM); | ||
this.loading = true; | ||
this.DedicatedCloud.resizeNsxtEdgeCluster( | ||
this.serviceName, | ||
this.datacenterId, | ||
this.selectedNsxLevel, | ||
) | ||
.then(() => { | ||
this.trackPage(this.TRACKING_SUFFIX.CONFIRM_SUCCESS); | ||
this.goBack( | ||
this.$translate.instant('dedicatedCloud_manage_nsx_edge_success'), | ||
); | ||
}) | ||
.catch(() => { | ||
this.setMessage( | ||
`${this.$translate.instant( | ||
'dedicatedCloud_datacenter_nsx_resize_error', | ||
)}`, | ||
'danger', | ||
); | ||
this.trackPage(this.TRACKING_SUFFIX.CONFIRM_ERROR); | ||
}) | ||
.finally(() => { | ||
this.loading = false; | ||
}); | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
...ted-cloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<oui-header | ||
heading="{{'dedicatedCloud_manage_nsx_edge_title' | translate}}" | ||
description="{{ 'dedicatedCloud_tab_datacenter_global_information' | translate}}" | ||
> | ||
<oui-back-button data-on-click="$ctrl.goBack()"> </oui-back-button> | ||
</oui-header> | ||
|
||
<oui-message | ||
data-ng-if="!$ctrl.hasScalingCapabilities" | ||
class="d-block mb-4" | ||
data-type="info" | ||
> | ||
<span data-translate="dedicatedCloud_manage_nsx_missing_ressources"></span> | ||
|
||
<a | ||
class="oui-link oui-link_icon" | ||
data-ng-href="{{:: $ctrl.datastoreOrderLink }}" | ||
data-track-on="click" | ||
data-track-type="action" | ||
data-track-name="{{:: $ctrl.trackingPrefix + $ctrl.TRACKING_SUFFIX.ORDER_HOST}}" | ||
target="_blank" | ||
rel="noopener" | ||
> | ||
<span data-translate="dedicatedCloud_nsx_link_datastore_order"></span> | ||
<span class="oui-icon oui-icon-external-link" aria-hidden="true"></span> | ||
</a> | ||
|
||
<a | ||
class="oui-link oui-link_icon" | ||
data-ng-href="{{:: $ctrl.hostOrderLink }}" | ||
data-track-on="click" | ||
data-track-type="action" | ||
data-track-name="{{:: $ctrl.trackingPrefix + $ctrl.TRACKING_SUFFIX.ADD_HOST}}" | ||
target="_blank" | ||
rel="noopener" | ||
> | ||
<span data-translate="dedicatedCloud_nsx_link_hosts_order"></span> | ||
<span class="oui-icon oui-icon-external-link" aria-hidden="true"></span> | ||
</a> | ||
</oui-message> | ||
|
||
<div class="text-center" data-ng-if="$ctrl.loading"> | ||
<oui-spinner></oui-spinner> | ||
</div> | ||
|
||
<div class="row d-md-flex mt-3"> | ||
<div | ||
class="col-lg-4" | ||
data-ng-repeat="size in $ctrl.nsxSizes track by $index" | ||
> | ||
<oui-select-picker | ||
class="h-100" | ||
data-name="size" | ||
data-model="$ctrl.selectedNsxLevel" | ||
data-label="{{:: ('dedicatedCloud_manage_nsx_choice_title_' + size) | translate }}" | ||
data-values="[size]" | ||
data-variant="light" | ||
data-disabled="!$ctrl.isSizeAvailable(size) || size == $ctrl.nsxEdgeCurrentLevel" | ||
> | ||
<oui-select-picker-section> | ||
<div class="text-center"> | ||
<span | ||
data-ng-if="$ctrl.nsxEdgeCurrentLevel === size" | ||
data-translate="dedicatedCloud_nsx_edge_current_level" | ||
class="oui-badge oui-badge_info" | ||
></span> | ||
<br /> | ||
<span | ||
data-translate="{{'dedicatedCloud_manage_nsx_choice_description_' + size}}" | ||
></span> | ||
</div> | ||
</oui-select-picker-section> | ||
<oui-select-picker-footer> | ||
<div class="text-center"> | ||
<strong | ||
data-translate="{{'dedicatedCloud_manage_nsx_edge_require_per_node_' + size}}" | ||
></strong> | ||
<br /> | ||
<span | ||
data-translate="dedicatedCloud_manage_nsx_choice_footer" | ||
data-translate-values="{ cpu: $ctrl.NSX_RESOURCES[size].cpu, ram: $ctrl.NSX_RESOURCES[size].ram, storage: $ctrl.NSX_RESOURCES[size].storage }" | ||
></span> | ||
</div> | ||
</oui-select-picker-footer> | ||
</oui-select-picker> | ||
</div> | ||
</div> | ||
|
||
<div class="mt-4"> | ||
<oui-button | ||
data-variant="secondary" | ||
data-ng-click="$ctrl.goBack()" | ||
data-disabled="$ctrl.loading" | ||
> | ||
<span data-translate="common_cancel"></span> | ||
</oui-button> | ||
<oui-button | ||
data-variant="primary" | ||
data-ng-click="$ctrl.changeNsxSize()" | ||
data-disabled="!$ctrl.selectedNsxLevel || $ctrl.loading" | ||
> | ||
<span data-translate="common_confirm"></span> | ||
</oui-button> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
...ated/client/app/components/dedicated-cloud/datacenter/dashboard/manage-nsx-edges/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import angular from 'angular'; | ||
|
||
import 'angular-translate'; | ||
import '@ovh-ux/ui-kit'; | ||
import '@ovh-ux/ng-translate-async-loader'; | ||
|
||
import component from './dedicatedCloud-datacenter-manage-nsx.component'; | ||
|
||
const moduleName = 'ovhManagerDedicatedCloudDatacenterManageNsxEdgeComponent'; | ||
|
||
angular | ||
.module(moduleName, [ | ||
'ngTranslateAsyncLoader', | ||
'oui', | ||
'pascalprecht.translate', | ||
]) | ||
.component('ovhManagerDedicatedCloudDatacenterManageNsxEdges', component) | ||
.run(/* @ngTranslationsInject:json ./translations */); | ||
|
||
export default moduleName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.