From 036e8580fdb386824407b73f39bed5ced1cdc464 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Fri, 3 Jun 2011 08:12:21 +0000 Subject: [PATCH] change the actions buttons in nodes page layout according to comments git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9737 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/css/style.css | 20 +++++++-------- xCAT-UI/js/nodes/nodes.js | 48 +++++++++++++++--------------------- xCAT-UI/js/nodes/physical.js | 8 +++--- 3 files changed, 34 insertions(+), 42 deletions(-) diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css index 98dc227bf..6e51fb9b1 100644 --- a/xCAT-UI/css/style.css +++ b/xCAT-UI/css/style.css @@ -164,7 +164,7 @@ body { /*--------------- Nodes section ---------------*/ #nodes { - width: 700px; + width: 760px; min-height: 570px; margin: 15px 0px 15px 0px; padding: 0px 0px 0px 10px; @@ -303,20 +303,16 @@ legend { /*--------------- Actions bar ---------------*/ .actionBar { display: inline-table; + padding: 8px 0px 0px 8px; } .actionBar div { padding: 10px 0px; } -.actionBar span { - padding: 0px 10px; -} - .actionBar a { color: #FFFFFF; font-weight: bold; - cursor: pointer; } .actionBar a:hover { @@ -325,15 +321,19 @@ legend { .actionBar li { list-style: none; - padding: 5px; + padding: 2px; margin: 0; } /*--------------- jQuery datatable ---------------*/ .dataTables_wrapper { overflow: auto; - width: 700px; - margin: 0px auto; + width: auto; + margin: 10px auto; + -moz-border-radius:5px; + -webkit-border-radius:5px; + border-radius:5px; + background-color: #f5f5f5; } /*** Show X entries ***/ @@ -350,7 +350,7 @@ legend { display: block; float: right; text-align: right; - padding: 10px 10px; + padding: 8px 8px; } .tab input,select { diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index d731ce45a..0c6050bfa 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -564,8 +564,6 @@ function loadNodes(data) { * power, clone, delete, unlock, and advanced */ - var powerLnk = $('Power'); - // Power on var powerOnLnk = $('Power on'); powerOnLnk.click(function() { @@ -720,41 +718,31 @@ function loadNodes(data) { } }); - // Power actions - var powerActions = [ powerOnLnk, powerOffLnk ]; - var powerActionMenu = createMenu(powerActions); + // operations actions (power monitor) + var powerLnk = 'Operations'; + var powerActionMenu = createMenu([ powerOnLnk, powerOffLnk, monitorOnLnk, monitorOffLnk, scriptLnk]); - // Monitor actions - var monitorActions = [ monitorOnLnk, monitorOffLnk ]; - var monitorActionMenu = createMenu(monitorActions); - + //configurations + var configLnk = 'Configuration'; + var configMenu = createMenu([cloneLnk, deleteLnk, unlockLnk, updateLnk, editProps, installMonLnk]); // Advanced actions - var advancedLnk = $('Advanced'); - var advancedActions; - if ('compute' == group) { - advancedActions = [ boot2NetworkLnk, scriptLnk, setBootStateLnk, updateLnk, rcons, editProps, installMonLnk ]; - } else { - advancedActions = [ boot2NetworkLnk, scriptLnk, setBootStateLnk, updateLnk, editProps, installMonLnk ]; - } - var advancedActionMenu = createMenu(advancedActions); + var advancedLnk = 'Advanced'; + var advancedActionMenu = createMenu([ boot2NetworkLnk, setBootStateLnk, rcons]); // Create an action menu - var actionsDiv = $('
'); - var actions = [ [ powerLnk, powerActionMenu ], [ monitorLnk, monitorActionMenu ], cloneLnk, deleteLnk, unlockLnk, [ advancedLnk, advancedActionMenu ] ]; - var actionsMenu = createMenu(actions); + var actionsMenu = createMenu([ [ powerLnk, powerActionMenu ], [ configLnk, configMenu ], [ advancedLnk, advancedActionMenu ] ]); actionsMenu.superfish(); actionsMenu.css('display', 'inline-block'); - actionsDiv.append(actionsMenu); - actionBar.append(actionsDiv); + actionBar.append(actionsMenu); // Insert action bar and nodes datatable - $('#nodesTab').append(actionBar); + //$('#nodesTab').append(actionBar); $('#nodesTab').append(nodesTable.object()); /** * Create menu to save and undo table changes */ - + /* // Save changes var saveLnk = $('Save'); saveLnk.bind('click', function(event){ @@ -775,10 +763,12 @@ function loadNodes(data) { tableActionsMenu.css('display', 'inline-block'); tableActionsMenu.attr('id', 'tableActionMenu'); actionsDiv.append(tableActionsMenu.hide()); - + */ + // Turn table into a datatable var nodesDatatable = $('#' + nodesTableId).dataTable({ - 'iDisplayLength': 50 + 'iDisplayLength': 50, + 'bLengthChange': false }); // Filter table when enter key is pressed @@ -838,6 +828,8 @@ function loadNodes(data) { refreshGangliaStatus(group, nodesTableId); }); + $('#' + nodesTableId + '_wrapper').prepend(actionBar); + // Create tooltip for status var tooltipConf = { position: "center right", @@ -865,7 +857,7 @@ function loadNodes(data) { /** * Enable editable columns */ - + /* // Do not make 1st, 2nd, 3rd, 4th, 5th, or 6th column editable $('#' + nodesTableId + ' td:not(td:nth-child(1),td:nth-child(2),td:nth-child(3),td:nth-child(4),td:nth-child(5),td:nth-child(6))').editable( function(value, settings) { @@ -898,7 +890,7 @@ function loadNodes(data) { placeholder: ' ', height : '30px' // The height of the text area }); - + /* /** * Get the node status and definable node attributes */ diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js index 885ad0bac..6d41eb78a 100644 --- a/xCAT-UI/js/nodes/physical.js +++ b/xCAT-UI/js/nodes/physical.js @@ -127,10 +127,6 @@ function extractGraphicalData(data){ } function createPhysicalLayout(nodeList){ - bpaList = new Object(); - fspList = new Object(); - lparList = new Object(); - selectNode = new Object(); var flag = false; //no nodes are selected. @@ -159,6 +155,10 @@ function createPhysicalLayout(nodeList){ //there is not graphical data, get the info now if (!flag){ graphicalNodeList = new Object(); + bpaList = new Object(); + fspList = new Object(); + lparList = new Object(); + selectNode = new Object(); initGraphicalData(0); } else{