-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblaulicht-sms-dash.html
124 lines (121 loc) · 5.01 KB
/
blaulicht-sms-dash.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<script type="text/javascript">
RED.nodes.registerType('bl-sms-dash', {
category: 'input',
color: '#ffffff',
defaults: {
token: {value: "", required: false},
kid: {value: "", required: false},
user: {value: "", required: false},
password: {value: "", required: false},
timer: {
value: 10, required: true, validate: function (a) {
return a >= 5 && a <= 420000;
}
},
updateOnly: {value: false,},
name: {value: ""}
},
oneditprepare: function () {
$("#node-then-type").on("change", function () {
if ($(this).val() == "token") {
$(".node-type-credentials").hide();
$(".node-type-token").show();
} else if ($(this).val() == "cred") {
$(".node-type-token").hide();
$(".node-type-credentials").show();
}
});
if (this.kid && this.user && this.password) {
$("#node-then-type").val("cred");
} else {
$("#node-then-type").val("token");
}
$("#node-then-type").trigger("change");
},
oneditsave: function () {
if ($("#node-then-type").val() == "token") {
$("#node-input-kid").val("");
$("#node-input-user").val("");
$("#node-input-password").val("");
}
if ($("#node-then-type").val() == "cred") {
$("#node-input-token").val("");
}
},
inputs: 0,
outputs: 1,
icon: "blsms-logo.png",
label: function () {
return this.name || "BlaulichtSMS Dashboard";
}
});
</script>
<script type="text/x-red" data-template-name="bl-sms-dash">
<div class="form-row">
<label for="node-then-type"><i class="icon-globe"></i> Login Type</label>
<select id="node-then-type" style="width:70%;">
<option value="token">Token</option>
<option value="cred">Credentials</option>
</select>
</div>
<div class="form-row node-type-token">
<label for="node-input-token"><i class="icon-globe"></i> Token</label>
<input type="text" min="40" max="50" id="node-input-token" placeholder="123a4b5c-12a3-1234-a123-1a2345bc678dEFG9H0ijKl">
</div>
<div class="form-row node-type-credentials">
<label for="node-input-kid"><i class="icon-globe"></i> Customer ID</label>
<input type="number" min="1" id="node-input-kid" placeholder="123456">
</div>
<div class="form-row node-type-credentials">
<label for="node-input-user"><i class="icon-globe"></i> User</label>
<input type="text" id="node-input-user" placeholder="einsatzmonitor">
</div>
<div class="form-row node-type-credentials">
<label for="node-input-password"><i class="icon-globe"></i> Password</label>
<input type="password" id="node-input-password" placeholder="*******">
</div>
<div class="form-row">
<label for="node-input-timer"><i class="icon-cog"></i> Interval</label>
<input type="number" min="5" max="420000" id="node-input-timer" placeholder="2">
</div>
<div class="form-row">
<label for="node-input-updateOnly"><i class="icon-cog"></i> Message on update only</label>
<input type="checkbox" id="node-input-updateOnly">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="bl-sms-dash">
<p>A BlaulichtSMS Dashboard API node for getting alarms and infos</p>
<h3>Outputs</h3>
<ul class="node-ports">
<li>
<dl class="message-properties">
<dt>msg.payload</dt> contains the received object described in the
<a href="https://github.com/blaulichtSMS/docs/blob/master/dashboard_api_v1.md#dasboard-informationen">API Description</a>.
</dl>
</li>
</ul>
<h3>Config</h3>
<ul class="node-ports">
<li>
Customer ID, User and Password
<dl class="message-properties">
The user data for this is the same as that used to log in to <a href="https://dashboard.blaulichtsms.net">https://dashboard.blaulichtsms.net</a>.
</dl>
</li>
<li> Interval
<dl class="message-properties">
The request interval(in seconds) can be selected on your own.
</dl>
</li>
<li> Message on update only
<dl class="message-properties">
You can choose if you want every message or avoid duplicates.<br>
(!) Not every message is an alarm or info. There will also be an event if you only schedule an alert.
</dl>
</li>
</ul>
</script>