// clear table
$("#table_datacenter").empty();
// header
- $("#table_datacenter").append('<tr class="tbl-head"><td>Label</td><td>Int. Name</td><td>Switch</td><td>Num. Containers</td><td>Metadata Items</td></tr>');
+ $("#table_datacenter").append('<tr class="tbl-head"><td>Label</td><td>Int. Name</td><td>Switch</td><td>Num. Containers</td><td>VNFs</td></tr>');
// fill table
$.each(data, function(i, item) {
var row_str = "";
row_str += '<td>' + item.internalname + '</td>';
row_str += '<td>' + item.switch + '</td>';
row_str += '<td><span class="badge">' + item.n_running_containers + '</span></td>';
- row_str += '<td><span class="badge">' + Object.keys(item.metadata).length + '</span></td>';
+ //row_str += '<td><span class="badge">' + Object.keys(item.metadata).length + '</span></td>';
+ row_str += '<td>' + item.vnf_list + '</span></td>';
row_str += '<tr>';
$("#table_datacenter").append(row_str);
});
}
+function fetch_d3graph()
+{
+ // do HTTP request and trigger gui update on success
+ var request_url = API_HOST + "/restapi/network/d3jsgraph";
+ console.debug("fetching from: " + request_url);
+ //$.getJSON(request_url, update_graph);
+}
+
function fetch_loop()
{
// only fetch if we are connected
$(document).ready(function(){
console.info("document ready");
// setup global connection error handling
+ /*
$.ajaxSetup({
"error": errorAjaxConnection
});
// add listeners
$("#btn_connect").click(connect);
$("#btn_disconnect").click(disconnect);
+ */
+ setTimeout(fetch_datacenter, 2000);//fetch_datacenter();
+ setTimeout(fetch_container, 4000);//fetch_container();
+
// additional refresh on window focus
$(window).focus(function () {