-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(provider/openstack): Add Scheduler Hints and Availability Zone S…
…elect (#4740) Update help text for availability zones
- Loading branch information
1 parent
efbeef4
commit 1265376
Showing
8 changed files
with
179 additions
and
127 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
49 changes: 0 additions & 49 deletions
49
...dules/openstack/src/serverGroup/configure/wizard/advanced/advancedSettings.component.html
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
...modules/openstack/src/serverGroup/configure/wizard/advanced/advancedSettings.component.js
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
...odules/openstack/src/serverGroup/configure/wizard/advanced/advancedSettings.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,53 @@ | ||
'use strict'; | ||
|
||
const angular = require('angular'); | ||
|
||
import {V2_MODAL_WIZARD_SERVICE} from '@spinnaker/core'; | ||
|
||
module.exports = angular | ||
.module('spinnaker.openstack.serverGroup.configure.wizard.advancedSettings', [ | ||
require('@uirouter/angularjs').default, | ||
require('angular-ui-bootstrap'), | ||
require('../../../../common/cacheBackedMultiSelectField.directive.js').name, | ||
]) | ||
.controller('openstackServerGroupAdvancedSettingsCtrl', function ($scope, v2modalWizardService) { | ||
|
||
$scope.selectedAZs = $scope.command.zones ? | ||
$scope.command.zones.map(i => { | ||
return {id: i, name: i}; | ||
}) : []; | ||
|
||
$scope.updateAvailabilityZones = function () { | ||
$scope.allAvailabilityZones = getAvailabilityZones(); | ||
}; | ||
|
||
$scope.selectedAZsChanged = function () { | ||
$scope.command.zones = _.map($scope.selectedAZs, 'id'); | ||
}; | ||
|
||
$scope.$watch('selectedAZs', $scope.selectedAZsChanged); | ||
|
||
$scope.$watch(function () { | ||
return _.map(getAvailabilityZones(), 'id').join(','); | ||
}, function () { | ||
$scope.selectedAZs = []; | ||
$scope.updateAvailabilityZones(); | ||
}); | ||
|
||
$scope.$watch('command.credentials', $scope.updateAvailabilityZones); | ||
$scope.$watch('command.region', $scope.updateAvailabilityZones); | ||
|
||
function getAvailabilityZones() { | ||
var account = $scope.command.credentials; | ||
var region = $scope.command.region; | ||
if (!account || !region) { | ||
return []; | ||
} else { | ||
var ids = _.get($scope.command, ['backingData', 'credentialsKeyedByAccount', account, 'regionToZones', region], []); | ||
return ids.map(i => { | ||
return {id: i, name: i}; | ||
}); | ||
} | ||
} | ||
|
||
}); |
75 changes: 70 additions & 5 deletions
75
...scripts/modules/openstack/src/serverGroup/configure/wizard/advanced/advancedSettings.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 |
---|---|---|
@@ -1,7 +1,72 @@ | ||
<div class="clearfix"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<openstack-server-group-advanced-settings command="command" application="application"></openstack-server-group-advanced-settings> | ||
</div> | ||
<div class="container-fluid form-horizontal" ng-controller="openstackServerGroupAdvancedSettingsCtrl as advancedSettingsCtrl"> | ||
<div class="modal-body"> | ||
<ng-form name="advancedSettings" novalidate> | ||
<div class="form-group"> | ||
<div class="sm-label-left"> | ||
<b>User Data (optional)</b> | ||
<help-field key="openstack.serverGroup.userData"></help-field> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-md-3 sm-label-right"><b>User Data Type</b></div> | ||
<div class="col-md-7"> | ||
<ui-select ng-model="command.userDataType" class="form-control input-sm"> | ||
<ui-select-match placeholder="Select...">{{$select.selected}}</ui-select-match> | ||
<ui-select-choices repeat="userDataType in command.backingData.userDataTypes | filter: $select.search"> | ||
<span ng-bind-html="userDataType | highlight: $select.search"></span> | ||
</ui-select-choices> | ||
</ui-select> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-md-3 sm-label-right">User Data Value</div> | ||
<div class="col-md-9 no-spel"> | ||
<input type="text" | ||
class="form-control" | ||
ng-model="command.userData" | ||
placeholder="A url that points to a script" | ||
ng-if="command.userDataType == 'URL'"> | ||
<input type="text" | ||
class="form-control" | ||
ng-model="command.userData" | ||
placeholder="A swift object that contains a script, e.g. '<container>:<my/object>'" | ||
ng-if="command.userDataType == 'Swift'"> | ||
<textarea class="form-control nospel" | ||
ng-model="command.userData" | ||
ng-if="command.userDataType=='Text' || !command.userDataType" | ||
rows="3" | ||
placeholder="A raw plaintext script"> | ||
</textarea> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="sm-label-left"> | ||
<b>Zone Placement (optional)</b> | ||
<help-field key="openstack.serverGroup.availabilityZones"></help-field> | ||
</div> | ||
<os-cache-backed-multi-select-field | ||
label="Zones" | ||
cache="allAvailabilityZones" | ||
refresh-cache="updateAvailabilityZones" | ||
required="false" | ||
model="selectedAZs" | ||
on-change="selectedAZsChanged()"> | ||
</os-cache-backed-multi-select-field> | ||
</div> | ||
<div class="form-group"> | ||
<div class="sm-label-left"> | ||
<b>Scheduler Hints (optional)</b> | ||
<help-field key="openstack.serverGroup.schedulerHints"></help-field> | ||
</div> | ||
<map-editor model="command.schedulerHints" allow-empty="true"></map-editor> | ||
</div> | ||
<div class="form-group"> | ||
<div class="sm-label-left"> | ||
<b>Tags (optional)</b> | ||
<help-field key="openstack.serverGroup.tags"></help-field> | ||
</div> | ||
<map-editor model="command.tags" allow-empty="true"></map-editor> | ||
</div> | ||
</ng-form> | ||
</div> | ||
</div> |
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