Fixes to the new repo and build status:
- make the new repo icon gray - have the build status properly center (this is a hack, unfortunately) - have the build status update when open
This commit is contained in:
parent
d7f51fb764
commit
8cb177128b
3 changed files with 29 additions and 10 deletions
|
@ -5,7 +5,7 @@
|
||||||
.user-tools .user-tool {
|
.user-tools .user-tool {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
margin-top: 14px;
|
margin-top: 14px;
|
||||||
color: black;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-tools i.user-tool:hover {
|
.user-tools i.user-tool:hover {
|
||||||
|
@ -13,6 +13,14 @@
|
||||||
color: #428bca;
|
color: #428bca;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status-boxes .popover {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-boxes .popover-content {
|
||||||
|
width: 260px;
|
||||||
|
}
|
||||||
|
|
||||||
.build-statuses {
|
.build-statuses {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,17 +28,20 @@
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
|
width: 230px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.build-status-container .build-message {
|
.build-status-container .build-message {
|
||||||
display: block;
|
display: block;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.build-status-container .progress {
|
.build-status-container .progress {
|
||||||
height: 12px;
|
height: 12px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
width: 230px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.build-status-container:last-child {
|
.build-status-container:last-child {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="build-status-container">
|
<div id="build-status-container" class="build-status-container">
|
||||||
<span class="build-message">{{ getBuildMessage(build) }}</span>
|
<span class="build-message">{{ getBuildMessage(build) }}</span>
|
||||||
<div class="progress" ng-class="getBuildProgress(build) < 100 ? 'active progress-striped' : ''" ng-show="getBuildProgress(build) >= 0">
|
<div class="progress" ng-class="getBuildProgress(build) < 100 ? 'active progress-striped' : ''" ng-show="getBuildProgress(build) >= 0">
|
||||||
<div class="progress-bar" role="progressbar" aria-valuenow="{{ getBuildProgress(build) }}" aria-valuemin="0" aria-valuemax="100" style="{{ 'width: ' + getBuildProgress(build) + '%' }}">
|
<div class="progress-bar" role="progressbar" aria-valuenow="{{ getBuildProgress(build) }}" aria-valuemin="0" aria-valuemax="100" style="{{ 'width: ' + getBuildProgress(build) + '%' }}">
|
||||||
|
|
|
@ -340,9 +340,13 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope, $location, $tim
|
||||||
});
|
});
|
||||||
|
|
||||||
var startBuildInfoTimer = function(repo) {
|
var startBuildInfoTimer = function(repo) {
|
||||||
|
getBuildInfo(repo);
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
|
var container = document.getElementById('build-status-container');
|
||||||
|
if (container != null && container.offsetWidth > 0) {
|
||||||
$scope.$apply(function() { getBuildInfo(repo); });
|
$scope.$apply(function() { getBuildInfo(repo); });
|
||||||
}, 5000);
|
}
|
||||||
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
var getBuildInfo = function(repo) {
|
var getBuildInfo = function(repo) {
|
||||||
|
@ -458,7 +462,7 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope, $location, $tim
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
|
|
||||||
if (repo.is_building) {
|
if (repo.is_building) {
|
||||||
getBuildInfo(repo);
|
startBuildInfoTimer(repo);
|
||||||
}
|
}
|
||||||
}, function() {
|
}, function() {
|
||||||
$scope.repo = null;
|
$scope.repo = null;
|
||||||
|
@ -919,6 +923,12 @@ function NewRepoCtrl($scope, $location, $http, UserService, Restangular) {
|
||||||
'initialize': false
|
'initialize': false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$('#couldnotbuildModal').on('hidden.bs.modal', function() {
|
||||||
|
$scope.$apply(function() {
|
||||||
|
$location.path('/repository/' + $scope.created.namespace + '/' + $scope.created.name);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var startBuild = function(repo, fileId) {
|
var startBuild = function(repo, fileId) {
|
||||||
$scope.building = true;
|
$scope.building = true;
|
||||||
|
|
||||||
|
@ -931,7 +941,6 @@ function NewRepoCtrl($scope, $location, $http, UserService, Restangular) {
|
||||||
$location.path('/repository/' + repo.namespace + '/' + repo.name);
|
$location.path('/repository/' + repo.namespace + '/' + repo.name);
|
||||||
}, function() {
|
}, function() {
|
||||||
$('#couldnotbuildModal').modal();
|
$('#couldnotbuildModal').modal();
|
||||||
$location.path('/repository/' + repo.namespace + '/' + repo.name);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -940,7 +949,7 @@ function NewRepoCtrl($scope, $location, $http, UserService, Restangular) {
|
||||||
request.open('PUT', url, true);
|
request.open('PUT', url, true);
|
||||||
request.setRequestHeader('Content-Type', mimeType);
|
request.setRequestHeader('Content-Type', mimeType);
|
||||||
request.onprogress = function(e) {
|
request.onprogress = function(e) {
|
||||||
$scope.apply(function() {
|
$scope.$apply(function() {
|
||||||
var percentLoaded;
|
var percentLoaded;
|
||||||
if (e.lengthComputable) {
|
if (e.lengthComputable) {
|
||||||
$scope.upload_progress = (e.loaded / e.total) * 100;
|
$scope.upload_progress = (e.loaded / e.total) * 100;
|
||||||
|
@ -948,9 +957,8 @@ function NewRepoCtrl($scope, $location, $http, UserService, Restangular) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
request.onerror = function() {
|
request.onerror = function() {
|
||||||
$scope.apply(function() {
|
$scope.$apply(function() {
|
||||||
$('#couldnotbuildModal').modal();
|
$('#couldnotbuildModal').modal();
|
||||||
$location.path('/repository/' + repo.namespace + '/' + repo.name);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
request.onreadystatechange = function() {
|
request.onreadystatechange = function() {
|
||||||
|
@ -984,7 +992,6 @@ function NewRepoCtrl($scope, $location, $http, UserService, Restangular) {
|
||||||
conductUpload(repo, file, resp.url, resp.file_id, mimeType);
|
conductUpload(repo, file, resp.url, resp.file_id, mimeType);
|
||||||
}, function() {
|
}, function() {
|
||||||
$('#couldnotbuildModal').modal();
|
$('#couldnotbuildModal').modal();
|
||||||
$location.path('/repository/' + repo.namespace + '/' + repo.name);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1035,6 +1042,7 @@ function NewRepoCtrl($scope, $location, $http, UserService, Restangular) {
|
||||||
var createPost = Restangular.one('repository');
|
var createPost = Restangular.one('repository');
|
||||||
createPost.customPOST(data).then(function(created) {
|
createPost.customPOST(data).then(function(created) {
|
||||||
$scope.creating = false;
|
$scope.creating = false;
|
||||||
|
$scope.created = created;
|
||||||
|
|
||||||
// Repository created. Start the upload process if applicable.
|
// Repository created. Start the upload process if applicable.
|
||||||
if ($scope.repo.initialize) {
|
if ($scope.repo.initialize) {
|
||||||
|
|
Reference in a new issue