1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-01 07:40:50 +00:00
falk-werner_webfuse-provider/example/daemon/www/js/startup.js

26 lines
759 B
JavaScript
Raw Normal View History

2019-02-19 20:26:06 +00:00
/* global Connection, ConnectionView, FileSystem, FileSystemHandler */
function mode(value) {
return parseInt(value, 8);
}
2019-01-28 21:08:37 +00:00
function startup() {
let connection = new Connection();
let connectionView = new ConnectionView(connection);
2019-01-29 21:03:21 +00:00
document.getElementById('connection').appendChild(connectionView.element);
2019-01-28 21:08:37 +00:00
let fs = new FileSystem({
2019-02-02 13:25:57 +00:00
inode: 1,
2019-02-19 20:26:06 +00:00
mode: mode("0755"),
2019-01-28 21:08:37 +00:00
type: "dir",
entries: {
2019-02-19 20:26:06 +00:00
"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"}
2019-01-28 21:08:37 +00:00
}
});
2019-02-19 20:26:06 +00:00
let handler = new FileSystemHandler(fs, connection);
2019-01-28 21:08:37 +00:00
}
window.onload = startup;