mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-28 05:05:19 +01:00
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
(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',
|
|
'templateUrl': '/static/resources/js/components/top-repository/top-repository.directive.html',
|
|
'controller': TopRepositoryController,
|
|
'scope' : true,
|
|
'controllerAs': 'vm',
|
|
'bindToController': true
|
|
};
|
|
|
|
return directive;
|
|
}
|
|
|
|
})(); |