-
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(octavia): add pool edition view (#10435)
ref: MANAGER-12302 Signed-off-by: Jacques Larique <[email protected]> Co-authored-by: CDS Translator Agent <[email protected]>
- Loading branch information
1 parent
9933d8d
commit debae19
Showing
29 changed files
with
325 additions
and
33 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
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
23 changes: 23 additions & 0 deletions
23
.../load-balancers/load-balancer/pools/components/pool-form/translations/Messages_fr_CA.json
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,23 @@ | ||
{ | ||
"octavia_load_balancer_pools_create_name": "Nom du pool", | ||
"octavia_load_balancer_pools_create_options": "Options du pool", | ||
"octavia_load_balancer_pools_create_algorithm": "Algorithme", | ||
"octavia_load_balancer_pools_create_algorithm_tooltip": "L’algorithme du Load Balancer qui répartit le trafic entre les membres du pool.", | ||
"octavia_load_balancer_pools_create_algorithm_roundRobin": "Fait pivoter les requêtes uniformément entre plusieurs instances.", | ||
"octavia_load_balancer_pools_create_algorithm_leastConnections": "Alloue les requêtes à l'instance avec le moins de connexions actives.", | ||
"octavia_load_balancer_pools_create_algorithm_sourceIP": "Les requêtes provenant d'une adresse IP source unique sont dirigées de manière cohérente vers la même instance.", | ||
"octavia_load_balancer_pools_create_algorithm_sourceIPPort": "Les requêtes provenant d'une adresse IP source Port source unique sont dirigées de manière cohérente vers la même instance.", | ||
"octavia_load_balancer_pools_create_protocol": "Protocole", | ||
"octavia_load_balancer_pools_create_protocol_tooltip": "Protocole pour lequel ce pool et ses membres écoutent.", | ||
"octavia_load_balancer_pools_create_protocol_default": "Sélectionner un protocole", | ||
"octavia_load_balancer_pools_create_session": "Session persistante", | ||
"octavia_load_balancer_pools_create_session_tooltip": "Type de session permanente pour la distribution du trafic aux membres du pool.", | ||
"octavia_load_balancer_pools_create_persistent_session": "Sélectionner une session persistante", | ||
"octavia_load_balancer_pools_create_persistent_session_sourceIP": "Persistance de session basée sur l'adresse IP source.", | ||
"octavia_load_balancer_pools_create_persistent_session_httpCookie": "Persistance de session basée sur le cookie http.", | ||
"octavia_load_balancer_pools_create_persistent_session_appCookie": "Persistance de session basée sur le cookie d'application.", | ||
"octavia_load_balancer_pools_create_persistent_session_cookie_name": "Nom du cookie", | ||
"octavia_load_balancer_pools_create_cancel": "Annuler", | ||
"octavia_load_balancer_pools_create_submit": "Ajouter", | ||
"octavia_load_balancer_pools_create_submit_edition": "Editer" | ||
} |
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
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
19 changes: 19 additions & 0 deletions
19
...er/modules/octavia-load-balancer/src/load-balancers/load-balancer/pools/edit/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,19 @@ | ||
import controller from './controller'; | ||
import template from './template.html'; | ||
|
||
export default { | ||
bindings: { | ||
projectId: '<', | ||
region: '<', | ||
poolId: '<', | ||
pool: '<', | ||
algorithms: '<', | ||
poolProtocols: '<', | ||
sessionPersistenceTypes: '<', | ||
trackEditAction: '<', | ||
trackEditPage: '<', | ||
goBack: '<', | ||
}, | ||
controller, | ||
template, | ||
}; |
5 changes: 5 additions & 0 deletions
5
...er/modules/octavia-load-balancer/src/load-balancers/load-balancer/pools/edit/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,5 @@ | ||
export const TRACKING_HIT_PREFIX = 'edit'; | ||
|
||
export default { | ||
TRACKING_HIT_PREFIX, | ||
}; |
69 changes: 69 additions & 0 deletions
69
...r/modules/octavia-load-balancer/src/load-balancers/load-balancer/pools/edit/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,69 @@ | ||
export default class OctaviaLoadBalancerPoolsEditCtrl { | ||
/* @ngInject */ | ||
constructor(OctaviaLoadBalancerPoolsService, Alerter, $translate) { | ||
this.OctaviaLoadBalancerPoolsService = OctaviaLoadBalancerPoolsService; | ||
this.Alerter = Alerter; | ||
this.$translate = $translate; | ||
} | ||
|
||
$onInit() { | ||
this.loading = false; | ||
this.model = { | ||
name: this.pool.name, | ||
algorithm: this.pool.algorithm, | ||
protocol: this.pool.protocol, | ||
persistentSession: this.pool.sessionPersistence, | ||
cookieName: this.pool.sessionPersistence.cookieName, | ||
hasSession: this.pool.sessionPersistence.type !== 'disabled', | ||
}; | ||
} | ||
|
||
submit() { | ||
this.loading = true; | ||
this.trackEditAction('confirm'); | ||
const sessionPersistence = this.model.hasSession | ||
? { | ||
type: this.model.persistentSession.value, | ||
cookieName: this.model.cookieName, | ||
} | ||
: undefined; | ||
this.OctaviaLoadBalancerPoolsService.editPool( | ||
this.projectId, | ||
this.region, | ||
this.poolId, | ||
this.model.name, | ||
this.model.algorithm.value, | ||
sessionPersistence, | ||
) | ||
.then(async () => { | ||
this.trackEditPage('success'); | ||
this.Alerter.set( | ||
'alert-success', | ||
this.$translate.instant('octavia_load_balancer_pools_edit_success', { | ||
pool: this.model.name, | ||
}), | ||
null, | ||
'octavia.alerts.global', | ||
); | ||
await this.goBack(true); | ||
}) | ||
.catch((error) => { | ||
this.trackEditPage('error'); | ||
this.Alerter.error( | ||
this.$translate.instant('octavia_load_balancer_global_error', { | ||
message: error.data?.message, | ||
requestId: error.headers('X-Ovh-Queryid'), | ||
}), | ||
'octavia.alerts.global', | ||
); | ||
}) | ||
.finally(() => { | ||
this.loading = false; | ||
}); | ||
} | ||
|
||
cancel() { | ||
this.trackEditAction('cancel'); | ||
this.goBack(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...anager/modules/octavia-load-balancer/src/load-balancers/load-balancer/pools/edit/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 = 'ovhManagerOctaviaLoadBalancerDashboardPoolsEditLazyLoading'; | ||
|
||
angular.module(moduleName, ['ui.router', 'oc.lazyLoad']).config( | ||
/* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('octavia-load-balancer.loadbalancer.pools.edit.**', { | ||
url: '/:poolId/edit', | ||
lazyLoad: ($transition$) => { | ||
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad'); | ||
|
||
return import('./module').then((mod) => | ||
$ocLazyLoad.inject(mod.default || mod), | ||
); | ||
}, | ||
}); | ||
}, | ||
); | ||
|
||
export default moduleName; |
15 changes: 15 additions & 0 deletions
15
...nager/modules/octavia-load-balancer/src/load-balancers/load-balancer/pools/edit/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,15 @@ | ||
import angular from 'angular'; | ||
|
||
import component from './component'; | ||
import routing from './routing'; | ||
|
||
import poolComponents from '../components'; | ||
|
||
const moduleName = 'ovhManagerOctaviaLoadBalancerPoolsEdit'; | ||
|
||
angular | ||
.module(moduleName, [poolComponents]) | ||
.config(routing) | ||
.component('octaviaLoadBalancerPoolsEdit', component); | ||
|
||
export default moduleName; |
39 changes: 39 additions & 0 deletions
39
...ager/modules/octavia-load-balancer/src/load-balancers/load-balancer/pools/edit/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,39 @@ | ||
import { TRACKING_HIT_PREFIX } from './constants'; | ||
import { TRACKING_SUFFIX } from '../constants'; | ||
import { TRACKING_NAME } from '../../constants'; | ||
|
||
export default /* @ngInject */ ($stateProvider) => { | ||
$stateProvider.state('octavia-load-balancer.loadbalancer.pools.edit', { | ||
url: '/:poolId/edit', | ||
views: { | ||
loadbalancerPoolsView: 'octaviaLoadBalancerPoolsEdit', | ||
}, | ||
resolve: { | ||
breadcrumb: () => null, | ||
poolId: /* @ngInject */ ($transition$) => $transition$.params().poolId, | ||
pool: /* @ngInject */ ( | ||
OctaviaLoadBalancerPoolsService, | ||
projectId, | ||
region, | ||
poolId, | ||
) => OctaviaLoadBalancerPoolsService.getPool(projectId, region, poolId), | ||
goBack: /* @ngInject */ ($state, poolId) => (reload) => | ||
$state.go( | ||
'octavia-load-balancer.loadbalancer.pools.detail', | ||
{ | ||
poolId, | ||
}, | ||
reload | ||
? { reload: 'octavia-load-balancer.loadbalancer.pools.detail' } | ||
: null, | ||
), | ||
trackEditAction: /* @ngInject */ (trackAction) => (hit) => | ||
trackAction(`${TRACKING_HIT_PREFIX}::${hit}`), | ||
trackEditPage: /* @ngInject */ (trackPage) => (hit) => | ||
trackPage(`${TRACKING_HIT_PREFIX}-${hit}`), | ||
}, | ||
atInternet: { | ||
rename: `${TRACKING_NAME}::${TRACKING_SUFFIX}::${TRACKING_HIT_PREFIX}`, | ||
}, | ||
}); | ||
}; |
14 changes: 14 additions & 0 deletions
14
...r/modules/octavia-load-balancer/src/load-balancers/load-balancer/pools/edit/template.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,14 @@ | ||
<div class="text-center" data-ng-if="$ctrl.loading"> | ||
<oui-spinner></oui-spinner> | ||
</div> | ||
|
||
<octavia-load-balancer-pool-form | ||
data-ng-if="!$ctrl.loading" | ||
data-algorithms="$ctrl.algorithms" | ||
data-protocols="$ctrl.poolProtocols" | ||
data-session-persistence-types="$ctrl.sessionPersistenceTypes" | ||
data-model="$ctrl.model" | ||
data-is-editing="true" | ||
data-on-submit="$ctrl.submit()" | ||
data-on-cancel="$ctrl.cancel()" | ||
></octavia-load-balancer-pool-form> |
Oops, something went wrong.