2016-06-14 07:56:25 +02:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular
|
|
|
|
.module('harbor.top.repository')
|
|
|
|
.directive('topRepository', topRepository);
|
|
|
|
|
|
|
|
TopRepositoryController.$inject = ['ListTopRepositoryService'];
|
|
|
|
|
|
|
|
function TopRepositoryController(ListTopRepositoryService) {
|
|
|
|
var vm = this;
|
|
|
|
|
|
|
|
ListTopRepositoryService(10)
|
|
|
|
.success(listTopRepositorySuccess)
|
|
|
|
.error(listTopRepositoryFailed);
|
|
|
|
|
|
|
|
function listTopRepositorySuccess(data) {
|
|
|
|
vm.top10Repositories = data || []
|
|
|
|
console.log(vm.top10Repositories.length);
|
|
|
|
}
|
|
|
|
|
|
|
|
function listTopRepositoryFailed(data, status) {
|
|
|
|
console.log('Failed list integrated logs:' + status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function topRepository() {
|
|
|
|
var directive = {
|
|
|
|
'restrict': 'E',
|
2016-06-16 08:10:35 +02:00
|
|
|
'templateUrl': '/static/resources/js/components/top-repository/top-repository.directive.html',
|
2016-06-14 07:56:25 +02:00
|
|
|
'controller': TopRepositoryController,
|
|
|
|
'scope' : true,
|
|
|
|
'controllerAs': 'vm',
|
|
|
|
'bindToController': true
|
|
|
|
};
|
|
|
|
|
|
|
|
return directive;
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|