parent
edc2bc8b93
commit
e85a1bce0a
13 changed files with 541 additions and 369 deletions
|
@ -14,30 +14,12 @@ angular.module('quay').directive('dockerfileBuildDialog', function () {
|
|||
'buildStarted': '&buildStarted'
|
||||
},
|
||||
controller: function($scope, $element, ApiService) {
|
||||
$scope.building = false;
|
||||
$scope.uploading = false;
|
||||
$scope.startCounter = 0;
|
||||
$scope.viewTriggers = false;
|
||||
$scope.triggers = null;
|
||||
|
||||
$scope.startTriggerCounter = 0;
|
||||
$scope.startTrigger = null;
|
||||
|
||||
$scope.handleBuildStarted = function(build) {
|
||||
$element.find('.dockerfilebuildModal').modal('hide');
|
||||
if ($scope.buildStarted) {
|
||||
$scope.buildStarted({'build': build});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.handleBuildFailed = function(message) {
|
||||
$scope.errorMessage = message;
|
||||
};
|
||||
|
||||
$scope.startBuild = function() {
|
||||
$scope.errorMessage = null;
|
||||
$scope.startCounter++;
|
||||
};
|
||||
|
||||
$scope.showTriggers = function(value) {
|
||||
$scope.viewTriggers = value;
|
||||
};
|
||||
|
@ -48,11 +30,27 @@ angular.module('quay').directive('dockerfileBuildDialog', function () {
|
|||
$scope.startTriggerCounter++;
|
||||
};
|
||||
|
||||
$scope.startBuild = function() {
|
||||
$scope.buildStarting = true;
|
||||
$scope.startBuildCallback(function(status, messageOrBuild) {
|
||||
$element.find('.dockerfilebuildModal').modal('hide');
|
||||
if (status) {
|
||||
$scope.buildStarted({'build': messageOrBuild});
|
||||
} else {
|
||||
bootbox.alert(messageOrBuild || 'Could not start build');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.readyForBuild = function(startBuild) {
|
||||
$scope.startBuildCallback = startBuild;
|
||||
};
|
||||
|
||||
$scope.$watch('showNow', function(sn) {
|
||||
if (sn && $scope.repository) {
|
||||
$scope.viewTriggers = false;
|
||||
$scope.startTrigger = null;
|
||||
$scope.errorMessage = null;
|
||||
$scope.buildStarting = false;
|
||||
|
||||
$element.find('.dockerfilebuildModal').modal({});
|
||||
|
||||
|
|
Reference in a new issue