-the COPY FILE tab is updated; now it can handle the basic xdcp command
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3600 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
9c7bac58a7
commit
e54571e702
26
xCAT-web/machines/copy_action.php
Normal file
26
xCAT-web/machines/copy_action.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$TOPDIR = '..';
|
||||
require_once "$TOPDIR/lib/functions.php";
|
||||
//get the necessary information from the copyfile dialog,
|
||||
//Now it ONLY checks the following two arguments: source file name, and dest directory;
|
||||
$src = $_REQUEST["src"];
|
||||
$dest = $_REQUEST["dest"];
|
||||
$nr = $_REQUEST["noderange"];
|
||||
$cmd = $_REQUEST["command"];
|
||||
?>
|
||||
<p>
|
||||
<?php
|
||||
//TODO
|
||||
echo "Command: <b>$cmd $nr $src $dest</b>";
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
$arg = "$src $dest";
|
||||
echo "<p>argument is:$arg</p>";
|
||||
$xml = docmd($cmd, $nr, array($src, $dest));
|
||||
foreach($xml->children() as $response) foreach ($response->children() as $line) {
|
||||
echo "$line<br />";
|
||||
}
|
||||
?>
|
||||
</p>
|
@ -11,7 +11,9 @@ if(empty($noderange)) { echo "<p>Select one or more groups or nodes.</p>\n"; exi
|
||||
|
||||
?>
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.need_to_fill { border-style: solid; border-color: red;}
|
||||
</style>
|
||||
|
||||
<FORM NAME=copyForm>
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php insertButtons(array('label' => 'Copy Files', 'id'=> 'copyButton', 'onclick' => 'copydialog()')); ?>
|
||||
|
||||
<div id="copyDialog" title="This is the tile" class="flora"></div>
|
||||
<div id="copyDialog" title="The result" class="flora"></div>
|
||||
<table cellspacing=0 cellpadding=5>
|
||||
<tr>
|
||||
<td>Source File:</td><td> <input id='sourcefile' type="text"></td>
|
||||
<td>The source file you need to copy to another path</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dest Directory:</td><td> <input id='destdir' type="text"></td>
|
||||
<td>The destination directory you want to copy the source file to</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Options:</h3>
|
||||
<TABLE id=inner_table cellspacing=0 cellpadding=5>
|
||||
|
Loading…
Reference in New Issue
Block a user