@spinnaker/google 0.2.4 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -5
- package/src/autoscalingPolicy/components/metricSettings/metricSettings.component.js +83 -81
- package/src/autoscalingPolicy/components/scalingSchedules/scalingSchedules.component.js +38 -36
- package/src/loadBalancer/configure/http/backendService/backendService.component.js +47 -45
- package/src/loadBalancer/configure/http/basicSettings/basicSettings.component.js +21 -19
- package/src/loadBalancer/configure/http/healthCheck/healthCheck.component.js +37 -35
- package/src/loadBalancer/configure/http/hostRule/hostRule.component.js +9 -7
- package/src/loadBalancer/configure/http/listeners/listener.component.js +46 -45
- package/src/loadBalancer/details/loadBalancerType/loadBalancerType.component.js +11 -9
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinnaker/google",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.12",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
7
10
|
"scripts": {
|
|
8
11
|
"clean": "shx rm -rf dist",
|
|
9
12
|
"prepublishOnly": "npm run build",
|
|
@@ -13,7 +16,7 @@
|
|
|
13
16
|
"lib": "npm run build"
|
|
14
17
|
},
|
|
15
18
|
"dependencies": {
|
|
16
|
-
"@spinnaker/core": "^0.
|
|
19
|
+
"@spinnaker/core": "^0.28.0",
|
|
17
20
|
"@uirouter/angularjs": "1.0.26",
|
|
18
21
|
"angular": "1.6.10",
|
|
19
22
|
"angular-ui-bootstrap": "2.5.0",
|
|
@@ -26,8 +29,8 @@
|
|
|
26
29
|
"ui-select": "0.19.8"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
|
-
"@spinnaker/eslint-plugin": "^3.0.
|
|
30
|
-
"@spinnaker/scripts": "^0.
|
|
32
|
+
"@spinnaker/eslint-plugin": "^3.0.2",
|
|
33
|
+
"@spinnaker/scripts": "^0.4.0",
|
|
31
34
|
"@types/angular": "1.6.26",
|
|
32
35
|
"@types/angular-mocks": "1.5.10",
|
|
33
36
|
"@types/angular-ui-bootstrap": "0.13.41",
|
|
@@ -37,5 +40,5 @@
|
|
|
37
40
|
"shx": "0.3.3",
|
|
38
41
|
"typescript": "4.3.5"
|
|
39
42
|
},
|
|
40
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "20d6ca89f39a5f44a802a1ccaffd669587450d76"
|
|
41
44
|
}
|
|
@@ -16,91 +16,93 @@ module(GOOGLE_AUTOSCALINGPOLICY_COMPONENTS_METRICSETTINGS_METRICSETTINGS_COMPONE
|
|
|
16
16
|
},
|
|
17
17
|
templateUrl: require('./metricSettings.component.html'),
|
|
18
18
|
controller: function () {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.policy[metricType]
|
|
19
|
+
this.$onInit = () => {
|
|
20
|
+
const multipleAllowedFor = {
|
|
21
|
+
cpuUtilization: false,
|
|
22
|
+
loadBalancingUtilization: false,
|
|
23
|
+
customMetricUtilizations: true,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const metricTypes = Object.keys(multipleAllowedFor);
|
|
27
|
+
|
|
28
|
+
this.targetTypesToDisplayMap = {
|
|
29
|
+
GAUGE: 'Gauge',
|
|
30
|
+
DELTA_PER_SECOND: 'Delta / second',
|
|
31
|
+
DELTA_PER_MINUTE: 'Delta / minute',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
this.metricScopeTypesToDisplayMap = {
|
|
35
|
+
TIME_SERIES_PER_INSTANCE: 'Time series per instance',
|
|
36
|
+
SINGLE_TIME_SERIES_PER_GROUP: 'Single time series per group',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
this.scalingpolicyTypesToDisplayMap = {
|
|
40
|
+
UTILIZATION_TARGET: 'Utilization target',
|
|
41
|
+
SINGLE_INSTANCE_ASSIGNMENT: 'singleInstanceAssignment',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
this.addMetric = (metricType) => {
|
|
45
|
+
if (multipleAllowedFor[metricType]) {
|
|
46
|
+
this.policy[metricType] = this.policy[metricType] || [];
|
|
47
|
+
this.policy[metricType].push({});
|
|
48
|
+
} else if (emptyOrUndefined(this.policy[metricType])) {
|
|
49
|
+
this.policy[metricType] = { utilizationTarget: null };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
this.deleteMetric = (metricType, index) => {
|
|
54
|
+
if (multipleAllowedFor[metricType]) {
|
|
55
|
+
this.policy[metricType].splice(index, 1);
|
|
56
|
+
} else {
|
|
57
|
+
// sending an empty object to the API deletes the policy.
|
|
58
|
+
this.policy[metricType] = {};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
this.showMetric = (metricType) => {
|
|
63
|
+
const metric = this.policy[metricType];
|
|
64
|
+
// should not show policy form if the policy is undefined or an empty object.
|
|
65
|
+
return !emptyOrUndefined(metric);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
this.isSingleTimeSeriesPerGroup = (scopeType, index) => {
|
|
69
|
+
if (this.policy.customMetricUtilizations[index].metricExportScope === scopeType) return true;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
this.isScalingPolicySingleInstanceAssignment = (policyType, index) => {
|
|
73
|
+
if (this.policy.customMetricUtilizations[index].scalingpolicy === policyType) return true;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
this.showNoMetricsWarning = () => {
|
|
77
|
+
return _.every(
|
|
78
|
+
metricTypes.map((type) => {
|
|
79
|
+
return _.some([
|
|
80
|
+
multipleAllowedFor[type] && !_.get(this.policy, [type, 'length']),
|
|
81
|
+
emptyOrUndefined(this.policy[type]),
|
|
82
|
+
]);
|
|
83
|
+
}),
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
this.setUtilizationTargetFromDisplay = (metricType, value) => {
|
|
88
|
+
this.policy[metricType].utilizationTarget = value / 100;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
this.initializeTargetDisplay = (metricType) => {
|
|
92
|
+
this[`${metricType}TargetDisplay`] = safeDecimalToPercent(this.policy[metricType].utilizationTarget);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
function safeDecimalToPercent(value) {
|
|
96
|
+
if (value === 0) {
|
|
97
|
+
return 0;
|
|
98
|
+
}
|
|
99
|
+
return value ? Math.round(value * 100) : undefined;
|
|
49
100
|
}
|
|
50
|
-
};
|
|
51
101
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.policy[metricType].splice(index, 1);
|
|
55
|
-
} else {
|
|
56
|
-
// sending an empty object to the API deletes the policy.
|
|
57
|
-
this.policy[metricType] = {};
|
|
102
|
+
function emptyOrUndefined(value) {
|
|
103
|
+
return _.isEqual(value, {}) || _.isUndefined(value);
|
|
58
104
|
}
|
|
59
105
|
};
|
|
60
|
-
|
|
61
|
-
this.showMetric = (metricType) => {
|
|
62
|
-
const metric = this.policy[metricType];
|
|
63
|
-
// should not show policy form if the policy is undefined or an empty object.
|
|
64
|
-
return !emptyOrUndefined(metric);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
this.isSingleTimeSeriesPerGroup = (scopeType, index) => {
|
|
68
|
-
if (this.policy.customMetricUtilizations[index].metricExportScope === scopeType) return true;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
this.isScalingPolicySingleInstanceAssignment = (policyType, index) => {
|
|
72
|
-
if (this.policy.customMetricUtilizations[index].scalingpolicy === policyType) return true;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
this.showNoMetricsWarning = () => {
|
|
76
|
-
return _.every(
|
|
77
|
-
metricTypes.map((type) => {
|
|
78
|
-
return _.some([
|
|
79
|
-
multipleAllowedFor[type] && !_.get(this.policy, [type, 'length']),
|
|
80
|
-
emptyOrUndefined(this.policy[type]),
|
|
81
|
-
]);
|
|
82
|
-
}),
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
this.setUtilizationTargetFromDisplay = (metricType, value) => {
|
|
87
|
-
this.policy[metricType].utilizationTarget = value / 100;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
this.initializeTargetDisplay = (metricType) => {
|
|
91
|
-
this[`${metricType}TargetDisplay`] = safeDecimalToPercent(this.policy[metricType].utilizationTarget);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
function safeDecimalToPercent(value) {
|
|
95
|
-
if (value === 0) {
|
|
96
|
-
return 0;
|
|
97
|
-
}
|
|
98
|
-
return value ? Math.round(value * 100) : undefined;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function emptyOrUndefined(value) {
|
|
102
|
-
return _.isEqual(value, {}) || _.isUndefined(value);
|
|
103
|
-
}
|
|
104
106
|
},
|
|
105
107
|
},
|
|
106
108
|
);
|
|
@@ -16,44 +16,46 @@ module(GOOGLE_AUTOSCALINGPOLICY_COMPONENTS_SCALINGSCHEDULES_SCALINGSCHEDULES_COM
|
|
|
16
16
|
},
|
|
17
17
|
templateUrl: require('./scalingSchedules.component.html'),
|
|
18
18
|
controller: function () {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.policy[scheduleType]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
19
|
+
this.$onInit = () => {
|
|
20
|
+
const multipleAllowedFor = {
|
|
21
|
+
scalingSchedules: true,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
this.timezones = timezones;
|
|
25
|
+
|
|
26
|
+
this.addSchedule = (scheduleType) => {
|
|
27
|
+
if (multipleAllowedFor[scheduleType]) {
|
|
28
|
+
this.policy[scheduleType] = this.policy[scheduleType] || [];
|
|
29
|
+
this.policy[scheduleType].push({});
|
|
30
|
+
} else if (emptyOrUndefined(this.policy[scheduleType])) {
|
|
31
|
+
this.policy[scheduleType] = {};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
this.deleteSchedule = (scheduleType, index) => {
|
|
36
|
+
if (multipleAllowedFor[scheduleType]) {
|
|
37
|
+
this.policy[scheduleType].splice(index, 1);
|
|
38
|
+
} else {
|
|
39
|
+
// sending an empty object to the API deletes the policy.
|
|
40
|
+
this.policy[scheduleType] = {};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
this.selectTimezone = (timezone, index) => {
|
|
45
|
+
const { scalingSchedules } = this.policy;
|
|
46
|
+
const schedule = scalingSchedules[index];
|
|
47
|
+
scalingSchedules[index] = { ...schedule, timezone };
|
|
48
|
+
|
|
49
|
+
this.updatePolicy({
|
|
50
|
+
...this.policy,
|
|
51
|
+
scalingSchedules: [...scalingSchedules],
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function emptyOrUndefined(value) {
|
|
56
|
+
return _.isEqual(value, {}) || _.isUndefined(value);
|
|
40
57
|
}
|
|
41
58
|
};
|
|
42
|
-
|
|
43
|
-
this.selectTimezone = (timezone, index) => {
|
|
44
|
-
const { scalingSchedules } = this.policy;
|
|
45
|
-
const schedule = scalingSchedules[index];
|
|
46
|
-
scalingSchedules[index] = { ...schedule, timezone };
|
|
47
|
-
|
|
48
|
-
this.updatePolicy({
|
|
49
|
-
...this.policy,
|
|
50
|
-
scalingSchedules: [...scalingSchedules],
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
function emptyOrUndefined(value) {
|
|
55
|
-
return _.isEqual(value, {}) || _.isUndefined(value);
|
|
56
|
-
}
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
);
|
|
@@ -18,60 +18,62 @@ module(GOOGLE_LOADBALANCER_CONFIGURE_HTTP_BACKENDSERVICE_BACKENDSERVICE_COMPONEN
|
|
|
18
18
|
},
|
|
19
19
|
templateUrl: require('./backendService.component.html'),
|
|
20
20
|
controller: function () {
|
|
21
|
-
this
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
this.$onInit = () => {
|
|
22
|
+
this.backingData = this.command.backingData;
|
|
23
|
+
this.loadBalancer = this.command.loadBalancer;
|
|
24
|
+
const servicesByName = this.backingData.backendServicesKeyedByName;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
this.onBackendServiceSelect = (selectedBackendService) => {
|
|
27
|
+
assign(selectedBackendService);
|
|
28
|
+
this.command.onHealthCheckSelected(selectedBackendService.healthCheck, this.command);
|
|
29
|
+
};
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
this.toggleEditExisting = () => {
|
|
32
|
+
this.editExisting = !this.editExisting;
|
|
33
|
+
if (!this.editExisting) {
|
|
34
|
+
const template = new BackendServiceTemplate();
|
|
35
|
+
assign(template);
|
|
36
|
+
} else {
|
|
37
|
+
delete this.backendService.name;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
this.getAllHealthChecks = () => {
|
|
42
|
+
const allHealthChecks = this.loadBalancer.healthChecks.concat(this.backingData.healthChecks);
|
|
43
|
+
return _.chain(allHealthChecks)
|
|
44
|
+
.filter((hc) => hc.account === this.loadBalancer.credentials || !hc.account)
|
|
45
|
+
.map((hc) => hc.name)
|
|
46
|
+
.uniq()
|
|
47
|
+
.value();
|
|
48
|
+
};
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
this.getSessionAffinitySuggestions = () => {
|
|
51
|
+
if (this.loadBalancer.loadBalancerType === 'HTTP') {
|
|
52
|
+
return ['None', 'Client IP', 'Generated Cookie'];
|
|
53
|
+
} else {
|
|
54
|
+
return ['None', 'Client IP', 'Generated Cookie', 'Header Field', 'HTTP Cookie'];
|
|
55
|
+
}
|
|
56
|
+
};
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
this.getAllServiceNames = () => {
|
|
59
|
+
return this.command.backingData.backendServices
|
|
60
|
+
.filter((service) => service.account === this.loadBalancer.credentials)
|
|
61
|
+
.map((service) => service.name);
|
|
62
|
+
};
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
this.maxCookieTtl = 60 * 60 * 24; // One day.
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const getBackendServiceName = () => {
|
|
67
|
+
return _.get(this, 'backendService.name');
|
|
68
|
+
};
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
if (servicesByName[getBackendServiceName()]) {
|
|
71
|
+
this.editExisting = true;
|
|
72
|
+
}
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
const assign = (toAssign) => {
|
|
75
|
+
this.loadBalancer.backendServices[this.index] = this.backendService = toAssign;
|
|
76
|
+
};
|
|
75
77
|
};
|
|
76
78
|
},
|
|
77
79
|
},
|
|
@@ -15,30 +15,32 @@ module(GOOGLE_LOADBALANCER_CONFIGURE_HTTP_BASICSETTINGS_BASICSETTINGS_COMPONENT,
|
|
|
15
15
|
},
|
|
16
16
|
templateUrl: require('./basicSettings.component.html'),
|
|
17
17
|
controller: function () {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
this.$onInit = () => {
|
|
19
|
+
const c = this.command;
|
|
20
|
+
this.loadBalancer = c.loadBalancer;
|
|
21
|
+
this.accounts = c.backingData.accounts;
|
|
22
|
+
const loadBalancerMap = c.backingData.loadBalancerMap;
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
this.getName = (loadBalancer, applicationName) => {
|
|
25
|
+
const loadBalancerName = [applicationName, loadBalancer.stack || '', loadBalancer.detail || ''].join('-');
|
|
26
|
+
return _.trimEnd(loadBalancerName, '-');
|
|
27
|
+
};
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
this.updateName = (lb, appName) => {
|
|
30
|
+
lb.urlMapName = this.getName(lb, appName);
|
|
31
|
+
};
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
this.accountChanged = (account) => {
|
|
34
|
+
this.existingLoadBalancerNames = _.get(loadBalancerMap, [account, 'urlMapNames']) || [];
|
|
35
|
+
c.onAccountChange(c);
|
|
36
|
+
};
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
if (!this.loadBalancer.name) {
|
|
39
|
+
this.updateName(this.loadBalancer, this.application.name);
|
|
40
|
+
}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
this.existingLoadBalancerNames = _.get(loadBalancerMap, [this.loadBalancer.credentials, 'urlMapNames']) || [];
|
|
43
|
+
};
|
|
42
44
|
},
|
|
43
45
|
},
|
|
44
46
|
);
|
|
@@ -19,49 +19,51 @@ module(GOOGLE_LOADBALANCER_CONFIGURE_HTTP_HEALTHCHECK_HEALTHCHECK_COMPONENT, [])
|
|
|
19
19
|
},
|
|
20
20
|
templateUrl: require('./healthCheck.component.html'),
|
|
21
21
|
controller: function () {
|
|
22
|
-
this
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
this.$onInit = () => {
|
|
23
|
+
this.max = Number.MAX_SAFE_INTEGER;
|
|
24
|
+
this.backingData = this.command.backingData;
|
|
25
|
+
this.loadBalancer = this.command.loadBalancer;
|
|
26
|
+
const healthChecksByName = this.backingData.healthChecksKeyedByName;
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
this.onHealthCheckSelect = (selectedHealthCheck) => {
|
|
29
|
+
assign(selectedHealthCheck);
|
|
30
|
+
};
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
this.getAllHealthCheckNames = () => {
|
|
33
|
+
return this.command.backingData.healthChecks
|
|
34
|
+
.filter((hc) => hc.account === this.loadBalancer.credentials)
|
|
35
|
+
.map((hc) => hc.name);
|
|
36
|
+
};
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
this.toggleEditExisting = () => {
|
|
39
|
+
this.editExisting = !this.editExisting;
|
|
40
|
+
if (!this.editExisting) {
|
|
41
|
+
assign(new HealthCheckTemplate());
|
|
42
|
+
} else {
|
|
43
|
+
delete this.healthCheck.name;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const assign = (toAssign) => {
|
|
48
|
+
this.loadBalancer.healthChecks[this.index] = this.healthCheck = toAssign;
|
|
49
|
+
};
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const getHealthCheckName = () => {
|
|
52
|
+
return _.get(this, 'healthCheck.name');
|
|
53
|
+
};
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
this.onProtocolChange = () => {
|
|
56
|
+
if (this.healthCheck.healthCheckType !== this.healthCheckType) {
|
|
57
|
+
assign(Object.assign({}, new HealthCheckTemplate(), { healthCheckType: this.healthCheckType }));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
if (healthChecksByName[getHealthCheckName()]) {
|
|
62
|
+
this.editExisting = true;
|
|
63
|
+
}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
this.healthCheckType = this.healthCheck.healthCheckType;
|
|
66
|
+
};
|
|
65
67
|
},
|
|
66
68
|
},
|
|
67
69
|
);
|
|
@@ -19,15 +19,17 @@ module(GOOGLE_LOADBALANCER_CONFIGURE_HTTP_HOSTRULE_HOSTRULE_COMPONENT, [
|
|
|
19
19
|
},
|
|
20
20
|
templateUrl: require('./hostRule.component.html'),
|
|
21
21
|
controller: function () {
|
|
22
|
-
this
|
|
23
|
-
|
|
22
|
+
this.$onInit = () => {
|
|
23
|
+
this.loadBalancer = this.command.loadBalancer;
|
|
24
|
+
const pathRules = this.hostRule.pathMatcher.pathRules;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
this.addPathRule = () => {
|
|
27
|
+
pathRules.push(new PathRuleTemplate());
|
|
28
|
+
};
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
this.deletePathRule = (index) => {
|
|
31
|
+
pathRules.splice(index, 1);
|
|
32
|
+
};
|
|
31
33
|
};
|
|
32
34
|
},
|
|
33
35
|
});
|