1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-01 04:50:45 +00:00
falk-werner_webfuse-provider/example/daemon/www/js/startup.js
2019-02-19 21:26:06 +01:00

26 lines
759 B
JavaScript

/* global Connection, ConnectionView, FileSystem, FileSystemHandler */
function mode(value) {
return parseInt(value, 8);
}
function startup() {
let connection = new Connection();
let connectionView = new ConnectionView(connection);
document.getElementById('connection').appendChild(connectionView.element);
let fs = new FileSystem({
inode: 1,
mode: mode("0755"),
type: "dir",
entries: {
"hello.txt" : { inode: 2, mode: mode("0444"), type: "file", contents: "Hello, World!"},
"say_hello.sh": { inode: 3, mode: mode("0555"), type: "file", contents: "#!/bin/sh\necho hello\n"}
}
});
let handler = new FileSystemHandler(fs, connection);
}
window.onload = startup;