mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-25 11:46:43 +01:00
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
(function() {
|
|
|
|
'use strict';
|
|
|
|
angular
|
|
.module('harbor.summary')
|
|
.directive('projectSummary', projectSummary);
|
|
|
|
ProjectSummaryController.$inject = ['StatProjectService'];
|
|
|
|
function ProjectSummaryController(StatProjectService) {
|
|
var vm = this;
|
|
|
|
StatProjectService()
|
|
.success(statProjectSuccess)
|
|
.error(statProjectFailed);
|
|
|
|
function statProjectSuccess(data, status) {
|
|
vm.statProjects = data;
|
|
}
|
|
|
|
function statProjectFailed(status) {
|
|
console.log('Failed stat project:' + status);
|
|
}
|
|
}
|
|
|
|
function projectSummary() {
|
|
var directive = {
|
|
'restrict': 'E',
|
|
'templateUrl': '/static/ng/resources/js/components/summary/summary.directive.html',
|
|
'controller': ProjectSummaryController,
|
|
'scope' : true,
|
|
'controllerAs': 'vm',
|
|
'bindToController': true
|
|
};
|
|
|
|
return directive;
|
|
}
|
|
|
|
})(); |