-
Notifications
You must be signed in to change notification settings - Fork 0
/
pushjet.html
87 lines (83 loc) · 3.14 KB
/
pushjet.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<script type="text/x-red" data-template-name="pushjet-service">
<div class="form-row">
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-config-input-name">
</div>
<div class="form-row">
<label for="node-config-input-secret"><i class="fa fa-key"></i> Secret</label>
<input type="text" id="node-config-input-secret">
</div>
<div class="form-row">
<label for="node-config-input-server"><i class="fa fa-globe"></i> Server</label>
<input type="text" id="node-config-input-server" placeholder="api.pushjet.io">
</div>
</script>
<script type="text/x-red" data-template-name="pushjet">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name">
</div>
<div class="form-row">
<label for="node-input-service"><i class="fa fa-server"></i> Service</label>
<input type="text" id="node-input-service">
</div>
<div class="form-row">
<label for="node-input-message"><i class="fa fa-envelope"></i> Message</label>
<input type="text" id="node-input-message">
</div>
<div class="form-row">
<label for="node-input-title"><i class="fa fa-font"></i> Title</label>
<input type="text" id="node-input-title">
</div>
<div class="form-row">
<label for="node-input-level"><i class="fa fa-list-ol"></i> Level</label>
<input type="text" id="node-input-level">
</div>
<div class="form-row">
<label for="node-input-link"><i class="fa fa-link"></i> Link</label>
<input type="text" id="node-input-link">
</div>
<div class="form-tips">
<span><b>Tip:</b> Message, Title and Link support mustache templates.<br /><br />
Mustache variables are HTML-escaped by default. If you want to return unescaped HTML, use the triple mustache: <code>{{{name}}}</code>.</span>
</div>
</script>
<script type="text/x-red" data-help-name="pushjet">
<p>TODO</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('pushjet-service', {
category: 'config',
defaults: {
name: {value: ""},
secret: {value: "", required: true},
server: {value: "api.pushjet.io", required: true}
},
label: function () {
return this.name || this.secret;
}
});
</script>
<script type="text/javascript">
RED.nodes.registerType('pushjet', {
category: 'function',
color: '#4764ad',
defaults: {
name: {value: ""},
service: {value: "", type: "pushjet-service", required: true},
message: {value: "{{{payload}}}", required: true},
title: {value: ""},
level: {value: "", validate:RED.validators.regex(/(^$)|(^[1-5]$)/)},
link: {value: ""}
},
inputs: 1,
outputs: 1,
icon: "pushjet.png",
label: function () {
return this.name || "pushjet";
},
labelStyle: function() {
return this.name ? "node_label_italic" : "";
}
});
</script>