-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphSlicer.html
59 lines (54 loc) · 2.76 KB
/
GraphSlicer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!--
Copyright 2016 Danfoss A/S.
MIT License
-->
<script type="text/x-red" data-template-name="DCloud-GraphSlicer">
<div class="form-row">
<label for="node-input-variables"><i class="fa fa-key"></i> Variables</label>
<input type="text" id="node-input-variables" placeholder="variables">
</div>
<div class="form-row">
<label for="node-input-from"><i class="fa fa-clock-o"></i> From</label>
<input type="text" id="node-input-from" placeholder="from">
</div>
</script>
<!-- Next, some simple help text is provided for the node. -->
<script type="text/x-red" data-help-name="DCloud-GraphSlicer">
<!-- data-help-name identifies the node type this help is for -->
<!-- This content appears in the Info sidebar when a node is selected -->
<!-- The first <p> is used as the pop-up tool tip when hovering over a -->
<!-- node in the palette. -->
<p>
Configures DCloud read operations into a chart ready data structure
</p>
<p>
Enter the variable names that you would like to include in the output
</p>
<p>
ignored at the moment (will enable shortening the view of the timeseries)
leave from empty to get the latest value including the timestamp (notice checked and changed might be diferent, checked is when it was last validated, changed is when it was last observed as changed)
if entering something then format the inquery as {integer}{h|d|m} where h is hours, d days m months. Observe the rounding back (to enable database caching) hours rounded back to nearest hour, days and months as well.
</p>
</script>
<!-- Finally, the node type is registered along with all of its properties -->
<!-- The example below shows a small subset of the properties that can be set-->
<script type="text/javascript">
RED.nodes.registerType('DCloud-GraphSlicer', {
category: 'dcloud', // the palette category
defaults: { // defines the editable properties of the node
variables: { value: "", required: true },
from: { value: "", required: false},
name: { value: "DCloud GS" }
},
inputs: 1, // set the number of inputs - only 0 or 1
outputs: 1, // set the number of outputs - 0 to n
// set the icon (held in icons dir below where you save the node)
icon: "function.png", // saved in icons/myicon.png
color: "#FF0000",
label: function () { // sets the default label contents
var _sourceObj = RED.nodes.node(this.source);
//console.debug(_sourceObj);
return 'R ' + this.variable+'@'+_sourceObj.name;
}
});
</script>