-
Notifications
You must be signed in to change notification settings - Fork 1
/
clock.html
70 lines (64 loc) · 11 KB
/
clock.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
60
61
62
63
64
65
66
67
68
69
70
<script type="text/javascript">
RED.nodes.registerType( 'ui_digital_clock', {
category: 'dashboard',
paletteLabel: 'digital clock',
inputs: 1,
outputs: 0,
color: '#2ed7e4',
icon: 'font-awesome/fa-clock-o',
align: 'right',
defaults: {
name: { value: '' },
group: { type: 'ui_group', required: true },
order: { value: 0 },
width: { value: 0, validate: function( width ) {
const group = RED.nodes.node( $( '#node-input-group' ).val() || this.group );
const valid = !group || +width <= +group.width;
$( '#node-input-size' ).toggleClass( 'input-error', !valid );
return valid;
} },
height: { value: 0 }
},
label: function() {
return this.name || 'digital clock';
},
oneditprepare: () => {
$( '#node-input-size' ).elementSizer( {
width: "#node-input-width",
height: "#node-input-height",
group: "#node-input-group"
} );
}
} );
</script>
<script type="text/html" data-template-name="ui_digital_clock">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-fw fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<br />
<div class="form-row" id="template-row-group">
<label><i class="fa fa-fw fa-table"></i> Group</label>
<input type="text" id="node-input-group" />
</div>
<div class="form-row" id="template-row-size">
<label><i class="fa fa-fw fa-object-group"></i> Size</label>
<input type="hidden" id="node-input-width" />
<input type="hidden" id="node-input-height" />
<button id="node-input-size" class="editor-button"></button>
</div>
</script>
<script type="text/html" data-help-name="ui_digital_clock">
<p style="text-align: justify;">
A digital clock for the Node-RED Dashboard.
</p>
<br />
<p style="text-align: center;">
<img alt="ui_clock" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATIAAABXCAIAAAAI6l7PAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYW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OI1hyr3FnUnJ0uHxfCUgex3SXNd+8p3njHcKShii+WwPSwPTXt3UyMA0yD/AWJ1DRlobYTcNJSrZB2+mFO/J8SpUNTJq+AIs5TX9cwtbY70+WZChdwB4pbOhWBrLq7P4NkWhvzOGIJxiHgZJvTbU9ICJxpkMxbwx1rpnu2vh1wkqhVFl20Z36CpS7g0KGTtb2KuKqtm9G3cNsu1YUIJ7dulNSb6VbeAJWOyqSgrwsv0wObESWZHO43BPkgWeYby/ymD821pUD4RuxVjR480QodI7rzoSTZ11Tzhxo6DDCwcw0dTAxsXnxg9lyF2NNjaLICOO1pOSqGHIR75EHZ6Qqhh1vinBBLQd+BHgiAlvR+CQVCHd9ToJLWLuCeG800x6LuGyHdmhY/xLnhhrYTNr2EbjdhaZKM20ROl6P/F2AANaXYo3KjxOMAAAAASUVORK5CYII=" />
</p>
<br />
<p style="text-align: justify;">
The time to be displayed is transferred as timestamp (milliseconds since 01.01.1970) in
<code>msg.payload</code>. The local time is displayed in the dashboard.
</p>
</script>