-
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(*): add node nutanix resilitate popin
ref: MANAGER-15716 Signed-off-by: Thibault Barske <[email protected]>
- Loading branch information
Showing
10 changed files
with
108 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ export default { | |
goBack: '<', | ||
id: '<', | ||
serviceType: '<', | ||
serviceName: '<?', | ||
}, | ||
controller, | ||
template, | ||
|
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
5 changes: 5 additions & 0 deletions
5
packages/manager/modules/nutanix/src/dashboard/nodes/list/resiliate-node/constant.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,5 @@ | ||
export const SERVICE_TYPE = 'NUTANIX_NODE'; | ||
|
||
export default { | ||
SERVICE_TYPE, | ||
}; |
22 changes: 22 additions & 0 deletions
22
packages/manager/modules/nutanix/src/dashboard/nodes/list/resiliate-node/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,22 @@ | ||
import angular from 'angular'; | ||
import '@uirouter/angularjs'; | ||
import 'oclazyload'; | ||
|
||
const moduleName = 'ovhManagerNutanixDashboardNodeResiliateLazyLoad'; | ||
|
||
angular.module(moduleName, ['ui.router', 'oc.lazyLoad']).config( | ||
/* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('nutanix.dashboard.nodes.all.resiliate-node.**', { | ||
url: '/resiliate/:nodeId', | ||
lazyLoad: ($transition$) => { | ||
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad'); | ||
|
||
return import('./resiliate.module').then((mod) => | ||
$ocLazyLoad.inject(mod.default || mod), | ||
); | ||
}, | ||
}); | ||
}, | ||
); | ||
|
||
export default moduleName; |
19 changes: 19 additions & 0 deletions
19
packages/manager/modules/nutanix/src/dashboard/nodes/list/resiliate-node/resiliate.module.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,19 @@ | ||
import angular from 'angular'; | ||
|
||
import '@uirouter/angularjs'; | ||
import 'angular-translate'; | ||
|
||
import ovhManagerBillingComponents from '@ovh-ux/manager-billing-components'; | ||
import routing from './resiliate.routing'; | ||
|
||
const moduleName = 'ovhManagerNutanixDashboardNodeResiliate'; | ||
|
||
angular | ||
.module(moduleName, [ | ||
'pascalprecht.translate', | ||
'ui.router', | ||
ovhManagerBillingComponents, | ||
]) | ||
.config(routing); | ||
|
||
export default moduleName; |
50 changes: 50 additions & 0 deletions
50
...ages/manager/modules/nutanix/src/dashboard/nodes/list/resiliate-node/resiliate.routing.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,50 @@ | ||
import { SERVICE_TYPE } from './constant'; | ||
|
||
export default /* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('nutanix.dashboard.nodes.all.resiliate-node', { | ||
url: '/resiliate/:nodeName', | ||
views: { | ||
modal: { | ||
component: 'billingAutorenewTerminateAgoraService', | ||
}, | ||
}, | ||
params: { | ||
serviceName: null, | ||
}, | ||
layout: 'modal', | ||
resolve: { | ||
serviceType: () => SERVICE_TYPE, | ||
nodeName: /* @ngInject */ ($transition$) => | ||
$transition$.params().nodeName, | ||
serviceName: /* @ngInject */ (nodeName) => nodeName, | ||
id: /* ngInject */ (server) => server.serviceId, | ||
server: /* @ngInject */ (nodeName, NutanixService) => | ||
NutanixService.getServer(nodeName), | ||
goBack: /* @ngInject */ ( | ||
$state, | ||
$timeout, | ||
Alerter, | ||
clusterServiceName, | ||
) => (message, type) => { | ||
const promise = $state.go('nutanix.dashboard.nodes.all', { | ||
clusterServiceName, | ||
}); | ||
|
||
if (message) { | ||
promise.then(() => | ||
$timeout(() => | ||
Alerter.set( | ||
`alert-${type}`, | ||
message, | ||
null, | ||
'nutanix_dashboard_alert', | ||
), | ||
), | ||
); | ||
} | ||
|
||
return promise; | ||
}, | ||
}, | ||
}); | ||
}; |
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