-
+
Username | Repository Name | Operation | Timestamp |
-
- Haox | myrepo/Ubuntu | Create | 2016-03-22 12:35:00 |
+
+ //log.Username// | //log.RepoName// | //log.Operation// | //log.OpTime// |
-
- Haox | myrepo/MySQL | Push | 2016-03-22 12:35:00 |
-
-
- Daniel | myproject/Golang | Create | 2016-03-12 12:35:00 |
-
diff --git a/static/ng/resources/js/components/log/list-log.directive.js b/static/ng/resources/js/components/log/list-log.directive.js
index a64dca46a..acbacc886 100644
--- a/static/ng/resources/js/components/log/list-log.directive.js
+++ b/static/ng/resources/js/components/log/list-log.directive.js
@@ -6,12 +6,56 @@
.module('harbor.log')
.directive('listLog', listLog);
- ListLogController.$inject = ['ListLogService'];
+ ListLogController.$inject = ['ListLogService', '$routeParams'];
- function ListLogController(ListLogService) {
+ function ListLogController(ListLogService, $routeParams) {
var vm = this;
vm.isOpen = false;
+ vm.projectId = $routeParams.project_id;
+
+ vm.beginTimestamp = 0;
+ vm.endTimestamp = 0;
+ vm.keywords = "";
+ vm.username = "";
+
+ vm.op = [];
+ vm.others = "";
+
+
+ vm.search = search;
+ vm.aSearch= aSearch;
+
vm.advancedSearch = advancedSearch;
+
+
+ var queryParams = {
+ 'beginTimestamp' : vm.beginTimestamp,
+ 'endTimestamp' : vm.endTimestamp,
+ 'keywords' : vm.keywords,
+ 'projectId': vm.projectId,
+ 'username' : vm.username
+ };
+
+ retrieve(queryParams);
+
+ function search(e) {
+ queryParams.username = e.username;
+ retrieve(queryParams);
+ }
+
+ function aSearch(e) {
+ if(e.op == 'all') {
+ queryParams.keywords = '';
+ }else {
+ queryParams.keywords = e.op.join('/') ;
+ }
+ if(e.others != "") {
+ queryParams.keywords += '/' + e.others;
+ }
+ queryParams.username = vm.username;
+
+ retrieve(queryParams);
+ }
function advancedSearch() {
if(vm.isOpen){
@@ -20,6 +64,20 @@
vm.isOpen = true;
}
}
+
+ function retrieve(queryParams) {
+ ListLogService(queryParams)
+ .then(listLogComplete)
+ .catch(listLogFailed);
+ }
+
+
+ function listLogComplete(response) {
+ vm.logs = response.data;
+ }
+ function listLogFailed(e){
+ console.log('listLogFailed:' + e);
+ }
}
function listLog() {
diff --git a/static/ng/resources/js/components/project-member/add-project-member.directive.js b/static/ng/resources/js/components/project-member/add-project-member.directive.js
index 82e09f61e..7c769436c 100644
--- a/static/ng/resources/js/components/project-member/add-project-member.directive.js
+++ b/static/ng/resources/js/components/project-member/add-project-member.directive.js
@@ -10,19 +10,32 @@
function AddProjectMemberController(roles, AddProjectMemberService) {
var vm = this;
+ vm.username = "";
vm.roles = roles();
vm.optRole = 1;
vm.save = save;
vm.cancel = cancel;
function save() {
- console.log(vm.optRole);
+
+ AddProjectMemberService(2, vm.optRole, vm.username)
+ .success(addProjectMemberComplete)
+ .error(addProjectMemberFailed);
+ vm.isOpen = false;
}
function cancel() {
vm.isOpen = false;
}
+ function addProjectMemberComplete(data, status, header) {
+ console.log('addProjectMemberComplete: status:' + status + ', data:' + data);
+ }
+
+ function addProjectMemberFailed(data, status, headers) {
+ console.log('addProjectMemberFailed: status:' + status + ', data:' + data);
+ }
+
}
function addProjectMember() {
diff --git a/static/ng/resources/js/components/project-member/list-project-member.directive.html b/static/ng/resources/js/components/project-member/list-project-member.directive.html
index 5fb818e88..cc4f37471 100644
--- a/static/ng/resources/js/components/project-member/list-project-member.directive.html
+++ b/static/ng/resources/js/components/project-member/list-project-member.directive.html
@@ -4,7 +4,7 @@
-
+
diff --git a/static/ng/resources/js/components/project-member/list-project-member.directive.js b/static/ng/resources/js/components/project-member/list-project-member.directive.js
index 10601ee41..262250100 100644
--- a/static/ng/resources/js/components/project-member/list-project-member.directive.js
+++ b/static/ng/resources/js/components/project-member/list-project-member.directive.js
@@ -6,23 +6,25 @@
.module('harbor.project.member')
.directive('listProjectMember', listProjectMember);
- ListProjectMemberController.$inject = ['ListProjectMemberService', '$routeParams'];
+ ListProjectMemberController.$inject = ['$scope', 'ListProjectMemberService', '$routeParams'];
- function ListProjectMemberController(ListProjectMemberService, $routeParams) {
+ function ListProjectMemberController($scope, ListProjectMemberService, $routeParams) {
var vm = this;
+
+ vm.projectId = $routeParams.project_id;
vm.isOpen = false;
vm.username = "";
-
+
vm.search = search;
vm.addProjectMember = addProjectMember;
- vm.projectId = $routeParams.project_id || 2;
-
- retrieve(vm.username);
+ retrieve(vm.projectId , vm.username);
+
function search(e) {
- retrieve(e.username);
+ console.log('project_id:' + e.projectId);
+ retrieve(e.projectId, e.username);
}
function addProjectMember() {
@@ -33,8 +35,8 @@
}
}
- function retrieve(username) {
- ListProjectMemberService(vm.projectId, {'username': username})
+ function retrieve(projectId, username) {
+ ListProjectMemberService(projectId, {'username': username})
.then(getProjectMemberComplete)
.catch(getProjectMemberFailed);
}
diff --git a/static/ng/resources/js/components/repository/list-repository.directive.js b/static/ng/resources/js/components/repository/list-repository.directive.js
index 810697df5..1c8c1142d 100644
--- a/static/ng/resources/js/components/repository/list-repository.directive.js
+++ b/static/ng/resources/js/components/repository/list-repository.directive.js
@@ -5,16 +5,19 @@
.module('harbor.repository')
.directive('listRepository', listRepository);
- ListRepositoryController.$inject = ['ListRepositoryService', 'ListTagService', 'nameFilter', '$routeParams'];
+ ListRepositoryController.$inject = ['$scope', 'ListRepositoryService', 'ListTagService', 'nameFilter', '$routeParams'];
- function ListRepositoryController(ListRepositoryService, ListTagService, nameFilter, $routeParams) {
+ function ListRepositoryController($scope, ListRepositoryService, ListTagService, nameFilter, $routeParams) {
var vm = this;
+ vm.projectId = $routeParams.project_id;
vm.filterInput = "";
-
- ListRepositoryService({'projectId': $routeParams.project_id, 'q': ''})
+ vm.expand = expand;
+
+ ListRepositoryService({'projectId': vm.projectId, 'q': ''})
.then(getRepositoryComplete)
.catch(getRepositoryFailed);
+
function getRepositoryComplete(response) {
vm.repositories = response.data;
@@ -23,9 +26,7 @@
function getRepositoryFailed(repsonse) {
}
-
- vm.expand = expand;
-
+
function expand(e) {
vm.tags = [];
ListTagService(e.repoName)
@@ -47,9 +48,6 @@
restrict: 'E',
templateUrl: '/static/ng/resources/js/components/repository/list-repository.directive.html',
replace: true,
- scope: {
- 'info': '='
- },
controller: ListRepositoryController,
controllerAs: 'vm',
bindToController: true
diff --git a/static/ng/resources/js/layout/navigation/navigation-details.directive.html b/static/ng/resources/js/layout/navigation/navigation-details.directive.html
index bf0aaceb9..fa6c55ffe 100644
--- a/static/ng/resources/js/layout/navigation/navigation-details.directive.html
+++ b/static/ng/resources/js/layout/navigation/navigation-details.directive.html
@@ -1,5 +1,5 @@
\ No newline at end of file
diff --git a/static/ng/resources/js/layout/navigation/navigation-details.directive.js b/static/ng/resources/js/layout/navigation/navigation-details.directive.js
index f78eec396..129fbfe71 100644
--- a/static/ng/resources/js/layout/navigation/navigation-details.directive.js
+++ b/static/ng/resources/js/layout/navigation/navigation-details.directive.js
@@ -30,7 +30,8 @@
templateUrl: '/static/ng/resources/js/layout/navigation/navigation-details.directive.html',
link: link,
scope: {
- 'isOpen': "="
+ 'isOpen': '=',
+ 'selectedProject': '='
},
replace: true,
controller: NavigationDetailsController,
diff --git a/static/ng/resources/js/layout/project-member/project-member.controller.js b/static/ng/resources/js/layout/project-member/project-member.controller.js
index 55e747012..113ab72ea 100644
--- a/static/ng/resources/js/layout/project-member/project-member.controller.js
+++ b/static/ng/resources/js/layout/project-member/project-member.controller.js
@@ -6,8 +6,14 @@
.module('harbor.layout.project.member')
.controller('ProjectMemberController', ProjectMemberController);
- function ProjectMemberController() {
+ ProjectMemberController.$inject = ['$scope'];
+ function ProjectMemberController($scope) {
+ var vm = this;
+ $scope.$on('currentProjectId', function(e, val) {
+ console.log('received currentProjecjtId: ' + val + ' in ProjectMemberController');
+ vm.projectId = val;
+ });
}
})();
\ No newline at end of file
diff --git a/static/ng/resources/js/layout/repository/repository.controller.html b/static/ng/resources/js/layout/repository/repository.controller.html
index 8f69c080d..536aaf276 100644
--- a/static/ng/resources/js/layout/repository/repository.controller.html
+++ b/static/ng/resources/js/layout/repository/repository.controller.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/static/ng/resources/js/layout/repository/repository.controller.js b/static/ng/resources/js/layout/repository/repository.controller.js
index 717a7efaf..bf1b1890b 100644
--- a/static/ng/resources/js/layout/repository/repository.controller.js
+++ b/static/ng/resources/js/layout/repository/repository.controller.js
@@ -5,9 +5,17 @@
angular
.module('harbor.layout.repository')
.controller('RepositoryController', RepositoryController);
+
+ RepositoryController.$inject = ['$scope'];
- function RepositoryController() {
+ function RepositoryController($scope) {
var vm = this;
+
+ $scope.$on('currentProjectId', function(e, val) {
+ console.log('received currentProjecjtId: ' + val + ' in RepositoryController');
+ vm.projectId = val;
+ });
+
}
})();
\ No newline at end of file
diff --git a/static/ng/resources/js/services/log/services.list-log.js b/static/ng/resources/js/services/log/services.list-log.js
index 2e5f018c2..b201595d3 100644
--- a/static/ng/resources/js/services/log/services.list-log.js
+++ b/static/ng/resources/js/services/log/services.list-log.js
@@ -13,7 +13,20 @@
return LogResult;
function LogResult(queryParams) {
- $log.info(queryParams);
+ var projectId = queryParams.projectId;
+ var username = queryParams.username;
+ var beginTimestamp = queryParams.beginTimestamp;
+ var endTimestamp = queryParams.endTimestamp;
+ var keywords = queryParams.keywords;
+
+ return $http
+ .post('/api/projects/' + projectId + '/logs/filter', {
+ 'beginTimestamp' : beginTimestamp,
+ 'endTimestamp' : endTimestamp,
+ 'keywords' : keywords,
+ 'project_id': projectId,
+ 'username' : username
+ });
}
}
})();
\ No newline at end of file
diff --git a/static/ng/resources/js/services/project-member/services.add-project-member.js b/static/ng/resources/js/services/project-member/services.add-project-member.js
index 4759e60f6..3b3b8aedf 100644
--- a/static/ng/resources/js/services/project-member/services.add-project-member.js
+++ b/static/ng/resources/js/services/project-member/services.add-project-member.js
@@ -12,8 +12,12 @@
return AddProjectMember;
- function AddProjectMember(projectMember) {
-
+ function AddProjectMember(projectId, roles, username) {
+ return $http
+ .post('/api/projects/' + projectId + '/members/', {
+ 'roles': [ Number(roles) ],
+ 'user_name': username
+ });
}
}
diff --git a/views/ng/repository.htm b/views/ng/repository.htm
index 2ffbecd93..ac233ad48 100644
--- a/views/ng/repository.htm
+++ b/views/ng/repository.htm
@@ -5,16 +5,15 @@
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+