Add a logs view for specific members of an organization
This commit is contained in:
parent
59046b2e79
commit
a0f9e1646a
7 changed files with 124 additions and 8 deletions
|
@ -451,6 +451,7 @@ quayApp = angular.module('quay', ['ngRoute', 'restangular', 'angularMoment', 'an
|
|||
when('/organization/:orgname', {templateUrl: '/static/partials/org-view.html', controller: OrgViewCtrl}).
|
||||
when('/organization/:orgname/admin', {templateUrl: '/static/partials/org-admin.html', controller: OrgAdminCtrl}).
|
||||
when('/organization/:orgname/teams/:teamname', {templateUrl: '/static/partials/team-view.html', controller: TeamViewCtrl}).
|
||||
when('/organization/:orgname/logs/:membername', {templateUrl: '/static/partials/org-member-logs.html', controller: OrgMemberLogsCtrl}).
|
||||
when('/v1/', {title: 'Activation information', templateUrl: '/static/partials/v1-page.html', controller: V1Ctrl}).
|
||||
when('/', {title: 'Hosted Private Docker Registry', templateUrl: '/static/partials/landing.html', controller: LandingCtrl}).
|
||||
otherwise({redirectTo: '/'});
|
||||
|
@ -679,7 +680,8 @@ quayApp.directive('logsView', function () {
|
|||
'organization': '=organization',
|
||||
'user': '=user',
|
||||
'visible': '=visible',
|
||||
'repository': '=repository'
|
||||
'repository': '=repository',
|
||||
'performer': '=performer'
|
||||
},
|
||||
controller: function($scope, $element, $sce, Restangular) {
|
||||
$scope.loading = true;
|
||||
|
@ -782,6 +784,10 @@ quayApp.directive('logsView', function () {
|
|||
if ($scope.repository) {
|
||||
url = getRestUrl('repository', $scope.repository.namespace, $scope.repository.name, 'logs');
|
||||
}
|
||||
|
||||
if ($scope.performer) {
|
||||
url += '?performer=' + encodeURIComponent($scope.performer.username);
|
||||
}
|
||||
|
||||
var loadLogs = Restangular.one(url);
|
||||
loadLogs.customGET().then(function(resp) {
|
||||
|
@ -851,6 +857,7 @@ quayApp.directive('logsView', function () {
|
|||
$scope.$watch('user', update);
|
||||
$scope.$watch('repository', update);
|
||||
$scope.$watch('visible', update);
|
||||
$scope.$watch('performer', update);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1318,7 +1318,7 @@ function NewOrgCtrl($scope, $routeParams, $timeout, $location, UserService, Plan
|
|||
$scope.loading = false;
|
||||
}, true);
|
||||
|
||||
requested = $routeParams['plan'];
|
||||
requested = $routeParams['plan'];
|
||||
|
||||
// Load the list of plans.
|
||||
PlanService.getPlans(function(plans) {
|
||||
|
@ -1380,4 +1380,49 @@ function NewOrgCtrl($scope, $routeParams, $timeout, $location, UserService, Plan
|
|||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function OrgMemberLogsCtrl($scope, $routeParams, $timeout, Restangular) {
|
||||
var orgname = $routeParams.orgname;
|
||||
var membername = $routeParams.membername;
|
||||
|
||||
$scope.orgname = orgname;
|
||||
$scope.loading = true;
|
||||
$scope.memberInfo = null;
|
||||
$scope.ready = false;
|
||||
|
||||
var checkReady = function() {
|
||||
$scope.loading = !$scope.organization || !$scope.memberInfo;
|
||||
if (!$scope.loading) {
|
||||
$timeout(function() {
|
||||
$scope.ready = true;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var loadOrganization = function() {
|
||||
var getOrganization = Restangular.one(getRestUrl('organization', orgname))
|
||||
getOrganization.get().then(function(resp) {
|
||||
$scope.organization = resp;
|
||||
checkReady();
|
||||
}, function() {
|
||||
$scope.organization = null;
|
||||
$scope.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
var loadMemberInfo = function() {
|
||||
var getMemberInfo = Restangular.one(getRestUrl('organization', orgname, 'members', membername))
|
||||
getMemberInfo.get().then(function(resp) {
|
||||
$scope.memberInfo = resp.member;
|
||||
checkReady();
|
||||
}, function() {
|
||||
$scope.memberInfo = null;
|
||||
$scope.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
loadOrganization();
|
||||
loadMemberInfo();
|
||||
}
|
Reference in a new issue