track_interface.js 926 B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. 'require view';
  3. 'require form';
  4. 'require tools.widgets as widgets';
  5. 'require uci';
  6. return view.extend({
  7. render: function() {
  8. let m, s, o;
  9. m = new form.Map('keepalived');
  10. s = m.section(form.GridSection, 'track_interface', _('Track Interface'));
  11. s.anonymous = true;
  12. s.addremove = true;
  13. s.nodescriptions = true;
  14. o = s.option(form.Value, 'name', _('Name'));
  15. o.rmempty = false;
  16. o.optional = false;
  17. o = s.option(widgets.DeviceSelect, 'value', _('Device'),
  18. _('Device to track'));
  19. o.noaliases = true;
  20. o.rmempty = false;
  21. o.optional = false;
  22. o = s.option(form.Value, 'weight', _('Weight'),
  23. _('When a weight is specified, instead of setting the vrrp_instance to the FAULT state in case of failure, ') +
  24. _('its priority will be increased or decreased by the weight when the interface is up or down'));
  25. o.optional = false;
  26. o.datatype = 'uinteger';
  27. return m.render();
  28. }
  29. });