2017-06-20 10:54:27 +00:00
|
|
|
<div ng-if="service.ServiceMounts" id="service-mounts">
|
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="Mounts">
|
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 ||addMount(service)" ng-disabled="isUpdating">
|
|
|
|
<i class="fa fa-plus-circle" aria-hidden="true"></i> mount
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</rd-widget-header>
|
|
|
|
<rd-widget-body ng-if="service.ServiceMounts.length === 0">
|
|
|
|
<p>There are no mounts for this service.</p>
|
|
|
|
</rd-widget-body>
|
|
|
|
<rd-widget-body ng-if="service.ServiceMounts.length > 0" classes="no-padding">
|
2020-04-10 21:54:53 +00:00
|
|
|
<table class="table">
|
2017-03-20 20:28:09 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2018-03-29 07:41:47 +00:00
|
|
|
<th ng-if="isAdmin || allowBindMounts">Type</th>
|
2017-03-20 20:28:09 +00:00
|
|
|
<th>Source</th>
|
|
|
|
<th>Target</th>
|
2020-01-31 15:49:59 +00:00
|
|
|
<th authorization="DockerServiceUpdate">Read only</th>
|
|
|
|
<th authorization="DockerServiceUpdate">Actions</th>
|
2017-03-20 20:28:09 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr ng-repeat="mount in service.ServiceMounts">
|
2018-03-29 07:41:47 +00:00
|
|
|
<td ng-if="isAdmin || allowBindMounts">
|
2021-02-11 03:38:25 +00:00
|
|
|
<select
|
|
|
|
name="mountType"
|
|
|
|
class="form-control"
|
|
|
|
ng-model="mount.Type"
|
|
|
|
ng-change="updateMount(service, mount)"
|
|
|
|
ng-disabled="isUpdating"
|
|
|
|
disable-authorization="DockerServiceUpdate"
|
|
|
|
>
|
2017-03-20 20:28:09 +00:00
|
|
|
<option value="volume">Volume</option>
|
|
|
|
<option value="bind">Bind</option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td>
|
2020-04-10 21:54:53 +00:00
|
|
|
<select
|
|
|
|
class="form-control"
|
|
|
|
ng-model="mount.Source"
|
|
|
|
ng-options="vol.Id as ((vol.Id|truncate:30) + ' - ' + (vol.Driver|truncate:30)) for vol in availableVolumes"
|
|
|
|
ng-if="mount.Type === 'volume'"
|
2021-02-11 03:38:25 +00:00
|
|
|
ng-change="updateMount(service, mount)"
|
2020-04-10 21:54:53 +00:00
|
|
|
disable-authorization="DockerServiceUpdate"
|
|
|
|
>
|
2018-03-29 07:41:47 +00:00
|
|
|
<option selected disabled hidden value="">Select a volume</option>
|
|
|
|
</select>
|
2020-04-10 21:54:53 +00:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
class="form-control"
|
2020-12-14 03:27:05 +00:00
|
|
|
name=""
|
2020-04-10 21:54:53 +00:00
|
|
|
ng-model="mount.Source"
|
|
|
|
placeholder="e.g. /tmp/portainer/data"
|
|
|
|
ng-change="updateMount(service, mount)"
|
|
|
|
ng-disabled="isUpdating || (!isAdmin && !allowBindMounts && mount.Type === 'bind')"
|
|
|
|
ng-if="mount.Type === 'bind'"
|
|
|
|
/>
|
2020-12-14 03:27:05 +00:00
|
|
|
<div class="col-sm-12 small text-warning" ng-show="!mount.Source"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Source is required. </div>
|
2017-03-20 20:28:09 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2020-04-10 21:54:53 +00:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
class="form-control"
|
|
|
|
ng-model="mount.Target"
|
|
|
|
placeholder="e.g. /tmp/portainer/data"
|
|
|
|
ng-change="updateMount(service, mount)"
|
|
|
|
ng-disabled="isUpdating"
|
|
|
|
disable-authorization="DockerServiceUpdate"
|
|
|
|
/>
|
2020-12-14 03:27:05 +00:00
|
|
|
<div class="col-sm-12 small text-warning" ng-show="!mount.Target"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Target is required. </div>
|
2017-03-20 20:28:09 +00:00
|
|
|
</td>
|
2020-01-31 15:49:59 +00:00
|
|
|
<td authorization="DockerServiceUpdate">
|
2020-04-10 21:54:53 +00:00
|
|
|
<input type="checkbox" class="form-control" ng-model="mount.ReadOnly" ng-change="updateMount(service, mount)" ng-disabled="isUpdating" />
|
2017-03-20 20:28:09 +00:00
|
|
|
</td>
|
2019-05-24 06:04:58 +00:00
|
|
|
<td authorization="DockerServiceUpdate">
|
2017-03-20 20:28:09 +00:00
|
|
|
<span class="input-group-btn">
|
2017-03-27 12:44:39 +00:00
|
|
|
<button class="btn btn-sm btn-danger" type="button" ng-click="removeMount(service, $index)" ng-disabled="isUpdating">
|
|
|
|
<i class="fa fa-trash" aria-hidden="true"></i>
|
2017-03-20 20:28:09 +00:00
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
</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">
|
2020-12-14 03:27:05 +00:00
|
|
|
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!mountsAreValid() || !hasChanges(service, ['ServiceMounts'])" ng-click="updateService(service)">
|
|
|
|
Apply changes
|
|
|
|
</button>
|
2017-03-20 20:28:09 +00:00
|
|
|
<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, ['ServiceMounts'])">Reset changes</a></li>
|
|
|
|
<li><a ng-click="cancelChanges(service)">Reset all changes</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</rd-widget-footer>
|
|
|
|
</rd-widget>
|
|
|
|
</div>
|