2017-12-21 08:53:34 +00:00
|
|
|
<div>
|
|
|
|
<rd-widget>
|
2022-07-19 03:29:50 +00:00
|
|
|
<rd-widget-header icon="list" feather-icon="true" title-text="Hosts file entries">
|
2019-05-24 06:04:58 +00:00
|
|
|
<div class="nopadding" authorization="DockerServiceUpdate">
|
2022-08-12 03:47:56 +00:00
|
|
|
<a class="btn btn-secondary btn-sm pull-right" ng-click="isUpdating ||addHostsEntry(service)" ng-disabled="isUpdating">
|
|
|
|
<pr-icon icon="'plus'" feather="true"></pr-icon> add host entry
|
2017-12-21 08:53:34 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</rd-widget-header>
|
|
|
|
<rd-widget-body ng-if="!service.Hosts || service.Hosts.length === 0">
|
|
|
|
<p>The Hosts file has no extra entries.</p>
|
2019-05-24 06:04:58 +00:00
|
|
|
</rd-widget-body>
|
2017-12-21 08:53:34 +00:00
|
|
|
<rd-widget-body ng-if="service.Hosts.length > 0" classes="no-padding">
|
2020-04-10 21:54:53 +00:00
|
|
|
<table class="table">
|
2017-12-21 08:53:34 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Hostname</th>
|
|
|
|
<th>IP</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr ng-repeat="entry in service.Hosts">
|
|
|
|
<td>
|
|
|
|
<div class="input-group input-group-sm">
|
2020-04-10 21:54:53 +00:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
class="form-control"
|
|
|
|
ng-model="entry.hostname"
|
|
|
|
placeholder="e.g. example.com"
|
|
|
|
ng-change="updateHostsEntry(service, entry)"
|
|
|
|
ng-disabled="isUpdating"
|
|
|
|
disable-authorization="DockerServiceUpdate"
|
|
|
|
/>
|
2017-12-21 08:53:34 +00:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="input-group input-group-sm">
|
2020-04-10 21:54:53 +00:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
class="form-control"
|
|
|
|
ng-model="entry.ip"
|
|
|
|
placeholder="e.g. 10.0.1.1"
|
|
|
|
ng-change="updateHostsEntry(service, entry)"
|
|
|
|
ng-disabled="isUpdating"
|
|
|
|
disable-authorization="DockerServiceUpdate"
|
|
|
|
/>
|
2019-05-24 06:04:58 +00:00
|
|
|
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
2022-07-26 23:18:06 +00:00
|
|
|
<button class="btn btn-sm btn-light" type="button" ng-click="removeHostsEntry(service, $index)" ng-disabled="isUpdating">
|
2022-08-03 00:56:29 +00:00
|
|
|
<pr-icon icon="'trash-2'" feather="true" class-name="'icon-secondary icon-md'"></pr-icon>
|
2017-12-21 08:53:34 +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-12-21 08:53:34 +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, ['Hosts'])" 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, ['Hosts'])">Reset changes</a></li>
|
|
|
|
<li><a ng-click="cancelChanges(service)">Reset all changes</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</rd-widget-footer>
|
|
|
|
</rd-widget>
|
|
|
|
</div>
|