Localize admin dashboard

This commit is contained in:
Brian Federle 2012-02-09 13:16:05 -08:00
parent c6a78e056d
commit 881a46ff54
5 changed files with 48 additions and 20 deletions

View File

@ -1,3 +1,8 @@
label.local.storage=Local Storage
label.direct.ips=Direct IPs
label.view.all=View all
label.zone.details=Zone details
message.alert.state.detected=Alert state detected
state.Starting=Starting
state.Expunging=Expunging
state.Creating=Creating
@ -717,7 +722,7 @@ label.submit=Submit
label.submitted.by=[Submitted by: <span id="submitted_by"></span>]
label.succeeded=Succeeded
label.sunday=Sunday
label.system.capacity=System Wide Capacity
label.system.capacity=System Capacity
label.system.vm.type=System VM Type
label.system.vm=System VM
label.system.vms=System VMs

View File

@ -1084,8 +1084,8 @@
<!-- General alerts-->
<div class="dashboard-container sub alerts first">
<div class="top">
<div class="title"><span>General Alerts</span></div>
<div class="button view-all">view all</div>
<div class="title"><span></span></div>
<div class="button view-all"></div>
</div>
<ul data-item="alerts">
<li class="error" concat-value="50">
@ -1100,8 +1100,8 @@
<!-- Host alerts-->
<div class="dashboard-container sub alerts last">
<div class="top">
<div class="title"><span>Host Alerts</span></div>
<div class="button view-all">view all</div>
<div class="title"><span></span></div>
<div class="button view-all"></div>
</div>
<ul data-item="hostAlerts">
<li class="error" concat-value="50">
@ -1116,7 +1116,7 @@
<div class="dashboard-container head">
<div class="top">
<div class="title">
<span>System Capacity</span>
<span></span>
</div>
<div class="selects" style="display:none;">
<div class="select">
@ -1599,6 +1599,23 @@
<script language="javascript">
dictionary = {
'label.local.storage': '<fmt:message key="label.local.storage"/>',
'label.direct.ips': '<fmt:message key="label.direct.ips"/>',
'label.secondary.storage': '<fmt:message key="label.secondary.storage"/>',
'label.private.ips': '<fmt:message key="label.private.ips"/>',
'label.public.ips': '<fmt:message key="label.public.ips"/>',
'label.primary.storage': '<fmt:message key="label.primary.storage"/>',
'label.storage': '<fmt:message key="label.storage"/>',
'label.memory': '<fmt:message key="label.memory"/>',
'label.system.capacity': '<fmt:message key="label.system.capacity"/>',
'label.host.alerts': '<fmt:message key="label.host.alerts"/>',
'label.view.all': '<fmt:message key="label.view.all"/>',
'label.general.alerts': '<fmt:message key="label.general.alerts"/>',
'label.zone.details': '<fmt:message key="label.zone.details"/>',
'message.alert.state.detected': '<fmt:message key="message.alert.state.detected"/>',
'label.alert': '<fmt:message key="label.alert"/>',
'label.resources': '<fmt:message key="label.resources"/>',
'label.menu.dashboard': '<fmt:message key="label.menu.dashboard"/>',
'state.Starting': '<fmt:message key="state.Starting"/>',
'state.Creating': '<fmt:message key="state.Creating"/>',
'state.Expunging': '<fmt:message key="state.Expunging"/>',

View File

@ -1,7 +1,7 @@
(function($, cloudStack) {
// Admin dashboard
cloudStack.sections.dashboard = {
title: 'Dashboard',
title: 'label.menu.dashboard',
show: cloudStack.uiCustom.dashboard,
adminCheck: function(args) {
@ -104,7 +104,7 @@
zoneDetailView: {
tabs: {
resources: {
title: 'Resources',
title: 'label.resources',
custom: cloudStack.uiCustom.systemChart('resources')
}
}
@ -213,7 +213,7 @@
hostAlerts: $.map(hosts, function(host) {
return {
name: host.name,
description: 'Alert state detected for ' + host.name
description: 'message.alert.state.detected'
};
})
}));

View File

@ -291,16 +291,16 @@ cloudStack.converters = {
},
toAlertType: function(alertCode) {
switch (alertCode) {
case 0 : return "Memory";
case 1 : return "CPU";
case 2 : return "Storage";
case 3 : return "Allocated Storage";
case 4 : return "Public IP";
case 5 : return "Private IP";
case 6 : return "Secondary Storage";
case 7 : return "VLAN";
case 8 : return "Direct Public IP";
case 9 : return "Local Storage";
case 0 : return _l('label.memory');
case 1 : return 'CPU';
case 2 : return _l('label.storage');
case 3 : return _l('label.primary.storage');
case 4 : return _l('label.public.ips');
case 5 : return _l('label.private.ips');
case 6 : return _l('label.secondary.storage');
case 7 : return 'VLAN';
case 8 : return _l('label.direct.ips');
case 9 : return _l('label.local.storage');
// These are old values -- can be removed in the future
case 10 : return "Routing Host";

View File

@ -27,7 +27,7 @@
if ($li.is('.zone-stats li')) {
$li.click(function() {
$browser.cloudBrowser('addPanel', {
title: 'Zone details',
title: _l('label.zone.details'),
parent: $dashboard.closest('.panel'),
maximizeIfSelected: true,
complete: function($newPanel) {
@ -125,6 +125,12 @@
// Get dashboard layout
var $dashboard = $('#template').find('div.dashboard.' + dashboardType).clone();
// Update text
$dashboard.find('.button.view-all').html(_l('label.view.all'));
$dashboard.find('.dashboard-container.sub.alerts.first .top .title span').html(_l('label.general.alerts'));
$dashboard.find('.dashboard-container.sub.alerts.last .top .title span').html(_l('label.host.alerts'));
$dashboard.find('.dashboard-container.head .top .title span').html(_l('label.system.capacity'));
// View all action
$dashboard.find('.view-all').click(function() {
if ($(this).hasClass('network')) $('#navigation li.network').click();