filebrowser.js 568 B

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';
  2. 'require view';
  3. 'require ui';
  4. 'require form';
  5. var formData = {
  6. files: {
  7. root: null,
  8. }
  9. };
  10. return view.extend({
  11. render: function() {
  12. let m, s, o;
  13. m = new form.JSONMap(formData, _('File Browser'), '');
  14. s = m.section(form.NamedSection, 'files', 'files');
  15. o = s.option(form.FileUpload, 'root', '');
  16. o.root_directory = '/';
  17. o.browser = true;
  18. o.show_hidden = true;
  19. o.enable_upload = true;
  20. o.enable_remove = true;
  21. o.enable_download = true;
  22. return m.render();
  23. },
  24. handleSave: null,
  25. handleSaveApply: null,
  26. handleReset: null
  27. })