mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-31 03:51:23 +01:00
update local message
This commit is contained in:
parent
21f0633d6d
commit
b338af3973
@ -1,37 +0,0 @@
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('harbor.summary')
|
||||
.constant('projectStatistics', projectStatistics)
|
||||
.factory('getStatisticsName', getStatisticsName);
|
||||
|
||||
function projectStatistics() {
|
||||
return [
|
||||
{'name': 'projects', 'payloadName': 'my_project_count'},
|
||||
{'name': 'repositories', 'payloadName': 'my_repo_count'},
|
||||
{'name': 'public_projects', 'payloadName': 'public_project_count'},
|
||||
{'name': 'public_repositories', 'payloadName': 'public_repo_count'},
|
||||
{'name': 'total_projects', 'payloadName': 'total_project_count'},
|
||||
{'name': 'total_repositories', 'payloadName': 'total_repo_count'},
|
||||
];
|
||||
}
|
||||
|
||||
getStatisticsName.$inject = ['projectStatistics'];
|
||||
|
||||
function getStatisticsName(projectStatistics) {
|
||||
var r = projectStatistics();
|
||||
return get;
|
||||
function get(query) {
|
||||
|
||||
for(var i = 0; i < r.length; i++) {
|
||||
var StatisticsName = r[i];
|
||||
if(query.key === 'payloadName' && StatisticsName.payloadName === query.value
|
||||
|| query.key === 'name' && StatisticsName.name === query.value) {
|
||||
return StatisticsName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
@ -1,4 +1,4 @@
|
||||
<h4 class="page-header title-color underlined">// 'summary' | tr //</h4>
|
||||
<dl class="page-content dl-horizontal" ng-repeat="(key, value) in vm.statProjects">
|
||||
<dt>// vm.getSummaryName(key) | tr //:</dt><dd>//value//</dd>
|
||||
<dt>// key | tr //:</dt><dd>//value//</dd>
|
||||
</dl>
|
||||
|
@ -6,11 +6,10 @@
|
||||
.module('harbor.summary')
|
||||
.directive('projectSummary', projectSummary);
|
||||
|
||||
ProjectSummaryController.$inject = ['StatProjectService', 'getStatisticsName'];
|
||||
ProjectSummaryController.$inject = ['StatProjectService'];
|
||||
|
||||
function ProjectSummaryController(StatProjectService, getStatisticsName) {
|
||||
function ProjectSummaryController(StatProjectService) {
|
||||
var vm = this;
|
||||
vm.getSummaryName = getSummaryName;
|
||||
|
||||
StatProjectService()
|
||||
.success(statProjectSuccess)
|
||||
@ -23,11 +22,6 @@
|
||||
function statProjectFailed(status) {
|
||||
console.log('Failed stat project:' + status);
|
||||
}
|
||||
|
||||
function getSummaryName(payloadName) {
|
||||
var statisticsName = getStatisticsName({'key': 'payloadName', 'value': payloadName});
|
||||
return statisticsName.name;
|
||||
}
|
||||
}
|
||||
|
||||
function projectSummary() {
|
||||
|
@ -50,9 +50,13 @@ var locale_messages = {
|
||||
'projects': 'Projects',
|
||||
'public_projects': 'Public Projects',
|
||||
'public': 'Public',
|
||||
'total_projects': 'Total Projects',
|
||||
'public_repositories': 'Public Repositories',
|
||||
'total_repositories': 'Total Repositories',
|
||||
'my_project_count': 'Projects',
|
||||
'my_repo_count': 'Repositories',
|
||||
'public_project_count': 'Public Projects',
|
||||
'public_repo_count': 'Public Repositories',
|
||||
'total_project_count': 'Total Projects',
|
||||
'total_repo_count': 'Total Repositories',
|
||||
'top_10_repositories': 'Top 10 Repositories',
|
||||
'repository_name': 'Repository Name',
|
||||
'size': 'Size',
|
||||
|
@ -50,9 +50,13 @@ var locale_messages = {
|
||||
'projects': '项目',
|
||||
'public_projects': '公开项目',
|
||||
'public': '公开',
|
||||
'total_projects': '全部项目',
|
||||
'public_repositories': '公开镜像仓库',
|
||||
'total_repositories': '全部镜像仓库',
|
||||
'my_project_count': '项目',
|
||||
'my_repo_count': '镜像仓库',
|
||||
'public_project_count': '公开项目',
|
||||
'public_repo_count': '公开镜像仓库',
|
||||
'total_project_count': '全部项目',
|
||||
'total_repo_count': '全部镜像仓库',
|
||||
'top_10_repositories': 'Top 10 镜像仓库',
|
||||
'repository_name': '镜像仓库名',
|
||||
'size': '规格',
|
||||
|
@ -200,4 +200,3 @@
|
||||
|
||||
<script src="/static/ng/resources/js/components/summary/summary.module.js"></script>
|
||||
<script src="/static/ng/resources/js/components/summary/summary.directive.js"></script>
|
||||
<script src="/static/ng/resources/js/components/summary/summary.config.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user