-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a File Browser based on the FileUpload CBI element. It allows to browse files and directories on a router, delete and upload. This already covers a basic needs. Signed-off-by: Sergey Ponomarev <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
modules/luci-mod-system/htdocs/luci-static/resources/view/system/filebrowser.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'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; | ||
|
||
return m.render(); | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters