You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/oa/builtin/webdav/dir.html

134 lines
3.0 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OA</title>
<style>
html {
overflow: hidden;
}
body {
overflow: auto;
height: 100vh;
width: 100vw;
font-family: Arial, sans-serif;
background-color: #f4f4f9;
margin: 0;
padding: 0;
background: #f0f0f0;
}
.header {
background: #fff;
width: 100vw;
height: 4rem;
line-height: 4rem;
font-size: 2rem;
padding-left: 4rem;
box-sizing: border-box;
box-shadow: 0px 0px 20px 0px rgb(0 0 0 / 10%);
}
.container {
padding: 2rem;
box-sizing: border-box;
width: 100vw;
height: calc(100vh - 4rem);
display: flex;
flex-direction: column;
justify-content: start;
align-items: center;
}
.core {
width: 70%;
min-height: 50%;
background: #fff;
border-radius: 1rem;
box-shadow: 0 2px 5px 1px rgb(0 0 0 / 5%);
}
.meta {
border-bottom: solid 1px #000;
height: 3rem;
font-size: 1.25rem;
line-height: 2rem;
padding: 0.5rem 2rem;
box-sizing: border-box;
display: flex;
gap: 1rem;
}
.core-box {
padding: 0.5rem 2rem;
box-sizing: border-box;
height: calc(100% - 3rem);
overflow: auto;
}
.line {
display: flex;
height: 2rem;
font-size: 1rem;
line-height: 2rem;
}
a:link {
text-decoration: none;
font-weight: bold;
}
</style>
</head>
<body>
<div class="header">
<a href="/">/</a>{{ range .path }}{{if .}}<span><a class="path_tag">{{.}}</a></span>/{{end}}{{end}}
</div>
<div class="container">
<div class="core">
<div class="meta">
<span>{{.cdir}} directory</span>
<span>{{.cfile}} files</span>
<span>{{.size}}</span>
</div>
<div class="core-box">
{{ range .files }}
<div class="line">
<div style="flex: 1"><a href="{{index . 1}}">{{index . 0}}</a></div>
<div style="flex: 0 0 10rem">{{index . 2}}</div>
<div style="flex: 0 0 10rem" class="2localtime">{{index . 3}}</div>
</div>
{{end}}
<div style="height: 5rem;"></div>
</div>
</div>
</div>
</body>
<script>
// 当文档加载完成后执行
document.addEventListener("DOMContentLoaded", function () {
var divs = document.getElementsByClassName('path_tag');
var base = "/"
for (var i = 0; i < divs.length; i++) {
var div = divs[i];
if (div.textContent) {
base = base + div.textContent + "/"
div.setAttribute('href', base)
}
}
var divs = document.getElementsByClassName('2localtime');
for (var i = 0; i < divs.length; i++) {
var div = divs[i];
if (div.textContent) {
div.textContent = new Date(div.textContent).toLocaleString();
}
}
});
</script>
</html>