Skip to content

Commit dbb3f58

Browse files
authored
add the ability to pull an image from a custom registry (#228)
1 parent b2005eb commit dbb3f58

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

app/components/pullImage/pullImage.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,11 @@ <h3>Pull Image</h3>
77
</div>
88
<div class="modal-body">
99
<form novalidate role="form" name="pullForm">
10-
<!--<div class="input-group">
11-
<span class="input-group-addon" id="basic-addon1">Image name</span>
12-
<input type="text" class="form-control" placeholder="imageName" aria-describedby="basic-addon1">
13-
</div>-->
1410
<div class="form-group">
1511
<label>Registry:</label>
1612
<input type="text" ng-model="config.registry" class="form-control"
1713
placeholder="Registry. Leave empty to user docker hub"/>
1814
</div>
19-
<div class="form-group">
20-
<label>Repo:</label>
21-
<input type="text" ng-model="config.repo" class="form-control"
22-
placeholder="Repository - usually your username."/>
23-
</div>
2415
<div class="form-group">
2516
<label>Image Name:</label>
2617
<input type="text" ng-model="config.fromImage" class="form-control" placeholder="Image name"

app/components/pullImage/pullImageController.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ angular.module('pullImage', [])
66
$scope.init = function () {
77
$scope.config = {
88
registry: '',
9-
repo: '',
109
fromImage: '',
1110
tag: 'latest'
1211
};
@@ -20,11 +19,11 @@ angular.module('pullImage', [])
2019

2120
$scope.pull = function () {
2221
$('#error-message').hide();
23-
var config = angular.copy($scope.config);
24-
var imageName = (config.registry ? config.registry + '/' : '' ) +
25-
(config.repo ? config.repo + '/' : '') +
26-
(config.fromImage) +
27-
(config.tag ? ':' + config.tag : '');
22+
var imageName = ($scope.config.registry ? $scope.config.registry + '/' : '' ) +
23+
($scope.config.fromImage);
24+
var config = {};
25+
config.fromImage = imageName;
26+
config.tag = $scope.config.tag;
2827

2928
ViewSpinner.spin();
3029
$('#pull-modal').modal('hide');

app/shared/services.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ angular.module('dockerui.services', ['ngResource', 'ngSanitize'])
8989
var str = data.replace(/\n/g, " ").replace(/\}\W*\{/g, "}, {");
9090
return angular.fromJson("[" + str + "]");
9191
}],
92-
params: {action: 'create', fromImage: '@fromImage', repo: '@repo', tag: '@tag', registry: '@registry'}
92+
params: {action: 'create', fromImage: '@fromImage', tag: '@tag'}
9393
},
9494
insert: {method: 'POST', params: {id: '@id', action: 'insert'}},
9595
push: {method: 'POST', params: {id: '@id', action: 'push'}},

0 commit comments

Comments
 (0)