iobroker.ebus 3.2.4 → 3.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/.eslintrc.json +34 -34
  2. package/.releaseconfig.json +3 -0
  3. package/LICENSE +20 -20
  4. package/README.md +143 -130
  5. package/admin/index_m.html +419 -419
  6. package/admin/style.css +18 -18
  7. package/admin/words.js +27 -27
  8. package/io-package.json +205 -192
  9. package/lib/support_tools.js +370 -370
  10. package/lib/tools.js +99 -99
  11. package/main.js +1232 -1232
  12. package/package.json +12 -10
  13. package/widgets/ebus/lib/js/flot/jquery.canvaswrapper.js +549 -549
  14. package/widgets/ebus/lib/js/flot/jquery.colorhelpers.js +199 -199
  15. package/widgets/ebus/lib/js/flot/jquery.flot.axislabels.js +212 -212
  16. package/widgets/ebus/lib/js/flot/jquery.flot.browser.js +98 -98
  17. package/widgets/ebus/lib/js/flot/jquery.flot.categories.js +202 -202
  18. package/widgets/ebus/lib/js/flot/jquery.flot.composeImages.js +330 -330
  19. package/widgets/ebus/lib/js/flot/jquery.flot.crosshair.js +202 -202
  20. package/widgets/ebus/lib/js/flot/jquery.flot.drawSeries.js +662 -662
  21. package/widgets/ebus/lib/js/flot/jquery.flot.errorbars.js +375 -375
  22. package/widgets/ebus/lib/js/flot/jquery.flot.fillbetween.js +254 -254
  23. package/widgets/ebus/lib/js/flot/jquery.flot.flatdata.js +47 -47
  24. package/widgets/ebus/lib/js/flot/jquery.flot.hover.js +361 -361
  25. package/widgets/ebus/lib/js/flot/jquery.flot.image.js +249 -249
  26. package/widgets/ebus/lib/js/flot/jquery.flot.js +2953 -2953
  27. package/widgets/ebus/lib/js/flot/jquery.flot.legend.js +437 -437
  28. package/widgets/ebus/lib/js/flot/jquery.flot.logaxis.js +298 -298
  29. package/widgets/ebus/lib/js/flot/jquery.flot.navigate.js +834 -834
  30. package/widgets/ebus/lib/js/flot/jquery.flot.pie.js +794 -794
  31. package/widgets/ebus/lib/js/flot/jquery.flot.resize.js +60 -60
  32. package/widgets/ebus/lib/js/flot/jquery.flot.saturated.js +43 -43
  33. package/widgets/ebus/lib/js/flot/jquery.flot.selection.js +527 -527
  34. package/widgets/ebus/lib/js/flot/jquery.flot.stack.js +220 -220
  35. package/widgets/ebus/lib/js/flot/jquery.flot.symbol.js +98 -98
  36. package/widgets/ebus/lib/js/flot/jquery.flot.threshold.js +143 -143
  37. package/widgets/ebus/lib/js/flot/jquery.flot.time.js +586 -586
  38. package/widgets/ebus/lib/js/flot/jquery.flot.touch.js +320 -320
  39. package/widgets/ebus/lib/js/flot/jquery.flot.touchNavigate.js +360 -360
  40. package/widgets/ebus/lib/js/flot/jquery.flot.uiConstants.js +10 -10
  41. package/widgets/ebus/lib/js/flot/jquery.js +9473 -9473
  42. package/widgets/ebus/lib/js/lib/globalize.culture.en-US.js +33 -33
  43. package/widgets/ebus/lib/js/lib/globalize.js +1601 -1601
  44. package/widgets/ebus/lib/js/lib/jquery.event.drag.js +145 -145
  45. package/widgets/ebus/lib/js/lib/jquery.mousewheel.js +86 -86
  46. package/widgets/ebus.html +2395 -2395
  47. package/readme.txt +0 -297
@@ -1,419 +1,419 @@
1
- <html>
2
-
3
- <head>
4
- <!-- Load ioBroker scripts and styles-->
5
- <link rel="stylesheet" type="text/css" href="../../lib/css/fancytree/ui.fancytree.min.css" />
6
- <link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
7
- <link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
8
-
9
- <script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
10
- <script type="text/javascript" src="../../socket.io/socket.io.js"></script>
11
-
12
- <script type="text/javascript" src="../../lib/js/materialize.js"></script>
13
- <script type="text/javascript" src="../../lib/js/jquery-ui.min.js"></script>
14
- <script type="text/javascript" src="../../lib/js/jquery.fancytree-all.min.js"></script>
15
-
16
- <script type="text/javascript" src="../../js/translate.js"></script>
17
- <script type="text/javascript" src="../../lib/js/selectID.js"></script>
18
- <script type="text/javascript" src="../../js/adapter-settings.js"></script>
19
-
20
- <!-- my own styles -->
21
- <link rel="stylesheet" type="text/css" href="style.css" />
22
- <script type="text/javascript" src="words.js"></script>
23
-
24
-
25
- <style>
26
-
27
- #dialog-room-edit {
28
- max-height: 95% !important;
29
- max-width: 85% !important;
30
- width: 80% !important;
31
- height: 90% !important;
32
- overflow: visible !important;
33
- top: 10px !important;
34
- }
35
-
36
- #dialog-select-member {
37
- max-height: 95% !important;
38
- max-width: 85% !important;
39
- width: 80% !important;
40
- height: 90% !important;
41
- overflow: visible !important;
42
- top: 10px !important;
43
- }
44
-
45
- .collapsible-body {
46
- margin-left: 2rem !important;
47
- padding-top: 0 !important;
48
- }
49
-
50
- redlabel {
51
- color: red;
52
- }
53
- </style>
54
-
55
-
56
- <!-- you have to define 2 functions in the global scope: -->
57
- <script type="text/javascript">
58
-
59
-
60
- //var timeout2;
61
- function findParams(circuit, onChange, instance) {
62
- //timeout2 = setTimeout(function () {
63
- // getUUID(onChange, instance);
64
- //}, 4000);
65
-
66
- //function sendTo(_adapter_instance, command, message, callback)
67
-
68
- console.log("findParams called with " + circuit);
69
-
70
- sendTo(instance, 'findParams', circuit, function (list) {
71
- //if (timeout2) {
72
- // clearTimeout(timeout2);
73
- // timeout2 = null;
74
- //}
75
-
76
- console.log('got params ' + JSON.stringify(list));
77
-
78
- let polledVars = table2values('polledDP');
79
-
80
- //console.log('current list ' + JSON.stringify(polledVars));
81
-
82
- for (let i = 0; i < list.length; i++) {
83
-
84
- //console.log('add ' + JSON.stringify(list[i]));
85
-
86
- let entry = {
87
- active: list[i].active,
88
- circuit: list[i].circuit,
89
- name: list[i].name,
90
- parameter: ""
91
- }
92
- polledVars.push(entry);
93
- }
94
-
95
- //console.log('new list ' + JSON.stringify(polledVars));
96
-
97
- values2table('polledDP', polledVars, OnChange, tablePolledDPOnReady);
98
-
99
- showHideSettings();
100
- onChange(true);
101
- M.updateTextFields();
102
-
103
- });
104
- }
105
-
106
-
107
- // the function loadSettings has to exist ...
108
- function load(settings, onChange) {
109
-
110
- if (!settings) return;
111
-
112
- // example: select elements with id=key and class=value and insert value
113
- for (var key in settings) {
114
- // example: select elements with id=key and class=value and insert value
115
- if ($('#' + key + '.value').attr('type') == 'checkbox') {
116
- $('#' + key + '.value').prop('checked', settings[key]).change(function () {
117
- onChange();
118
- });
119
- } else {
120
- $('#' + key + '.value').val(settings[key]).change(function () {
121
- onChange();
122
- }).keyup(function () {
123
- $(this).trigger('change');
124
- });
125
- }
126
- }
127
-
128
- myOnChange = onChange;
129
- // Signal to admin, that no changes yet
130
- onChange(false);
131
-
132
- M.updateTextFields();
133
-
134
- FillTablePolledDP(settings);
135
- FillTableHistoryDP(settings);
136
-
137
- var _id = 'ebus.' + instance;
138
-
139
- $("#findParams").click(function () {
140
- let circuit= $("#Circuit4Find").val();
141
- findParams(circuit, onChange, _id);
142
- });
143
-
144
- }
145
-
146
- function FillTablePolledDP(settings) {
147
-
148
- if (typeof settings.PolledDPs !== 'undefined' && settings.PolledDPs != null && settings.PolledDPs.length > 0) {
149
-
150
- values2table('polledDP', settings.PolledDPs, OnChange, tablePolledDPOnReady);
151
- console.log('using new PolledDPs from settings ' + JSON.stringify(settings.PolledDPs));
152
- }
153
- // make it compatible to older versions
154
- else if (typeof settings.PolledValues !== 'undefined' && settings.PolledValues != null) {
155
-
156
- var values = settings.PolledValues.split(",");
157
-
158
- var newValues = [];
159
- for (let i = 0; i < values.length; i++) {
160
- if (values[i].length > 0) {
161
- console.log('add ' + values[i]);
162
- const value = {
163
- circuit: "",
164
- name: values[i],
165
- parameter: "",
166
- }
167
- newValues.push(value);
168
- }
169
- }
170
- values2table('polledDP', newValues, OnChange, tablePolledDPOnReady);
171
- console.log('using PolledValues from old settings ' + JSON.stringify(settings.PolledValues) + " " + JSON.stringify(newValues));
172
-
173
- }
174
-
175
- }
176
-
177
- function tablePolledDPOnReady() {
178
-
179
- showHideSettings();
180
- }
181
-
182
- var myOnChange = null;
183
- function OnChange() {
184
- //do nothing
185
- console.log('on change called');
186
-
187
- if (myOnChange != null) {
188
- myOnChange();
189
- }
190
- }
191
-
192
- function showHideSettings() {
193
-
194
- }
195
-
196
- function FillTableHistoryDP(settings) {
197
-
198
- if (typeof settings.HistoryDPs !== 'undefined' && settings.HistoryDPs != null && settings.HistoryDPs.length > 0) {
199
-
200
- values2table('historyDP', settings.HistoryDPs, OnChange, tableHistoryDPOnReady);
201
- console.log('using new HistoryDPs from settings ' + JSON.stringify(settings.HistoryDPs));
202
- }
203
- // make it compatible to older versions
204
- else if (typeof settings.HistoryValues !== 'undefined' && settings.HistoryValues != null) {
205
-
206
- var values = settings.HistoryValues.split(",");
207
-
208
- var newValues = [];
209
- for (let i = 0; i < values.length; i++) {
210
- if (values[i].length > 0) {
211
- console.log('add ' + values[i]);
212
- const value = {
213
- name: values[i],
214
- }
215
- newValues.push(value);
216
- }
217
- }
218
- values2table('historyDP', newValues, OnChange, tableHistoryDPOnReady);
219
- console.log('using HistoryValues from old settings ' + JSON.stringify(settings.HistoryValues) + " " + JSON.stringify(newValues));
220
-
221
- }
222
- }
223
-
224
- function tableHistoryDPOnReady() {
225
-
226
- }
227
-
228
- // ... and the function save has to exist.
229
- // you have to make sure the callback is called with the settings object as first param!
230
- function save(callback) {
231
- // example: select elements with class=value and build settings object
232
- var obj = {};
233
- $('.value').each(function () {
234
- var $this = $(this);
235
-
236
- var id = $this.attr('id');
237
-
238
- if ($this.attr('type') === 'checkbox') {
239
- obj[$this.attr('id')] = $this.prop('checked');
240
- } else {
241
- obj[$this.attr('id')] = $this.val();
242
- }
243
- });
244
-
245
- obj.PolledDPs = table2values('polledDP');
246
- console.log('saving polledDP ' + JSON.stringify(obj.PolledDPs));
247
-
248
- obj.HistoryDPs = table2values('historyDP');
249
- console.log('saving historyDP ' + JSON.stringify(obj.HistoryDPs));
250
-
251
- obj.PolledValues = "";
252
- obj.HistoryValues = "";
253
-
254
- callback(obj);
255
- }
256
-
257
-
258
-
259
- </script>
260
- </head>
261
- <body>
262
- <!-- you have to put your config page in a div with id adapter-container -->
263
- <div class="m adapter-container">
264
- <div class="row">
265
-
266
- <div class="col s12">
267
- <ul class="tabs">
268
- <li class="tab col s2"><a href="#tab-main" class="translate active">Main settings</a></li>
269
- <li class="tab col s2 le-settings"><a href="#tab-ebusd" class="translate">ebusd</a></li>
270
- <li class="tab col s2 le-settings"><a href="#tab-polledDP" class="translate">polledDP</a></li>
271
- <li class="tab col s2 le-settings"><a href="#tab-historyDP" class="translate">historyDP</a></li>
272
- </ul>
273
- </div>
274
-
275
- <!-- main - settings -->
276
-
277
-
278
- <div id="tab-main" class="col s12 page">
279
- <div class="row">
280
- <div class="col s6 m4 l2">
281
- <img src="ebus.png" class="logo">
282
- </div>
283
- </div>
284
-
285
- <div class="row">
286
- <div class="input-field col s12 m8 l5">
287
- <input type="text" id="targetIP" class="value" />
288
- <label for="targetIP" class="translate">target_IP</label>
289
- </div>
290
- </div>
291
-
292
- <div class="row">
293
- <div class="input-field col s6">
294
- <input type="checkbox" id="useBoolean4Onoff" class="value" />
295
- <label for="useBoolean4Onoff" class="translate">useBoolean4Onoff</label>
296
- </div>
297
- </div>
298
-
299
- </div>
300
-
301
- <!-- settings for ebusd -->
302
- <div id="tab-ebusd" class="col s12 page-ebusd">
303
- <div class="row">
304
- <div class="col s6 m4 l2">
305
- <img src="ebus.png" class="logo">
306
- </div>
307
- </div>
308
- <div class="row">
309
- <div class="col s12">
310
- <span class="translate">hint_ebusd</span>
311
- </div>
312
- </div>
313
- <div class="row">
314
- <div class="input-field col s12 m4 l3">
315
- <input class="value number" id="targetHTTPPort" size="5" maxlength="5" type="number" />
316
- <label for="targetHTTPPort" class="translate">target_HTTPPort</label>
317
- </div>
318
-
319
- <div class="input-field col s12 m4 l3">
320
- <input class="value number" id="targetTelnetPort" size="5" maxlength="5" type="number" />
321
- <label for="targetTelnetPort" class="translate">target_TelnetPort</label>
322
- </div>
323
- </div>
324
- <div class="row">
325
- <div class="input-field col s12 m4 l3">
326
- <input class="value number" id="readInterval" size="3" maxlength="3" type="number" />
327
- <label for="readInterval" class="translate">readInterval</label>
328
- </div>
329
- </div>
330
- <div class="row">
331
- <div class="input-field col s12 m4 l3">
332
- <input class="value number" id="parseTimeout" size="3" maxlength="3" type="number" />
333
- <label for="parseTimeout" class="translate">parse_timeout</label>
334
- </div>
335
-
336
- <div class="input-field col s12 m4 l3">
337
- <input class="value number" id="maxretries" size="3" maxlength="3" type="number" min="0" max="10" />
338
- <label for="maxretries" class="translate">maxretries</label>
339
- </div>
340
- </div>
341
-
342
-
343
-
344
- </div>
345
-
346
- <!-- tab "tab-polledDP" -->
347
- <div id="tab-polledDP" class="col s12 page">
348
-
349
- <div class="row">
350
- <div class="col s6">
351
- <span class="translate">hint_ebusd_polled</span>
352
- </div>
353
- </div>
354
-
355
- <div class="col s12" id="polledDP">
356
-
357
- <div class="row">
358
- <div class="input-field col s2 m2 l2">
359
- <button class="btn-floating btn-small waves-effect waves-light" title="findParams" id="findParams">
360
- <i class="material-icons">search</i>
361
- </button>
362
- </div>
363
- <div class="input-field col s4 m4 l4">
364
- <input class="value" id="Circuit4Find" type="text" />
365
- <label for="maxretries" class="translate">Circuit4Find</label>
366
- </div>
367
- </div>
368
- <div class="row">
369
- <a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
370
- </div>
371
- <div class="table-values-div">
372
- <table id="table_polledDP" class="table-values" style="width: 100%;">
373
- <thead>
374
- <tr>
375
- <th id="polledDP_col_0" data-type="checkbox" data-name="active" style=" background: #64b5f6 " class="translate">active</th>
376
- <th id="polledDP_col_1" data-type="text" data-name="circuit" style="width: 20%; background: #64b5f6 " class="translate">circuit</th>
377
- <th id="polledDP_col_2" data-type="text" data-name="name" style="background: #64b5f6" class="translate">name</th>
378
- <th id="polledDP_col_3" data-type="text" data-name="parameter" style="background: #64b5f6" class="translate">addParameter</th>
379
- <th data-buttons="up down delete" style="width: 100px; background: #64b5f6"></th>
380
- </tr>
381
- </thead>
382
- </table>
383
- </div>
384
- </div>
385
- </div>
386
-
387
-
388
-
389
- <!-- tab "tab-historyDP" -->
390
- <div id="tab-historyDP" class="col s12 page">
391
-
392
- <div class="row">
393
- <div class="col s6">
394
- <span class="translate">hint_ebusd_history</span>
395
- </div>
396
- </div>
397
-
398
- <div class="col s12" id="historyDP">
399
-
400
- <a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
401
-
402
- <div class="table-values-div">
403
- <table id="table_historyDP" class="table-values" style="width: 100%;">
404
- <thead>
405
- <tr>
406
- <th id="historyDP_col_1" data-name="name" style="width: 20%; background: #64b5f6 " class="translate">name</th>
407
- <th data-buttons="add up down delete" style="width: 100px; background: #64b5f6"></th>
408
- </tr>
409
- </thead>
410
- </table>
411
- </div>
412
- </div>
413
- </div>
414
-
415
- </div>
416
- </div>
417
- </body>
418
- </html>
419
-
1
+ <html>
2
+
3
+ <head>
4
+ <!-- Load ioBroker scripts and styles-->
5
+ <link rel="stylesheet" type="text/css" href="../../lib/css/fancytree/ui.fancytree.min.css" />
6
+ <link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
7
+ <link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
8
+
9
+ <script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
10
+ <script type="text/javascript" src="../../socket.io/socket.io.js"></script>
11
+
12
+ <script type="text/javascript" src="../../lib/js/materialize.js"></script>
13
+ <script type="text/javascript" src="../../lib/js/jquery-ui.min.js"></script>
14
+ <script type="text/javascript" src="../../lib/js/jquery.fancytree-all.min.js"></script>
15
+
16
+ <script type="text/javascript" src="../../js/translate.js"></script>
17
+ <script type="text/javascript" src="../../lib/js/selectID.js"></script>
18
+ <script type="text/javascript" src="../../js/adapter-settings.js"></script>
19
+
20
+ <!-- my own styles -->
21
+ <link rel="stylesheet" type="text/css" href="style.css" />
22
+ <script type="text/javascript" src="words.js"></script>
23
+
24
+
25
+ <style>
26
+
27
+ #dialog-room-edit {
28
+ max-height: 95% !important;
29
+ max-width: 85% !important;
30
+ width: 80% !important;
31
+ height: 90% !important;
32
+ overflow: visible !important;
33
+ top: 10px !important;
34
+ }
35
+
36
+ #dialog-select-member {
37
+ max-height: 95% !important;
38
+ max-width: 85% !important;
39
+ width: 80% !important;
40
+ height: 90% !important;
41
+ overflow: visible !important;
42
+ top: 10px !important;
43
+ }
44
+
45
+ .collapsible-body {
46
+ margin-left: 2rem !important;
47
+ padding-top: 0 !important;
48
+ }
49
+
50
+ redlabel {
51
+ color: red;
52
+ }
53
+ </style>
54
+
55
+
56
+ <!-- you have to define 2 functions in the global scope: -->
57
+ <script type="text/javascript">
58
+
59
+
60
+ //var timeout2;
61
+ function findParams(circuit, onChange, instance) {
62
+ //timeout2 = setTimeout(function () {
63
+ // getUUID(onChange, instance);
64
+ //}, 4000);
65
+
66
+ //function sendTo(_adapter_instance, command, message, callback)
67
+
68
+ console.log("findParams called with " + circuit);
69
+
70
+ sendTo(instance, 'findParams', circuit, function (list) {
71
+ //if (timeout2) {
72
+ // clearTimeout(timeout2);
73
+ // timeout2 = null;
74
+ //}
75
+
76
+ console.log('got params ' + JSON.stringify(list));
77
+
78
+ let polledVars = table2values('polledDP');
79
+
80
+ //console.log('current list ' + JSON.stringify(polledVars));
81
+
82
+ for (let i = 0; i < list.length; i++) {
83
+
84
+ //console.log('add ' + JSON.stringify(list[i]));
85
+
86
+ let entry = {
87
+ active: list[i].active,
88
+ circuit: list[i].circuit,
89
+ name: list[i].name,
90
+ parameter: ""
91
+ }
92
+ polledVars.push(entry);
93
+ }
94
+
95
+ //console.log('new list ' + JSON.stringify(polledVars));
96
+
97
+ values2table('polledDP', polledVars, OnChange, tablePolledDPOnReady);
98
+
99
+ showHideSettings();
100
+ onChange(true);
101
+ M.updateTextFields();
102
+
103
+ });
104
+ }
105
+
106
+
107
+ // the function loadSettings has to exist ...
108
+ function load(settings, onChange) {
109
+
110
+ if (!settings) return;
111
+
112
+ // example: select elements with id=key and class=value and insert value
113
+ for (var key in settings) {
114
+ // example: select elements with id=key and class=value and insert value
115
+ if ($('#' + key + '.value').attr('type') == 'checkbox') {
116
+ $('#' + key + '.value').prop('checked', settings[key]).change(function () {
117
+ onChange();
118
+ });
119
+ } else {
120
+ $('#' + key + '.value').val(settings[key]).change(function () {
121
+ onChange();
122
+ }).keyup(function () {
123
+ $(this).trigger('change');
124
+ });
125
+ }
126
+ }
127
+
128
+ myOnChange = onChange;
129
+ // Signal to admin, that no changes yet
130
+ onChange(false);
131
+
132
+ M.updateTextFields();
133
+
134
+ FillTablePolledDP(settings);
135
+ FillTableHistoryDP(settings);
136
+
137
+ var _id = 'ebus.' + instance;
138
+
139
+ $("#findParams").click(function () {
140
+ let circuit= $("#Circuit4Find").val();
141
+ findParams(circuit, onChange, _id);
142
+ });
143
+
144
+ }
145
+
146
+ function FillTablePolledDP(settings) {
147
+
148
+ if (typeof settings.PolledDPs !== 'undefined' && settings.PolledDPs != null && settings.PolledDPs.length > 0) {
149
+
150
+ values2table('polledDP', settings.PolledDPs, OnChange, tablePolledDPOnReady);
151
+ console.log('using new PolledDPs from settings ' + JSON.stringify(settings.PolledDPs));
152
+ }
153
+ // make it compatible to older versions
154
+ else if (typeof settings.PolledValues !== 'undefined' && settings.PolledValues != null) {
155
+
156
+ var values = settings.PolledValues.split(",");
157
+
158
+ var newValues = [];
159
+ for (let i = 0; i < values.length; i++) {
160
+ if (values[i].length > 0) {
161
+ console.log('add ' + values[i]);
162
+ const value = {
163
+ circuit: "",
164
+ name: values[i],
165
+ parameter: "",
166
+ }
167
+ newValues.push(value);
168
+ }
169
+ }
170
+ values2table('polledDP', newValues, OnChange, tablePolledDPOnReady);
171
+ console.log('using PolledValues from old settings ' + JSON.stringify(settings.PolledValues) + " " + JSON.stringify(newValues));
172
+
173
+ }
174
+
175
+ }
176
+
177
+ function tablePolledDPOnReady() {
178
+
179
+ showHideSettings();
180
+ }
181
+
182
+ var myOnChange = null;
183
+ function OnChange() {
184
+ //do nothing
185
+ console.log('on change called');
186
+
187
+ if (myOnChange != null) {
188
+ myOnChange();
189
+ }
190
+ }
191
+
192
+ function showHideSettings() {
193
+
194
+ }
195
+
196
+ function FillTableHistoryDP(settings) {
197
+
198
+ if (typeof settings.HistoryDPs !== 'undefined' && settings.HistoryDPs != null && settings.HistoryDPs.length > 0) {
199
+
200
+ values2table('historyDP', settings.HistoryDPs, OnChange, tableHistoryDPOnReady);
201
+ console.log('using new HistoryDPs from settings ' + JSON.stringify(settings.HistoryDPs));
202
+ }
203
+ // make it compatible to older versions
204
+ else if (typeof settings.HistoryValues !== 'undefined' && settings.HistoryValues != null) {
205
+
206
+ var values = settings.HistoryValues.split(",");
207
+
208
+ var newValues = [];
209
+ for (let i = 0; i < values.length; i++) {
210
+ if (values[i].length > 0) {
211
+ console.log('add ' + values[i]);
212
+ const value = {
213
+ name: values[i],
214
+ }
215
+ newValues.push(value);
216
+ }
217
+ }
218
+ values2table('historyDP', newValues, OnChange, tableHistoryDPOnReady);
219
+ console.log('using HistoryValues from old settings ' + JSON.stringify(settings.HistoryValues) + " " + JSON.stringify(newValues));
220
+
221
+ }
222
+ }
223
+
224
+ function tableHistoryDPOnReady() {
225
+
226
+ }
227
+
228
+ // ... and the function save has to exist.
229
+ // you have to make sure the callback is called with the settings object as first param!
230
+ function save(callback) {
231
+ // example: select elements with class=value and build settings object
232
+ var obj = {};
233
+ $('.value').each(function () {
234
+ var $this = $(this);
235
+
236
+ var id = $this.attr('id');
237
+
238
+ if ($this.attr('type') === 'checkbox') {
239
+ obj[$this.attr('id')] = $this.prop('checked');
240
+ } else {
241
+ obj[$this.attr('id')] = $this.val();
242
+ }
243
+ });
244
+
245
+ obj.PolledDPs = table2values('polledDP');
246
+ console.log('saving polledDP ' + JSON.stringify(obj.PolledDPs));
247
+
248
+ obj.HistoryDPs = table2values('historyDP');
249
+ console.log('saving historyDP ' + JSON.stringify(obj.HistoryDPs));
250
+
251
+ obj.PolledValues = "";
252
+ obj.HistoryValues = "";
253
+
254
+ callback(obj);
255
+ }
256
+
257
+
258
+
259
+ </script>
260
+ </head>
261
+ <body>
262
+ <!-- you have to put your config page in a div with id adapter-container -->
263
+ <div class="m adapter-container">
264
+ <div class="row">
265
+
266
+ <div class="col s12">
267
+ <ul class="tabs">
268
+ <li class="tab col s2"><a href="#tab-main" class="translate active">Main settings</a></li>
269
+ <li class="tab col s2 le-settings"><a href="#tab-ebusd" class="translate">ebusd</a></li>
270
+ <li class="tab col s2 le-settings"><a href="#tab-polledDP" class="translate">polledDP</a></li>
271
+ <li class="tab col s2 le-settings"><a href="#tab-historyDP" class="translate">historyDP</a></li>
272
+ </ul>
273
+ </div>
274
+
275
+ <!-- main - settings -->
276
+
277
+
278
+ <div id="tab-main" class="col s12 page">
279
+ <div class="row">
280
+ <div class="col s6 m4 l2">
281
+ <img src="ebus.png" class="logo">
282
+ </div>
283
+ </div>
284
+
285
+ <div class="row">
286
+ <div class="input-field col s12 m8 l5">
287
+ <input type="text" id="targetIP" class="value" />
288
+ <label for="targetIP" class="translate">target_IP</label>
289
+ </div>
290
+ </div>
291
+
292
+ <div class="row">
293
+ <div class="input-field col s6">
294
+ <input type="checkbox" id="useBoolean4Onoff" class="value" />
295
+ <label for="useBoolean4Onoff" class="translate">useBoolean4Onoff</label>
296
+ </div>
297
+ </div>
298
+
299
+ </div>
300
+
301
+ <!-- settings for ebusd -->
302
+ <div id="tab-ebusd" class="col s12 page-ebusd">
303
+ <div class="row">
304
+ <div class="col s6 m4 l2">
305
+ <img src="ebus.png" class="logo">
306
+ </div>
307
+ </div>
308
+ <div class="row">
309
+ <div class="col s12">
310
+ <span class="translate">hint_ebusd</span>
311
+ </div>
312
+ </div>
313
+ <div class="row">
314
+ <div class="input-field col s12 m4 l3">
315
+ <input class="value number" id="targetHTTPPort" size="5" maxlength="5" type="number" />
316
+ <label for="targetHTTPPort" class="translate">target_HTTPPort</label>
317
+ </div>
318
+
319
+ <div class="input-field col s12 m4 l3">
320
+ <input class="value number" id="targetTelnetPort" size="5" maxlength="5" type="number" />
321
+ <label for="targetTelnetPort" class="translate">target_TelnetPort</label>
322
+ </div>
323
+ </div>
324
+ <div class="row">
325
+ <div class="input-field col s12 m4 l3">
326
+ <input class="value number" id="readInterval" size="3" maxlength="3" type="number" />
327
+ <label for="readInterval" class="translate">readInterval</label>
328
+ </div>
329
+ </div>
330
+ <div class="row">
331
+ <div class="input-field col s12 m4 l3">
332
+ <input class="value number" id="parseTimeout" size="3" maxlength="3" type="number" />
333
+ <label for="parseTimeout" class="translate">parse_timeout</label>
334
+ </div>
335
+
336
+ <div class="input-field col s12 m4 l3">
337
+ <input class="value number" id="maxretries" size="3" maxlength="3" type="number" min="0" max="10" />
338
+ <label for="maxretries" class="translate">maxretries</label>
339
+ </div>
340
+ </div>
341
+
342
+
343
+
344
+ </div>
345
+
346
+ <!-- tab "tab-polledDP" -->
347
+ <div id="tab-polledDP" class="col s12 page">
348
+
349
+ <div class="row">
350
+ <div class="col s6">
351
+ <span class="translate">hint_ebusd_polled</span>
352
+ </div>
353
+ </div>
354
+
355
+ <div class="col s12" id="polledDP">
356
+
357
+ <div class="row">
358
+ <div class="input-field col s2 m2 l2">
359
+ <button class="btn-floating btn-small waves-effect waves-light" title="findParams" id="findParams">
360
+ <i class="material-icons">search</i>
361
+ </button>
362
+ </div>
363
+ <div class="input-field col s4 m4 l4">
364
+ <input class="value" id="Circuit4Find" type="text" />
365
+ <label for="maxretries" class="translate">Circuit4Find</label>
366
+ </div>
367
+ </div>
368
+ <div class="row">
369
+ <a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
370
+ </div>
371
+ <div class="table-values-div">
372
+ <table id="table_polledDP" class="table-values" style="width: 100%;">
373
+ <thead>
374
+ <tr>
375
+ <th id="polledDP_col_0" data-type="checkbox" data-name="active" style=" background: #64b5f6 " class="translate">active</th>
376
+ <th id="polledDP_col_1" data-type="text" data-name="circuit" style="width: 20%; background: #64b5f6 " class="translate">circuit</th>
377
+ <th id="polledDP_col_2" data-type="text" data-name="name" style="background: #64b5f6" class="translate">name</th>
378
+ <th id="polledDP_col_3" data-type="text" data-name="parameter" style="background: #64b5f6" class="translate">addParameter</th>
379
+ <th data-buttons="up down delete" style="width: 100px; background: #64b5f6"></th>
380
+ </tr>
381
+ </thead>
382
+ </table>
383
+ </div>
384
+ </div>
385
+ </div>
386
+
387
+
388
+
389
+ <!-- tab "tab-historyDP" -->
390
+ <div id="tab-historyDP" class="col s12 page">
391
+
392
+ <div class="row">
393
+ <div class="col s6">
394
+ <span class="translate">hint_ebusd_history</span>
395
+ </div>
396
+ </div>
397
+
398
+ <div class="col s12" id="historyDP">
399
+
400
+ <a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
401
+
402
+ <div class="table-values-div">
403
+ <table id="table_historyDP" class="table-values" style="width: 100%;">
404
+ <thead>
405
+ <tr>
406
+ <th id="historyDP_col_1" data-name="name" style="width: 20%; background: #64b5f6 " class="translate">name</th>
407
+ <th data-buttons="add up down delete" style="width: 100px; background: #64b5f6"></th>
408
+ </tr>
409
+ </thead>
410
+ </table>
411
+ </div>
412
+ </div>
413
+ </div>
414
+
415
+ </div>
416
+ </div>
417
+ </body>
418
+ </html>
419
+