/
config.html
56 lines (49 loc) · 2.25 KB
/
config.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
<script type="text/javascript">
RED.nodes.registerType('wmbus-dongle', {
category: 'config',
defaults: {
serielport: { value: "", required: true },
dongletype: { value: "Imst", required: true },
},
label: function () {
return this.dongletype + "@" + this.serielport;
},
oneditprepare: function () {
var node = this;
try {
$("#node-config-input-serialport").autocomplete("destroy");
} catch (err) {
}
$("#node-config-lookup-serial").click(function () {
$("#node-config-lookup-serial").addClass('disabled');
$.getJSON('serialports', function (data) {
$("#node-config-lookup-serial").removeClass('disabled');
var ports = data || [];
$("#node-config-input-serialport").autocomplete({
source: ports,
minLength: 0,
close: function (event, ui) {
$("#node-config-input-serialport").autocomplete("destroy");
}
}).autocomplete("search", "");
});
});
//var node = $("#node-config-input-serielport")
//node.append($('<option>' + 'f' + '- ' + '1' + '</option>').attr('value', 1));
}
});
</script>
<script type="text/x-red" data-template-name="wmbus-dongle">
<div class="form-row">
<label for="node-config-input-serialport"><i class="fa fa-random"></i> <span data-i18n="serial.label.serialport"></span></label>
<input type="text" id="node-config-input-serielport" style="width:66%;" data-i18n="serial.placeholder.serialport">
<a id="node-config-lookup-serial" class="red-ui-button"><i id="node-config-lookup-serial-icon" class="fa fa-search"></i></a>
</div>
<div class="form-row">
<label for="node-config-input-dongletype"><i class="icon-bookmark"></i> Type</label>
<select id="node-config-input-dongletype">
<option value="Imst">Imst iM871A-USB</option>
<option value="Amber">Amber AMB8465-M</option>
</select>
</div>
</script>