Files

34 lines
1.0 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<html>
<head>
<title>绿坝娘资源小站 (仮) | {{ title }}</title>
<link rel="icon" type="image/png" sizes="128x128" href="/static/src/img/logo.png">
</head>
<body>
<a href="/">返回主页</a>
<br>
<h1>Index of /</h1>
<hr>
<div id="content">
</div>
<hr>
<br>
以下还可以预览小绿的图片本来想做预览图的结果能力有限现在正在努力学习javascript
<br>
<a href="/image">图片导览</a>_<a href="/video">视频导览</a>
</body>
</html>
<script>
fetch("https://greendam.ww3.tw/api/files/list/")
.then(res => res.json())
.then (data => {
data.forEach(item => {
console.log('ID', item.id);
console.log('Name', item.filename);
console.log('URL', item.url_path);
let contentDocment = `<a href="https://greendam.ww3.tw/resources/${item.filename}">${item.filename}</a><br>`
document.getElementById("content").innerHTML += contentDocment
})
})
</script>