Change the auth dialog to copy a full docker login command

This commit is contained in:
Joseph Schorr 2014-08-22 16:54:53 -04:00
parent 2a3094cfde
commit 34c6d7f5b4
2 changed files with 12 additions and 3 deletions

View file

@ -20,9 +20,10 @@
<a href="javascript:void(0)" ng-click="downloadCfg(shownRobot)">Download .dockercfg file</a>
</span>
<div class="clipboard-copied-message" style="display: none">
Copied to clipboard
Copied
</div>
<button id="copyClipboard" type="button" class="btn btn-primary" data-clipboard-target="token-view">Copy to clipboard</button>
<input type="hidden" name="command-data" id="command-data" value="{{ command }}">
<button id="copyClipboard" type="button" class="btn btn-primary" data-clipboard-target="command-data">Copy Login Command</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->

View file

@ -2383,7 +2383,15 @@ quayApp.directive('dockerAuthDialog', function (Config) {
'shown': '=shown',
'counter': '=counter'
},
controller: function($scope, $element) {
controller: function($scope, $element) {
var updateCommand = function() {
$scope.command = 'docker login -e="." -u="' + $scope.username +
'" -p="' + $scope.token + '" ' + Config['SERVER_HOSTNAME'];
};
$scope.$watch('username', updateCommand);
$scope.$watch('token', updateCommand);
$scope.isDownloadSupported = function() {
var isSafari = /^((?!chrome).)*safari/i.test(navigator.userAgent);
if (isSafari) {