parent
edc2bc8b93
commit
e85a1bce0a
13 changed files with 541 additions and 369 deletions
|
@ -27,37 +27,26 @@
|
|||
$scope.repo.namespace = namespace;
|
||||
};
|
||||
|
||||
$scope.handleBuildStarted = function() {
|
||||
var repo = $scope.repo;
|
||||
$location.path('/repository/' + repo.namespace + '/' + repo.name);
|
||||
};
|
||||
|
||||
$scope.handleBuildFailed = function(message) {
|
||||
var repo = $scope.repo;
|
||||
|
||||
bootbox.dialog({
|
||||
"message": message,
|
||||
"title": "Could not start Dockerfile build",
|
||||
"buttons": {
|
||||
"close": {
|
||||
"label": "Close",
|
||||
"className": "btn-primary",
|
||||
"callback": function() {
|
||||
$scope.$apply(function() {
|
||||
$location.path('/repository/' + repo.namespace + '/' + repo.name);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
$scope.$watch('repo.name', function() {
|
||||
$scope.createError = null;
|
||||
});
|
||||
|
||||
$scope.startBuild = function() {
|
||||
$scope.buildStarting = true;
|
||||
$scope.startBuildCallback(function(status, messageOrBuild) {
|
||||
if (status) {
|
||||
$location.url('/repository/' + $scope.created.namespace + '/' + $scope.created.name +
|
||||
'?tab=builds');
|
||||
} else {
|
||||
bootbox.alert(messageOrBuild || 'Could not start build');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.readyForBuild = function(startBuild) {
|
||||
$scope.startBuildCallback = startBuild;
|
||||
};
|
||||
|
||||
$scope.createNewRepo = function() {
|
||||
$scope.creating = true;
|
||||
var repo = $scope.repo;
|
||||
|
@ -72,9 +61,10 @@
|
|||
$scope.creating = false;
|
||||
$scope.created = created;
|
||||
|
||||
// Start the upload process if applicable.
|
||||
// Start the build if applicable.
|
||||
if ($scope.repo.initialize == 'dockerfile' || $scope.repo.initialize == 'zipfile') {
|
||||
$scope.createdForBuild = created;
|
||||
$scope.startBuild();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue