mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 23:05:26 +02:00
chore(project): add prettier for code format (#3645)
* chore(project): install prettier and lint-staged * chore(project): apply prettier to html too * chore(project): git ignore eslintcache * chore(project): add a comment about format script * chore(prettier): update printWidth * chore(prettier): remove useTabs option * chore(prettier): add HTML validation * refactor(prettier): fix closing tags * feat(prettier): define angular parser for html templates * style(prettier): run prettier on codebase Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
parent
6663073be1
commit
cf5056d9c0
714 changed files with 31228 additions and 28305 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,8 +1,6 @@
|
|||
<rd-header>
|
||||
<rd-header-title title-text="Create service"></rd-header-title>
|
||||
<rd-header-content>
|
||||
<a ui-sref="docker.services">Services</a> > Add service
|
||||
</rd-header-content>
|
||||
<rd-header-content> <a ui-sref="docker.services">Services</a> > Add service </rd-header-content>
|
||||
</rd-header>
|
||||
|
||||
<div class="row">
|
||||
|
@ -14,7 +12,7 @@
|
|||
<div class="form-group">
|
||||
<label for="service_name" class="col-sm-1 control-label text-left">Name</label>
|
||||
<div class="col-sm-11">
|
||||
<input type="text" class="form-control" ng-model="formValues.Name" id="service_name" placeholder="e.g. myService">
|
||||
<input type="text" class="form-control" ng-model="formValues.Name" id="service_name" placeholder="e.g. myService" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- !name-input -->
|
||||
|
@ -22,11 +20,7 @@
|
|||
Image configuration
|
||||
</div>
|
||||
<!-- image-and-registry -->
|
||||
<por-image-registry
|
||||
model="formValues.RegistryModel"
|
||||
auto-complete="true"
|
||||
label-class="col-sm-1" input-class="col-sm-11"
|
||||
></por-image-registry>
|
||||
<por-image-registry model="formValues.RegistryModel" auto-complete="true" label-class="col-sm-1" input-class="col-sm-11"></por-image-registry>
|
||||
<!-- !image-and-registry -->
|
||||
<div class="col-sm-12 form-section-title">
|
||||
Scheduling
|
||||
|
@ -48,7 +42,7 @@
|
|||
<label class="control-label text-left">
|
||||
Replicas
|
||||
</label>
|
||||
<input type="number" class="form-control" ng-model="formValues.Replicas" id="replicas" placeholder="e.g. 3" style="margin-left: 20px;">
|
||||
<input type="number" class="form-control" ng-model="formValues.Replicas" id="replicas" placeholder="e.g. 3" style="margin-left: 20px;" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- !scheduling-mode -->
|
||||
|
@ -68,7 +62,7 @@
|
|||
<!-- host-port -->
|
||||
<div class="input-group col-sm-3 input-group-sm">
|
||||
<span class="input-group-addon">host</span>
|
||||
<input type="text" class="form-control" ng-model="portBinding.PublishedPort" placeholder="e.g. 80 or 1.2.3.4:80 (optional)">
|
||||
<input type="text" class="form-control" ng-model="portBinding.PublishedPort" placeholder="e.g. 80 or 1.2.3.4:80 (optional)" />
|
||||
</div>
|
||||
<!-- !host-port -->
|
||||
<span style="margin: 0 10px 0 10px;">
|
||||
|
@ -77,7 +71,7 @@
|
|||
<!-- container-port -->
|
||||
<div class="input-group col-sm-3 input-group-sm">
|
||||
<span class="input-group-addon">container</span>
|
||||
<input type="text" class="form-control" ng-model="portBinding.TargetPort" placeholder="e.g. 80">
|
||||
<input type="text" class="form-control" ng-model="portBinding.TargetPort" placeholder="e.g. 80" />
|
||||
</div>
|
||||
<!-- !container-port -->
|
||||
<!-- protocol-actions -->
|
||||
|
@ -108,11 +102,12 @@
|
|||
<div class="col-sm-12">
|
||||
<label class="control-label text-left">
|
||||
Create a service webhook
|
||||
<portainer-tooltip position="top" message="Create a webhook (or callback URI) to automate the update of this service. Sending a POST request to this callback URI (without requiring any authentication) will pull the most up-to-date version of the associated image and re-deploy this service."></portainer-tooltip>
|
||||
</label>
|
||||
<label class="switch" style="margin-left: 20px;">
|
||||
<input type="checkbox" ng-model="formValues.Webhook"><i></i>
|
||||
<portainer-tooltip
|
||||
position="top"
|
||||
message="Create a webhook (or callback URI) to automate the update of this service. Sending a POST request to this callback URI (without requiring any authentication) will pull the most up-to-date version of the associated image and re-deploy this service."
|
||||
></portainer-tooltip>
|
||||
</label>
|
||||
<label class="switch" style="margin-left: 20px;"> <input type="checkbox" ng-model="formValues.Webhook" /><i></i> </label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- !create-webhook -->
|
||||
|
@ -125,7 +120,13 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !formValues.RegistryModel.Image" ng-click="create()" button-spinner="state.actionInProgress">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="state.actionInProgress || !formValues.RegistryModel.Image"
|
||||
ng-click="create()"
|
||||
button-spinner="state.actionInProgress"
|
||||
>
|
||||
<span ng-hide="state.actionInProgress">Create the service</span>
|
||||
<span ng-show="state.actionInProgress">Creating service...</span>
|
||||
</button>
|
||||
|
@ -150,7 +151,7 @@
|
|||
<li class="interactive"><a data-target="#labels" data-toggle="tab">Labels</a></li>
|
||||
<li class="interactive"><a data-target="#update-config" data-toggle="tab">Update config & Restart</a></li>
|
||||
<li class="interactive" ng-if="applicationState.endpoint.apiVersion >= 1.25"><a data-target="#secrets" data-toggle="tab">Secrets</a></li>
|
||||
<li class="interactive"><a data-target="#configs" data-toggle="tab" ng-if="applicationState.endpoint.apiVersion >= 1.30">Configs</a></li>
|
||||
<li class="interactive"><a data-target="#configs" data-toggle="tab" ng-if="applicationState.endpoint.apiVersion >= 1.3">Configs</a></li>
|
||||
<li class="interactive"><a data-target="#resources-placement" data-toggle="tab" ng-click="refreshSlider()">Resources & Placement</a></li>
|
||||
</ul>
|
||||
<!-- tab-content -->
|
||||
|
@ -165,7 +166,7 @@
|
|||
<div class="form-group">
|
||||
<label for="service_command" class="col-sm-2 col-lg-1 control-label text-left">Command</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" ng-model="formValues.Command" id="service_command" placeholder="e.g. /usr/bin/nginx -t -c /mynginx.conf">
|
||||
<input type="text" class="form-control" ng-model="formValues.Command" id="service_command" placeholder="e.g. /usr/bin/nginx -t -c /mynginx.conf" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- !command-input -->
|
||||
|
@ -173,7 +174,7 @@
|
|||
<div class="form-group">
|
||||
<label for="service_entrypoint" class="col-sm-2 col-lg-1 control-label text-left">Entrypoint</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" ng-model="formValues.EntryPoint" id="service_entrypoint" placeholder="e.g. /bin/sh -c">
|
||||
<input type="text" class="form-control" ng-model="formValues.EntryPoint" id="service_entrypoint" placeholder="e.g. /bin/sh -c" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- !entrypoint-input -->
|
||||
|
@ -181,11 +182,11 @@
|
|||
<div class="form-group">
|
||||
<label for="service_workingdir" class="col-sm-2 col-lg-1 control-label text-left">Working Dir</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" ng-model="formValues.WorkingDir" id="service_workingdir" placeholder="e.g. /myapp">
|
||||
<input type="text" class="form-control" ng-model="formValues.WorkingDir" id="service_workingdir" placeholder="e.g. /myapp" />
|
||||
</div>
|
||||
<label for="service_user" class="col-sm-1 control-label text-left">User</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" ng-model="formValues.User" id="service_user" placeholder="e.g. nginx">
|
||||
<input type="text" class="form-control" ng-model="formValues.User" id="service_user" placeholder="e.g. nginx" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- !workdir-user-input -->
|
||||
|
@ -202,11 +203,11 @@
|
|||
<div ng-repeat="variable in formValues.Env" style="margin-top: 2px;">
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">name</span>
|
||||
<input type="text" class="form-control" ng-model="variable.name" placeholder="e.g. FOO">
|
||||
<input type="text" class="form-control" ng-model="variable.name" placeholder="e.g. FOO" />
|
||||
</div>
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">value</span>
|
||||
<input type="text" class="form-control" ng-model="variable.value" placeholder="e.g. bar">
|
||||
<input type="text" class="form-control" ng-model="variable.value" placeholder="e.g. bar" />
|
||||
</div>
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeEnvironmentVariable($index)">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
@ -232,7 +233,9 @@
|
|||
</div>
|
||||
<div class="col-sm-5">
|
||||
<p class="small text-muted">
|
||||
Logging driver for service that will override the default docker daemon driver. Select Default logging driver if you don't want to override it. Supported logging drivers can be found <a href="https://docs.docker.com/engine/admin/logging/overview/#supported-logging-drivers" target="_blank">in the Docker documentation</a>.
|
||||
Logging driver for service that will override the default docker daemon driver. Select Default logging driver if you don't want to override it. Supported
|
||||
logging drivers can be found
|
||||
<a href="https://docs.docker.com/engine/admin/logging/overview/#supported-logging-drivers" target="_blank">in the Docker documentation</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -242,9 +245,16 @@
|
|||
<div class="col-sm-12" style="margin-top: 5px;">
|
||||
<label class="control-label text-left">
|
||||
Options
|
||||
<portainer-tooltip position="top" message="Add button is disabled unless a driver other than none or default is selected. Options are specific to the selected driver, refer to the driver documentation."></portainer-tooltip>
|
||||
<portainer-tooltip
|
||||
position="top"
|
||||
message="Add button is disabled unless a driver other than none or default is selected. Options are specific to the selected driver, refer to the driver documentation."
|
||||
></portainer-tooltip>
|
||||
</label>
|
||||
<span class="label label-default interactive" style="margin-left: 10px;" ng-click="!formValues.LogDriverName || formValues.LogDriverName === 'none' || addLogDriverOpt(formValues.LogDriverName)">
|
||||
<span
|
||||
class="label label-default interactive"
|
||||
style="margin-left: 10px;"
|
||||
ng-click="!formValues.LogDriverName || formValues.LogDriverName === 'none' || addLogDriverOpt(formValues.LogDriverName)"
|
||||
>
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i> add logging driver option
|
||||
</span>
|
||||
</div>
|
||||
|
@ -253,11 +263,11 @@
|
|||
<div ng-repeat="opt in formValues.LogDriverOpts" style="margin-top: 2px;">
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">option</span>
|
||||
<input type="text" class="form-control" ng-model="opt.name" placeholder="e.g. FOO">
|
||||
<input type="text" class="form-control" ng-model="opt.name" placeholder="e.g. FOO" />
|
||||
</div>
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">value</span>
|
||||
<input type="text" class="form-control" ng-model="opt.value" placeholder="e.g. bar">
|
||||
<input type="text" class="form-control" ng-model="opt.value" placeholder="e.g. bar" />
|
||||
</div>
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeLogDriverOpt($index)">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
@ -267,8 +277,6 @@
|
|||
<!-- logging-opts-input-list -->
|
||||
</div>
|
||||
<!-- !logging-opts -->
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<!-- !tab-command -->
|
||||
|
@ -292,7 +300,7 @@
|
|||
<!-- container-path -->
|
||||
<div class="input-group input-group-sm col-sm-6">
|
||||
<span class="input-group-addon">container</span>
|
||||
<input type="text" class="form-control" ng-model="volume.Target" placeholder="e.g. /path/in/container">
|
||||
<input type="text" class="form-control" ng-model="volume.Target" placeholder="e.g. /path/in/container" />
|
||||
</div>
|
||||
<!-- !container-path -->
|
||||
<!-- volume-type -->
|
||||
|
@ -314,7 +322,11 @@
|
|||
<!-- volume -->
|
||||
<div class="input-group input-group-sm col-sm-6" ng-if="volume.Type === 'volume'">
|
||||
<span class="input-group-addon">volume</span>
|
||||
<select class="form-control" ng-model="volume.Source" ng-options="vol as ((vol.Id|truncate:30) + ' - ' + (vol.Driver|truncate:30)) for vol in availableVolumes">
|
||||
<select
|
||||
class="form-control"
|
||||
ng-model="volume.Source"
|
||||
ng-options="vol as ((vol.Id|truncate:30) + ' - ' + (vol.Driver|truncate:30)) for vol in availableVolumes"
|
||||
>
|
||||
<option selected disabled hidden value="">Select a volume</option>
|
||||
</select>
|
||||
</div>
|
||||
|
@ -322,7 +334,7 @@
|
|||
<!-- bind -->
|
||||
<div class="input-group input-group-sm col-sm-6" ng-if="volume.Type === 'bind'">
|
||||
<span class="input-group-addon">host</span>
|
||||
<input type="text" class="form-control" ng-model="volume.Source" placeholder="e.g. /path/on/host">
|
||||
<input type="text" class="form-control" ng-model="volume.Source" placeholder="e.g. /path/on/host" />
|
||||
</div>
|
||||
<!-- !bind -->
|
||||
<!-- read-only -->
|
||||
|
@ -395,7 +407,7 @@
|
|||
<div ng-repeat="variable in formValues.HostsEntries" style="margin-top: 2px;">
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">value</span>
|
||||
<input type="text" class="form-control" ng-model="variable.value" placeholder="e.g. host:IP">
|
||||
<input type="text" class="form-control" ng-model="variable.value" placeholder="e.g. host:IP" />
|
||||
</div>
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeHostsEntry($index)">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
@ -424,11 +436,11 @@
|
|||
<div ng-repeat="label in formValues.Labels" style="margin-top: 2px;">
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">name</span>
|
||||
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo">
|
||||
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo" />
|
||||
</div>
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">value</span>
|
||||
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar">
|
||||
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar" />
|
||||
</div>
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeLabel($index)">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
@ -451,11 +463,11 @@
|
|||
<div ng-repeat="label in formValues.ContainerLabels" style="margin-top: 2px;">
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">name</span>
|
||||
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo">
|
||||
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo" />
|
||||
</div>
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">value</span>
|
||||
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar">
|
||||
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar" />
|
||||
</div>
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeContainerLabel($index)">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
@ -475,7 +487,7 @@
|
|||
<div class="tab-pane" id="secrets" ng-if="applicationState.endpoint.apiVersion >= 1.25" ng-include="'app/docker/views/services/create/includes/secret.html'"></div>
|
||||
<!-- !tab-secrets -->
|
||||
<!-- tab-configs -->
|
||||
<div class="tab-pane" id="configs" ng-if="applicationState.endpoint.apiVersion >= 1.30" ng-include="'app/docker/views/services/create/includes/config.html'"></div>
|
||||
<div class="tab-pane" id="configs" ng-if="applicationState.endpoint.apiVersion >= 1.3" ng-include="'app/docker/views/services/create/includes/config.html'"></div>
|
||||
<!-- !tab-configs -->
|
||||
<!-- tab-resources-placement -->
|
||||
<div class="tab-pane" id="resources-placement" ng-include="'app/docker/views/services/create/includes/resources-placement.html'"></div>
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
<div class="form-group">
|
||||
<div class="col-sm-12" style="margin-top: 5px;">
|
||||
<label class="control-label text-left">Configs</label>
|
||||
<span class="label label-default interactive" style="margin-left: 10px;" ng-click="addConfig()">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i> add a config
|
||||
</span>
|
||||
<span class="label label-default interactive" style="margin-left: 10px;" ng-click="addConfig()"> <i class="fa fa-plus-circle" aria-hidden="true"></i> add a config </span>
|
||||
</div>
|
||||
<div class="col-sm-12 form-inline" style="margin-top: 10px;">
|
||||
<div ng-repeat="config in formValues.Configs" style="margin-top: 2px;">
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<slider model="formValues.MemoryReservation" floor="0" ceil="state.sliderMaxMemory" step="256" ng-if="state.sliderMaxMemory"></slider>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<input type="number" min="0" class="form-control" ng-model="formValues.MemoryReservation">
|
||||
<input type="number" min="0" class="form-control" ng-model="formValues.MemoryReservation" />
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<p class="small text-muted" style="margin-top: 7px;">
|
||||
|
@ -29,7 +29,7 @@
|
|||
<slider model="formValues.MemoryLimit" floor="0" ceil="state.sliderMaxMemory" step="256" ng-if="state.sliderMaxMemory"></slider>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<input type="number" min="0" class="form-control" ng-model="formValues.MemoryLimit">
|
||||
<input type="number" min="0" class="form-control" ng-model="formValues.MemoryLimit" />
|
||||
</div>
|
||||
<div class="col-sm-4" style="margin-top: 7px;">
|
||||
<p class="small text-muted">
|
||||
|
@ -83,7 +83,7 @@
|
|||
<div ng-repeat="constraint in formValues.PlacementConstraints" style="margin-top: 2px;">
|
||||
<div class="input-group col-sm-4 input-group-sm">
|
||||
<span class="input-group-addon">name</span>
|
||||
<input type="text" class="form-control" ng-model="constraint.key" placeholder="e.g. node.role">
|
||||
<input type="text" class="form-control" ng-model="constraint.key" placeholder="e.g. node.role" />
|
||||
</div>
|
||||
<div class="input-group col-sm-1 input-group-sm">
|
||||
<select name="constraintOperator" class="form-control" ng-model="constraint.operator">
|
||||
|
@ -93,7 +93,7 @@
|
|||
</div>
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">value</span>
|
||||
<input type="text" class="form-control" ng-model="constraint.value" placeholder="e.g. manager">
|
||||
<input type="text" class="form-control" ng-model="constraint.value" placeholder="e.g. manager" />
|
||||
</div>
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removePlacementConstraint($index)">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
@ -103,7 +103,7 @@
|
|||
</div>
|
||||
<!-- !placement-constraints -->
|
||||
<!-- placement-preferences -->
|
||||
<div class="form-group" ng-if="applicationState.endpoint.apiVersion >= 1.30">
|
||||
<div class="form-group" ng-if="applicationState.endpoint.apiVersion >= 1.3">
|
||||
<div class="col-sm-12" style="margin-top: 5px;">
|
||||
<label class="control-label text-left">Placement preferences</label>
|
||||
<span class="label label-default interactive" style="margin-left: 10px;" ng-click="addPlacementPreference()">
|
||||
|
@ -114,11 +114,11 @@
|
|||
<div ng-repeat="preference in formValues.PlacementPreferences" style="margin-top: 2px;">
|
||||
<div class="input-group col-sm-4 input-group-sm">
|
||||
<span class="input-group-addon">strategy</span>
|
||||
<input type="text" class="form-control" ng-model="preference.strategy" placeholder="e.g. spread">
|
||||
<input type="text" class="form-control" ng-model="preference.strategy" placeholder="e.g. spread" />
|
||||
</div>
|
||||
<div class="input-group col-sm-5 input-group-sm">
|
||||
<span class="input-group-addon">value</span>
|
||||
<input type="text" class="form-control" ng-model="preference.value" placeholder="e.g. node.labels.datacenter">
|
||||
<input type="text" class="form-control" ng-model="preference.value" placeholder="e.g. node.labels.datacenter" />
|
||||
</div>
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removePlacementPreference($index)">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
<form class="form-horizontal" style="margin-top: 15px;">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12 small text-muted">
|
||||
By default, secrets will be available under <code>/run/secrets/$SECRET_NAME</code> in containers.
|
||||
</div>
|
||||
<div class="col-sm-12 small text-muted"> By default, secrets will be available under <code>/run/secrets/$SECRET_NAME</code> in containers. </div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12" style="margin-top: 5px;">
|
||||
<label class="control-label text-left">Secrets</label>
|
||||
<span class="label label-default interactive" style="margin-left: 10px;" ng-click="addSecret()">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i> add a secret
|
||||
</span>
|
||||
<span class="label label-default interactive" style="margin-left: 10px;" ng-click="addSecret()"> <i class="fa fa-plus-circle" aria-hidden="true"></i> add a secret </span>
|
||||
</div>
|
||||
<div class="col-sm-12 form-inline" style="margin-top: 10px;">
|
||||
<div ng-repeat="secret in formValues.Secrets track by $index" style="margin-top: 4px;">
|
||||
|
@ -19,12 +15,12 @@
|
|||
<option value="" selected="selected">Select a secret</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group col-sm-4 input-group-sm" ng-if="applicationState.endpoint.apiVersion >= 1.30 && secret.overrideTarget">
|
||||
<div class="input-group col-sm-4 input-group-sm" ng-if="applicationState.endpoint.apiVersion >= 1.3 && secret.overrideTarget">
|
||||
<span class="input-group-addon">target</span>
|
||||
<input class="form-control" ng-model="secret.target" placeholder="/path/in/container">
|
||||
<input class="form-control" ng-model="secret.target" placeholder="/path/in/container" />
|
||||
</div>
|
||||
<div class="input-group col-sm-3 input-group-sm">
|
||||
<div class="btn-group btn-group-sm" ng-if="applicationState.endpoint.apiVersion >= 1.30">
|
||||
<div class="btn-group btn-group-sm" ng-if="applicationState.endpoint.apiVersion >= 1.3">
|
||||
<label class="btn btn-primary" ng-model="secret.overrideTarget" uib-btn-radio="false">Default location</label>
|
||||
<label class="btn btn-primary" ng-model="secret.overrideTarget" uib-btn-radio="true">Override</label>
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<form class="form-horizontal" style="margin-top: 15px;">
|
||||
<div class="col-sm-12 form-section-title">
|
||||
Update config
|
||||
Update config
|
||||
</div>
|
||||
<!-- parallelism-input -->
|
||||
<div class="form-group">
|
||||
<label for="parallelism" class="col-sm-3 col-lg-2 control-label text-left">Update parallelism</label>
|
||||
<div class="col-sm-4 col-lg-3">
|
||||
<input type="number" class="form-control" ng-model="formValues.Parallelism" id="parallelism" placeholder="e.g. 1">
|
||||
<input type="number" class="form-control" ng-model="formValues.Parallelism" id="parallelism" placeholder="e.g. 1" />
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<p class="small text-muted">
|
||||
|
@ -20,9 +20,9 @@
|
|||
<label for="update-delay" class="col-sm-3 col-lg-2 control-label text-left">
|
||||
Update delay
|
||||
<portainer-tooltip position="bottom" message="Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns."></portainer-tooltip>
|
||||
</label>
|
||||
</label>
|
||||
<div class="col-sm-4 col-lg-3">
|
||||
<input type="text" class="form-control" ng-model="formValues.UpdateDelay" id="update-delay" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i">
|
||||
<input type="text" class="form-control" ng-model="formValues.UpdateDelay" id="update-delay" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<p class="small text-muted">
|
||||
|
@ -63,9 +63,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- !order-input -->
|
||||
|
||||
|
||||
<div class="col-sm-12 form-section-title">
|
||||
Restart policy
|
||||
Restart policy
|
||||
</div>
|
||||
<!-- restartCondition-input -->
|
||||
<div class="form-group">
|
||||
|
@ -79,7 +79,7 @@
|
|||
</div>
|
||||
<div class="col-sm-5">
|
||||
<p class="small text-muted">
|
||||
Restart when condition is met (default condition "any").
|
||||
Restart when condition is met (default condition "any").
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -89,9 +89,9 @@
|
|||
<label for="restart-delay" class="col-sm-3 col-lg-2 control-label text-left">
|
||||
Restart delay
|
||||
<portainer-tooltip position="bottom" message="Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns."></portainer-tooltip>
|
||||
</label>
|
||||
</label>
|
||||
<div class="col-sm-4 col-lg-3">
|
||||
<input type="text" class="form-control" ng-model="formValues.RestartDelay" id="restart-delay" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i">
|
||||
<input type="text" class="form-control" ng-model="formValues.RestartDelay" id="restart-delay" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<p class="small text-muted">
|
||||
|
@ -101,10 +101,10 @@
|
|||
</div>
|
||||
<!-- !restartDelay-input -->
|
||||
<!-- restartMaxAttempts-input -->
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<label for="restart-max-attempts" class="col-sm-3 col-lg-2 control-label text-left">Restart max attempts</label>
|
||||
<div class="col-sm-4 col-lg-3">
|
||||
<input type="number" class="form-control" ng-model="formValues.RestartMaxAttempts" id="restart-max-attempts" placeholder="e.g. 0">
|
||||
<input type="number" class="form-control" ng-model="formValues.RestartMaxAttempts" id="restart-max-attempts" placeholder="e.g. 0" />
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<p class="small text-muted">
|
||||
|
@ -118,9 +118,9 @@
|
|||
<label for="restart-window" class="col-sm-3 col-lg-2 control-label text-left">
|
||||
Restart window
|
||||
<portainer-tooltip position="bottom" message="Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns."></portainer-tooltip>
|
||||
</label>
|
||||
</label>
|
||||
<div class="col-sm-4 col-lg-3">
|
||||
<input type="text" class="form-control" ng-model="formValues.RestartWindow" id="restart-window" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i">
|
||||
<input type="text" class="form-control" ng-model="formValues.RestartWindow" id="restart-window" placeholder="e.g. 1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<p class="small text-muted">
|
||||
|
@ -129,4 +129,4 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- !restartWindow-input -->
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
<form ng-if="applicationState.endpoint.apiVersion >= 1.30" id="service-configs" ng-submit="updateService(service)">
|
||||
<form ng-if="applicationState.endpoint.apiVersion >= 1.3" id="service-configs" ng-submit="updateService(service)">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-tasks" title-text="Configs">
|
||||
</rd-widget-header>
|
||||
<rd-widget-header icon="fa-tasks" title-text="Configs"> </rd-widget-header>
|
||||
<rd-widget-body classes="no-padding">
|
||||
<div class="form-inline" style="padding: 10px;" authorization="DockerServiceUpdate">
|
||||
Add a config:
|
||||
<select class="form-control" ng-options="config.Name for config in configs | orderBy: 'Name'" ng-model="newConfig">
|
||||
<option selected disabled hidden value="">Select a config</option>
|
||||
</select>
|
||||
<a class="btn btn-default btn-sm" ng-click="addConfig(service, newConfig)">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i> add config
|
||||
</a>
|
||||
<a class="btn btn-default btn-sm" ng-click="addConfig(service, newConfig)"> <i class="fa fa-plus-circle" aria-hidden="true"></i> add config </a>
|
||||
</div>
|
||||
<table class="table" style="margin-top: 5px;">
|
||||
<thead>
|
||||
|
@ -25,9 +22,18 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="config in service.ServiceConfigs">
|
||||
<td><a ui-sref="docker.configs.config({id: config.Id})">{{ config.Name }}</a></td>
|
||||
<td
|
||||
><a ui-sref="docker.configs.config({id: config.Id})">{{ config.Name }}</a></td
|
||||
>
|
||||
<td>
|
||||
<input class="form-control" ng-model="config.FileName" ng-change="updateConfig(service)" placeholder="e.g. /path/in/container" required disable-authorization="DockerServiceUpdate"/>
|
||||
<input
|
||||
class="form-control"
|
||||
ng-model="config.FileName"
|
||||
ng-change="updateConfig(service)"
|
||||
placeholder="e.g. /path/in/container"
|
||||
required
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</td>
|
||||
<td>{{ config.Uid }}</td>
|
||||
<td>{{ config.Gid }}</td>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<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" >
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
|
@ -23,12 +23,27 @@
|
|||
<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" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="constraint.key"
|
||||
placeholder="e.g. node.role"
|
||||
ng-change="updatePlacementConstraint(service, constraint)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</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" disable-authorization="DockerServiceUpdate">
|
||||
<select
|
||||
name="constraintOperator"
|
||||
class="form-control"
|
||||
ng-model="constraint.operator"
|
||||
ng-change="updatePlacementConstraint(service, constraint)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
>
|
||||
<option value="==">==</option>
|
||||
<option value="!=">!=</option>
|
||||
</select>
|
||||
|
@ -36,7 +51,15 @@
|
|||
</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" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="constraint.value"
|
||||
placeholder="e.g. manager"
|
||||
ng-change="updatePlacementConstraint(service, constraint)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
||||
<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>
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<td>CMD</td>
|
||||
<td><code ng-if="service.Command">{{ service.Command|command }}</code></td>
|
||||
<td
|
||||
><code ng-if="service.Command">{{ service.Command | command }}</code></td
|
||||
>
|
||||
<td>
|
||||
<p class="small text-muted" style="margin-top: 10px;">
|
||||
Command to execute.
|
||||
|
@ -15,7 +17,9 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Args</td>
|
||||
<td><code ng-if="service.Arguments">{{ service.Arguments }}</code></td>
|
||||
<td
|
||||
><code ng-if="service.Arguments">{{ service.Arguments }}</code></td
|
||||
>
|
||||
<td>
|
||||
<p class="small text-muted" style="margin-top: 10px;">
|
||||
Arguments passed to command in container.
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<p>There are no container labels for this service.</p>
|
||||
</rd-widget-body>
|
||||
<rd-widget-body ng-if="service.ServiceContainerLabels.length > 0" classes="no-padding">
|
||||
<table class="table" >
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Label</th>
|
||||
|
@ -23,13 +23,29 @@
|
|||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">name</span>
|
||||
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo" ng-change="updateContainerLabel(service, label)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="label.key"
|
||||
placeholder="e.g. com.example.foo"
|
||||
ng-change="updateContainerLabel(service, label)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">value</span>
|
||||
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar" ng-change="updateContainerLabel(service, label)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="label.value"
|
||||
placeholder="e.g. bar"
|
||||
ng-change="updateContainerLabel(service, label)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeContainerLabel(service, $index)" ng-disabled="isUpdating">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
@ -44,7 +60,9 @@
|
|||
<rd-widget-footer authorization="DockerServiceUpdate">
|
||||
<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, ['ServiceContainerLabels'])" ng-click="updateService(service)">Apply changes</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!hasChanges(service, ['ServiceContainerLabels'])" 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>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<p>There are no environment variables for this service.</p>
|
||||
</rd-widget-body>
|
||||
<rd-widget-body ng-if="service.EnvironmentVariables.length > 0" classes="no-padding">
|
||||
<table class="table" >
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
|
@ -23,13 +23,21 @@
|
|||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">name</span>
|
||||
<input type="text" class="form-control" ng-model="var.key" ng-disabled="var.added || isUpdating" placeholder="e.g. FOO">
|
||||
<input type="text" class="form-control" ng-model="var.key" ng-disabled="var.added || isUpdating" placeholder="e.g. FOO" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">value</span>
|
||||
<input type="text" class="form-control" ng-model="var.value" ng-change="updateEnvironmentVariable(service, var)" placeholder="e.g. bar" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="var.value"
|
||||
ng-change="updateEnvironmentVariable(service, var)"
|
||||
placeholder="e.g. bar"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeEnvironmentVariable(service, $index)" ng-disabled="isUpdating">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<p>The Hosts file has no extra entries.</p>
|
||||
</rd-widget-body>
|
||||
<rd-widget-body ng-if="service.Hosts.length > 0" classes="no-padding">
|
||||
<table class="table" >
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hostname</th>
|
||||
|
@ -22,12 +22,28 @@
|
|||
<tr ng-repeat="entry in service.Hosts">
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<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">
|
||||
<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"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<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">
|
||||
<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"
|
||||
/>
|
||||
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeHostsEntry(service, $index)" ng-disabled="isUpdating">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
<div id="service-container-image" authorization="DockerServiceUpdate">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-clone" title-text="Change container image">
|
||||
</rd-widget-header>
|
||||
<rd-widget-header icon="fa-clone" title-text="Change container image"> </rd-widget-header>
|
||||
<rd-widget-body ng-if="!isUpdating">
|
||||
<form class="form-horizontal">
|
||||
<por-image-registry
|
||||
model="formValues.RegistryModel"
|
||||
auto-complete="true"
|
||||
label-class="col-sm-1" input-class="col-sm-11"
|
||||
></por-image-registry>
|
||||
<por-image-registry model="formValues.RegistryModel" auto-complete="true" label-class="col-sm-1" input-class="col-sm-11"></por-image-registry>
|
||||
</form>
|
||||
</rd-widget-body>
|
||||
<rd-widget-body ng-if="isUpdating">
|
||||
|
|
|
@ -1,65 +1,74 @@
|
|||
<div id="service-logging-driver">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-tasks" title-text="Logging driver">
|
||||
</rd-widget-header>
|
||||
<rd-widget-body classes="no-padding">
|
||||
<div class="form-inline" style="padding: 10px;" authorization="DockerServiceUpdate">
|
||||
Driver:
|
||||
<select class="form-control" ng-model="service.LogDriverName" ng-change="updateLogDriverName(service)" ng-disabled="isUpdating">
|
||||
<option selected value="">Default logging driver</option>
|
||||
<option ng-repeat="driver in availableLoggingDrivers" ng-value="driver">{{ driver }}</option>
|
||||
<option value="none">none</option>
|
||||
</select>
|
||||
<a class="btn btn-default btn-sm" ng-click="!service.LogDriverName || service.LogDriverName === 'none' || addLogDriverOpt(service)">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i> add logging driver option
|
||||
</a>
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-tasks" title-text="Logging driver"> </rd-widget-header>
|
||||
<rd-widget-body classes="no-padding">
|
||||
<div class="form-inline" style="padding: 10px;" authorization="DockerServiceUpdate">
|
||||
Driver:
|
||||
<select class="form-control" ng-model="service.LogDriverName" ng-change="updateLogDriverName(service)" ng-disabled="isUpdating">
|
||||
<option selected value="">Default logging driver</option>
|
||||
<option ng-repeat="driver in availableLoggingDrivers" ng-value="driver">{{ driver }}</option>
|
||||
<option value="none">none</option>
|
||||
</select>
|
||||
<a class="btn btn-default btn-sm" ng-click="!service.LogDriverName || service.LogDriverName === 'none' || addLogDriverOpt(service)">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i> add logging driver option
|
||||
</a>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="option in service.LogDriverOpts">
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">name</span>
|
||||
<input type="text" class="form-control" ng-model="option.key" ng-disabled="option.added || isUpdating" placeholder="e.g. FOO" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">value</span>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="option.value"
|
||||
ng-change="updateLogDriverOpt(service, option)"
|
||||
placeholder="e.g. bar"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeLogDriverOpt(service, $index)" ng-disabled="isUpdating">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-if="service.LogDriverOpts.length === 0">
|
||||
<td colspan="6" class="text-center text-muted">No options associated to this logging driver.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</rd-widget-body>
|
||||
<rd-widget-footer authorization="DockerServiceUpdate">
|
||||
<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, ['LogDriverName', 'LogDriverOpts'])" 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, ['LogDriverName', 'LogDriverOpts'])">Reset changes</a></li>
|
||||
<li><a ng-click="cancelChanges(service)">Reset all changes</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<table class="table" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="option in service.LogDriverOpts">
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">name</span>
|
||||
<input type="text" class="form-control" ng-model="option.key" ng-disabled="option.added || isUpdating" placeholder="e.g. FOO">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">value</span>
|
||||
<input type="text" class="form-control" ng-model="option.value" ng-change="updateLogDriverOpt(service, option)" placeholder="e.g. bar" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeLogDriverOpt(service, $index)" ng-disabled="isUpdating">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-if="service.LogDriverOpts.length === 0">
|
||||
<td colspan="6" class="text-center text-muted">No options associated to this logging driver.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</rd-widget-body>
|
||||
<rd-widget-footer authorization="DockerServiceUpdate">
|
||||
<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, ['LogDriverName', 'LogDriverOpts'])" 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, ['LogDriverName', 'LogDriverOpts'])">Reset changes</a></li>
|
||||
<li><a ng-click="cancelChanges(service)">Reset all changes</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</rd-widget-footer>
|
||||
</rd-widget>
|
||||
</div>
|
||||
</div>
|
||||
</rd-widget-footer>
|
||||
</rd-widget>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<p>There are no mounts for this service.</p>
|
||||
</rd-widget-body>
|
||||
<rd-widget-body ng-if="service.ServiceMounts.length > 0" classes="no-padding">
|
||||
<table class="table" >
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th ng-if="isAdmin || allowBindMounts">Type</th>
|
||||
|
@ -30,16 +30,38 @@
|
|||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<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'" disable-authorization="DockerServiceUpdate">
|
||||
<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'"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
>
|
||||
<option selected disabled hidden value="">Select a volume</option>
|
||||
</select>
|
||||
<input type="text" class="form-control" 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'">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
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'"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<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">
|
||||
<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"
|
||||
/>
|
||||
</td>
|
||||
<td authorization="DockerServiceUpdate">
|
||||
<input type="checkbox" class="form-control" ng-model="mount.ReadOnly" ng-change="updateMount(service, mount)" ng-disabled="isUpdating">
|
||||
<input type="checkbox" class="form-control" ng-model="mount.ReadOnly" ng-change="updateMount(service, mount)" ng-disabled="isUpdating" />
|
||||
</td>
|
||||
<td authorization="DockerServiceUpdate">
|
||||
<span class="input-group-btn">
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<p>This service is not connected to any networks.</p>
|
||||
</rd-widget-body>
|
||||
<rd-widget-body ng-if="service.VirtualIPs && service.VirtualIPs.length > 0" classes="no-padding">
|
||||
<table class="table" >
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<p>There are no placement preferences for this service.</p>
|
||||
</rd-widget-body>
|
||||
<rd-widget-body ng-if="service.ServicePreferences.length > 0" classes="no-padding">
|
||||
<table class="table" >
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Strategy</th>
|
||||
|
@ -22,12 +22,28 @@
|
|||
<tr ng-repeat="preference in service.ServicePreferences">
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" ng-model="preference.strategy" placeholder="e.g. node.role" ng-change="updatePlacementPreference(service, preference)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="preference.strategy"
|
||||
placeholder="e.g. node.role"
|
||||
ng-change="updatePlacementPreference(service, preference)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" ng-model="preference.value" placeholder="e.g. manager" ng-change="updatePlacementPreference(service, preference)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="preference.value"
|
||||
placeholder="e.g. manager"
|
||||
ng-change="updatePlacementPreference(service, preference)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removePlacementPreference(service, $index)" ng-disabled="isUpdating">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<p>This service has no ports published.</p>
|
||||
</rd-widget-body>
|
||||
<rd-widget-body ng-if="service.Ports && service.Ports.length > 0" classes="no-padding">
|
||||
<table class="table" >
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Host port</th>
|
||||
|
@ -26,18 +26,40 @@
|
|||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">host</span>
|
||||
<input type="number" class="form-control" ng-model="portBinding.PublishedPort" placeholder="e.g. 8080" ng-change="updatePublishedPort(service, mapping)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="number"
|
||||
class="form-control"
|
||||
ng-model="portBinding.PublishedPort"
|
||||
placeholder="e.g. 8080"
|
||||
ng-change="updatePublishedPort(service, mapping)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon">container</span>
|
||||
<input type="number" class="form-control" ng-model="portBinding.TargetPort" placeholder="e.g. 80" ng-change="updatePublishedPort(service, mapping)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="number"
|
||||
class="form-control"
|
||||
ng-model="portBinding.TargetPort"
|
||||
placeholder="e.g. 80"
|
||||
ng-change="updatePublishedPort(service, mapping)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<select class="selectpicker form-control" ng-model="portBinding.Protocol" ng-change="updatePublishedPort(service, mapping)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
ng-model="portBinding.Protocol"
|
||||
ng-change="updatePublishedPort(service, mapping)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
>
|
||||
<option value="tcp">tcp</option>
|
||||
<option value="udp">udp</option>
|
||||
</select>
|
||||
|
@ -45,7 +67,13 @@
|
|||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<select class="selectpicker form-control" ng-model="portBinding.PublishMode" ng-change="updatePublishedPort(service, mapping)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
ng-model="portBinding.PublishMode"
|
||||
ng-change="updatePublishedPort(service, mapping)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
>
|
||||
<option value="ingress">ingress</option>
|
||||
<option value="host">host</option>
|
||||
</select>
|
||||
|
|
|
@ -1,61 +1,94 @@
|
|||
<div id="service-resources">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-list-alt" title-text="Resource limits and reservations">
|
||||
</rd-widget-header>
|
||||
<rd-widget-header icon="fa-list-alt" title-text="Resource limits and reservations"> </rd-widget-header>
|
||||
<rd-widget-body classes="no-padding">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align : middle;">
|
||||
<td style="vertical-align: middle;">
|
||||
Memory reservation (MB)
|
||||
</td>
|
||||
<td>
|
||||
<input class="input-sm" type="number" step="0.125" min="0" ng-model="service.ReservationMemoryBytes" ng-change="updateServiceAttribute(service, 'ReservationMemoryBytes')" disable-authorization="DockerServiceUpdate"/>
|
||||
<input
|
||||
class="input-sm"
|
||||
type="number"
|
||||
step="0.125"
|
||||
min="0"
|
||||
ng-model="service.ReservationMemoryBytes"
|
||||
ng-change="updateServiceAttribute(service, 'ReservationMemoryBytes')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</td>
|
||||
<td style="vertical-align : middle;">
|
||||
<td style="vertical-align: middle;">
|
||||
<p class="small text-muted">
|
||||
Minimum memory available on a node to run a task (set to 0 for unlimited)
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align : middle;">
|
||||
<td style="vertical-align: middle;">
|
||||
Memory limit (MB)
|
||||
</td>
|
||||
<td>
|
||||
<input class="input-sm" type="number" step="0.125" min="0" ng-model="service.LimitMemoryBytes" ng-change="updateServiceAttribute(service, 'LimitMemoryBytes')" disable-authorization="DockerServiceUpdate"/>
|
||||
<input
|
||||
class="input-sm"
|
||||
type="number"
|
||||
step="0.125"
|
||||
min="0"
|
||||
ng-model="service.LimitMemoryBytes"
|
||||
ng-change="updateServiceAttribute(service, 'LimitMemoryBytes')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</td>
|
||||
<td style="vertical-align : middle;">
|
||||
<td style="vertical-align: middle;">
|
||||
<p class="small text-muted">
|
||||
Maximum memory usage per task (set to 0 for unlimited)
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align : middle;">
|
||||
<td style="vertical-align: middle;">
|
||||
<div>
|
||||
CPU reservation
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<slider model="service.ReservationNanoCPUs" floor="0" ceil="state.sliderMaxCpu" step="0.25" precision="2" ng-if="service && state.sliderMaxCpu" on-change="updateServiceAttribute(service, 'ReservationNanoCPUs')" disable-authorization="DockerServiceUpdate"></slider>
|
||||
<slider
|
||||
model="service.ReservationNanoCPUs"
|
||||
floor="0"
|
||||
ceil="state.sliderMaxCpu"
|
||||
step="0.25"
|
||||
precision="2"
|
||||
ng-if="service && state.sliderMaxCpu"
|
||||
on-change="updateServiceAttribute(service, 'ReservationNanoCPUs')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
></slider>
|
||||
</td>
|
||||
<td style="vertical-align : middle;">
|
||||
<td style="vertical-align: middle;">
|
||||
<p class="small text-muted">
|
||||
Minimum CPU available on a node to run a task
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align : middle;">
|
||||
<td style="vertical-align: middle;">
|
||||
<div>
|
||||
CPU limit
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<slider model="service.LimitNanoCPUs" floor="0" ceil="state.sliderMaxCpu" step="0.25" precision="2" ng-if="service && state.sliderMaxCpu" on-change="updateServiceAttribute(service, 'LimitNanoCPUs')" disable-authorization="DockerServiceUpdate"></slider>
|
||||
<slider
|
||||
model="service.LimitNanoCPUs"
|
||||
floor="0"
|
||||
ceil="state.sliderMaxCpu"
|
||||
step="0.25"
|
||||
precision="2"
|
||||
ng-if="service && state.sliderMaxCpu"
|
||||
on-change="updateServiceAttribute(service, 'LimitNanoCPUs')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
></slider>
|
||||
</td>
|
||||
<td style="vertical-align : middle;">
|
||||
<td style="vertical-align: middle;">
|
||||
<p class="small text-muted">
|
||||
Maximum CPU usage per task
|
||||
</p>
|
||||
|
@ -67,7 +100,13 @@
|
|||
<rd-widget-footer authorization="DockerServiceUpdate">
|
||||
<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, ['LimitNanoCPUs', 'LimitMemoryBytes', 'ReservationNanoCPUs', 'ReservationMemoryBytes'])" ng-click="updateService(service)">Apply changes</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="!hasChanges(service, ['LimitNanoCPUs', 'LimitMemoryBytes', 'ReservationNanoCPUs', 'ReservationMemoryBytes'])"
|
||||
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>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<div id="service-restart-policy">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-list-alt" title-text="Restart policy">
|
||||
</rd-widget-header>
|
||||
<rd-widget-header icon="fa-list-alt" title-text="Restart policy"> </rd-widget-header>
|
||||
<rd-widget-body classes="no-padding">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
|
@ -9,7 +8,12 @@
|
|||
<td>Restart condition</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<select class="selectpicker form-control" ng-model="service.RestartCondition" ng-change="updateServiceAttribute(service, 'RestartCondition')" disable-authorization="DockerServiceUpdate">
|
||||
<select
|
||||
class="selectpicker form-control"
|
||||
ng-model="service.RestartCondition"
|
||||
ng-change="updateServiceAttribute(service, 'RestartCondition')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
>
|
||||
<option value="none">None</option>
|
||||
<option value="on-failure">On failure</option>
|
||||
<option value="any">Any</option>
|
||||
|
@ -25,7 +29,14 @@
|
|||
<tr>
|
||||
<td>Restart delay</td>
|
||||
<td>
|
||||
<input class="input-sm" type="text" ng-model="service.RestartDelay" ng-change="updateServiceAttribute(service, 'RestartDelay')" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" disable-authorization="DockerServiceUpdate"/>
|
||||
<input
|
||||
class="input-sm"
|
||||
type="text"
|
||||
ng-model="service.RestartDelay"
|
||||
ng-change="updateServiceAttribute(service, 'RestartDelay')"
|
||||
ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<p class="small text-muted" style="margin-top: 10px;">
|
||||
|
@ -36,7 +47,13 @@
|
|||
<tr>
|
||||
<td>Restart max attempts</td>
|
||||
<td>
|
||||
<input class="input-sm" type="number" ng-model="service.RestartMaxAttempts" ng-change="updateServiceAttribute(service, 'RestartMaxAttempts')" disable-authorization="DockerServiceUpdate"/>
|
||||
<input
|
||||
class="input-sm"
|
||||
type="number"
|
||||
ng-model="service.RestartMaxAttempts"
|
||||
ng-change="updateServiceAttribute(service, 'RestartMaxAttempts')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<p class="small text-muted" style="margin-top: 10px;">
|
||||
|
@ -47,7 +64,14 @@
|
|||
<tr>
|
||||
<td>Restart window</td>
|
||||
<td>
|
||||
<input class="input-sm" type="text" ng-model="service.RestartWindow" ng-change="updateServiceAttribute(service, 'RestartWindow')" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" disable-authorization="DockerServiceUpdate"/>
|
||||
<input
|
||||
class="input-sm"
|
||||
type="text"
|
||||
ng-model="service.RestartWindow"
|
||||
ng-change="updateServiceAttribute(service, 'RestartWindow')"
|
||||
ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<p class="small text-muted" style="margin-top: 10px;">
|
||||
|
@ -61,7 +85,13 @@
|
|||
<rd-widget-footer authorization="DockerServiceUpdate">
|
||||
<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, ['RestartCondition', 'RestartDelay', 'RestartMaxAttempts', 'RestartWindow'])" ng-click="updateService(service)">Apply changes</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="!hasChanges(service, ['RestartCondition', 'RestartDelay', 'RestartMaxAttempts', 'RestartWindow'])"
|
||||
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>
|
||||
|
|
|
@ -1,24 +1,21 @@
|
|||
<div ng-if="applicationState.endpoint.apiVersion >= 1.25" id="service-secrets">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-tasks" title-text="Secrets">
|
||||
</rd-widget-header>
|
||||
<rd-widget-header icon="fa-tasks" title-text="Secrets"> </rd-widget-header>
|
||||
<rd-widget-body classes="no-padding">
|
||||
<div class="form-inline" style="padding: 10px;" authorization="DockerServiceUpdate">
|
||||
Add a secret:
|
||||
<select class="form-control" ng-options="secret.Name for secret in secrets | orderBy: 'Name'" ng-model="state.addSecret.secret">
|
||||
<option selected disabled hidden value="">Select a secret</option>
|
||||
</select>
|
||||
<div class="form-group" ng-if="applicationState.endpoint.apiVersion >= 1.30 && state.addSecret.override">
|
||||
<div class="form-group" ng-if="applicationState.endpoint.apiVersion >= 1.3 && state.addSecret.override">
|
||||
Target:
|
||||
<input class="form-control" ng-model="state.addSecret.target" placeholder="/path/in/container">
|
||||
<input class="form-control" ng-model="state.addSecret.target" placeholder="/path/in/container" />
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm" ng-if="applicationState.endpoint.apiVersion >= 1.30">
|
||||
<div class="btn-group btn-group-sm" ng-if="applicationState.endpoint.apiVersion >= 1.3">
|
||||
<label class="btn btn-primary" ng-model="state.addSecret.override" uib-btn-radio="false">Default location</label>
|
||||
<label class="btn btn-primary" ng-model="state.addSecret.override" uib-btn-radio="true">Override</label>
|
||||
</div>
|
||||
<a class="btn btn-default btn-sm" ng-click="addSecret(service, state.addSecret)">
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i> add secret
|
||||
</a>
|
||||
<a class="btn btn-default btn-sm" ng-click="addSecret(service, state.addSecret)"> <i class="fa fa-plus-circle" aria-hidden="true"></i> add secret </a>
|
||||
</div>
|
||||
<table class="table" style="margin-top: 5px;">
|
||||
<thead>
|
||||
|
@ -33,7 +30,9 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="secret in service.ServiceSecrets">
|
||||
<td><a ui-sref="docker.secrets.secret({id: secret.Id})">{{ secret.Name }}</a></td>
|
||||
<td
|
||||
><a ui-sref="docker.secrets.secret({id: secret.Id})">{{ secret.Name }}</a></td
|
||||
>
|
||||
<td>{{ secret.FileName }}</td>
|
||||
<td>{{ secret.Uid }}</td>
|
||||
<td>{{ secret.Gid }}</td>
|
||||
|
|
|
@ -27,13 +27,29 @@
|
|||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">name</span>
|
||||
<input type="text" class="form-control" ng-model="label.key" placeholder="e.g. com.example.foo" ng-change="updateLabel(service, label)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="label.key"
|
||||
placeholder="e.g. com.example.foo"
|
||||
ng-change="updateLabel(service, label)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon fit-text-size">value</span>
|
||||
<input type="text" class="form-control" ng-model="label.value" placeholder="e.g. bar" ng-change="updateLabel(service, label)" ng-disabled="isUpdating" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
ng-model="label.value"
|
||||
placeholder="e.g. bar"
|
||||
ng-change="updateLabel(service, label)"
|
||||
ng-disabled="isUpdating"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
<span class="input-group-btn" authorization="DockerServiceUpdate">
|
||||
<button class="btn btn-sm btn-danger" type="button" ng-click="removeLabel(service, $index)" ng-disabled="isUpdating">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<div ng-if="tasks.length > 0 && nodes" id="service-tasks">
|
||||
<tasks-datatable
|
||||
title-text="Tasks" title-icon="fa-tasks"
|
||||
dataset="tasks" table-key="service-tasks"
|
||||
order-by="Updated" reverse-order="true"
|
||||
title-text="Tasks"
|
||||
title-icon="fa-tasks"
|
||||
dataset="tasks"
|
||||
table-key="service-tasks"
|
||||
order-by="Updated"
|
||||
reverse-order="true"
|
||||
nodes="nodes"
|
||||
|
||||
show-slot-column="service.Mode !== 'global'"
|
||||
show-logs-button="applicationState.endpoint.apiVersion >= 1.30"
|
||||
agent-proxy="applicationState.endpoint.mode.agentProxy"
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
<div id="service-update-config">
|
||||
<rd-widget>
|
||||
<rd-widget-header icon="fa-list-alt" title-text="Update configuration">
|
||||
</rd-widget-header>
|
||||
<rd-widget-header icon="fa-list-alt" title-text="Update configuration"> </rd-widget-header>
|
||||
<rd-widget-body classes="no-padding">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Update Parallelism</td>
|
||||
<td>
|
||||
<input class="input-sm" type="number" ng-model="service.UpdateParallelism" ng-change="updateServiceAttribute(service, 'UpdateParallelism')" disable-authorization="DockerServiceUpdate"/>
|
||||
<input
|
||||
class="input-sm"
|
||||
type="number"
|
||||
ng-model="service.UpdateParallelism"
|
||||
ng-change="updateServiceAttribute(service, 'UpdateParallelism')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<p class="small text-muted" style="margin-top: 10px;">
|
||||
|
@ -19,7 +24,14 @@
|
|||
<tr>
|
||||
<td>Update Delay</td>
|
||||
<td>
|
||||
<input class="input-sm" type="text" ng-model="service.UpdateDelay" ng-change="updateServiceAttribute(service, 'UpdateDelay')" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" disable-authorization="DockerServiceUpdate"/>
|
||||
<input
|
||||
class="input-sm"
|
||||
type="text"
|
||||
ng-model="service.UpdateDelay"
|
||||
ng-change="updateServiceAttribute(service, 'UpdateDelay')"
|
||||
ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<p class="small text-muted" style="margin-top: 10px;">
|
||||
|
@ -32,11 +44,25 @@
|
|||
<td>
|
||||
<div class="form-group">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="failure_action" ng-model="service.UpdateFailureAction" value="continue" ng-change="updateServiceAttribute(service, 'UpdateFailureAction')" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="radio"
|
||||
name="failure_action"
|
||||
ng-model="service.UpdateFailureAction"
|
||||
value="continue"
|
||||
ng-change="updateServiceAttribute(service, 'UpdateFailureAction')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
Continue
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="failure_action" ng-model="service.UpdateFailureAction" value="pause" ng-change="updateServiceAttribute(service, 'UpdateFailureAction')" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="radio"
|
||||
name="failure_action"
|
||||
ng-model="service.UpdateFailureAction"
|
||||
value="pause"
|
||||
ng-change="updateServiceAttribute(service, 'UpdateFailureAction')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
Pause
|
||||
</label>
|
||||
</div>
|
||||
|
@ -52,11 +78,25 @@
|
|||
<td>
|
||||
<div class="form-group">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="updateconfig_order" ng-model="service.UpdateOrder" value="start-first" ng-change="updateServiceAttribute(service, 'UpdateOrder')" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="radio"
|
||||
name="updateconfig_order"
|
||||
ng-model="service.UpdateOrder"
|
||||
value="start-first"
|
||||
ng-change="updateServiceAttribute(service, 'UpdateOrder')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
start-first
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="updateconfig_order" ng-model="service.UpdateOrder" value="stop-first" ng-change="updateServiceAttribute(service, 'UpdateOrder')" disable-authorization="DockerServiceUpdate">
|
||||
<input
|
||||
type="radio"
|
||||
name="updateconfig_order"
|
||||
ng-model="service.UpdateOrder"
|
||||
value="stop-first"
|
||||
ng-change="updateServiceAttribute(service, 'UpdateOrder')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
stop-first
|
||||
</label>
|
||||
</div>
|
||||
|
@ -73,7 +113,13 @@
|
|||
<rd-widget-footer authorization="DockerServiceUpdate">
|
||||
<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, ['UpdateFailureAction', 'UpdateDelay', 'UpdateParallelism', 'UpdateOrder'])" ng-click="updateService(service)">Apply changes</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="!hasChanges(service, ['UpdateFailureAction', 'UpdateDelay', 'UpdateParallelism', 'UpdateOrder'])"
|
||||
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>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<tr>
|
||||
<td>Name</td>
|
||||
<td ng-if="applicationState.endpoint.apiVersion <= 1.24">
|
||||
<input type="text" class="form-control" ng-model="service.Name" ng-change="updateServiceAttribute(service, 'Name')" ng-disabled="isUpdating">
|
||||
<input type="text" class="form-control" ng-model="service.Name" ng-change="updateServiceAttribute(service, 'Name')" ng-disabled="isUpdating" />
|
||||
</td>
|
||||
<td ng-if="applicationState.endpoint.apiVersion >= 1.25">
|
||||
{{ service.Name }}
|
||||
|
@ -42,11 +42,11 @@
|
|||
</tr>
|
||||
<tr ng-if="service.CreatedAt">
|
||||
<td>Created at</td>
|
||||
<td>{{ service.CreatedAt|getisodate}}</td>
|
||||
<td>{{ service.CreatedAt | getisodate }}</td>
|
||||
</tr>
|
||||
<tr ng-if="service.UpdatedAt">
|
||||
<td>Last updated at</td>
|
||||
<td>{{ service.UpdatedAt|getisodate }}</td>
|
||||
<td>{{ service.UpdatedAt | getisodate }}</td>
|
||||
</tr>
|
||||
<tr ng-if="service.Version">
|
||||
<td>Version</td>
|
||||
|
@ -60,7 +60,13 @@
|
|||
<td>Replicas</td>
|
||||
<td>
|
||||
<span ng-if="service.Mode === 'replicated'">
|
||||
<input class="input-sm" type="number" ng-model="service.Replicas" ng-change="updateServiceAttribute(service, 'Replicas')" disable-authorization="DockerServiceUpdate" />
|
||||
<input
|
||||
class="input-sm"
|
||||
type="number"
|
||||
ng-model="service.Replicas"
|
||||
ng-change="updateServiceAttribute(service, 'Replicas')"
|
||||
disable-authorization="DockerServiceUpdate"
|
||||
/>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -69,42 +75,77 @@
|
|||
<td>{{ service.Image }}</td>
|
||||
</tr>
|
||||
<tr ng-if="applicationState.endpoint.type !== 4">
|
||||
<td colspan="{{webhookURL ? '1' : '2'}}">
|
||||
<td colspan="{{ webhookURL ? '1' : '2' }}">
|
||||
Service webhook
|
||||
<portainer-tooltip position="top" message="Webhook (or callback URI) used to automate the update of this service. Sending a POST request to this callback URI (without requiring any authentication) will pull the most up-to-date version of the associated image and re-deploy this service."></portainer-tooltip>
|
||||
<portainer-tooltip
|
||||
position="top"
|
||||
message="Webhook (or callback URI) used to automate the update of this service. Sending a POST request to this callback URI (without requiring any authentication) will pull the most up-to-date version of the associated image and re-deploy this service."
|
||||
></portainer-tooltip>
|
||||
<label class="switch" style="margin-left: 20px;">
|
||||
<input disable-authorization="DockerServiceUpdate" type="checkbox" ng-model="WebhookExists" ng-click="updateWebhook(service)"><i></i>
|
||||
<input disable-authorization="DockerServiceUpdate" type="checkbox" ng-model="WebhookExists" ng-click="updateWebhook(service)" /><i></i>
|
||||
</label>
|
||||
</td>
|
||||
<td ng-if="webhookURL">
|
||||
<span class="text-muted">{{ webhookURL | truncatelr }}</span>
|
||||
<button type="button" class="btn btn-sm btn-primary btn-sm space-left" ng-if="webhookURL" ng-click="copyWebhook()" >
|
||||
<button type="button" class="btn btn-sm btn-primary btn-sm space-left" ng-if="webhookURL" ng-click="copyWebhook()">
|
||||
<span><i class="fa fa-copy space-right" aria-hidden="true"></i>Copy link</span>
|
||||
</button>
|
||||
<span>
|
||||
<i id="copyNotification" class="fa fa-check green-icon" aria-hidden="true" style="margin-left: 7px; display: none;"></i>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr authorization="DockerServiceLogs, DockerServiceUpdate, DockerServiceDelete">
|
||||
<td colspan="2">
|
||||
<p class="small text-muted" authorization="DockerServiceUpdate">
|
||||
Note: you can only rollback one level of changes. Clicking the rollback button without making a new change will undo your previous rollback
|
||||
<p>
|
||||
<a authorization="DockerServiceLogs" ng-if="applicationState.endpoint.apiVersion >= 1.30" class="btn btn-primary btn-sm" type="button" ui-sref="docker.services.service.logs({id: service.Id})"><i class="fa fa-file-alt space-right" aria-hidden="true"></i>Service logs</a>
|
||||
<button authorization="DockerServiceUpdate" type="button" class="btn btn-primary btn-sm" ng-disabled="state.updateInProgress || isUpdating" ng-click="forceUpdateService(service)" button-spinner="state.updateInProgress" ng-if="applicationState.endpoint.apiVersion >= 1.25">
|
||||
<span ng-hide="state.updateInProgress"><i class="fa fa-sync space-right" aria-hidden="true"></i>Update the service</span>
|
||||
<span ng-show="state.updateInProgress">Update in progress...</span>
|
||||
</button>
|
||||
<button authorization="DockerServiceUpdate" type="button" class="btn btn-primary btn-sm" ng-disabled="state.rollbackInProgress || isUpdating" ng-click="rollbackService(service)" button-spinner="state.rollbackInProgress" ng-if="applicationState.endpoint.apiVersion >= 1.25">
|
||||
<span ng-hide="state.rollbackInProgress"><i class="fa fa-undo space-right" aria-hidden="true"></i>Rollback the service</span>
|
||||
<span ng-show="state.rollbackInProgress">Rollback in progress...</span>
|
||||
</button>
|
||||
<button authorization="DockerServiceDelete" type="button" class="btn btn-danger btn-sm" ng-disabled="state.deletionInProgress || isUpdating" ng-click="removeService()" button-spinner="state.deletionInProgress">
|
||||
<span ng-hide="state.deletionInProgress"><i class="fa fa-trash-alt space-right" aria-hidden="true"></i>Delete the service</span>
|
||||
<span ng-show="state.deletionInProgress">Deletion in progress...</span>
|
||||
</button>
|
||||
</td>
|
||||
Note: you can only rollback one level of changes. Clicking the rollback button without making a new change will undo your previous rollback </p
|
||||
|
||||
><p>
|
||||
<a
|
||||
authorization="DockerServiceLogs"
|
||||
ng-if="applicationState.endpoint.apiVersion >= 1.3"
|
||||
class="btn btn-primary btn-sm"
|
||||
type="button"
|
||||
ui-sref="docker.services.service.logs({id: service.Id})"
|
||||
><i class="fa fa-file-alt space-right" aria-hidden="true"></i>Service logs</a
|
||||
>
|
||||
<button
|
||||
authorization="DockerServiceUpdate"
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="state.updateInProgress || isUpdating"
|
||||
ng-click="forceUpdateService(service)"
|
||||
button-spinner="state.updateInProgress"
|
||||
ng-if="applicationState.endpoint.apiVersion >= 1.25"
|
||||
>
|
||||
<span ng-hide="state.updateInProgress"><i class="fa fa-sync space-right" aria-hidden="true"></i>Update the service</span>
|
||||
<span ng-show="state.updateInProgress">Update in progress...</span>
|
||||
</button>
|
||||
<button
|
||||
authorization="DockerServiceUpdate"
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="state.rollbackInProgress || isUpdating"
|
||||
ng-click="rollbackService(service)"
|
||||
button-spinner="state.rollbackInProgress"
|
||||
ng-if="applicationState.endpoint.apiVersion >= 1.25"
|
||||
>
|
||||
<span ng-hide="state.rollbackInProgress"><i class="fa fa-undo space-right" aria-hidden="true"></i>Rollback the service</span>
|
||||
<span ng-show="state.rollbackInProgress">Rollback in progress...</span>
|
||||
</button>
|
||||
<button
|
||||
authorization="DockerServiceDelete"
|
||||
type="button"
|
||||
class="btn btn-danger btn-sm"
|
||||
ng-disabled="state.deletionInProgress || isUpdating"
|
||||
ng-click="removeService()"
|
||||
button-spinner="state.deletionInProgress"
|
||||
>
|
||||
<span ng-hide="state.deletionInProgress"><i class="fa fa-trash-alt space-right" aria-hidden="true"></i>Delete the service</span>
|
||||
<span ng-show="state.deletionInProgress">Deletion in progress...</span>
|
||||
</button>
|
||||
</p></td
|
||||
>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -115,7 +156,9 @@
|
|||
</p>
|
||||
<div class="btn-toolbar" role="toolbar">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-primary" ng-disabled="!hasChanges(service, ['Mode', 'Replicas', 'Name', 'Webhooks'])" ng-click="updateService(service)">Apply changes</button>
|
||||
<button type="button" class="btn btn-primary" ng-disabled="!hasChanges(service, ['Mode', 'Replicas', 'Name', 'Webhooks'])" ng-click="updateService(service)"
|
||||
>Apply changes</button
|
||||
>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
|
@ -141,7 +184,7 @@
|
|||
<li><a href ng-click="goToItem('service-network-specs')">Network & published ports</a></li>
|
||||
<li><a href ng-click="goToItem('service-resources')">Resource limits & reservations</a></li>
|
||||
<li><a href ng-click="goToItem('service-placement-constraints')">Placement constraints</a></li>
|
||||
<li ng-if="applicationState.endpoint.apiVersion >= 1.30"><a href ng-click="goToItem('service-placement-preferences')">Placement preferences</a></li>
|
||||
<li ng-if="applicationState.endpoint.apiVersion >= 1.3"><a href ng-click="goToItem('service-placement-preferences')">Placement preferences</a></li>
|
||||
<li><a href ng-click="goToItem('service-restart-policy')">Restart policy</a></li>
|
||||
<li><a href ng-click="goToItem('service-update-config')">Update configuration</a></li>
|
||||
<li><a href ng-click="goToItem('service-logging')">Logging</a></li>
|
||||
|
@ -160,12 +203,13 @@
|
|||
ng-if="service && applicationState.application.authentication"
|
||||
resource-id="service.Id"
|
||||
resource-control="service.ResourceControl"
|
||||
resource-type="'service'">
|
||||
resource-type="'service'"
|
||||
>
|
||||
</por-access-control-panel>
|
||||
<!-- !access-control-panel -->
|
||||
|
||||
<div class="row">
|
||||
<hr>
|
||||
<hr />
|
||||
<div class="col-lg-12 col-md-12 col-xs-12">
|
||||
<h3 id="container-specs">Container specification</h3>
|
||||
<div id="service-container-spec" class="padding-top" ng-include="'app/docker/views/services/edit/includes/container-specs.html'"></div>
|
||||
|
@ -177,7 +221,7 @@
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<hr>
|
||||
<hr />
|
||||
<div class="col-lg-12 col-md-12 col-xs-12">
|
||||
<h3 id="service-network-specs">Networks & ports</h3>
|
||||
<div id="service-networks" class="padding-top" ng-include="'app/docker/views/services/edit/includes/networks.html'"></div>
|
||||
|
@ -187,12 +231,17 @@
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<hr>
|
||||
<hr />
|
||||
<div class="col-lg-12 col-md-12 col-xs-12">
|
||||
<h3 id="service-specs">Service specification</h3>
|
||||
<div id="service-resources" class="padding-top" ng-include="'app/docker/views/services/edit/includes/resources.html'"></div>
|
||||
<div id="service-placement-constraints" class="padding-top" ng-include="'app/docker/views/services/edit/includes/constraints.html'"></div>
|
||||
<div id="service-placement-preferences" ng-if="applicationState.endpoint.apiVersion >= 1.30" class="padding-top" ng-include="'app/docker/views/services/edit/includes/placementPreferences.html'"></div>
|
||||
<div
|
||||
id="service-placement-preferences"
|
||||
ng-if="applicationState.endpoint.apiVersion >= 1.3"
|
||||
class="padding-top"
|
||||
ng-include="'app/docker/views/services/edit/includes/placementPreferences.html'"
|
||||
></div>
|
||||
<div id="service-restart-policy" class="padding-top" ng-include="'app/docker/views/services/edit/includes/restart.html'"></div>
|
||||
<div id="service-update-config" class="padding-top" ng-include="'app/docker/views/services/edit/includes/updateconfig.html'"></div>
|
||||
<div id="service-logging" class="padding-top" ng-include="'app/docker/views/services/edit/includes/logging.html'"></div>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,72 +1,76 @@
|
|||
import moment from 'moment';
|
||||
|
||||
angular.module('portainer.docker')
|
||||
.controller('ServiceLogsController', ['$scope', '$transition$', '$interval', 'ServiceService', 'Notifications',
|
||||
function ($scope, $transition$, $interval, ServiceService, Notifications) {
|
||||
$scope.state = {
|
||||
refreshRate: 3,
|
||||
lineCount: 100,
|
||||
sinceTimestamp: '',
|
||||
displayTimestamps: false
|
||||
};
|
||||
angular.module('portainer.docker').controller('ServiceLogsController', [
|
||||
'$scope',
|
||||
'$transition$',
|
||||
'$interval',
|
||||
'ServiceService',
|
||||
'Notifications',
|
||||
function ($scope, $transition$, $interval, ServiceService, Notifications) {
|
||||
$scope.state = {
|
||||
refreshRate: 3,
|
||||
lineCount: 100,
|
||||
sinceTimestamp: '',
|
||||
displayTimestamps: false,
|
||||
};
|
||||
|
||||
$scope.changeLogCollection = function(logCollectionStatus) {
|
||||
if (!logCollectionStatus) {
|
||||
stopRepeater();
|
||||
} else {
|
||||
setUpdateRepeater();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
stopRepeater();
|
||||
});
|
||||
|
||||
function stopRepeater() {
|
||||
var repeater = $scope.repeater;
|
||||
if (angular.isDefined(repeater)) {
|
||||
$interval.cancel(repeater);
|
||||
repeater = null;
|
||||
}
|
||||
}
|
||||
|
||||
function setUpdateRepeater() {
|
||||
var refreshRate = $scope.state.refreshRate;
|
||||
$scope.repeater = $interval(function() {
|
||||
ServiceService.logs($transition$.params().id, 1, 1, $scope.state.displayTimestamps ? 1 : 0, moment($scope.state.sinceTimestamp).unix(), $scope.state.lineCount)
|
||||
.then(function success(data) {
|
||||
$scope.logs = data;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
$scope.changeLogCollection = function (logCollectionStatus) {
|
||||
if (!logCollectionStatus) {
|
||||
stopRepeater();
|
||||
Notifications.error('Failure', err, 'Unable to retrieve service logs');
|
||||
});
|
||||
}, refreshRate * 1000);
|
||||
}
|
||||
} else {
|
||||
setUpdateRepeater();
|
||||
}
|
||||
};
|
||||
|
||||
function startLogPolling() {
|
||||
ServiceService.logs($transition$.params().id, 1, 1, $scope.state.displayTimestamps ? 1 : 0, moment($scope.state.sinceTimestamp).unix(), $scope.state.lineCount)
|
||||
.then(function success(data) {
|
||||
$scope.logs = data;
|
||||
setUpdateRepeater();
|
||||
})
|
||||
.catch(function error(err) {
|
||||
$scope.$on('$destroy', function () {
|
||||
stopRepeater();
|
||||
Notifications.error('Failure', err, 'Unable to retrieve service logs');
|
||||
});
|
||||
}
|
||||
|
||||
function initView() {
|
||||
ServiceService.service($transition$.params().id)
|
||||
.then(function success(data) {
|
||||
$scope.service = data;
|
||||
startLogPolling();
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve service information');
|
||||
});
|
||||
|
||||
}
|
||||
function stopRepeater() {
|
||||
var repeater = $scope.repeater;
|
||||
if (angular.isDefined(repeater)) {
|
||||
$interval.cancel(repeater);
|
||||
repeater = null;
|
||||
}
|
||||
}
|
||||
|
||||
initView();
|
||||
}]);
|
||||
function setUpdateRepeater() {
|
||||
var refreshRate = $scope.state.refreshRate;
|
||||
$scope.repeater = $interval(function () {
|
||||
ServiceService.logs($transition$.params().id, 1, 1, $scope.state.displayTimestamps ? 1 : 0, moment($scope.state.sinceTimestamp).unix(), $scope.state.lineCount)
|
||||
.then(function success(data) {
|
||||
$scope.logs = data;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
stopRepeater();
|
||||
Notifications.error('Failure', err, 'Unable to retrieve service logs');
|
||||
});
|
||||
}, refreshRate * 1000);
|
||||
}
|
||||
|
||||
function startLogPolling() {
|
||||
ServiceService.logs($transition$.params().id, 1, 1, $scope.state.displayTimestamps ? 1 : 0, moment($scope.state.sinceTimestamp).unix(), $scope.state.lineCount)
|
||||
.then(function success(data) {
|
||||
$scope.logs = data;
|
||||
setUpdateRepeater();
|
||||
})
|
||||
.catch(function error(err) {
|
||||
stopRepeater();
|
||||
Notifications.error('Failure', err, 'Unable to retrieve service logs');
|
||||
});
|
||||
}
|
||||
|
||||
function initView() {
|
||||
ServiceService.service($transition$.params().id)
|
||||
.then(function success(data) {
|
||||
$scope.service = data;
|
||||
startLogPolling();
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve service information');
|
||||
});
|
||||
}
|
||||
|
||||
initView();
|
||||
},
|
||||
]);
|
||||
|
|
|
@ -6,5 +6,10 @@
|
|||
</rd-header>
|
||||
|
||||
<log-viewer
|
||||
data="logs" ng-if="logs" log-collection-change="changeLogCollection" display-timestamps="state.displayTimestamps" line-count="state.lineCount" since-timestamp="state.sinceTimestamp"
|
||||
data="logs"
|
||||
ng-if="logs"
|
||||
log-collection-change="changeLogCollection"
|
||||
display-timestamps="state.displayTimestamps"
|
||||
line-count="state.lineCount"
|
||||
since-timestamp="state.sinceTimestamp"
|
||||
></log-viewer>
|
||||
|
|
|
@ -10,17 +10,19 @@
|
|||
<div class="row" ng-if="services">
|
||||
<div class="col-sm-12">
|
||||
<services-datatable
|
||||
title-text="Services" title-icon="fa-list-alt"
|
||||
dataset="services" table-key="services"
|
||||
order-by="Name"
|
||||
nodes="nodes"
|
||||
agent-proxy="applicationState.endpoint.mode.agentProxy"
|
||||
show-ownership-column="applicationState.application.authentication"
|
||||
show-update-action="applicationState.endpoint.apiVersion >= 1.25"
|
||||
show-task-logs-button="applicationState.endpoint.apiVersion >= 1.30"
|
||||
show-add-action="true"
|
||||
show-stack-column="true"
|
||||
refresh-callback="getServices"
|
||||
title-text="Services"
|
||||
title-icon="fa-list-alt"
|
||||
dataset="services"
|
||||
table-key="services"
|
||||
order-by="Name"
|
||||
nodes="nodes"
|
||||
agent-proxy="applicationState.endpoint.mode.agentProxy"
|
||||
show-ownership-column="applicationState.application.authentication"
|
||||
show-update-action="applicationState.endpoint.apiVersion >= 1.25"
|
||||
show-task-logs-button="applicationState.endpoint.apiVersion >= 1.30"
|
||||
show-add-action="true"
|
||||
show-stack-column="true"
|
||||
refresh-callback="getServices"
|
||||
></services-datatable>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,47 +1,55 @@
|
|||
angular.module('portainer.docker')
|
||||
.controller('ServicesController', ['$q', '$scope', 'ServiceService', 'ServiceHelper', 'Notifications', 'TaskService', 'TaskHelper', 'NodeService', 'ContainerService',
|
||||
function ($q, $scope, ServiceService, ServiceHelper, Notifications, TaskService, TaskHelper, NodeService, ContainerService) {
|
||||
angular.module('portainer.docker').controller('ServicesController', [
|
||||
'$q',
|
||||
'$scope',
|
||||
'ServiceService',
|
||||
'ServiceHelper',
|
||||
'Notifications',
|
||||
'TaskService',
|
||||
'TaskHelper',
|
||||
'NodeService',
|
||||
'ContainerService',
|
||||
function ($q, $scope, ServiceService, ServiceHelper, Notifications, TaskService, TaskHelper, NodeService, ContainerService) {
|
||||
$scope.getServices = getServices;
|
||||
function getServices() {
|
||||
var agentProxy = $scope.applicationState.endpoint.mode.agentProxy;
|
||||
|
||||
$scope.getServices = getServices;
|
||||
function getServices() {
|
||||
var agentProxy = $scope.applicationState.endpoint.mode.agentProxy;
|
||||
$q.all({
|
||||
services: ServiceService.services(),
|
||||
tasks: TaskService.tasks(),
|
||||
containers: agentProxy ? ContainerService.containers(1) : [],
|
||||
nodes: NodeService.nodes(),
|
||||
})
|
||||
.then(function success(data) {
|
||||
var services = data.services;
|
||||
var tasks = data.tasks;
|
||||
|
||||
$q.all({
|
||||
services: ServiceService.services(),
|
||||
tasks: TaskService.tasks(),
|
||||
containers: agentProxy ? ContainerService.containers(1) : [],
|
||||
nodes: NodeService.nodes()
|
||||
})
|
||||
.then(function success(data) {
|
||||
var services = data.services;
|
||||
var tasks = data.tasks;
|
||||
if (agentProxy) {
|
||||
var containers = data.containers;
|
||||
for (var j = 0; j < tasks.length; j++) {
|
||||
var task = tasks[j];
|
||||
TaskHelper.associateContainerToTask(task, containers);
|
||||
}
|
||||
}
|
||||
|
||||
if (agentProxy) {
|
||||
var containers = data.containers;
|
||||
for (var j = 0; j < tasks.length; j++) {
|
||||
var task = tasks[j];
|
||||
TaskHelper.associateContainerToTask(task, containers);
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < services.length; i++) {
|
||||
var service = services[i];
|
||||
ServiceHelper.associateTasksToService(service, tasks);
|
||||
}
|
||||
|
||||
for (var i = 0; i < services.length; i++) {
|
||||
var service = services[i];
|
||||
ServiceHelper.associateTasksToService(service, tasks);
|
||||
}
|
||||
$scope.nodes = data.nodes;
|
||||
$scope.tasks = tasks;
|
||||
$scope.services = services;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
$scope.services = [];
|
||||
Notifications.error('Failure', err, 'Unable to retrieve services');
|
||||
});
|
||||
}
|
||||
|
||||
$scope.nodes = data.nodes;
|
||||
$scope.tasks = tasks;
|
||||
$scope.services = services;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
$scope.services = [];
|
||||
Notifications.error('Failure', err, 'Unable to retrieve services');
|
||||
});
|
||||
}
|
||||
function initView() {
|
||||
getServices();
|
||||
}
|
||||
|
||||
function initView() {
|
||||
getServices();
|
||||
}
|
||||
|
||||
initView();
|
||||
}]);
|
||||
initView();
|
||||
},
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue