View SSH Key modal

This commit is contained in:
Jimmy Zelinskie 2015-04-14 14:11:02 -04:00
parent f4ba7b41b3
commit 876d9c53f2
4 changed files with 73 additions and 2 deletions

View file

@ -32,6 +32,9 @@ angular.module('quay').directive('repoPanelBuilds', function () {
$scope.showTriggerStartDialogCounter = 0;
$scope.showTriggerSetupCounter = 0;
$scope.sshKeyModalTrigger = null;
$scope.sshKeyModalCounter = 0;
var updateBuilds = function() {
if (!$scope.allBuilds) { return; }
@ -158,6 +161,11 @@ angular.module('quay').directive('repoPanelBuilds', function () {
$scope.options.predicate = predicate;
};
$scope.showSSHKeyModal = function(trigger) {
$scope.sshKeyModalTrigger = trigger;
$scope.sshKeyModalCounter++;
};
$scope.askDeleteTrigger = function(trigger) {
$scope.deleteTriggerInfo = {
'trigger': trigger

View 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;
});