diff options
author | Sergey Ponomarev <stokito@gmail.com> | 2024-04-09 10:37:05 +0300 |
---|---|---|
committer | Sergey Ponomarev <stokito@gmail.com> | 2024-04-09 11:02:00 +0300 |
commit | 6afea76f4e5eabc6f0c73729afa3bd3df745e415 (patch) | |
tree | 3039d10ab4217670de7a3c5ca438ed10610e3e15 /applications/luci-app-filebrowser/htdocs | |
parent | 4b771b3df0c39baed5e0904ad66e460691194636 (diff) |
luci-app-filebrowser: File Browser
Add a File Browser based on the FileUpload CBI element.
It allows browsing files and directories on a router, delete and upload.
This covers only basic needs.
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Diffstat (limited to 'applications/luci-app-filebrowser/htdocs')
-rw-r--r-- | applications/luci-app-filebrowser/htdocs/luci-static/resources/view/system/filebrowser.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/applications/luci-app-filebrowser/htdocs/luci-static/resources/view/system/filebrowser.js b/applications/luci-app-filebrowser/htdocs/luci-static/resources/view/system/filebrowser.js new file mode 100644 index 0000000000..33fe2614e8 --- /dev/null +++ b/applications/luci-app-filebrowser/htdocs/luci-static/resources/view/system/filebrowser.js @@ -0,0 +1,34 @@ +'use strict'; +'require view'; +'require ui'; +'require form'; + +var formData = { + files: { + root: null, + } +}; + +return view.extend({ + render: function() { + var m, s, o; + + m = new form.JSONMap(formData, _('File Browser'), ''); + + s = m.section(form.NamedSection, 'files', 'files'); + + o = s.option(form.FileUpload, 'root', ''); + o.root_directory = '/'; + o.browser = true; + o.show_hidden = true; + o.enable_upload = true; + o.enable_remove = true; + o.enable_download = true; + + return m.render(); + }, + + handleSave: null, + handleSaveApply: null, + handleReset: null +}) |