Skip to content

Commit a342be4

Browse files
radireddyantleblanc
authored andcommitted
feat(pci.project): add auto backup (#972)
ref: MBP-456
1 parent 94ec9a2 commit a342be4

File tree

71 files changed

+2156
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2156
-3
lines changed

packages/manager/modules/pci/src/projects/project/instances/instance/instance.component.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ export default {
3333
ipMitigationLink: '<',
3434
gotToNetworks: '<',
3535
attachPrivateNetwork: '<',
36+
scheduleAutoBackup: '<',
3637
},
3738
};

packages/manager/modules/pci/src/projects/project/instances/instance/instance.controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ export default class PciInstanceController {
22
/* @ngInject */
33
constructor(
44
$translate,
5+
coreConfig,
56
CucCloudMessage,
67
CucRegionService,
78
PciProjectsProjectInstanceService,
89
) {
910
this.$translate = $translate;
11+
this.coreConfig = coreConfig;
1012
this.CucCloudMessage = CucCloudMessage;
1113
this.CucRegionService = CucRegionService;
1214
this.PciProjectsProjectInstanceService = PciProjectsProjectInstanceService;

packages/manager/modules/pci/src/projects/project/instances/instance/instance.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
data-ng-if="$ctrl.instance.statusGroup === 'ACTIVE'">
3131
<span data-translate="pci_projects_project_instances_instance_action_createBackup_label"></span>
3232
</oui-tile-button>
33+
<oui-tile-button data-on-click="$ctrl.scheduleAutoBackup($ctrl.instance)"
34+
data-ng-if="$ctrl.instance.statusGroup === 'ACTIVE' && !$ctrl.coreConfig.isRegion('US')">
35+
<span data-translate="pci_projects_project_instances_autobackup_label"></span>
36+
</oui-tile-button>
3337
<oui-tile-button data-on-click="$ctrl.startRescueInstance()"
3438
data-ng-if="$ctrl.instance.canBeHardRebooted()">
3539
<span data-translate="pci_projects_project_instances_instance_action_rescue_label"></span>

packages/manager/modules/pci/src/projects/project/instances/instances.component.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ export default {
2323
instanceLink: '<',
2424
vrackLink: '<',
2525
vrack: '<',
26+
scheduleAutoBackup: '<',
2627
},
2728
};

packages/manager/modules/pci/src/projects/project/instances/instances.controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ export default class CloudProjectComputeInfrastructureListCtrl {
77
constructor(
88
$q,
99
$translate,
10+
coreConfig,
1011
CucCloudMessage,
1112
CucRegionService,
1213
ovhUserPref,
1314
PciProjectsProjectInstanceService,
1415
) {
1516
this.$q = $q;
1617
this.$translate = $translate;
18+
this.coreConfig = coreConfig;
1719
this.CucCloudMessage = CucCloudMessage;
1820
this.CucRegionService = CucRegionService;
1921
this.ovhUserPref = ovhUserPref;

packages/manager/modules/pci/src/projects/project/instances/instances.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ <h1 data-translate="pci_projects_project_instances_title"></h1>
109109
data-on-click="$ctrl.createBackupInstance($row)"
110110
data-ng-if="$row.statusGroup === 'ACTIVE'">
111111
</oui-action-menu-item>
112+
<oui-action-menu-item
113+
data-text="{{:: 'pci_projects_project_instances_autobackup_label' | translate }}"
114+
data-on-click="$ctrl.scheduleAutoBackup($row)"
115+
data-ng-if="$row.statusGroup === 'ACTIVE' && !$ctrl.coreConfig.isRegion('US')">
116+
</oui-action-menu-item>
112117
<oui-action-menu-divider
113118
data-ng-if="$row.statusGroup === 'ACTIVE' || $row.status === 'RESCUE'">
114119
</oui-action-menu-divider>

packages/manager/modules/pci/src/projects/project/instances/instances.routing.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,14 @@ export default /* @ngInject */($stateProvider) => {
6767
vrackLink: /* @ngInject */ ($state, projectId) => () => $state.href('pci.projects.project.privateNetwork.vrack.new', {
6868
projectId,
6969
}),
70+
scheduleAutoBackup: /* @ngInject */ ($state, projectId) => instance => $state.go('pci.projects.project.workflow.new', {
71+
projectId,
72+
selectedInstance: instance,
73+
}),
7074
vrack: /* @ngInject */ (
7175
PciPrivateNetworks,
7276
projectId,
7377
) => PciPrivateNetworks.getVrack(projectId),
74-
7578
goToInstances: /* @ngInject */ (CucCloudMessage, $state, projectId) => (message = false, type = 'success') => {
7679
const reload = message && type === 'success';
7780

packages/manager/modules/pci/src/projects/project/instances/translations/Messages_fr_FR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@
5757
"pci_projects_project_instances_error_query": "Une erreur est survenue lors de la récupération des volumes",
5858

5959
"pci_projects_project_instances_vrack_none": "Vous n'avez pas encore configuré de vRack",
60-
"pci_projects_project_instances_vrack_create": "Créer un vRack"
60+
"pci_projects_project_instances_vrack_create": "Créer un vRack",
61+
"pci_projects_project_instances_autobackup_label": "Créer une sauvegarde automatisée"
6162
}

packages/manager/modules/pci/src/projects/project/project.module.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import users from './users';
2424
import vouchers from './vouchers';
2525
import regions from './regions';
2626
import routing from './project.routing';
27+
import workflow from './workflow';
2728

2829
import './project.less';
2930

@@ -52,6 +53,7 @@ angular
5253
storages,
5354
users,
5455
vouchers,
56+
workflow,
5557
])
5658
.config(routing)
5759
.run(/* @ngTranslationsInject:json ./translations */);

packages/manager/modules/pci/src/projects/project/sidebar/sidebar.constant.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,22 @@ export const MENU = [
8787
regions: ['CA', 'EU'],
8888
},
8989
{
90+
beta: true,
9091
id: 'private-registry',
9192
options: {
9293
state: 'pci.projects.project.private-registry',
9394
},
9495
title: 'Managed Private Registry',
95-
beta: true,
9696
regions: ['EU'],
9797
},
98+
{
99+
id: 'workflow-management',
100+
options: {
101+
state: 'pci.projects.project.workflow',
102+
},
103+
title: 'Workflow Management',
104+
regions: ['CA', 'EU'],
105+
},
98106
],
99107
regions: ['CA', 'EU'],
100108
title: 'Orchestration / Industrialization',

0 commit comments

Comments
 (0)