mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
Add networks list view to Networks section
- Add basic list view section - 'Networks' - Add detail view, with view all IP addresses button
This commit is contained in:
parent
f524f882bc
commit
d8780d7bac
@ -53,12 +53,72 @@
|
||||
return args.context.sections;
|
||||
}
|
||||
else {
|
||||
return ['ipAddresses'];
|
||||
return ['networks', 'ipAddresses'];
|
||||
}
|
||||
},
|
||||
label: 'Select view'
|
||||
},
|
||||
sections: {
|
||||
networks: {
|
||||
type: 'select',
|
||||
title: 'Networks',
|
||||
listView: {
|
||||
filters: {
|
||||
all: { label: 'All' },
|
||||
mine: { label: 'My network' }
|
||||
},
|
||||
fields: {
|
||||
name: { label: 'Name' },
|
||||
traffictype: { label: 'Traffic Type' },
|
||||
gateway: { label: 'Gateway' },
|
||||
vlan: { label: 'VLAN' }
|
||||
},
|
||||
dataProvider: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('listNetworks'),
|
||||
data: {
|
||||
trafficType: 'Guest'
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
args.response.success({
|
||||
data: data.listnetworksresponse.network
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
detailView: {
|
||||
name: 'Network details',
|
||||
viewAll: { path: 'network.ipAddresses', label: 'IP Addresses' },
|
||||
tabs: {
|
||||
details: {
|
||||
title: 'Details',
|
||||
fields: [
|
||||
{
|
||||
name: { label: 'Name' }
|
||||
},
|
||||
{
|
||||
name: { label: 'Short name' },
|
||||
displaytext: { label: 'Description' },
|
||||
traffictype: { label: 'Traffic Type' },
|
||||
gateway: { label: 'Gateway' },
|
||||
vlan: { label: 'VLAN' }
|
||||
},
|
||||
{
|
||||
startip: { label: 'Start IP' },
|
||||
endip: { label: 'End IP' }
|
||||
}
|
||||
],
|
||||
dataProvider: function(args) {
|
||||
args.response.success({ data: args.context.networks[0] });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
ipAddresses: {
|
||||
type: 'select',
|
||||
title: 'IP Addresses',
|
||||
@ -355,6 +415,10 @@
|
||||
forloadbalancing: true
|
||||
});
|
||||
|
||||
if (args.context.networks) {
|
||||
$.extend(data, { associatedNetworkId: args.context.networks[0].id });
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL('listPublicIpAddresses'),
|
||||
data: data,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user