mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-20 23:57:42 +01:00
show user role on the project list page
This commit is contained in:
parent
55d1b075f3
commit
f6e9827ed4
@ -11,6 +11,13 @@
|
|||||||
function ProjectController($scope, ListProjectService, $timeout, currentUser) {
|
function ProjectController($scope, ListProjectService, $timeout, currentUser) {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
|
vm.MAP = {
|
||||||
|
0: 'NA',
|
||||||
|
1: 'Project Admin',
|
||||||
|
2: 'Developer',
|
||||||
|
3: 'Guest'
|
||||||
|
};
|
||||||
|
|
||||||
vm.isOpen = false;
|
vm.isOpen = false;
|
||||||
vm.projectName = '';
|
vm.projectName = '';
|
||||||
vm.publicity = 0;
|
vm.publicity = 0;
|
||||||
@ -35,6 +42,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function listProjectSuccess(data, status) {
|
function listProjectSuccess(data, status) {
|
||||||
|
data.forEach(function(data){
|
||||||
|
data.role = vm.MAP[data.role_id];
|
||||||
|
});
|
||||||
vm.projects = data;
|
vm.projects = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="p in vm.projects">
|
<tr ng-repeat="p in vm.projects">
|
||||||
<td><a href="/ng/repository#/repositories?project_id=//p.ProjectId//&is_public=//p.Public//">//p.Name//</a></td>
|
<td><a href="/ng/repository#/repositories?project_id=//p.ProjectId//&is_public=//p.Public//">//p.Name//</a></td>
|
||||||
<td>N/A</td>
|
<td>//p.count//</td>
|
||||||
<td>N/A</td>
|
<td>//p.role//</td>
|
||||||
<td>//p.CreationTime | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
|
<td>//p.CreationTime | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
|
||||||
<td><publicity-button is-public="p.Public" owned="p.OwnerId == vm.user.UserId" project-id="p.ProjectId"></publicity-button></td>
|
<td><publicity-button is-public="p.Public" owned="p.OwnerId == vm.user.UserId" project-id="p.ProjectId"></publicity-button></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user