aboutsummaryrefslogtreecommitdiff
path: root/vfs/example.html
diff options
context:
space:
mode:
Diffstat (limited to 'vfs/example.html')
-rw-r--r--vfs/example.html22
1 files changed, 16 insertions, 6 deletions
diff --git a/vfs/example.html b/vfs/example.html
index 0fb1f82..3d8a772 100644
--- a/vfs/example.html
+++ b/vfs/example.html
@@ -9,6 +9,7 @@
<script>
var exports = {}
+ var wui_vfs;
</script>
<script src="vfs.js"></script>
<script>
@@ -82,15 +83,19 @@
},
}
- function main() {
+ async function main() {
let opts = {
id: "vfs",
- is_editable: true,
ListNodes: doListNodes,
- GetNode: doGetNode,
+ OnClickNode: OnClickNode,
}
- let vfs = new Vfs(opts)
+ let res = await NewWuiVfs(opts)
+ if (res.code != 200) {
+ console.error(res)
+ return
+ }
+ wui_vfs = res.data
}
function doListNodes() {
@@ -101,7 +106,11 @@
return res
}
- function doGetNode(path) {
+ function OnClickNode(path, is_dir) {
+ if (is_dir) {
+ return
+ }
+
let res = {
code: 200,
data: {
@@ -132,7 +141,8 @@
res.code = 404
res.message = "path not found"
}
- return res
+
+ console.log(res)
}
</script>
</body>