2017-06-20 10:54:27 +00:00
|
|
|
<div ng-if="service.ServiceConstraints" id="service-placement-constraints">
|
2017-03-20 20:28:09 +00:00
|
|
|
<rd-widget>
|
2018-06-06 16:12:35 +00:00
|
|
|
<rd-widget-header icon="fa-tasks" title-text="Placement constraints">
|
2019-05-24 06:04:58 +00:00
|
|
|
<div class="nopadding" authorization="DockerServiceUpdate">
|
2017-03-20 20:28:09 +00:00
|
|
|
<a class="btn btn-default btn-sm pull-right" ng-click="isUpdating || addPlacementConstraint(service)" ng-disabled="isUpdating">
|
|
|
|
<i class="fa fa-plus-circle" aria-hidden="true"></i> placement constraint
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</rd-widget-header>
|
|
|
|
<rd-widget-body ng-if="service.ServiceConstraints.length === 0">
|
|
|
|
<p>There are no placement constraints for this service.</p>
|
|
|
|
</rd-widget-body>
|
|
|
|
<rd-widget-body ng-if="service.ServiceConstraints.length > 0" classes="no-padding">
|
|
|
|
<table class="table" >
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Operator</th>
|
|
|
|
<th>Value</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr ng-repeat="constraint in service.ServiceConstraints">
|
|
|
|
<td>
|
|
|
|
<div class="input-group input-group-sm">
|
|
|
|
<input type="text" class="form-control" ng-model="constraint.key" placeholder="e.g. node.role" ng-change="updatePlacementConstraint(service, constraint)" ng-disabled="isUpdating">
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="input-group input-group-sm">
|
|
|
|
<select name="constraintOperator" class="form-control" ng-model="constraint.operator" ng-change="updatePlacementConstraint(service, constraint)" ng-disabled="isUpdating">
|
|
|
|
<option value="==">==</option>
|
|
|
|
<option value="!=">!=</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="input-group input-group-sm">
|
|
|
|
<input type="text" class="form-control" ng-model="constraint.value" placeholder="e.g. manager" ng-change="updatePlacementConstraint(service, constraint)" ng-disabled="isUpdating">
|
2019-05-24 06:04:58 +00:00
|
|
|
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
2017-03-27 12:44:39 +00:00
|
|
|
<button class="btn btn-sm btn-danger" type="button" ng-click="removePlacementConstraint(service, $index)" ng-disabled="isUpdating">
|
|
|
|
<i class="fa fa-trash" aria-hidden="true"></i>
|
2017-03-20 20:28:09 +00:00
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</rd-widget-body>
|
2019-05-24 06:04:58 +00:00
|
|
|
<rd-widget-footer authorization="DockerServiceUpdate">
|
2017-03-20 20:28:09 +00:00
|
|
|
<div class="btn-toolbar" role="toolbar">
|
|
|
|
<div class="btn-group" role="group">
|
|
|
|
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!hasChanges(service, ['ServiceConstraints'])" ng-click="updateService(service)">Apply changes</button>
|
|
|
|
<button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
<span class="caret"></span>
|
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<li><a ng-click="cancelChanges(service, ['ServiceConstraints'])">Reset changes</a></li>
|
|
|
|
<li><a ng-click="cancelChanges(service)">Reset all changes</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</rd-widget-footer>
|
|
|
|
</rd-widget>
|
|
|
|
</div>
|