Change the auth dialog to copy a full docker login command
This commit is contained in:
parent
2a3094cfde
commit
34c6d7f5b4
2 changed files with 12 additions and 3 deletions
|
@ -20,9 +20,10 @@
|
||||||
<a href="javascript:void(0)" ng-click="downloadCfg(shownRobot)">Download .dockercfg file</a>
|
<a href="javascript:void(0)" ng-click="downloadCfg(shownRobot)">Download .dockercfg file</a>
|
||||||
</span>
|
</span>
|
||||||
<div class="clipboard-copied-message" style="display: none">
|
<div class="clipboard-copied-message" style="display: none">
|
||||||
Copied to clipboard
|
Copied
|
||||||
</div>
|
</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>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
|
|
|
@ -2383,7 +2383,15 @@ quayApp.directive('dockerAuthDialog', function (Config) {
|
||||||
'shown': '=shown',
|
'shown': '=shown',
|
||||||
'counter': '=counter'
|
'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() {
|
$scope.isDownloadSupported = function() {
|
||||||
var isSafari = /^((?!chrome).)*safari/i.test(navigator.userAgent);
|
var isSafari = /^((?!chrome).)*safari/i.test(navigator.userAgent);
|
||||||
if (isSafari) {
|
if (isSafari) {
|
||||||
|
|
Reference in a new issue