1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

fix(services): pre fill service registry and image [EE-1769] (#5798)

fix(services): pre fill service registry and image [EE-1769]  (#5798)
This commit is contained in:
Marcelo Rydel 2021-10-14 09:42:10 -03:00 committed by GitHub
parent 12e7aa6b60
commit edb25ee10d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 12 deletions

View file

@ -15,12 +15,14 @@ class porImageRegistryController {
this.Notifications = Notifications;
this.onRegistryChange = this.onRegistryChange.bind(this);
this.onImageChange = this.onImageChange.bind(this);
this.registries = [];
this.images = [];
this.defaultRegistry = new DockerHubViewModel();
this.$scope.$watch(() => this.model.Registry, this.onRegistryChange);
this.$scope.$watch(() => this.model.Image, this.onImageChange);
}
isKnownRegistry(registry) {
@ -62,6 +64,12 @@ class porImageRegistryController {
}
}
async onImageChange() {
if (!this.isDockerHubRegistry()) {
this.setValidity(true);
}
}
displayedRegistryURL() {
return this.getRegistryURL(this.model.Registry) || 'docker.io';
}

View file

@ -24,7 +24,7 @@
uib-typeahead="image for image in $ctrl.availableImages | filter:$viewValue | limitTo:5"
ng-model="$ctrl.model.Image"
name="image_name"
placeholder="e.g. myImage:myTag"
placeholder="e.g. my-image:my-tag"
ng-change="$ctrl.onImageChange()"
required
data-cy="component-imageInput"
@ -54,7 +54,7 @@
</span>
<label for="image_name" ng-class="$ctrl.labelClass" class="control-label text-left">Image </label>
<div ng-class="$ctrl.inputClass">
<input type="text" class="form-control" ng-model="$ctrl.model.Image" name="image_name" placeholder="e.g. registry:port/myImage:myTag" required />
<input type="text" class="form-control" ng-model="$ctrl.model.Image" name="image_name" placeholder="e.g. registry:port/my-image:my-tag" required />
</div>
</div>
</div>