proxies.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. 'use strict';
  2. 'require view';
  3. 'require form';
  4. return view.extend({
  5. render: function() {
  6. var m, s, o;
  7. m = new form.Map('ser2net', 'ser2net');
  8. s = m.section(form.TypedSection, "proxy", _("Proxies"));
  9. s.anonymous = true;
  10. s.addremove = true;
  11. o = s.option(form.Flag, "enabled", _("Enabled"));
  12. o.rmempty = false;
  13. o = s.option(form.Value, "port", _("Service port"), _("The TCP port to listen on."));
  14. o.rmempty = false;
  15. o.default = 5000;
  16. o = s.option(form.ListValue, "protocol", _("Protocol"), _("The protocol to listen to."));
  17. o.rmempty = false;
  18. o.value("raw", _("Raw"));
  19. o.value("rawlp", _("Rawlp"));
  20. o.value("telnet", _("Telnet"));
  21. o.value("off", _("Off"));
  22. o.default = "raw";
  23. 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."));
  24. o.rmempty = false;
  25. o.default = 0;
  26. 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>."));
  27. o.rmempty = false;
  28. o.default = "/dev/ttyUSB0";
  29. o = s.option(form.ListValue, "baudrate", _("Baud rate"), _("The speed the device port should operate at."));
  30. o.rmempty = false;
  31. o.value(300);
  32. o.value(1200);
  33. o.value(2400);
  34. o.value(4800);
  35. o.value(9600);
  36. o.value(19200);
  37. o.value(38400);
  38. o.value(57600);
  39. o.value(115200);
  40. o.default = 9600;
  41. o = s.option(form.ListValue, "databits", _("Data bits"));
  42. o.rmempty = false;
  43. o.value(8);
  44. o.value(7);
  45. o.default = 8;
  46. o = s.option(form.ListValue, "parity", _("Parity"));
  47. o.rmempty = false;
  48. o.value("none", _("None"));
  49. o.value("even", _("Even"));
  50. o.value("odd", _("Odd"));
  51. o.default = "none";
  52. o = s.option(form.ListValue, "stopbits", _("Stop bits"));
  53. o.rmempty = false;
  54. o.value(1);
  55. o.value(2);
  56. o.default = 1;
  57. s.option(form.Flag, "rtscts", _("Use RTS and CTS lines"));
  58. s.option(form.Flag, "local", _("Ignore modem control signals"));
  59. s.option(form.Flag, "remctl", _("Allow the RFC 2217 protocol"));
  60. s.option(form.DynamicList, "options", _("Extra options"));
  61. s.option(form.Value, "led_tx", _("TX LED configuration"));
  62. s.option(form.Value, "led_rx", _("RX LED configuration"));
  63. return m.render();
  64. }
  65. });