View SSH Key modal
This commit is contained in:
parent
f4ba7b41b3
commit
876d9c53f2
4 changed files with 73 additions and 2 deletions
|
@ -130,13 +130,16 @@
|
||||||
|
|
||||||
<tr ng-repeat="trigger in triggers | filter:{'is_active':true}">
|
<tr ng-repeat="trigger in triggers | filter:{'is_active':true}">
|
||||||
<td><div class="trigger-description" trigger="trigger" short="true"></div></td>
|
<td><div class="trigger-description" trigger="trigger" short="true"></div></td>
|
||||||
<td>{{ trigger.config.subdir || '(Root Directory)' }}</td>
|
<td>{{ trigger.config.subdir || '/' }}</td>
|
||||||
<td>{{ trigger.config.branchtag_regex || '(All)' }}</td>
|
<td>{{ trigger.config.branchtag_regex || 'All' }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="entity-reference" entity="trigger.pull_robot" ng-if="trigger.pull_robot"></span>
|
<span class="entity-reference" entity="trigger.pull_robot" ng-if="trigger.pull_robot"></span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="cor-options-menu">
|
<span class="cor-options-menu">
|
||||||
|
<span class="cor-option" option-click="showSSHKeyModal(trigger)" ng-show="trigger.service == 'custom'">
|
||||||
|
<i class="fa fa-unlock-alt"></i> View SSH Key
|
||||||
|
</span>
|
||||||
<span class="cor-option" option-click="askRunTrigger(trigger)">
|
<span class="cor-option" option-click="askRunTrigger(trigger)">
|
||||||
<i class="fa fa-chevron-right"></i> Run Trigger Now
|
<i class="fa fa-chevron-right"></i> Run Trigger Now
|
||||||
</span>
|
</span>
|
||||||
|
@ -153,6 +156,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- /Build Triggers -->
|
</div> <!-- /Build Triggers -->
|
||||||
|
|
||||||
|
<!-- Dialogs -->
|
||||||
|
|
||||||
|
<!-- SSH key dialog -->
|
||||||
|
<div class="ssh-key-dialog" trigger="sshKeyModalTrigger" counter="sshKeyModalCounter"></div>
|
||||||
|
|
||||||
<!-- Delete Tag Confirm -->
|
<!-- Delete Tag Confirm -->
|
||||||
<div class="cor-confirm-dialog"
|
<div class="cor-confirm-dialog"
|
||||||
dialog-context="deleteTriggerInfo"
|
dialog-context="deleteTriggerInfo"
|
||||||
|
@ -184,4 +192,6 @@
|
||||||
counter="showTriggerStartDialogCounter"
|
counter="showTriggerStartDialogCounter"
|
||||||
start-build="startTrigger(trigger, parameters)"></div>
|
start-build="startTrigger(trigger, parameters)"></div>
|
||||||
|
|
||||||
|
<!-- /Dialogs -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
24
static/directives/ssh-key-dialog.html
Normal file
24
static/directives/ssh-key-dialog.html
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<!-- Modal message dialog -->
|
||||||
|
<div class="modal fade" id="sshkeymodal">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
Public SSH Key
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<p>In order for our builders to clone your repository, you must give the following public key read access to the git repository.</p>
|
||||||
|
<!-- TODO(jzelinskie): link to a specific article in the docs -->
|
||||||
|
<p>More information on using a custom triggers can be found <a href="http://docs.quay.io">in the docs</a>.</p>
|
||||||
|
</div>
|
||||||
|
<div class="copy-box" value="trigger.config.public_key"></div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Done</button>
|
||||||
|
</div>
|
||||||
|
</div> <!-- /.modal-content -->
|
||||||
|
</div> <!-- /.modal-dialog -->
|
||||||
|
</div> <!-- /.modal -->
|
|
@ -32,6 +32,9 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
||||||
$scope.showTriggerStartDialogCounter = 0;
|
$scope.showTriggerStartDialogCounter = 0;
|
||||||
$scope.showTriggerSetupCounter = 0;
|
$scope.showTriggerSetupCounter = 0;
|
||||||
|
|
||||||
|
$scope.sshKeyModalTrigger = null;
|
||||||
|
$scope.sshKeyModalCounter = 0;
|
||||||
|
|
||||||
var updateBuilds = function() {
|
var updateBuilds = function() {
|
||||||
if (!$scope.allBuilds) { return; }
|
if (!$scope.allBuilds) { return; }
|
||||||
|
|
||||||
|
@ -158,6 +161,11 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
||||||
$scope.options.predicate = predicate;
|
$scope.options.predicate = predicate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.showSSHKeyModal = function(trigger) {
|
||||||
|
$scope.sshKeyModalTrigger = trigger;
|
||||||
|
$scope.sshKeyModalCounter++;
|
||||||
|
};
|
||||||
|
|
||||||
$scope.askDeleteTrigger = function(trigger) {
|
$scope.askDeleteTrigger = function(trigger) {
|
||||||
$scope.deleteTriggerInfo = {
|
$scope.deleteTriggerInfo = {
|
||||||
'trigger': trigger
|
'trigger': trigger
|
||||||
|
|
29
static/js/directives/ui/ssh-key-dialog.js
Normal file
29
static/js/directives/ui/ssh-key-dialog.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/**
|
||||||
|
* An element which displays a dialog with the public SSH keycredentials for a trigger.
|
||||||
|
*/
|
||||||
|
angular.module('quay').directive('sshKeyDialog', function () {
|
||||||
|
var directiveDefinitionObject = {
|
||||||
|
priority: 0,
|
||||||
|
templateUrl: '/static/directives/ssh-key-dialog.html',
|
||||||
|
replace: false,
|
||||||
|
transclude: true,
|
||||||
|
restrict: 'C',
|
||||||
|
scope: {
|
||||||
|
'trigger': '=trigger',
|
||||||
|
'counter': '=counter'
|
||||||
|
},
|
||||||
|
controller: function($scope, $element) {
|
||||||
|
var show = function() {
|
||||||
|
if (!$scope.trigger) {
|
||||||
|
$('#sshkeymodal').modal('hide');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$('#sshkeymodal').modal({});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.$watch('trigger', show);
|
||||||
|
$scope.$watch('counter', show);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return directiveDefinitionObject;
|
||||||
|
});
|
Reference in a new issue