diff --git a/xCAT-UI/js/monitor/monitor.js b/xCAT-UI/js/monitor/monitor.js index f69422b35..d161b14df 100644 --- a/xCAT-UI/js/monitor/monitor.js +++ b/xCAT-UI/js/monitor/monitor.js @@ -66,11 +66,12 @@ function loadMonitorPage() { */ success : function(data){ // Initialize status for each tool - var monitorStatusHash = new Object(); - monitorStatusHash['xcatmon'] = 'Not monitored'; - monitorStatusHash['rmcmon'] = 'Not monitored'; - monitorStatusHash['rmcevent'] = 'Not monitored'; - monitorStatusHash['gangliamon'] = 'Not monitored'; + var statusHash = new Object(); + statusHash['xcatmon'] = 'Off'; + statusHash['rmcmon'] = 'Off'; + statusHash['rmcevent'] = 'Off'; + statusHash['gangliamon'] = 'Off'; + statusHash['pcpmon'] = 'Off'; if (data.rsp[0]) { var tempArray = data.rsp[0].split(';'); var position = 0; @@ -84,43 +85,80 @@ function loadMonitorPage() { name = tempArray[i].substr(0, position); status = tempArray[i].substr(position + 1); - monitorStatusHash[name] = status; + statusHash[name] = status; } - } + } - var monitorTable = ''; + // Create a status buttonset for each monitoring tool + var statusButtonHash = new Object(); + for ( var name in statusHash) { + var statusButton = $('
').css({ + 'width': '100px', + 'text-align': 'center' + }); + statusButtonHash[name] = statusButton; + + // Set button to correct status + if (statusHash[name] == 'On') { + statusButton.append($('')); + statusButton.append($('')); + } else { + statusButton.append($('')); + statusButton.append($('')); + } + + statusButton.find('label').css({ + 'margin': '0px', + 'padding': '0px', + 'font-size': '10px', + 'width': 'auto' + }); + statusButton.buttonset(); + } + + var monTable = $('
Monitor ToolStatusDescription
'); + monTable.append($('Monitor ToolStatusDescription')); - // xCAT monitor - monitorTable += 'xCAT Monitor'; - monitorTable += '' + monitorStatusHash['xcatmon'] + ''; - monitorTable += 'Provides node status monitoring using fping on AIX and nmap on Linux. It also provides application status monitoring. The status and the appstatus columns of the nodelist table will be updated periodically with the latest status values for the nodes.'; + var monTableBody = $(''); + monTable.append(monTableBody); - // RMC monitor - monitorTable += 'RMC Monitor'; - monitorTable += '' + monitorStatusHash['rmcmon'] + ''; - monitorTable += 'IBM\'s Resource Monitoring and Control (RMC) subsystem is our recommended software for monitoring xCAT clusters. It\'s is part of the IBM\'s Reliable Scalable Cluster Technology (RSCT) that provides a comprehensive clustering environment for AIX and LINUX.'; + var xcatMon = $(''); + xcatMon.append($('xCAT Monitor')); + xcatMon.append($('').append(statusButtonHash['xcatmon'])); + xcatMon.append($('Provides node status monitoring using fping on AIX and nmap on Linux. It also provides application status monitoring. The status and the appstatus columns of the nodelist table will be updated periodically with the latest status values for the nodes.')); + monTableBody.append(xcatMon); - // RMC event - monitorTable += 'RMC Event'; - monitorTable += '' + monitorStatusHash['rmcevent'] + ''; - monitorTable += 'Listing event monitoring information recorded by the RSCT Event Response resource manager in the audit log. Creating and removing a condition/response association.'; + var rmcMon = $(''); + rmcMon.append($('RMC Monitor')); + rmcMon.append($('').append(statusButtonHash['rmcmon'])); + rmcMon.append($('IBM\'s Resource Monitoring and Control (RMC) subsystem is our recommended software for monitoring xCAT clusters. It\'s is part of the IBM\'s Reliable Scalable Cluster Technology (RSCT) that provides a comprehensive clustering environment for AIX and Linux.')); + monTableBody.append(rmcMon); - // Ganglia event - monitorTable += 'Ganglia Monitor'; - monitorTable += '' + monitorStatusHash['gangliamon'] + ''; - monitorTable += 'A scalable distributed monitoring system for high-performance computing systems such as clusters and Grids.'; + var rmcEvent = $(''); + rmcEvent.append($('RMC Event')); + rmcEvent.append($('').append(statusButtonHash['rmcevent'])); + rmcEvent.append($('Listing event monitoring information recorded by the RSCT Event Response resource manager in the audit log. Creating and removing a condition/response association.')); + monTableBody.append(rmcEvent); + + var gangliaMon = $(''); + gangliaMon.append($('Ganglia Monitor')); + gangliaMon.append($('').append(statusButtonHash['gangliamon'])); + gangliaMon.append($('A scalable distributed monitoring system for high-performance computing systems such as clusters and Grids.')); + monTableBody.append(gangliaMon); - // PCP monitor - monitorTable += 'PCP Monitor'; - monitorTable += 'Not monitored'; - monitorTable += 'Under construction.'; + var pcpMon = $(''); + pcpMon.append($('PCP Monitor')); + pcpMon.append($('').append(statusButtonHash['pcpmon'])); + pcpMon.append($('Under construction.')); + monTableBody.append(pcpMon); - monitorTable += ''; + // Do not word wrap + monTableBody.find('td:nth-child(1)').css('white-space', 'nowrap'); // Append info bar $('#monitorTab div').empty().append(createInfoBar('Select a monitoring tool to use.')); - $('#monitorTab .form').append(monitorTable); - + $('#monitorTab .form').append(monTable); + // Open monitoring tool onclick $('#monitorTab .form a').bind('click', function() { loadMonitorTab($(this).attr('name')); @@ -240,5 +278,5 @@ function loadMonitorTab(name) { function loadUnfinish(monitorName, tab) { var unfinishPage = $('
'); unfinishPage.append(createInfoBar('Under construction')); - tab.add(monitorName, 'Unfinish', unfinishPage, true); + tab.add(monitorName, 'Unfinished', unfinishPage, true); } \ No newline at end of file