Commit f9397374 by Oláh István Gergely

dashboard: fix tab in dashboard.js

parent d33c9843
...@@ -115,8 +115,8 @@ $(function () { ...@@ -115,8 +115,8 @@ $(function () {
{ 'url': '/dashboard/vm/delete/' + vm_pk + '/', { 'url': '/dashboard/vm/delete/' + vm_pk + '/',
'data': [], 'data': [],
'pk': vm_pk, 'pk': vm_pk,
'type': "vm", 'type': "vm",
'redirect': dir}); 'redirect': dir});
return false; return false;
}); });
...@@ -127,7 +127,7 @@ $(function () { ...@@ -127,7 +127,7 @@ $(function () {
{ 'url': '/dashboard/disk/' + disk_pk + '/remove/', { 'url': '/dashboard/disk/' + disk_pk + '/remove/',
'data': [], 'data': [],
'pk': disk_pk, 'pk': disk_pk,
'type': "disk", 'type': "disk",
}); });
return false; return false;
}); });
...@@ -140,7 +140,7 @@ $(function () { ...@@ -140,7 +140,7 @@ $(function () {
{ 'url': '/dashboard/node/delete/' + node_pk + '/', { 'url': '/dashboard/node/delete/' + node_pk + '/',
'data': [], 'data': [],
'pk': node_pk, 'pk': node_pk,
'type': "node", 'type': "node",
'redirect': dir}); 'redirect': dir});
return false; return false;
...@@ -168,7 +168,7 @@ $(function () { ...@@ -168,7 +168,7 @@ $(function () {
addModalConfirmation(deleteObject, addModalConfirmation(deleteObject,
{ 'url': '/dashboard/group/delete/' + group_pk + '/', { 'url': '/dashboard/group/delete/' + group_pk + '/',
'data': [], 'data': [],
'type': "group", 'type': "group",
'pk': group_pk, 'pk': group_pk,
'redirect': dir}); 'redirect': dir});
...@@ -232,14 +232,13 @@ $(function () { ...@@ -232,14 +232,13 @@ $(function () {
$.ajaxSetup( { "async": false } ); $.ajaxSetup( { "async": false } );
$.get("/dashboard/node/list/", function(result) { $.get("/dashboard/node/list/", function(result) {
for(var i in result) { for(var i in result) {
console.log(result[i]);
my_nodes.push({ my_nodes.push({
'name': result[i].name.toLowerCase(), 'name': result[i].name.toLowerCase(),
'icon': result[i].icon, 'icon': result[i].icon,
'status': result[i].status, 'status': result[i].status,
'label': result[i].label, 'label': result[i].label,
'url': result[i].url, 'url': result[i].url,
}); });
} }
}); });
$.ajaxSetup( { "async": true } ); $.ajaxSetup( { "async": true } );
...@@ -256,7 +255,7 @@ $(function () { ...@@ -256,7 +255,7 @@ $(function () {
for(var i=0; i<5 && i<search_result.length; i++) for(var i=0; i<5 && i<search_result.length; i++)
html += generateNodeHTML(search_result[i].name, html += generateNodeHTML(search_result[i].name,
search_result[i].icon, search_result[i].status, search_result[i].icon, search_result[i].status,
search_result[i].url); search_result[i].url);
if(search_result.length == 0) if(search_result.length == 0)
html += '<div class="list-group-item">No result</div>'; html += '<div class="list-group-item">No result</div>';
$("#dashboard-node-list").html(html); $("#dashboard-node-list").html(html);
...@@ -266,7 +265,7 @@ $(function () { ...@@ -266,7 +265,7 @@ $(function () {
for(var i=0; i<5 && i<search_result.length; i++) for(var i=0; i<5 && i<search_result.length; i++)
html += generateNodeTagHTML(search_result[i].name, html += generateNodeTagHTML(search_result[i].name,
search_result[i].icon, search_result[i].status, search_result[i].icon, search_result[i].status,
search_result[i].label, search_result[i].url); search_result[i].label, search_result[i].url);
if(search_result.length == 0) if(search_result.length == 0)
html += '<div class="list-group-item">No result</div>'; html += '<div class="list-group-item">No result</div>';
$("#dashboard-node-taglist").html(html); $("#dashboard-node-taglist").html(html);
...@@ -307,17 +306,17 @@ function generateVmHTML(pk, name, host, icon, _status, fav) { ...@@ -307,17 +306,17 @@ function generateVmHTML(pk, name, host, icon, _status, fav) {
function generateNodeHTML(name, icon, _status, url) { function generateNodeHTML(name, icon, _status, url) {
return '<a href="' + url + '" class="list-group-item" >' + return '<a href="' + url + '" class="list-group-item" >' +
'<span class="index-node-list-name">' + '<span class="index-node-list-name">' +
'<i class="' + icon + '" title="' + _status + '"></i> ' + name + '<i class="' + icon + '" title="' + _status + '"></i> ' + name +
'</span>' + '</span>' +
'<div style="clear: both;"></div>' + '<div style="clear: both;"></div>' +
'</a>'; '</a>';
} }
function generateNodeTagHTML(name, icon, _status, label , url) { function generateNodeTagHTML(name, icon, _status, label , url) {
return '<a href="' + url + '" class="label ' + label + '" >' + return '<a href="' + url + '" class="label ' + label + '" >' +
'<i class="' + icon + '" title="' + _status + '"></i> ' + name + '<i class="' + icon + '" title="' + _status + '"></i> ' + name +
'</a> '; '</a> ';
} }
/* copare vm-s by fav, pk order */ /* copare vm-s by fav, pk order */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment