diff --git a/xCAT-UI/lib/display.php b/xCAT-UI/lib/display.php index dfd555574..d5676bebd 100644 --- a/xCAT-UI/lib/display.php +++ b/xCAT-UI/lib/display.php @@ -541,10 +541,8 @@ echo <<Monitor -

New_style Monitor

EOS; } diff --git a/xCAT-UI/monitor/options.php b/xCAT-UI/monitor/options.php index ef80b2a9d..6b928b47b 100644 --- a/xCAT-UI/monitor/options.php +++ b/xCAT-UI/monitor/options.php @@ -30,6 +30,9 @@ switch ($option) { //show all the options for configuration showPluginConf($name); break; + case"savetab": + saveMonsettingTab(); + break; case "view": //show all the options for view showPluginView($name); @@ -41,6 +44,25 @@ switch ($option) { break; } +function saveMonsettingTab() +{ + $rsp = doTabRestore("monsetting",$_SESSION["editable-monsetting"]); + //TODO: to handle the errors in the future +// $errors = array(); +// if(getXmlErrors($rsp,$errors)){ +// displayErrors($errors); +// dumpGlobals(); +// exit; +// }else { +// displaySuccess("monsetting"); +// } + if(getXmlErrors($rsp, $errors)) { + echo "failed"; + }else { + echo "successful"; + } +} + function showPluginConf($name) { //TODO @@ -222,7 +244,31 @@ function showMonsettingTab() echo "
"; $xml = docmd('tabdump', '', array($tab)); - +echo << + $(function() { + makeEditable('monsetting','.editme', '.Ximg', '.Xlink'); + $("#reset").click(function() { + alert('You sure you want to discard changes?'); + $("#settings").tabs("load",1); //reload the "config" tabs + $("#settings .ui-tabs-panel #accordion").accordion('activate',1);//activate the "monsetting" accordion + }); + $("#monsettingaddrow").click(function() { + var line = $(".mContent #tabTable tbody tr").length + 1; + var newrow = formRow(line, 6, line%2); + $(".mContent #tabTable tbody").append($(newrow)); + makeEditable('monsetting', '.editme2', '.Ximg2', '.Xlink2'); + }); + $("#saveit").click(function() { + var plugin=$('.pluginstat.ui-state-active').attr('id'); + $.get("monitor/options.php",{name:plugin, opt:"savetab"},function(data){ + $("#settings").tabs("load",1); //reload the "config" tabs + $("#settings .ui-tabs-panel #accordion").accordion('activate',1);//activate the "monsetting" accordion + }); + }); + }); + +TOS22; echo "\n"; echo << @@ -271,7 +317,11 @@ TOS00; $_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 ""; + echo "

"; + echo ""; + echo ""; + echo "
"; echo "

\n"; } ?>