mirror of https://github.com/portainer/portainer
feat(container-creation): display a warning message when editing a container with an unknow registry (#1143)
parent
bf6b398a27
commit
be4beacdf7
|
@ -403,7 +403,6 @@ function ($q, $scope, $state, $stateParams, $filter, Container, ContainerHelper,
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadFromContainerImageConfig(d) {
|
function loadFromContainerImageConfig(d) {
|
||||||
// If no registry found, we let default DockerHub and let full image path
|
|
||||||
var imageInfo = ImageHelper.extractImageAndRegistryFromRepository($scope.config.Image);
|
var imageInfo = ImageHelper.extractImageAndRegistryFromRepository($scope.config.Image);
|
||||||
RegistryService.retrieveRegistryFromRepository($scope.config.Image)
|
RegistryService.retrieveRegistryFromRepository($scope.config.Image)
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
|
|
|
@ -21,24 +21,30 @@
|
||||||
<div class="col-sm-12 form-section-title">
|
<div class="col-sm-12 form-section-title">
|
||||||
Image configuration
|
Image configuration
|
||||||
</div>
|
</div>
|
||||||
<!-- image-and-registry -->
|
<div ng-if="!formValues.Registry && fromContainer">
|
||||||
<div class="form-group">
|
<i class="fa fa-exclamation-triangle orange-icon" aria-hidden="true"></i>
|
||||||
<por-image-registry image="config.Image" registry="formValues.Registry" ng-if="formValues.Registry"></por-image-registry>
|
<span class="small text-danger" style="margin-left: 5px;">The Docker registry for the <code>{{ config.Image }}</code> image is not registered inside Portainer, you will not be able to create a container. Please register that registry first.</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- !image-and-registry -->
|
<div ng-if="formValues.Registry || !fromContainer">
|
||||||
<!-- always-pull -->
|
<!-- image-and-registry -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-12">
|
<por-image-registry image="config.Image" registry="formValues.Registry" ng-if="formValues.Registry"></por-image-registry>
|
||||||
<label for="ownership" class="control-label text-left">
|
|
||||||
Always pull the image
|
|
||||||
<portainer-tooltip position="bottom" message="When enabled, Portainer will automatically try to pull the specified image before creating the container."></portainer-tooltip>
|
|
||||||
</label>
|
|
||||||
<label class="switch" style="margin-left: 20px;">
|
|
||||||
<input type="checkbox" ng-model="formValues.alwaysPull"><i></i>
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- !image-and-registry -->
|
||||||
|
<!-- always-pull -->
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<label for="ownership" class="control-label text-left">
|
||||||
|
Always pull the image
|
||||||
|
<portainer-tooltip position="bottom" message="When enabled, Portainer will automatically try to pull the specified image before creating the container."></portainer-tooltip>
|
||||||
|
</label>
|
||||||
|
<label class="switch" style="margin-left: 20px;">
|
||||||
|
<input type="checkbox" ng-model="formValues.alwaysPull"><i></i>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- !always-pull -->
|
||||||
</div>
|
</div>
|
||||||
<!-- !always-pull -->
|
|
||||||
<div class="col-sm-12 form-section-title">
|
<div class="col-sm-12 form-section-title">
|
||||||
Ports configuration
|
Ports configuration
|
||||||
</div>
|
</div>
|
||||||
|
@ -106,7 +112,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!config.Image" ng-click="create()">Start container</button>
|
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!config.Image || (!formValues.Registry && fromContainer)" ng-click="create()">Start container</button>
|
||||||
<a type="button" class="btn btn-default btn-sm" ui-sref="containers">Cancel</a>
|
<a type="button" class="btn btn-default btn-sm" ui-sref="containers">Cancel</a>
|
||||||
<i id="createContainerSpinner" class="fa fa-cog fa-spin" style="margin-left: 5px; display: none;"></i>
|
<i id="createContainerSpinner" class="fa fa-cog fa-spin" style="margin-left: 5px; display: none;"></i>
|
||||||
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>
|
<span class="text-danger" ng-if="state.formValidationError" style="margin-left: 5px;">{{ state.formValidationError }}</span>
|
||||||
|
|
Loading…
Reference in New Issue