Feature #3175: Add extended info to NICs in vm view

This commit is contained in:
Carlos Martín committed 2014-10-15 11:59:30 +02:00
1 parent eb5fde3065
commit 9dc6d99836
3 files changed
+126 -29

No files matched your search

+1 -1
View File
@@ -1 +1 @@
meta.foundation-version {font-family:"/5.3.3/";}meta.foundation-mq-small {font-family:"/only screen/";width:0em;}meta.foundation-mq-medium {font-family:"/only screen and (min-width:40.063em)/";width:40.063em;}meta.foundation-mq-large {font-family:"/only screen and (min-width:64.063em)/";width:64.063em;}meta.foundation-mq-xlarge {font-family:"/only screen and (min-width:90.063em)/";width:90.063em;}meta.foundation-mq-xxlarge {font-family:"/only screen and (min-width:120.063em)/";width:120.063em;}meta.foundation-data-attribute-namespace {font-family:false;}html ,body {height:100%;}* ,*:before ,*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html ,body {font-size:100%;}body {background:#ffffff;color:#555555;padding:0;margin:0;font-family:"Open Sans",sans-serif;font-weight:normal;font-style:normal;line-height:150%;position:relative;cursor:default;}a:hover {cursor:pointer;}img {max-width:100%;height:auto;}img {-ms-interpolation-mode:bicubic;}#map_canvas img ,#map_canvas embed ,#map_canvas object ,.map_canvas img ,.map_canvas embed ,.map_canvas object {max-width:none !important;}.left {float:left !important;}.right {float:right !important;}.clearfix:before ,.clearfix:after {content:" ";display:table;}.clearfix:after {clear:both;}.hide {display:none;}.antialiased {-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}img {display:inline-block;vertical-align:middle;}textarea {height:auto;min-height:50px;}select {width:100%;}.row {width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:75rem;}.row:before ,.row:after {content:" ";display:table;}.row:after {clear:both;}.row.collapse>.column ,.row.collapse>.columns {padding-left:0;padding-right:0;}.row.collapse .row {margin-left:0;margin-right:0;}.row .row {width:auto;margin-left:-0.9375rem;margin-right:-0.9375rem;margin-top:0;margin-bottom:0;max-width:none;}.row .row:before ,.row .row:after {content:" ";display:table;}.row .row:after {clear:both;}.row .row.collapse {width:auto;margin:0;max-width:none;}.row .row.collapse:before ,.row .row.collapse:after {content:" ";display:table;}.row .row.collapse:after {clear:both;}.column ,.columns {padding-left:0.9375rem;padding-right:0.9375rem;width:100%;float:left;}[class*="column"]+[class*="column"]:last-child {float:right;}[class*="column"]+[class*="column"].end {float:left;}@media only screen{.small-push-0 {position:relative;left:0%;right:auto;}.small-pull-0 {position:relative;right:0%;left:auto;}.small-push-1 {position:relative;left:8.33333%;right:auto;}.small-pull-1 {position:relative;right:8.33333%;left:auto;}.small-push-2 {position:relative;left:16.66667%;right:auto;}.small-pull-2 {position:relative;right:16.66667%;left:auto;}.small-push-3 {position:relative;left:25%;right:auto;}.small-pull-3 {position:relative;right:25%;left:auto;}.small-push-4 {position:relative;left:33.33333%;right:auto;}.small-pull-4 {position:relative;right:33.33333%;left:auto;}.small-push-5 {position:relative;left:41.66667%;right:auto;}.small-pull-5 {position:relative;right:41.66667%;left:auto;}.small-push-6 {position:relative;left:50%;right:auto;}.small-pull-6 {position:relative;right:50%;left:auto;}.small-push-7 {position:relative;left:58.33333%;right:auto;}.small-pull-7 {position:relative;right:58.33333%;left:auto;}.small-push-8 {position:relative;left:66.66667%;right:auto;}.small-pull-8 {position:relative;right:66.66667%;left:auto;}.small-push-9 {position:relative;left:75%;right:auto;}.small-pull-9 {position:relative;right:75%;left:auto;}.small-push-10 {position:relative;left:83.33333%;right:auto;}.small-pull-10 {position:relative;right:83.33333%;left:auto;}.small-push-11 {position:relative;left:91.66667%;right:auto;}.small-pull-11 {position:relative;right:91.66667%;left:auto;}.column ,.columns {position:relative;padding-left:0.9375rem;padding-right:0.9375rem;float:left;}.small-1 {width:8.33333%;}.small-2 {width:16.66667%;}.small-3 {width:25%;}.small-4 {width:33.33333%;}.small-5 {width:41.66667%;}.small-6 {width:50%;}.small-7 {width:58.33333%;}.small-8 {width:66.66667%;}.small-9 {width:75%;}.small-10 {width:83.33333%;}.small-11 {width:91.66667%;}.small-12 {width:100%;}.small-offset-0 {margin-left:0% !important;}.small-offset-1 {margin-left:8.33333% !important;}.small-offset-2 {margin-left:16.66667% !important;}.small-offset-3 {margin-left:25% !important;}.small-offset-4 {margin-left:33.33333% !important;}.small-offset-5 {margin-left:41.66667% !important;}.small-offset-6 {margin-left:50% !important;}.small-offset-7 {margin-left:58.33333% !important;}.small-offset-8 {margin-left:66.66667% !important;}.small-offset-9 {margin-left:75% !important;}.small-offset-10 {margin-left:83.33333% !important;}.small-offset-11 {margin-left:91.66667% !important;}.small-reset-order {margin-left:0;margin-right:0;left:auto;right:auto;float:left;}.column.small-centered ,.columns.small-centered {margin-left:auto;margin-right:auto;float:none;}.column.small-uncentered ,.columns.small-uLine truncated
meta.foundation-version {font-family:"/5.3.3/";}meta.foundation-mq-small {font-family:"/only screen/";width:0em;}meta.foundation-mq-medium {font-family:"/only screen and (min-width:40.063em)/";width:40.063em;}meta.foundation-mq-large {font-family:"/only screen and (min-width:64.063em)/";width:64.063em;}meta.foundation-mq-xlarge {font-family:"/only screen and (min-width:90.063em)/";width:90.063em;}meta.foundation-mq-xxlarge {font-family:"/only screen and (min-width:120.063em)/";width:120.063em;}meta.foundation-data-attribute-namespace {font-family:false;}html ,body {height:100%;}* ,*:before ,*:after {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html ,body {font-size:100%;}body {background:#ffffff;color:#555555;padding:0;margin:0;font-family:"Open Sans",sans-serif;font-weight:normal;font-style:normal;line-height:150%;position:relative;cursor:default;}a:hover {cursor:pointer;}img {max-width:100%;height:auto;}img {-ms-interpolation-mode:bicubic;}#map_canvas img ,#map_canvas embed ,#map_canvas object ,.map_canvas img ,.map_canvas embed ,.map_canvas object {max-width:none !important;}.left {float:left !important;}.right {float:right !important;}.clearfix:before ,.clearfix:after {content:" ";display:table;}.clearfix:after {clear:both;}.hide {display:none;}.antialiased {-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}img {display:inline-block;vertical-align:middle;}textarea {height:auto;min-height:50px;}select {width:100%;}.row {width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:75rem;}.row:before ,.row:after {content:" ";display:table;}.row:after {clear:both;}.row.collapse>.column ,.row.collapse>.columns {padding-left:0;padding-right:0;}.row.collapse .row {margin-left:0;margin-right:0;}.row .row {width:auto;margin-left:-0.9375rem;margin-right:-0.9375rem;margin-top:0;margin-bottom:0;max-width:none;}.row .row:before ,.row .row:after {content:" ";display:table;}.row .row:after {clear:both;}.row .row.collapse {width:auto;margin:0;max-width:none;}.row .row.collapse:before ,.row .row.collapse:after {content:" ";display:table;}.row .row.collapse:after {clear:both;}.column ,.columns {padding-left:0.9375rem;padding-right:0.9375rem;width:100%;float:left;}[class*="column"]+[class*="column"]:last-child {float:right;}[class*="column"]+[class*="column"].end {float:left;}@media only screen{.small-push-0 {position:relative;left:0%;right:auto;}.small-pull-0 {position:relative;right:0%;left:auto;}.small-push-1 {position:relative;left:8.33333%;right:auto;}.small-pull-1 {position:relative;right:8.33333%;left:auto;}.small-push-2 {position:relative;left:16.66667%;right:auto;}.small-pull-2 {position:relative;right:16.66667%;left:auto;}.small-push-3 {position:relative;left:25%;right:auto;}.small-pull-3 {position:relative;right:25%;left:auto;}.small-push-4 {position:relative;left:33.33333%;right:auto;}.small-pull-4 {position:relative;right:33.33333%;left:auto;}.small-push-5 {position:relative;left:41.66667%;right:auto;}.small-pull-5 {position:relative;right:41.66667%;left:auto;}.small-push-6 {position:relative;left:50%;right:auto;}.small-pull-6 {position:relative;right:50%;left:auto;}.small-push-7 {position:relative;left:58.33333%;right:auto;}.small-pull-7 {position:relative;right:58.33333%;left:auto;}.small-push-8 {position:relative;left:66.66667%;right:auto;}.small-pull-8 {position:relative;right:66.66667%;left:auto;}.small-push-9 {position:relative;left:75%;right:auto;}.small-pull-9 {position:relative;right:75%;left:auto;}.small-push-10 {position:relative;left:83.33333%;right:auto;}.small-pull-10 {position:relative;right:83.33333%;left:auto;}.small-push-11 {position:relative;left:91.66667%;right:auto;}.small-pull-11 {position:relative;right:91.66667%;left:auto;}.column ,.columns {position:relative;padding-left:0.9375rem;padding-right:0.9375rem;float:left;}.small-1 {width:8.33333%;}.small-2 {width:16.66667%;}.small-3 {width:25%;}.small-4 {width:33.33333%;}.small-5 {width:41.66667%;}.small-6 {width:50%;}.small-7 {width:58.33333%;}.small-8 {width:66.66667%;}.small-9 {width:75%;}.small-10 {width:83.33333%;}.small-11 {width:91.66667%;}.small-12 {width:100%;}.small-offset-0 {margin-left:0% !important;}.small-offset-1 {margin-left:8.33333% !important;}.small-offset-2 {margin-left:16.66667% !important;}.small-offset-3 {margin-left:25% !important;}.small-offset-4 {margin-left:33.33333% !important;}.small-offset-5 {margin-left:41.66667% !important;}.small-offset-6 {margin-left:50% !important;}.small-offset-7 {margin-left:58.33333% !important;}.small-offset-8 {margin-left:66.66667% !important;}.small-offset-9 {margin-left:75% !important;}.small-offset-10 {margin-left:83.33333% !important;}.small-offset-11 {margin-left:91.66667% !important;}.small-reset-order {margin-left:0;margin-right:0;left:auto;right:auto;float:left;}.column.small-centered ,.columns.small-centered {margin-left:auto;margin-right:auto;float:none;}.column.small-uncentered ,.columns.small-uLine truncated
+111 -21
View File
@@ -1513,6 +1513,31 @@ function updateVMInfo(request,vm){
// Enable / disable vnc button
$(".vnc-right-info").prop("disabled", !enableVnc(vm_info));
var nic_dt_data = $("#vms-tab").data("nic_dt_data");
// Setup and fill nics
var nics_table = $("#tab_network_form .nics_table", $info_panel).DataTable({
"bDeferRender": true,
"data": nic_dt_data,
"columns": [
{
"class": 'open-control',
"orderable": false,
"data": null,
"defaultContent": '<span class="fa fa-fw fa-chevron-down"></span>'
},
{ "data": "NIC_ID" },
{ "data": "NETWORK" },
{ "data": "IP" },
{ "data": "MAC" },
{ "data": "IP6_ULA" },
{ "data": "IP6_GLOBAL" },
{ "data": "ACTIONS" }
]
});
$("#tab_network_form .nics_table", $info_panel).dataTable().fnSort( [ [1,'asc'] ] );
}
function updateVMDisksInfo(request,vm){
@@ -2094,9 +2119,10 @@ function printNics(vm_info){
var html ='<form id="tab_network_form" vmid="'+vm_info.ID+'" >\
<div class="row">\
<div class="large-12 columns">\
<table class="info_table dataTable extended_table">\
<table class="nics_table no-hover info_table dataTable extended_table">\
<thead>\
<tr>\
<th></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Network")+'</th>\
<th>'+tr("IP")+'</th>\
@@ -2120,8 +2146,11 @@ function printNics(vm_info){
html += '</th>\
</tr>\
</thead>\
<tbody>';
<tbody>\
</tbody>\
</table>\
</div>\
</div>';
var nics = []
@@ -2171,6 +2200,7 @@ function printNics(vm_info){
</tr>';
}
else {
var nic_dt_data = [];
for (var i = 0; i < nics.length; i++){
var nic = nics[i];
@@ -2185,7 +2215,7 @@ function printNics(vm_info){
( //
nic.ATTACH == "YES")
) {
actions = 'attach/detach in progress'
actions = tr("attach/detach in progress")
}
else {
actions = '';
@@ -2197,24 +2227,35 @@ function printNics(vm_info){
}
}
html += '\
<tr nic_id="'+(nic.NIC_ID)+'">\
<td>' + nic.NIC_ID + '</td>\
<td>' + nic.NETWORK + '</td>\
<td>' + (nic.IP ? nic.IP : "--") + '</td>\
<td>' + nic.MAC + '</td>\
<td>' + (nic.IP6_ULA ? nic.IP6_ULA : "--") +'</td>\
<td>' + (nic.IP6_GLOBAL ? nic.IP6_GLOBAL : "--") +'</td>\
<td>' + actions + '</td>\
</tr>';
}
}
var secgroups = [];
html += '\
</tbody>\
</table>\
</div>\
</div>';
var nic_secgroups = {};
if (nic.SECURITY_GROUPS != undefined){
$.each(nic.SECURITY_GROUPS.split(","), function(){
nic_secgroups[this] = true;
});
}
$.each(vm_info.TEMPLATE.SECURITY_GROUP_RULE, function(){
if ( nic_secgroups[this.SECURITY_GROUP_ID] ){
secgroups.push(this);
}
});
nic_dt_data.push({
NIC_ID : nic.NIC_ID,
NETWORK : nic.NETWORK,
IP : (nic.IP ? nic.IP : "--"),
MAC : nic.MAC,
IP6_ULA : (nic.IP6_ULA ? nic.IP6_ULA : "--"),
IP6_GLOBAL : (nic.IP6_GLOBAL ? nic.IP6_GLOBAL : "--"),
ACTIONS : actions,
SECURITY_GROUP_RULES : secgroups
});
}
$("#vms-tab").data("nic_dt_data", nic_dt_data);
}
if (!isHybrid)
{
@@ -2357,6 +2398,55 @@ function setup_vm_network_tab(){
return false;
});
}
// Add event listener for opening and closing each NIC row details
$('#vms-tab').on('click', '#tab_network_form .nics_table td.open-control', function () {
var row = $(this).closest('table').DataTable().row( $(this).closest('tr') );
if ( row.child.isShown() ) {
row.child.hide();
$(this).children("span").addClass('fa-chevron-down');
$(this).children("span").removeClass('fa-chevron-up');
}
else {
var html = '<div style="padding-left: 30px;">\
<table class="extended_table dataTable">\
<thead>\
<tr>\
<th colspan="2">'+tr("Security Group")+'</th>\
<th>'+tr("Protocol")+'</th>\
<th>'+tr("Type")+'</th>\
<th>'+tr("Range")+'</th>\
<th>'+tr("Network")+'</th>\
<th>'+tr("ICMP Type")+'</th>\
</tr>\
<thead>\
<tbody>';
function td(attr){
return '<td>'+ (attr ? attr : '') +'</td>';
}
$.each(row.data().SECURITY_GROUP_RULES, function(index, elem){
var new_tr = '<tr>'+
td(this.SECURITY_GROUP_ID)+
td(this.SECURITY_GROUP_NAME)+
td(this.PROTOCOL)+
td(this.RULE_TYPE)+
td(this.RANGE)+
'<td>'+"TODO"+'</td>\
<td>'+"TODO"+'</td>\
</tr>'
html += new_tr;
});
row.child( html ).show();
$(this).children("span").removeClass('fa-chevron-down');
$(this).children("span").addClass('fa-chevron-up');
}
} );
}
function printCapacity(vm_info){
+14 -7
View File
@@ -143,17 +143,24 @@ table.dataTable {
}
}
table:not(.no-hover) {
tr.odd:hover td:not(.dataTables_empty) {
background-color: #2ba6cb !important;
cursor: pointer;
color: #FFF !important;
tr.odd:hover td:not(.dataTables_empty) {
background-color: #2ba6cb !important;
cursor: pointer;
color: #FFF !important;
}
tr.even:hover td:not(.dataTables_empty) {
background-color: #2ba6cb !important;
cursor: pointer;
color: #FFF !important;
}
}
tr.even:hover td:not(.dataTables_empty) {
background-color: #2ba6cb !important;
td.open-control:hover {
cursor: pointer;
color: #FFF !important;
}
input.search {