@spinnaker/appengine 2026.2.2 → 2026.3.0

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.
Files changed (131) hide show
  1. package/dist/appengine.module.d.ts +7 -1
  2. package/dist/domain/index.d.ts +0 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/instance/details/AppengineInstanceDetails.d.ts +11 -0
  7. package/dist/loadBalancer/configure/AppengineCreateLoadBalancerModal.d.ts +29 -0
  8. package/dist/loadBalancer/details/AppengineLoadBalancerActions.d.ts +5 -0
  9. package/dist/loadBalancer/details/AppengineLoadBalancerDetailsSection.d.ts +3 -0
  10. package/dist/loadBalancer/details/index.d.ts +3 -0
  11. package/dist/loadBalancer/details/useAppengineLoadBalancerDetails.d.ts +3 -0
  12. package/dist/loadBalancer/transformer.d.ts +2 -6
  13. package/dist/pipeline/stages/AppengineExecutionDetails.d.ts +15 -0
  14. package/dist/pipeline/stages/AppengineServerGroupStageConfig.d.ts +12 -0
  15. package/dist/pipeline/stages/destroyAsg/appengineDestroyAsgStage.d.ts +1 -1
  16. package/dist/pipeline/stages/disableAsg/appengineDisableAsgStage.d.ts +1 -1
  17. package/dist/pipeline/stages/editLoadBalancer/AppengineEditLoadBalancerStageConfig.d.ts +3 -0
  18. package/dist/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.d.ts +1 -1
  19. package/dist/pipeline/stages/enableAsg/appengineEnableAsgStage.d.ts +1 -1
  20. package/dist/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.d.ts +1 -1
  21. package/dist/pipeline/stages/startServerGroup/appengineStartServerGroupStage.d.ts +1 -1
  22. package/dist/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.d.ts +1 -1
  23. package/dist/serverGroup/configure/serverGroupCommandBuilder.service.d.ts +5 -9
  24. package/dist/serverGroup/configure/wizard/AppengineCloneServerGroupModal.d.ts +22 -0
  25. package/dist/serverGroup/details/AppengineServerGroupActions.d.ts +12 -0
  26. package/dist/serverGroup/details/AppengineServerGroupDetailsSection.d.ts +3 -0
  27. package/dist/serverGroup/details/appengineServerGroupDetailsGetter.d.ts +4 -0
  28. package/dist/serverGroup/details/index.d.ts +3 -0
  29. package/dist/serverGroup/transformer.d.ts +1 -5
  30. package/dist/serverGroup/writer/serverGroup.write.service.d.ts +15 -4
  31. package/package.json +4 -8
  32. package/src/appengine.module.spec.ts +194 -0
  33. package/src/appengine.module.ts +47 -58
  34. package/src/domain/index.ts +0 -1
  35. package/src/index.ts +1 -1
  36. package/src/instance/details/AppengineInstanceDetails.tsx +33 -0
  37. package/src/loadBalancer/configure/AppengineCreateLoadBalancerModal.tsx +342 -0
  38. package/src/loadBalancer/details/AppengineLoadBalancerActions.tsx +66 -0
  39. package/src/loadBalancer/details/AppengineLoadBalancerDetailsSection.tsx +42 -0
  40. package/src/loadBalancer/details/index.ts +3 -0
  41. package/src/loadBalancer/details/useAppengineLoadBalancerDetails.ts +37 -0
  42. package/src/loadBalancer/transformer.ts +3 -14
  43. package/src/pipeline/stages/AppengineExecutionDetails.tsx +90 -0
  44. package/src/pipeline/stages/AppengineServerGroupStageConfig.tsx +190 -0
  45. package/src/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts +17 -43
  46. package/src/pipeline/stages/disableAsg/appengineDisableAsgStage.ts +18 -53
  47. package/src/pipeline/stages/editLoadBalancer/AppengineEditLoadBalancerStageConfig.tsx +94 -0
  48. package/src/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts +14 -74
  49. package/src/pipeline/stages/enableAsg/appengineEnableAsgStage.ts +13 -48
  50. package/src/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts +13 -61
  51. package/src/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts +17 -54
  52. package/src/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts +17 -54
  53. package/src/serverGroup/configure/serverGroupCommandBuilder.service.ts +20 -19
  54. package/src/serverGroup/configure/wizard/AppengineCloneServerGroupModal.tsx +119 -0
  55. package/src/serverGroup/configure/wizard/serverGroupWizard.less +0 -8
  56. package/src/serverGroup/details/AppengineServerGroupActions.tsx +245 -0
  57. package/src/serverGroup/details/AppengineServerGroupDetailsSection.tsx +27 -0
  58. package/src/serverGroup/details/appengineServerGroupDetailsGetter.ts +62 -0
  59. package/src/serverGroup/details/index.ts +3 -0
  60. package/src/serverGroup/transformer.ts +3 -15
  61. package/src/serverGroup/writer/serverGroup.write.service.ts +57 -8
  62. package/dist/common/componentUrlDetails.component.d.ts +0 -1
  63. package/dist/common/conditionalDescriptionListItem.component.d.ts +0 -1
  64. package/dist/common/loadBalancerMessage.component.d.ts +0 -1
  65. package/dist/domain/IAppengineStageScope.d.ts +0 -18
  66. package/dist/instance/details/details.controller.d.ts +0 -1
  67. package/dist/loadBalancer/configure/wizard/advancedSettings.component.d.ts +0 -1
  68. package/dist/loadBalancer/configure/wizard/allocationConfigurationRow.component.d.ts +0 -1
  69. package/dist/loadBalancer/configure/wizard/basicSettings.component.d.ts +0 -1
  70. package/dist/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.d.ts +0 -1
  71. package/dist/loadBalancer/configure/wizard/wizard.controller.d.ts +0 -2
  72. package/dist/loadBalancer/details/details.controller.d.ts +0 -1
  73. package/dist/loadBalancer/loadBalancer.module.d.ts +0 -1
  74. package/dist/pipeline/pipeline.module.d.ts +0 -1
  75. package/dist/pipeline/stages/appengineStage.controller.d.ts +0 -12
  76. package/dist/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.d.ts +0 -1
  77. package/dist/serverGroup/configure/wizard/basicSettings.controller.d.ts +0 -1
  78. package/dist/serverGroup/configure/wizard/cloneServerGroup.controller.d.ts +0 -2
  79. package/dist/serverGroup/configure/wizard/configFileArtifactList.module.d.ts +0 -1
  80. package/dist/serverGroup/configure/wizard/configFiles.component.d.ts +0 -20
  81. package/dist/serverGroup/configure/wizard/dynamicBranchLabel.component.d.ts +0 -1
  82. package/dist/serverGroup/details/details.controller.d.ts +0 -1
  83. package/src/common/componentUrlDetails.component.ts +0 -29
  84. package/src/common/conditionalDescriptionListItem.component.ts +0 -37
  85. package/src/common/loadBalancerMessage.component.html +0 -33
  86. package/src/common/loadBalancerMessage.component.ts +0 -13
  87. package/src/domain/IAppengineStageScope.ts +0 -22
  88. package/src/instance/details/details.controller.ts +0 -116
  89. package/src/instance/details/details.html +0 -99
  90. package/src/loadBalancer/configure/wizard/advancedSettings.component.ts +0 -56
  91. package/src/loadBalancer/configure/wizard/allocationConfigurationRow.component.ts +0 -70
  92. package/src/loadBalancer/configure/wizard/basicSettings.component.html +0 -65
  93. package/src/loadBalancer/configure/wizard/basicSettings.component.ts +0 -98
  94. package/src/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.html +0 -117
  95. package/src/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.ts +0 -108
  96. package/src/loadBalancer/configure/wizard/wizard.controller.ts +0 -163
  97. package/src/loadBalancer/configure/wizard/wizard.html +0 -44
  98. package/src/loadBalancer/configure/wizard/wizard.less +0 -17
  99. package/src/loadBalancer/details/details.controller.ts +0 -151
  100. package/src/loadBalancer/details/details.html +0 -102
  101. package/src/loadBalancer/loadBalancer.module.ts +0 -21
  102. package/src/pipeline/pipeline.module.ts +0 -20
  103. package/src/pipeline/stages/appengineStage.controller.ts +0 -45
  104. package/src/pipeline/stages/destroyAsg/destroyAsgStage.html +0 -16
  105. package/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html +0 -1
  106. package/src/pipeline/stages/disableAsg/disableAsgStage.html +0 -18
  107. package/src/pipeline/stages/disableAsg/disableAsgStepLabel.html +0 -1
  108. package/src/pipeline/stages/editLoadBalancer/editLoadBalancerExecutionDetails.html +0 -33
  109. package/src/pipeline/stages/editLoadBalancer/editLoadBalancerStage.html +0 -51
  110. package/src/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts +0 -65
  111. package/src/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.html +0 -45
  112. package/src/pipeline/stages/enableAsg/enableAsgStage.html +0 -18
  113. package/src/pipeline/stages/enableAsg/enableAsgStepLabel.html +0 -1
  114. package/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html +0 -41
  115. package/src/pipeline/stages/startServerGroup/startServerGroupExecutionDetails.html +0 -26
  116. package/src/pipeline/stages/startServerGroup/startServerGroupStage.html +0 -18
  117. package/src/pipeline/stages/startServerGroup/startServerGroupStepLabel.html +0 -1
  118. package/src/pipeline/stages/stopServerGroup/stopServerGroupExecutionDetails.html +0 -26
  119. package/src/pipeline/stages/stopServerGroup/stopServerGroupStage.html +0 -18
  120. package/src/pipeline/stages/stopServerGroup/stopServerGroupStepLabel.html +0 -1
  121. package/src/serverGroup/configure/wizard/advancedSettings.html +0 -33
  122. package/src/serverGroup/configure/wizard/basicSettings.controller.ts +0 -151
  123. package/src/serverGroup/configure/wizard/basicSettings.html +0 -287
  124. package/src/serverGroup/configure/wizard/cloneServerGroup.controller.ts +0 -103
  125. package/src/serverGroup/configure/wizard/configFileArtifactList.module.ts +0 -18
  126. package/src/serverGroup/configure/wizard/configFiles.component.html +0 -81
  127. package/src/serverGroup/configure/wizard/configFiles.component.ts +0 -121
  128. package/src/serverGroup/configure/wizard/dynamicBranchLabel.component.ts +0 -19
  129. package/src/serverGroup/configure/wizard/serverGroupWizard.html +0 -39
  130. package/src/serverGroup/details/details.controller.ts +0 -463
  131. package/src/serverGroup/details/details.html +0 -229
@@ -1,99 +0,0 @@
1
- <div class="details-panel">
2
- <div class="header">
3
- <instance-details-header
4
- health-state="ctrl.instance.healthState"
5
- instance-id="ctrl.instance ? ctrl.instance.name : ctrl.instanceIdNotFound"
6
- loading="ctrl.state.loading"
7
- standalone="false"
8
- ></instance-details-header>
9
- <div ng-if="!ctrl.state.loading">
10
- <div class="actions">
11
- <div class="dropdown" uib-dropdown dropdown-append-to-body>
12
- <button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle>
13
- Instance Actions <span class="caret"></span>
14
- </button>
15
- <ul class="dropdown-menu" uib-dropdown-menu role="menu">
16
- <li><a href ng-click="ctrl.terminateInstance()">Terminate</a></li>
17
- </ul>
18
- </div>
19
- </div>
20
- </div>
21
- </div>
22
- <div class="content" ng-if="!ctrl.state.loading && ctrl.instance">
23
- <collapsible-section heading="Instance Information" expanded="true">
24
- <dl class="dl-horizontal dl-narrow">
25
- <dt>Launched</dt>
26
- <dd ng-if="ctrl.instance.launchTime">{{ctrl.instance.launchTime | timestamp}}</dd>
27
- <dt>In</dt>
28
- <dd><account-tag account="ctrl.instance.account" pad="right"></account-tag>{{}}</dd>
29
- <dt ng-if="ctrl.instance.serverGroup">Server Group</dt>
30
- <dd ng-if="ctrl.instance.serverGroup">
31
- <a
32
- ui-sref="^.serverGroup({region: ctrl.instance.region,
33
- accountId: ctrl.instance.account,
34
- serverGroup: ctrl.instance.serverGroup,
35
- provider: 'appengine'})"
36
- >{{ctrl.instance.serverGroup}}</a
37
- >
38
- </dd>
39
- <dt>Region</dt>
40
- <dd>{{ctrl.instance.region}}</dd>
41
- <appengine-conditional-dt-dd
42
- component="ctrl.instance"
43
- key="vmZoneName"
44
- label="Zone"
45
- ></appengine-conditional-dt-dd>
46
- </dl>
47
- </collapsible-section>
48
- <collapsible-section heading="Status" expanded="true">
49
- <dl>
50
- <dt>Load Balancer</dt>
51
- <dd>
52
- <span
53
- class="pull-left"
54
- uib-tooltip="{{ctrl.instance.healthState === 'Up' ? ctrl.upToolTip : ctrl.outOfServiceToolTip}}"
55
- tooltip-placement="right"
56
- >
57
- <span class="glyphicon glyphicon-{{ctrl.instance.healthState}}-triangle"></span>
58
- {{ctrl.instance.loadBalancers[0]}}
59
- </span>
60
- </dd>
61
- </dl>
62
- </collapsible-section>
63
- <collapsible-section heading="Metrics" expanded="true">
64
- <dl>
65
- <appengine-conditional-dt-dd component="ctrl.instance" key="instanceStatus" label="Availability">
66
- <key-label><help-field key="appengine.instance.availability"></help-field></key-label>
67
- </appengine-conditional-dt-dd>
68
- <appengine-conditional-dt-dd component="ctrl.instance" key="averageLatency">
69
- <key-label><help-field key="appengine.instance.averageLatency"></help-field></key-label>
70
- <value-label>ms</value-label>
71
- </appengine-conditional-dt-dd>
72
- <appengine-conditional-dt-dd component="ctrl.instance" key="errors">
73
- <key-label><help-field key="appengine.instance.errors"></help-field></key-label>
74
- </appengine-conditional-dt-dd>
75
- <appengine-conditional-dt-dd component="ctrl.instance" key="qps" label="QPS">
76
- <key-label><help-field key="appengine.instance.qps"></help-field></key-label>
77
- </appengine-conditional-dt-dd>
78
- <appengine-conditional-dt-dd component="ctrl.instance" key="requests">
79
- <key-label><help-field key="appengine.instance.requests"></help-field></key-label>
80
- </appengine-conditional-dt-dd>
81
- <appengine-conditional-dt-dd component="ctrl.instance" key="vmStatus" label="VM Status">
82
- <key-label><help-field key="appengine.instance.vmStatus"></help-field></key-label>
83
- </appengine-conditional-dt-dd>
84
- <appengine-conditional-dt-dd
85
- component="ctrl.instance"
86
- key="vmDebugEnabled"
87
- label="Debug Enabled"
88
- ></appengine-conditional-dt-dd>
89
- </dl>
90
- </collapsible-section>
91
- </div>
92
- <div class="content" ng-if="!ctrl.state.loading && !ctrl.instance">
93
- <div class="content-section">
94
- <div class="content-body text-center">
95
- <h3>Instance not found.</h3>
96
- </div>
97
- </div>
98
- </div>
99
- </div>
@@ -1,56 +0,0 @@
1
- import type { IComponentOptions, IController } from 'angular';
2
- import { module } from 'angular';
3
-
4
- import type { AppengineLoadBalancerUpsertDescription } from '../../transformer';
5
-
6
- class AppengineLoadBalancerAdvancedSettingsCtrl implements IController {
7
- public state = { error: false };
8
- public loadBalancer: AppengineLoadBalancerUpsertDescription;
9
-
10
- public disableMigrateTraffic(): boolean {
11
- if (this.loadBalancer.splitDescription.allocationDescriptions.length !== 1) {
12
- return true;
13
- } else {
14
- const targetServerGroupName = this.loadBalancer.splitDescription.allocationDescriptions[0].serverGroupName;
15
- const targetServerGroup = this.loadBalancer.serverGroups.find(
16
- (candidate) => candidate.name === targetServerGroupName,
17
- );
18
-
19
- if (targetServerGroup) {
20
- return !targetServerGroup.allowsGradualTrafficMigration;
21
- } else {
22
- // If the target server group name is not in the load balancer's server groups, then hopefully we are in
23
- // a pipeline stage - we'll leave it up to the user to make smart decisions.
24
- return false;
25
- }
26
- }
27
- }
28
- }
29
-
30
- const appengineLoadBalancerAdvancedSettingsComponent: IComponentOptions = {
31
- bindings: { loadBalancer: '=', application: '<' },
32
- template: `
33
- <ng-form name="advancedSettingsForm">
34
- <div class="row">
35
- <div class="form-group">
36
- <div class="col-md-3 sm-label-right">
37
- Migrate Traffic <help-field key="appengine.loadBalancer.migrateTraffic"></help-field>
38
- </div>
39
- <div class="col-md-9">
40
- <div class="checkbox">
41
- <input type="checkbox" ng-disabled="$ctrl.disableMigrateTraffic() && !($ctrl.loadBalancer.migrateTraffic = false)" ng-model="$ctrl.loadBalancer.migrateTraffic">
42
- </div>
43
- </div>
44
- </div>
45
- </div>
46
- </ng-form>
47
- `,
48
- controller: AppengineLoadBalancerAdvancedSettingsCtrl,
49
- };
50
-
51
- export const APPENGINE_LOAD_BALANCER_ADVANCED_SETTINGS = 'spinnaker.appengine.loadBalancer.advancedSettings.component';
52
-
53
- module(APPENGINE_LOAD_BALANCER_ADVANCED_SETTINGS, []).component(
54
- 'appengineLoadBalancerAdvancedSettings',
55
- appengineLoadBalancerAdvancedSettingsComponent,
56
- );
@@ -1,70 +0,0 @@
1
- import type { IComponentOptions, IController } from 'angular';
2
- import { module } from 'angular';
3
- import { uniq } from 'lodash';
4
-
5
- import type { IAppengineAllocationDescription } from '../../transformer';
6
-
7
- class AppengineAllocationConfigurationRowCtrl implements IController {
8
- public allocationDescription: IAppengineAllocationDescription;
9
- public serverGroupOptions: string[];
10
-
11
- public getServerGroupOptions(): string[] {
12
- if (this.allocationDescription.serverGroupName) {
13
- return uniq(this.serverGroupOptions.concat(this.allocationDescription.serverGroupName));
14
- } else {
15
- return this.serverGroupOptions;
16
- }
17
- }
18
- }
19
-
20
- const appengineAllocationConfigurationRowComponent: IComponentOptions = {
21
- bindings: {
22
- allocationDescription: '<',
23
- removeAllocation: '&',
24
- serverGroupOptions: '<',
25
- onAllocationChange: '&',
26
- },
27
- template: `
28
- <div class="form-group">
29
- <div class="row">
30
- <div class="col-md-7">
31
- <ui-select ng-model="$ctrl.allocationDescription.serverGroupName"
32
- on-select="$ctrl.onAllocationChange()"
33
- class="form-control input-sm">
34
- <ui-select-match placeholder="Select...">
35
- {{$select.selected}}
36
- </ui-select-match>
37
- <ui-select-choices repeat="serverGroup as serverGroup in $ctrl.getServerGroupOptions() | filter: $select.search">
38
- <div ng-bind-html="serverGroup | highlight: $select.search"></div>
39
- </ui-select-choices>
40
- </ui-select>
41
- </div>
42
- <div class="col-md-3">
43
- <div class="input-group input-group-sm">
44
- <input type="number"
45
- ng-model="$ctrl.allocationDescription.allocation"
46
- required
47
- class="form-control input-sm"
48
- min="0"
49
- ng-change="$ctrl.onAllocationChange()"
50
- max="100"/>
51
- <span class="input-group-addon">%</span>
52
- </div>
53
- </div>
54
- <div class="col-md-2">
55
- <a class="btn btn-link sm-label" ng-click="$ctrl.removeAllocation()">
56
- <span class="glyphicon glyphicon-trash"></span>
57
- </a>
58
- </div>
59
- </div>
60
- </div>
61
- `,
62
- controller: AppengineAllocationConfigurationRowCtrl,
63
- };
64
-
65
- export const APPENGINE_ALLOCATION_CONFIGURATION_ROW = 'spinnaker.appengine.allocationConfigurationRow.component';
66
-
67
- module(APPENGINE_ALLOCATION_CONFIGURATION_ROW, []).component(
68
- 'appengineAllocationConfigurationRow',
69
- appengineAllocationConfigurationRowComponent,
70
- );
@@ -1,65 +0,0 @@
1
- <ng-form name="basicSettingsForm">
2
- <div class="row">
3
- <div class="form-group">
4
- <div class="col-md-3 sm-label-right">
5
- Allocations
6
- <help-field key="appengine.loadBalancer.allocations"></help-field>
7
- </div>
8
- <div class="col-md-9">
9
- <div ng-if="!$ctrl.forPipelineConfig">
10
- <appengine-allocation-configuration-row
11
- ng-repeat="description in $ctrl.loadBalancer.splitDescription.allocationDescriptions"
12
- allocation-description="description"
13
- server-group-options="$ctrl.serverGroupOptions"
14
- on-allocation-change="$ctrl.updateServerGroupOptions()"
15
- remove-allocation="$ctrl.removeAllocation($index)"
16
- >
17
- </appengine-allocation-configuration-row>
18
- </div>
19
- <div ng-if="$ctrl.forPipelineConfig">
20
- <appengine-stage-allocation-configuration-row
21
- ng-repeat="description in $ctrl.loadBalancer.splitDescription.allocationDescriptions"
22
- allocation-description="description"
23
- application="$ctrl.application"
24
- region="{{ $ctrl.loadBalancer.region }}"
25
- account="{{ $ctrl.loadBalancer.account || $ctrl.loadBalancer.credentials }}"
26
- server-group-options="$ctrl.serverGroupOptions"
27
- on-allocation-change="$ctrl.updateServerGroupOptions()"
28
- remove-allocation="$ctrl.removeAllocation($index)"
29
- >
30
- </appengine-stage-allocation-configuration-row>
31
- </div>
32
- <button class="add-new col-md-11" ng-if="$ctrl.showAddButton()" ng-click="$ctrl.addAllocation()">
33
- <span class="glyphicon glyphicon-plus-sign"></span> Add allocation
34
- </button>
35
- </div>
36
- </div>
37
- <div class="form-group" ng-if="$ctrl.allocationIsInvalid()">
38
- <div class="col-md-12 text-center">
39
- <p class="alert alert-warning">Allocations must sum to 100%.</p>
40
- </div>
41
- </div>
42
- </div>
43
-
44
- <div class="row" ng-if="$ctrl.showShardByOptions()">
45
- <div class="form-group">
46
- <div class="col-md-3 sm-label-right">Shard By</div>
47
- <div class="col-md-9">
48
- <form class="form-inline">
49
- <div class="form-group">
50
- <label class="radio-inline">
51
- <input type="radio" ng-model="$ctrl.loadBalancer.splitDescription.shardBy" value="IP" />
52
- IP
53
- <help-field key="appengine.loadBalancer.shardBy.ip"></help-field>
54
- </label>
55
- <label class="radio-inline">
56
- <input type="radio" ng-model="$ctrl.loadBalancer.splitDescription.shardBy" value="COOKIE" />
57
- Cookie
58
- <help-field key="appengine.loadBalancer.shardBy.cookie"></help-field>
59
- </label>
60
- </div>
61
- </form>
62
- </div>
63
- </div>
64
- </div>
65
- </ng-form>
@@ -1,98 +0,0 @@
1
- import type { IController } from 'angular';
2
- import { module } from 'angular';
3
- import { difference } from 'lodash';
4
-
5
- import type { AppengineLoadBalancerUpsertDescription } from '../../transformer';
6
-
7
- class AppengineLoadBalancerSettingsController implements IController {
8
- public loadBalancer: AppengineLoadBalancerUpsertDescription;
9
- public serverGroupOptions: string[];
10
- public forPipelineConfig: boolean;
11
-
12
- public $onInit(): void {
13
- this.updateServerGroupOptions();
14
- }
15
-
16
- public addAllocation(): void {
17
- const remainingServerGroups = this.serverGroupsWithoutAllocation();
18
- if (remainingServerGroups.length) {
19
- this.loadBalancer.splitDescription.allocationDescriptions.push({
20
- serverGroupName: remainingServerGroups[0],
21
- allocation: 0,
22
- locatorType: 'fromExisting',
23
- });
24
- if (
25
- this.loadBalancer.splitDescription.allocationDescriptions.length > 1 &&
26
- !this.loadBalancer.splitDescription.shardBy
27
- ) {
28
- this.loadBalancer.splitDescription.shardBy = 'IP';
29
- }
30
- this.updateServerGroupOptions();
31
- } else if (this.forPipelineConfig) {
32
- this.loadBalancer.splitDescription.allocationDescriptions.push({
33
- allocation: 0,
34
- locatorType: 'text',
35
- serverGroupName: '',
36
- });
37
- }
38
- }
39
-
40
- public removeAllocation(index: number): void {
41
- this.loadBalancer.splitDescription.allocationDescriptions.splice(index, 1);
42
- this.updateServerGroupOptions();
43
- }
44
-
45
- public allocationIsInvalid(): boolean {
46
- return (
47
- this.loadBalancer.splitDescription.allocationDescriptions.reduce(
48
- (sum, allocationDescription) => sum + allocationDescription.allocation,
49
- 0,
50
- ) !== 100
51
- );
52
- }
53
-
54
- public updateServerGroupOptions(): void {
55
- this.serverGroupOptions = this.serverGroupsWithoutAllocation();
56
- }
57
-
58
- public showAddButton(): boolean {
59
- if (this.forPipelineConfig) {
60
- return true;
61
- } else {
62
- return this.serverGroupsWithoutAllocation().length > 0;
63
- }
64
- }
65
-
66
- public showShardByOptions(): boolean {
67
- return this.loadBalancer.splitDescription.allocationDescriptions.length > 1 || this.loadBalancer.migrateTraffic;
68
- }
69
-
70
- public initializeAsTextInput(serverGroupName: string): boolean {
71
- if (this.forPipelineConfig) {
72
- return !this.loadBalancer.serverGroups.map((serverGroup) => serverGroup.name).includes(serverGroupName);
73
- } else {
74
- return false;
75
- }
76
- }
77
-
78
- private serverGroupsWithoutAllocation(): string[] {
79
- const serverGroupsWithAllocation = this.loadBalancer.splitDescription.allocationDescriptions.map(
80
- (description) => description.serverGroupName,
81
- );
82
- const allServerGroups = this.loadBalancer.serverGroups.map((serverGroup) => serverGroup.name);
83
- return difference(allServerGroups, serverGroupsWithAllocation);
84
- }
85
- }
86
-
87
- const appengineLoadBalancerSettingsComponent: ng.IComponentOptions = {
88
- bindings: { loadBalancer: '=', forPipelineConfig: '<', application: '<' },
89
- controller: AppengineLoadBalancerSettingsController,
90
- templateUrl: require('./basicSettings.component.html'),
91
- };
92
-
93
- export const APPENGINE_LOAD_BALANCER_BASIC_SETTINGS = 'spinnaker.appengine.loadBalancerSettings.component';
94
-
95
- module(APPENGINE_LOAD_BALANCER_BASIC_SETTINGS, []).component(
96
- 'appengineLoadBalancerBasicSettings',
97
- appengineLoadBalancerSettingsComponent,
98
- );
@@ -1,117 +0,0 @@
1
- <div class="form-group">
2
- <div class="row">
3
- <div class="col-md-7">
4
- <appengine-stage-allocation-label allocation-description="$ctrl.allocationDescription">
5
- </appengine-stage-allocation-label>
6
- </div>
7
- <div class="col-md-3">
8
- <div class="input-group input-group-sm">
9
- <input
10
- type="number"
11
- ng-model="$ctrl.allocationDescription.allocation"
12
- required
13
- class="form-control input-sm"
14
- min="0"
15
- ng-change="$ctrl.onAllocationChange()"
16
- max="100"
17
- />
18
- <span class="input-group-addon">%</span>
19
- </div>
20
- </div>
21
- <div class="col-md-2">
22
- <a class="btn btn-link sm-label" ng-click="$ctrl.removeAllocation()">
23
- <span class="glyphicon glyphicon-trash"></span>
24
- </a>
25
- </div>
26
- </div>
27
- </div>
28
- <div class="form-group">
29
- <div class="well col-md-11" style="padding-top: 5px; padding-bottom: 10px">
30
- <div class="row">
31
- <div class="form-group">
32
- <div class="col-md-3 sm-label-right">Locator</div>
33
- <div class="col-md-7">
34
- <form>
35
- <div class="form-group">
36
- <label class="small" style="font-weight: normal">
37
- <input
38
- type="radio"
39
- ng-change="$ctrl.onLocatorTypeChange()"
40
- ng-model="$ctrl.allocationDescription.locatorType"
41
- value="fromExisting"
42
- />
43
- Existing server group
44
- </label>
45
- <br />
46
- <label class="small" style="font-weight: normal">
47
- <input
48
- type="radio"
49
- ng-change="$ctrl.onLocatorTypeChange()"
50
- ng-model="$ctrl.allocationDescription.locatorType"
51
- value="targetCoordinate"
52
- />
53
- Coordinates
54
- </label>
55
- <br />
56
- <label class="small" style="font-weight: normal">
57
- <input
58
- type="radio"
59
- ng-change="$ctrl.onLocatorTypeChange()"
60
- ng-model="$ctrl.allocationDescription.locatorType"
61
- value="text"
62
- />
63
- Text input
64
- </label>
65
- </div>
66
- </form>
67
- </div>
68
- </div>
69
- </div>
70
- <div class="row">
71
- <div class="form-group" ng-switch on="$ctrl.allocationDescription.locatorType">
72
- <div ng-switch-when="fromExisting">
73
- <div class="col-md-3 sm-label-right" style="padding-left: 0px">Server group</div>
74
- <div class="col-md-7">
75
- <ui-select
76
- ng-model="$ctrl.allocationDescription.serverGroupName"
77
- on-select="$ctrl.onAllocationChange()"
78
- class="form-control input-sm"
79
- >
80
- <ui-select-match placeholder="Select...">
81
- {{ $select.selected }}
82
- </ui-select-match>
83
- <ui-select-choices
84
- repeat="serverGroup as serverGroup in $ctrl.getServerGroupOptions() | filter: $select.search"
85
- >
86
- <div ng-bind-html="serverGroup | highlight: $select.search"></div>
87
- </ui-select-choices>
88
- </ui-select>
89
- </div>
90
- </div>
91
- <div ng-switch-when="targetCoordinate">
92
- <div class="col-md-3 sm-label-right">Cluster</div>
93
- <div class="col-md-7">
94
- <cluster-selector
95
- class="small"
96
- clusters="$ctrl.clusterList"
97
- model="$ctrl.allocationDescription.cluster"
98
- ></cluster-selector>
99
- </div>
100
- <div class="col-md-3 sm-label-right">Target</div>
101
- <div class="col-md-7">
102
- <target-select model="$ctrl.allocationDescription" options="$ctrl.targets"></target-select>
103
- </div>
104
- </div>
105
- <div ng-switch-when="text">
106
- <div class="col-md-3 sm-label-right">
107
- Text
108
- <help-field key="appengine.loadBalancer.textLocator"></help-field>
109
- </div>
110
- <div class="col-md-7">
111
- <input class="form-control input-sm" type="text" ng-model="$ctrl.allocationDescription.serverGroupName" />
112
- </div>
113
- </div>
114
- </div>
115
- </div>
116
- </div>
117
- </div>
@@ -1,108 +0,0 @@
1
- import type { IComponentOptions, IController } from 'angular';
2
- import { module } from 'angular';
3
- import { uniq } from 'lodash';
4
-
5
- import type { Application } from '@spinnaker/core';
6
- import { AppListExtractor, StageConstants } from '@spinnaker/core';
7
-
8
- import type { IAppengineAllocationDescription } from '../../transformer';
9
-
10
- class AppengineStageAllocationLabelCtrl implements IController {
11
- public inputViewValue: string;
12
- private allocationDescription: IAppengineAllocationDescription;
13
-
14
- private static mapTargetCoordinateToLabel(targetCoordinate: string): string {
15
- const target = StageConstants.TARGET_LIST.find((t) => t.val === targetCoordinate);
16
- if (target) {
17
- return target.label;
18
- } else {
19
- return null;
20
- }
21
- }
22
-
23
- public $doCheck(): void {
24
- this.setInputViewValue();
25
- }
26
-
27
- private setInputViewValue(): void {
28
- switch (this.allocationDescription.locatorType) {
29
- case 'text':
30
- this.inputViewValue = this.allocationDescription.serverGroupName;
31
- break;
32
- case 'fromExisting':
33
- this.inputViewValue = this.allocationDescription.serverGroupName;
34
- break;
35
- case 'targetCoordinate':
36
- if (this.allocationDescription.cluster && this.allocationDescription.target) {
37
- const targetLabel = AppengineStageAllocationLabelCtrl.mapTargetCoordinateToLabel(
38
- this.allocationDescription.target,
39
- );
40
- this.inputViewValue = `${targetLabel} (${this.allocationDescription.cluster})`;
41
- } else {
42
- this.inputViewValue = null;
43
- }
44
- break;
45
- default:
46
- this.inputViewValue = null;
47
- break;
48
- }
49
- }
50
- }
51
-
52
- const appengineStageAllocationLabel: IComponentOptions = {
53
- bindings: { allocationDescription: '<' },
54
- controller: AppengineStageAllocationLabelCtrl,
55
- template: `<input ng-model="$ctrl.inputViewValue" type="text" class="form-control input-sm" readonly/>`,
56
- };
57
-
58
- class AppengineStageAllocationConfigurationRowCtrl implements IController {
59
- public allocationDescription: IAppengineAllocationDescription;
60
- public serverGroupOptions: string[];
61
- public targets = StageConstants.TARGET_LIST;
62
- public clusterList: string[];
63
- public onAllocationChange: Function;
64
- private application: Application;
65
- private region: string;
66
- private account: string;
67
-
68
- public $onInit() {
69
- const clusterFilter = AppListExtractor.clusterFilterForCredentialsAndRegion(this.account, this.region);
70
- this.clusterList = AppListExtractor.getClusters([this.application], clusterFilter);
71
- }
72
-
73
- public getServerGroupOptions(): string[] {
74
- if (this.allocationDescription.serverGroupName) {
75
- return uniq(this.serverGroupOptions.concat(this.allocationDescription.serverGroupName));
76
- } else {
77
- return this.serverGroupOptions;
78
- }
79
- }
80
-
81
- public onLocatorTypeChange(): void {
82
- // Prevents pipeline expressions (or non-existent server groups) from entering the dropdown.
83
- if (!this.serverGroupOptions.includes(this.allocationDescription.serverGroupName)) {
84
- delete this.allocationDescription.serverGroupName;
85
- }
86
- this.onAllocationChange();
87
- }
88
- }
89
-
90
- const appengineStageAllocationConfigurationRow: IComponentOptions = {
91
- bindings: {
92
- application: '<',
93
- region: '@',
94
- account: '@',
95
- allocationDescription: '<',
96
- removeAllocation: '&',
97
- serverGroupOptions: '<',
98
- onAllocationChange: '&',
99
- },
100
- controller: AppengineStageAllocationConfigurationRowCtrl,
101
- templateUrl: require('./stageAllocationConfigurationRow.component.html'),
102
- };
103
-
104
- export const APPENGINE_STAGE_ALLOCATION_CONFIGURATION_ROW =
105
- 'spinnaker.appengine.stageAllocationConfigurationRow.component';
106
- module(APPENGINE_STAGE_ALLOCATION_CONFIGURATION_ROW, [])
107
- .component('appengineStageAllocationConfigurationRow', appengineStageAllocationConfigurationRow)
108
- .component('appengineStageAllocationLabel', appengineStageAllocationLabel);