105f591c4942a54b21eebc977bbaa9aa5a8609b9
[project/luci.git] / applications / luci-app-ser2net / htdocs / luci-static / resources / view / ser2net / proxies.js
1 'use strict';
2 'require form';
3
4 return L.view.extend({
5 render: function() {
6 var m, s, o;
7
8 m = new form.Map('ser2net', 'ser2net');
9
10 s = m.section(form.TypedSection, "proxy", _("Proxies"));
11 s.anonymous = true;
12 s.addremove = true;
13
14 o = s.option(form.Flag, "enabled", _("Enabled"));
15 o.rmempty = false;
16
17 o = s.option(form.Value, "port", _("Service port"), _("The TCP port to listen on."));
18 o.rmempty = false;
19 o.default = 5000;
20
21 o = s.option(form.ListValue, "protocol", _("Protocol"), _("The protocol to listen to."));
22 o.rmempty = false;
23 o.value("raw", _("Raw"));
24 o.value("rawlp", _("Rawlp"));
25 o.value("telnet", _("Telnet"));
26 o.value("off", _("Off"));
27 o.default = "raw";
28
29 o = s.option(form.Value, "timeout", _("Timeout"), _("The amount of seconds of inactivity before a disconnect occurs.<br/>A value of zero means wait indefinitely."));
30 o.rmempty = false;
31 o.default = 0;
32
33 o = s.option(form.Value, "device", _("Device"), _("The name of the device to connect to.<br/>This must be in the form of /dev/<device>."));
34 o.rmempty = false;
35 o.default = "/dev/ttyUSB0";
36
37 o = s.option(form.ListValue, "baudrate", _("Baud rate"), _("The speed the device port should operate at."));
38 o.rmempty = false;
39 o.value(300);
40 o.value(1200);
41 o.value(2400);
42 o.value(4800);
43 o.value(9600);
44 o.value(19200);
45 o.value(38400);
46 o.value(57600);
47 o.value(115200);
48 o.default = 9600;
49
50 o = s.option(form.ListValue, "databits", _("Data bits"));
51 o.rmempty = false;
52 o.value(8);
53 o.value(7);
54 o.default = 8;
55
56 o = s.option(form.ListValue, "parity", _("Parity"));
57 o.rmempty = false;
58 o.value("none", _("None"));
59 o.value("even", _("Even"));
60 o.value("odd", _("Odd"));
61 o.default = "none";
62
63 o = s.option(form.ListValue, "stopbits", _("Stop bits"));
64 o.rmempty = false;
65 o.value(1);
66 o.value(2);
67 o.default = 1;
68
69 s.option(form.Flag, "rtscts", _("Use RTS and CTS lines"));
70 s.option(form.Flag, "local", _("Ignore modem control signals"));
71 s.option(form.Flag, "remctl", _("Allow the RFC 2217 protocol"));
72 s.option(form.DynamicList, "options", _("Extra options"));
73 s.option(form.Value, "led_tx", _("TX LED configuration"));
74 s.option(form.Value, "led_rx", _("RX LED configuration"));
75
76 return m.render();
77 }
78 });