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:
parent
12e7aa6b60
commit
edb25ee10d
7 changed files with 29 additions and 12 deletions
|
@ -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';
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue