-
Notifications
You must be signed in to change notification settings - Fork 0
/
x-alarm-list.html
272 lines (231 loc) · 9.93 KB
/
x-alarm-list.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!--/* NODE-RED-CONTRIB-SNAP4CITY-MILESTONE
Copyright (C) 2023 DISIT Lab http://www.disit.org - University of Florence
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */-->
<script type="text/javascript">
RED.nodes.registerType('x-alarm-list', {
category: 'S4CMilestone',
color: '#fde910',
icon: 'icons/logocam.png',
inputs: 1,
outputs: 1,
label: 'Print Alarm List From XProtect',
defaults: {
hostname: { type: 'text' },
port: { type: 'text' },
maxLines: { type: 'text' },
order: { type: 'text' },
target: { type: 'text' },
}
});
</script>
<script type="text/html" data-template-name="x-alarm-list">
<div class="form-row">
<label for="node-input-hostname"><i class="fa fa-tag"></i>Hostname</label>
<input type="text" id="node-input-hostname" placeholder="Hostname(default:localhost)">
</div>
<div class="form-row">
<label for="node-input-port"><i class="fa fa-tag"></i>Port</label>
<input type="text" id="node-input-port" placeholder="Port(default:22331)">
</div>
<div class="form-row">
<label for="node-input-maxLines"><i class="fa fa-tag"></i>Max lines</label>
<input type="text" id="node-input-maxLines" placeholder="Max lines">
</div>
<div class="form-row">
<label for="node-input-order"><i class="fa fa-tag"></i>Order</label>
<select id="node-input-order" type="text">
<option value ="Descending">Descending</option>
<option value="Ascending">Ascending</option>
</select>
</div>
<div class="form-row">
<label for="node-input-target"><i class="fa fa-tag"></i>Target</label>
<select id="node-input-target" type="text">
<option value="LocalId">Id</option>
<option value="Timestamp">Timestamp</option>
<option value="StateName">StateName</option>
<option value="SourceName">SourceName</option>
<option value="Type">Type</option>
</select>
</div>
</script>
<script type="text/x-red" data-help-name="x-alarm-list">
<p>With this node you can retrieve the list of alarms/events from the event server</p>
<h3>Inputs</h3>
<p>A JSON with these parameters:</p>
<dl class="message-properties">
<dt>hostname
<span class="property-type">string</span>
</dt>
<dd>The hostname where the Event Server of Milestone VMS runs on. Only http or https are allowed(default localhost). <b>(mandatory)</b></dd>
<dt>port
<span class="property-type">number</span>
</dt>
<dd>The port that allows you to connect at the event server(default 22331). Check the XProtect documentation for more details. <b>(mandatory)</b></dd>
<dt>maxLines
<span class="property-type">number</span>
</dt>
<dd>Max lines of alarm to display from the event server <b>(mandatory)</b></dd>
<dt>order
<span class="property-type">string</span>
</dt>
<dd>The sorting type for the alarms.(Basically descending/ascending displayed in a drop-down menu in node properties). <b>(mandatory)</b></dd>
<dt>target
<span class="property-type">string</span>
</dt>
<dd>The target property of the sorting for the alarms.(They're displayed with a drop-down menu in node properties). <b>(mandatory)</b></dd>
</dl>
<h3>Outputs</h3>
<p>A JSON array which contains an alarm for each item, if the node works, with these informations:</p>
<dl class="message-properties">
<dt>CameraId
<span class="property-type">string</span>
</dt>
<dd>The Id of the camera corresponding to the alarm/event</dd>
<dt>Category
<span class="property-type">number</span>
</dt>
<dd>The category of the alarm/event</dd>
<dt>CustomTag
<span class="property-type">string</span>
</dt>
<dd>A tag associated with the alarm/event when it is triggered</dd>
<dt>Description
<span class="property-type">string</span>
</dt>
<dd>A short description of the alarm/event</dd>
<dt>FilterMatch
<span class="property-type">boolean</span>
</dt>
<dd>True or false, depending on the configuration of the filter</dd>
<dt>Id
<span class="property-type">string</span>
</dt>
<dd>The Id associated with the alarm/event in the VMS</dd>
<dt>LocalId
<span class="property-type">number</span>
</dt>
<dd>The relative Id associated with the alarm/event in the list</dd>
<dt>Location
<span class="property-type">string</span>
</dt>
<dd>Where the alarm/event is located in the VMS</dd>
<dt>Message
<span class="property-type">string</span>
</dt>
<dd>The message contained in the alarm/event when it triggered</dd>
<dt>Modified
<span class="property-type">datetime</span>
</dt>
<dd>Timestamp when the alarm/event was modified last time</dd>
<dt>Name
<span class="property-type">string</span>
</dt>
<dd>Name of the alarm/event in the VMS</dd>
<dt>Priority
<span class="property-type">number</span>
</dt>
<dd>The priority level of the alarm/event in the VMS</dd>
<dt>Priority Name
<span class="property-type">string</span>
</dt>
<dd>The priority associated at the priority number above</dd>
<dt>RuleType
<span class="property-type">string</span>
</dt>
<dd>The type of the rule associated with the alarm/event in the VMS</dd>
<dt>SourceId
<span class="property-type">string</span>
</dt>
<dd>The Id of the camera associated with the alarm/event in the VMS</dd>
<dt>SourceName
<span class="property-type">string</span>
</dt>
<dd>The name of the camera associated with the alarm/event in the VMS</dd>
<dt>State
<span class="property-type">number</span>
</dt>
<dd>The state of the alarm/event in the VMS when it triggered</dd>
<dt>StateName
<span class="property-type">string</span>
</dt>
<dd>The name associated at the state number above</dd>
<dt>Timestamp
<span class="property-type">datetime</span>
</dt>
<dd>Timestamp when the alarm/event was triggered</dd>
<dt>Type
<span class="property-type">string</span>
</dt>
<dd>The type of alarm/event in the VMS</dd>
<dt>VendorName
<span class="property-type">string</span>
</dt>
<dd>The vendor of the alarm/event in the VMS</dd>
</dl>
<p>A JSON object with these parameters, if the node doesn't work:</p>
<dl class="message-properties">
<dt>error
<span class="property-type">string</span>
</dt>
<dd>The type of error generated by the operation</dd>
<dt>description
<span class="property-type">string</span>
</dt>
<dd>A more accurate description to help resolve the issue</dd>
</dl>
<h3>Example of JSON output if the operation works:</h3>
<dl class="exampleJson">
<dd>
<pre>
{
Camerald: "ef06380b-88b8-4545-a93f-0e76b95b7434",
Category: "0",
CustomTag: "TagFromXML",
Description: "test send event block-IJJ Analytics event description,
FilterMatch: "true",
Id: "ae5efc61-bb48-45dc-abd9-cbeba3a17660",
LocalId: "197",
Location: " Event location 1,
Message: "MyAnalyticsEvent01",
Modified: "2023-06-06716:58:00.59Z",
Name: "MyAnalyticsAlarm01",
Priority: "1",
PriorityName: "High",
RuleType: "4547f085-8b68-4639-826f-8722afbOffc5",
Sourceld: "ef06380b-88b8-4545-a93f-0e76b95b7434",
SourceName: "AXIS Q1951-E Thermal Camera (192.168.1.000) - Telecamera 1",
State: "1",
StateName: "New",
Timestamp: "2023-06- 06716:58:00.557Z",
Type: "MyType",
VendorName: "My Smart Video"
}
</pre>
</dd>
</dl>
<h3>Example of JSON output if the operation goes wrong:</h3>
<dl class="exampleJson">
<dd>
<pre>
{
error: "500 Internal Server Error",
description: "The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://videoos.net/2/CentralServerAlarmCommand:maxCount. The InnerException message was 'There was an error deserializing the object of type System.Int32. The value " cannot be parsed as the type 'Int32'.'. Please see InnerException for more details."
}
</pre>
</dd>
</dl>
<h3>Details</h3>
<p>The node can receive the parameters described in the Inputs section, with them generates a XML file with which a SOAP request is sent to the event server.
A server response with the alarm list generates the output JSON. If the values are not present in the input JSON, these are read by those in the node properties.
If they are not present in either part or are wrong, an error is generated for the necessary parameters or the reason why are not correct.</p>
</script>