Add WebDAV browser
This commit is contained in:
parent
eb65f8cfe7
commit
59297a1a33
|
@ -24,7 +24,7 @@ drive.woozle.org {
|
||||||
route {
|
route {
|
||||||
file_server @nondav {
|
file_server @nondav {
|
||||||
root /srv/
|
root /srv/
|
||||||
browse
|
browse /browser.html
|
||||||
}
|
}
|
||||||
reverse_proxy webdav:8000
|
reverse_proxy webdav:8000
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@ services:
|
||||||
target: /www/index.mjs
|
target: /www/index.mjs
|
||||||
- source: index.css
|
- source: index.css
|
||||||
target: /www/index.css
|
target: /www/index.css
|
||||||
|
- source: browser.html
|
||||||
|
target: /browser.html
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- host.docker.internal:host-gateway
|
- host.docker.internal:host-gateway
|
||||||
|
|
||||||
|
@ -280,7 +282,7 @@ configs:
|
||||||
name: Corefile-v2
|
name: Corefile-v2
|
||||||
Caddyfile:
|
Caddyfile:
|
||||||
file: Caddyfile
|
file: Caddyfile
|
||||||
name: Caddyfile-v77
|
name: Caddyfile-v79
|
||||||
index.html:
|
index.html:
|
||||||
file: www/index.html
|
file: www/index.html
|
||||||
name: index.html-v32
|
name: index.html-v32
|
||||||
|
@ -290,6 +292,9 @@ configs:
|
||||||
index.css:
|
index.css:
|
||||||
file: www/index.css
|
file: www/index.css
|
||||||
name: index.css-v1
|
name: index.css-v1
|
||||||
|
browser.html:
|
||||||
|
file: www/browser.html
|
||||||
|
name: browser.html-v3
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
passwd:
|
passwd:
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Woozle Drive</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/dom111/webdav-js/assets/css/style-min.css">
|
||||||
|
<script>
|
||||||
|
function init() {
|
||||||
|
// This is dumb, but webdav-min.js doesn't have any checks to make sure the document is loaded.
|
||||||
|
let scr = document.head.appendChild(document.createElement("script"))
|
||||||
|
scr.src = "https://cdn.jsdelivr.net/gh/dom111/webdav-js/src/webdav-min.js"
|
||||||
|
|
||||||
|
for (let e of document.querySelectorAll(".listing")) {
|
||||||
|
console.log("Let's pray the WebDAV stuff works!", e)
|
||||||
|
e.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.readyState === "loading") {
|
||||||
|
document.addEventListener("DOMContentLoaded", init)
|
||||||
|
} else {
|
||||||
|
init()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<ul class="listing">
|
||||||
|
{{range .Items}}
|
||||||
|
<li>
|
||||||
|
<a href="{{html .URL}}">{{html .Name}}</a>
|
||||||
|
<span class="size" data-value="{{.Size}}">{{.HumanSize}}</span>
|
||||||
|
<time>{{.HumanModTime "2006-01-02T15:04:05Z"}}</time>
|
||||||
|
</li>
|
||||||
|
{{end}}
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue