diff --git a/xCAT-web/machines/copy_action.php b/xCAT-web/machines/copy_action.php new file mode 100644 index 000000000..f89381b82 --- /dev/null +++ b/xCAT-web/machines/copy_action.php @@ -0,0 +1,26 @@ + +

+$cmd $nr $src $dest"; +?> +

+

+argument is:$arg

"; + $xml = docmd($cmd, $nr, array($src, $dest)); + foreach($xml->children() as $response) foreach ($response->children() as $line) { + echo "$line
"; + } +?> +

diff --git a/xCAT-web/machines/copyfiles.php b/xCAT-web/machines/copyfiles.php index 2bada96c6..387545431 100644 --- a/xCAT-web/machines/copyfiles.php +++ b/xCAT-web/machines/copyfiles.php @@ -11,7 +11,9 @@ if(empty($noderange)) { echo "

Select one or more groups or nodes.

\n"; exi ?> - +
@@ -25,21 +27,66 @@ $.ui.dialog.defaults.bgiframe = true; var diagOpts = { bgiframe: true, modal: true, - //autoOpen: false, + autoOpen: false, }; $(function() { $("#copyDialog").dialog(diagOpts); + + //remove the underlying CSS style "need_to_fill" for the input element: sourcefile and destdir + $("#sourcefile").bind("click", function() { + $(this).removeClass("need_to_fill"); + }); + $("#destdir").bind("click", function() { + $(this).removeClass("need_to_fill"); + }); }); function copydialog() { - $("#copyDialog").dialog("show"); + var args = {}; + args.command="xdcp"; + + if(window.noderange && window.noderange != "") { + args.noderange = window.noderange; + }else if($("#nodegrps")) { + args.noderange = $("#nodegrps option:selected").val(); + }else if($("#nodeList")){ + args.noderange = $("#nodeList").val(); + } + + var tmp = $("#sourcefile").val(); + if(tmp.length) { args.src = tmp; } + else { + $("#sourcefile").addClass("need_to_fill"); + return; + } + + var tmp = $("#destdir").val(); + if(tmp.length) { args.dest = tmp; } + else { + $("#destdir").addClass("need_to_fill"); + return; + } + + $("#copyDialog").children().remove(); + $("#copyDialog").dialog("open"); + $("#copyDialog").load("./copy_action.php", args); } 'Copy Files', 'id'=> 'copyButton', 'onclick' => 'copydialog()')); ?> -
+
+ + + + + + + + + +
Source File: The source file you need to copy to another path
Dest Directory: The destination directory you want to copy the source file to

Options: