From 80a824e69f4eefe07fb7bd8c339dae2a93ea4f06 Mon Sep 17 00:00:00 2001 From: mxi1 Date: Fri, 20 Nov 2009 09:46:48 +0000 Subject: [PATCH] integrate the monsetting table into the mainpage for monitor plugin git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4625 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/monitor/options.php | 74 ++++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 9 deletions(-) diff --git a/xCAT-UI/monitor/options.php b/xCAT-UI/monitor/options.php index 605d1fbea..ef80b2a9d 100644 --- a/xCAT-UI/monitor/options.php +++ b/xCAT-UI/monitor/options.php @@ -67,12 +67,9 @@ echo <<

The monsetting table Setting

-
-

Press the following buttons to enable/disable the settings

-

In order to make it effect, turn to the "Enable/Disable" tab for the plugin

-
-
TOS10; + showMonsettingTab(); + echo ""; echo ""; } @@ -186,11 +183,11 @@ function insertButtonSet($state1, $state2, $default) echo ""; echo "
"; if($default == 0) { - echo ""; - echo ""; + echo ""; + echo ""; }else { - echo ""; - echo ""; + echo ""; + echo ""; } echo "
"; } @@ -218,4 +215,63 @@ TOS3; echo ""; } + +function showMonsettingTab() +{ + $tab = "monsetting"; + + echo "
"; + $xml = docmd('tabdump', '', array($tab)); + + echo "\n"; + echo << + + + + + + + +TOS00; +// $headers = getTabHeaders($xml); +// if(!is_array($headers)){ die("

Can't find header line in $tab

"); } +// echo "
namekeyvaluecommentsdisable
\n"; +// #echo "
\n"; +// echo "\n"; # extra cell for the red x +// #echo "\n"; # extra cell for the red x +// foreach($headers as $colHead) {echo ""; } +// echo "\n"; # close header row +// #echo ""; + $tableWidth = count($headers); + $ooe = 0; + $item = 0; + $line = 0; + $editable = array(); + foreach($xml->children() as $response) foreach($response->children() as $arr){ + $arr = (string) $arr; + if(ereg("^#", $arr)){ + $editable[$line++][$item] = $arr; + continue; + } + $cl = "ListLine$ooe"; + $values = splitTableFields($arr); + # X row + echo ""; + foreach($values as $v){ + echo ""; + $editable[$line][$item++] = $v; + } + echo "\n"; + $line++; + $item = 0; + $ooe = 1 - $ooe; + } + echo "
$colHead
$v
\n"; + $_SESSION["editable-$tab"] = & $editable; # save the array so we can access it in the next call of this file or change.php + echo "

"; + echo ""; + insertButtonSet("Apply", "Cancel", 0); + echo "

\n"; +} ?>