commands.js 1003 B

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';
  2. 'require view';
  3. 'require form';
  4. return view.extend({
  5. render: function(data) {
  6. var m, s, o;
  7. m = new form.Map('luci', _('Custom Commands'),
  8. _('This page allows you to configure custom shell commands which can be easily invoked from the web interface.'));
  9. s = m.section(form.GridSection, 'command');
  10. s.nodescriptions = true;
  11. s.anonymous = true;
  12. s.addremove = true;
  13. o = s.option(form.Value, 'name', _('Description'),
  14. _('A short textual description of the configured command'));
  15. o = s.option(form.Value, 'command', _('Command'), _('Command line to execute'));
  16. o.textvalue = function(section_id) {
  17. return E('code', [ this.cfgvalue(section_id) ]);
  18. };
  19. o = s.option(form.Flag, 'param', _('Custom arguments'),
  20. _('Allow the user to provide additional command line arguments'));
  21. o = s.option(form.Flag, 'public', _('Public access'),
  22. _('Allow executing the command and downloading its output without prior authentication'));
  23. return m.render();
  24. }
  25. });