fix(docker): pass endpoint to registry field (#5365)
parent
456995353b
commit
f990617a7e
|
@ -190,7 +190,16 @@
|
|||
</div>
|
||||
<!-- !tag-description -->
|
||||
<!-- image-and-registry -->
|
||||
<por-image-registry model="config.RegistryModel" auto-complete="true" label-class="col-sm-1" input-class="col-sm-11" endpoint="endpoint"></por-image-registry>
|
||||
<por-image-registry
|
||||
model="config.RegistryModel"
|
||||
auto-complete="true"
|
||||
label-class="col-sm-1"
|
||||
input-class="col-sm-11"
|
||||
endpoint="endpoint"
|
||||
is-admin="isAdmin"
|
||||
set-validity="setPullImageValidity"
|
||||
check-rate-limits="true"
|
||||
></por-image-registry>
|
||||
<!-- !image-and-registry -->
|
||||
<!-- tag-note -->
|
||||
<div class="form-group">
|
||||
|
@ -201,7 +210,14 @@
|
|||
<!-- !tag-note -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!config.RegistryModel.Image || config.commitInProgress" ng-click="commit()">Create</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
ng-disabled="!state.pullImageValidity || !config.RegistryModel.Image || config.commitInProgress"
|
||||
ng-click="commit()"
|
||||
>
|
||||
Create
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -44,6 +44,7 @@ angular.module('portainer.docker').controller('ContainerController', [
|
|||
endpoint
|
||||
) {
|
||||
$scope.endpoint = endpoint;
|
||||
$scope.isAdmin = Authentication.isAdmin();
|
||||
$scope.activityTime = 0;
|
||||
$scope.portBindings = [];
|
||||
$scope.displayRecreateButton = false;
|
||||
|
@ -57,8 +58,14 @@ angular.module('portainer.docker').controller('ContainerController', [
|
|||
recreateContainerInProgress: false,
|
||||
joinNetworkInProgress: false,
|
||||
leaveNetworkInProgress: false,
|
||||
pullImageValidity: false,
|
||||
};
|
||||
|
||||
$scope.setPullImageValidity = setPullImageValidity;
|
||||
function setPullImageValidity(validity) {
|
||||
$scope.state.pullImageValidity = validity;
|
||||
}
|
||||
|
||||
$scope.updateRestartPolicy = updateRestartPolicy;
|
||||
|
||||
var update = function () {
|
||||
|
|
|
@ -63,7 +63,15 @@
|
|||
<rd-widget-body>
|
||||
<form class="form-horizontal">
|
||||
<!-- image-and-registry -->
|
||||
<por-image-registry model="formValues.RegistryModel" endpoint="endpoint" label-class="col-sm-1" input-class="col-sm-11"></por-image-registry>
|
||||
<por-image-registry
|
||||
model="formValues.RegistryModel"
|
||||
label-class="col-sm-1"
|
||||
input-class="col-sm-11"
|
||||
endpoint="endpoint"
|
||||
is-admin="isAdmin"
|
||||
set-validity="setPullImageValidity"
|
||||
check-rate-limits="true"
|
||||
></por-image-registry>
|
||||
<!-- !image-and-registry -->
|
||||
<!-- tag-note -->
|
||||
<div class="form-group">
|
||||
|
@ -74,7 +82,7 @@
|
|||
<!-- !tag-note -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!formValues.RegistryModel.Image" ng-click="tagImage()">Tag</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!state.pullImageValidity || !formValues.RegistryModel.Image" ng-click="tagImage()">Tag</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -7,7 +7,7 @@ angular.module('portainer.docker').controller('ImageController', [
|
|||
'$scope',
|
||||
'$transition$',
|
||||
'$state',
|
||||
'endpoint',
|
||||
'Authentication',
|
||||
'ImageService',
|
||||
'ImageHelper',
|
||||
'RegistryService',
|
||||
|
@ -16,14 +16,34 @@ angular.module('portainer.docker').controller('ImageController', [
|
|||
'ModalService',
|
||||
'FileSaver',
|
||||
'Blob',
|
||||
function ($async, $q, $scope, $transition$, $state, endpoint, ImageService, ImageHelper, RegistryService, Notifications, HttpRequestHelper, ModalService, FileSaver, Blob) {
|
||||
'endpoint',
|
||||
function (
|
||||
$async,
|
||||
$q,
|
||||
$scope,
|
||||
$transition$,
|
||||
$state,
|
||||
Authentication,
|
||||
ImageService,
|
||||
ImageHelper,
|
||||
RegistryService,
|
||||
Notifications,
|
||||
HttpRequestHelper,
|
||||
ModalService,
|
||||
FileSaver,
|
||||
Blob,
|
||||
endpoint
|
||||
) {
|
||||
$scope.endpoint = endpoint;
|
||||
$scope.isAdmin = Authentication.isAdmin();
|
||||
|
||||
$scope.formValues = {
|
||||
RegistryModel: new PorImageRegistryModel(),
|
||||
};
|
||||
|
||||
$scope.state = {
|
||||
exportInProgress: false,
|
||||
pullImageValidity: false,
|
||||
};
|
||||
|
||||
$scope.sortType = 'Order';
|
||||
|
@ -40,6 +60,11 @@ angular.module('portainer.docker').controller('ImageController', [
|
|||
$('#layer-command-' + layerId + '-full').toggle();
|
||||
};
|
||||
|
||||
$scope.setPullImageValidity = setPullImageValidity;
|
||||
function setPullImageValidity(validity) {
|
||||
$scope.state.pullImageValidity = validity;
|
||||
}
|
||||
|
||||
$scope.tagImage = function () {
|
||||
const registryModel = $scope.formValues.RegistryModel;
|
||||
|
||||
|
|
Loading…
Reference in New Issue