|
1 | 1 | <script type="text/javascript">
|
2 | 2 | RED.nodes.registerType('rsync', {
|
3 |
| - category: 'function', |
| 3 | + category: 'advanced', |
4 | 4 | color: '#a6bbcf',
|
5 | 5 | defaults: {
|
6 |
| - name: {value: ""} |
| 6 | + name: { value: ""}, |
| 7 | + source: { value: "" }, |
| 8 | + destination: { value: "" }, |
| 9 | + verbose: { value: "" }, |
| 10 | + recursive: { value: "" }, |
7 | 11 | },
|
8 | 12 | inputs: 1,
|
9 |
| - outputs: 1, |
| 13 | + outputs: 2, |
10 | 14 | icon: "file.png",
|
11 | 15 | label: function() {
|
12 | 16 | return this.name || "rsync";
|
|
19 | 23 | <label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
20 | 24 | <input type="text" id="node-input-name" placeholder="Name">
|
21 | 25 | </div>
|
| 26 | + <div class="form-row"> |
| 27 | + <label for="node-input-source"><i class="fa fa-file-text-o"></i> Source</label> |
| 28 | + <input type="text" id="node-input-source" placeholder="Source"> |
| 29 | + </div> |
| 30 | + <div class="form-row"> |
| 31 | + <label for="node-input-destination"><i class="fa fa-file-text-o"></i> Destination</label> |
| 32 | + <input type="text" id="node-input-destination" placeholder="Destination"> |
| 33 | + </div> |
| 34 | + <div class="form-row"> |
| 35 | + <label for="node-input-verbose"><i class="fa fa-bug"></i> Verbose</label> |
| 36 | + <input type="checkbox" id="node-input-verbose" style="display: inline-block; width: auto; vertical-align: top;"> |
| 37 | + </div> |
| 38 | + <div class="form-row"> |
| 39 | + <label for="node-input-recursive"><i class="fa fa-bug"></i> Recursive</label> |
| 40 | + <input type="checkbox" id="node-input-recursive" style="display: inline-block; width: auto; vertical-align: top;"> |
| 41 | + </div> |
22 | 42 | </script>
|
23 | 43 |
|
24 | 44 | <script type="text/x-red" data-help-name="rsync">
|
25 |
| - <p>A node that uses rsyncwrapper to call rsync.</p> |
| 45 | +<p>Uses rsyncwrapper to call rsync.</p> |
| 46 | +<p>The node can be configured with the source and destination, as well as the options below.</p> |
| 47 | +<p>When configured through the dialog, the source can only be a single folder or filename. However, when configured |
| 48 | +through msg, the source can also be an array of folders or filenames.</p> |
| 49 | + |
| 50 | +<h3>Inputs</h3> |
| 51 | +<p>The following can be overridden by including them in the input msg</p> |
| 52 | +<dl class="message-properties"> |
| 53 | + <dt>source |
| 54 | + <span class="property-type">string or array</span> |
| 55 | + </dt> |
| 56 | + <dd>The folder or filename to copy from. Can also be an array of folders and filenames.</dd> |
| 57 | + <dt>destination |
| 58 | + <span class="property-type">string</span> |
| 59 | + </dt> |
| 60 | + <dd>The folder or filename to copy to.</dd> |
| 61 | + <dt>verbose |
| 62 | + <span class="property-type">boolean</span> |
| 63 | + </dt> |
| 64 | + <dd>Include verbose flag on rsync command.</dd> |
| 65 | + <dt>recursive |
| 66 | + <span class="property-type">boolean</span> |
| 67 | + </dt> |
| 68 | + <dd>Recursively copy child folders.</dd> |
| 69 | +</dl> |
| 70 | +<h3>Outputs</h3> |
| 71 | +<dl class="message-properties"> |
| 72 | +The resulting message will be sent to the first output if successfully, or the second output upon failure. The message will contain |
| 73 | +all of the input properties, as well as the following as appropriate: |
| 74 | + |
| 75 | + <dt>error |
| 76 | + <span class="property-type">string</span> |
| 77 | + </dt> |
| 78 | + <dt>stdout |
| 79 | + <span class="property-type">string</span> |
| 80 | + </dt> |
| 81 | + <dt>stderr |
| 82 | + <span class="property-type">string</span> |
| 83 | + </dt> |
| 84 | + <dt>cmd |
| 85 | + <span class="property-type">string</span> |
| 86 | + <dd>The command line as sent to rsync.</dd> |
| 87 | + </dt> |
26 | 88 | </script>
|
0 commit comments