bug 13864: IP Address page - add new field Purpose (only shown in Basic zone)

This commit is contained in:
Jessica Wang 2012-02-20 10:24:08 -08:00
parent 2a8bdb0c4c
commit 1dfe656f2a
4 changed files with 31 additions and 5 deletions

View File

@ -452,6 +452,9 @@ label.total.CPU=Total CPU
label.total.memory=Total Memory
label.total.storage=Total Storage
#after 2012-02-12
label.purpose=Purpose
#new labels (end) **********************************************************************************************

View File

@ -453,6 +453,9 @@ label.total.CPU=Total CPU
label.total.memory=Total Memory
label.total.storage=Total Storage
#after 2012-02-12
label.purpose=目的
#new labels (end) **********************************************************************************************

View File

@ -2836,6 +2836,7 @@ dictionary = {
'message.zone.creation.complete.would.you.like.to.enable.this.zone': '<fmt:message key="message.zone.creation.complete.would.you.like.to.enable.this.zone" />',
'message.please.add.at.lease.one.traffic.range': '<fmt:message key="message.please.add.at.lease.one.traffic.range" />',
'message.you.must.have.at.least.one.physical.network': '<fmt:message key="message.you.must.have.at.least.one.physical.network" />',
'message.please.select.a.different.public.and.management.network.before.removing': '<fmt:message key="message.please.select.a.different.public.and.management.network.before.removing" />'
'message.please.select.a.different.public.and.management.network.before.removing': '<fmt:message key="message.please.select.a.different.public.and.management.network.before.removing" />',
'label.purpose': '<fmt:message key="label.purpose" />'
};
</script>

View File

@ -896,9 +896,8 @@
}
},
zonename: { label: 'label.zone' },
//vlanname: { label: 'VLAN' },
iselastic: { label: 'label.elastic', converter: cloudStack.converters.toBooleanText },
account: { label: 'label.account' },
//vlanname: { label: 'VLAN' },
virtualmachinedisplayname: { label: 'label.vm.name' },
state: {
converter: function(str) {
// For localization
@ -1320,6 +1319,25 @@
tabs: {
details: {
title: 'label.details',
preFilter: function(args) {
var hiddenFields = [];
var zoneObj;
$.ajax({
url: createURL("listZones&id=" + args.context.ipAddresses[0].zoneid),
dataType: "json",
async: false,
success: function(json) {
zoneObj = json.listzonesresponse.zone[0];
}
});
if(zoneObj.networktype == "Advanced") {
hiddenFields.push("iselastic");
hiddenFields.push("purpose");
}
return hiddenFields;
},
fields: [
{
ipaddress: { label: 'IP' }
@ -1333,7 +1351,8 @@
state: { label: 'label.state' },
issourcenat: { label: 'label.source.nat', converter: cloudStack.converters.toBooleanText },
isstaticnat: { label: 'label.static.nat', converter: cloudStack.converters.toBooleanText },
iselastic: { label: 'label.elastic', converter: cloudStack.converters.toBooleanText },
iselastic: { label: 'label.elastic', converter: cloudStack.converters.toBooleanText }, //(basic zone only)
purpose: { label: 'label.purpose' }, //(basic zone only) When an IP is elastic, the purpose it serves can be Lb or static nat.
virtualmachinedisplayname: { label: 'label.vm.name' },
domain: { label: 'label.domain' },
account: { label: 'label.account' },