settings.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. //ser2net
  9. s = m.section(form.TypedSection, "ser2net", _("Global switch"));
  10. s.anonymous = true;
  11. o = s.option(form.Flag, "enabled", _("Enabled"));
  12. o.rmempty = false;
  13. //controlport
  14. s = m.section(form.TypedSection, "controlport", _("Control port"));
  15. s.anonymous = true;
  16. o = s.option(form.Flag, "enabled", _("Enabled"));
  17. o.rmempty = false;
  18. o = s.option(form.Value, "host", _("Binding address"), _("The network to listen from."));
  19. o.rmempty = false;
  20. o.default = "localhost";
  21. o = s.option(form.Value, "port", _("Control port"), _("The TCP port to listen on."));
  22. o.rmempty = false;
  23. o.default = 2000;
  24. //default
  25. s = m.section(form.TypedSection, "default", _("Default settings"));
  26. s.anonymous = true;
  27. o = s.option(form.ListValue, "speed", _("Baud rate"), _("The speed the device port should operate at."));
  28. o.rmempty = false;
  29. o.value(300);
  30. o.value(1200);
  31. o.value(2400);
  32. o.value(4800);
  33. o.value(9600);
  34. o.value(19200);
  35. o.value(38400);
  36. o.value(57600);
  37. o.value(115200);
  38. o.default = 9600;
  39. o = s.option(form.ListValue, "databits", _("Data bits"));
  40. o.rmempty = false;
  41. o.value(8);
  42. o.value(7);
  43. o.default = 8;
  44. o = s.option(form.ListValue, "parity", _("Parity"));
  45. o.rmempty = false;
  46. o.value("none", _("None"));
  47. o.value("even", _("Even"));
  48. o.value("odd", _("Odd"));
  49. o.default = "none";
  50. o = s.option(form.ListValue, "stopbits", _("Stop bits"));
  51. o.rmempty = false;
  52. o.value(1);
  53. o.value(2);
  54. o.default = 1;
  55. s.option(form.Flag, "rtscts", _("Use RTS and CTS lines"));
  56. s.option(form.Flag, "local", _("Ignore modem control signals"));
  57. s.option(form.Flag, "remctl", _("Allow the RFC 2217 protocol"));
  58. return m.render();
  59. }
  60. });