1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-30 22:50:10 +03:00

Feature #4215: pre-create VR tooltips, instead of on hover

This commit is contained in:
Carlos Martín 2016-01-21 18:45:21 +01:00
parent c1ab60b3fb
commit 8987396057

View File

@ -31,7 +31,6 @@ define(function(require) {
var _vrList;
var _indexedVRs;
var _vrouterVMs;
var _vrouterTables;
var _vnetLevel;
var _buttons = {
@ -164,7 +163,6 @@ define(function(require) {
_indexedVRs = {};
_vrouterVMs = {};
_vrouterTables = {};
$.each(_vrList, function(i, element){
var vr = element.VROUTER;
@ -236,7 +234,7 @@ define(function(require) {
nodes.push({
id: nodeId,
level: level+1,
title: '<div class="vrpopup"></div>',
title: '',
label: "VR "+vr,
group: "vr"});
}
@ -345,6 +343,17 @@ define(function(require) {
}
});
// Fill VR nodes tooltips
$.each(nodes, function(i, node){
var parts = node.id.split("vr");
if (parts.length == 1){
return true;
}
node.title = _tableVR(parts[1]);
});
// create a network
var container = document.getElementById('visgraph');
@ -485,24 +494,9 @@ define(function(require) {
}
}
});
_network.on("showPopup", function (params) {
var parts = params.split("vr");
if (parts.lenght == 1){
return;
}
$(".vis-network-tooltip").html( _tableVR(parts[1]) );
});
}
function _tableVR(vrid){
if (_vrouterTables[vrid] != undefined){
return _vrouterTables[vrid];
}
var vr = _indexedVRs[vrid];
var vms = [];
@ -555,8 +549,6 @@ define(function(require) {
"</tbody>"+
"</table>";
_vrouterTables[vrid] = html;
return html;
}