2019-03-26 22:04:53 +00:00
|
|
|
import { Client } from "./webfuse/client.js";
|
2019-02-20 19:23:56 +00:00
|
|
|
import { ConnectionView } from "./connection_view.js";
|
2019-02-21 23:35:59 +00:00
|
|
|
import { FileSystemProvider } from "./filesystem_provider.js";
|
2019-02-20 19:23:56 +00:00
|
|
|
|
2019-02-19 20:26:06 +00:00
|
|
|
|
|
|
|
function mode(value) {
|
|
|
|
return parseInt(value, 8);
|
|
|
|
}
|
|
|
|
|
2019-01-28 21:08:37 +00:00
|
|
|
function startup() {
|
2019-02-22 14:48:49 +00:00
|
|
|
const provider = new FileSystemProvider({
|
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-04-17 20:51:16 +00:00
|
|
|
const client = new Client();
|
|
|
|
const connectionView = new ConnectionView(client, provider);
|
2019-02-21 23:35:59 +00:00
|
|
|
document.getElementById('connection').appendChild(connectionView.element);
|
2019-01-28 21:08:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
window.onload = startup;
|