大概页面布局完成,api确认没问题,接下来就要上传内容了

This commit is contained in:
2026-05-22 03:16:06 +00:00
parent 55f01abd74
commit dfd630fa2b
10 changed files with 221 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
<html>
<head>
<title>选择不同版本的小绿</title>
</head>
<body>
<h2>选择不同版本的小绿<a href="/image">__>重新刷新</h2>
<div id="list"></div>
</body>
</html>
<script>
fetch('https://greendam.ww3.tw/api/image/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);
document.getElementById('list').innerHTML += `<a href="/image/${item.filename}"><b>${item.filename}</b></a>___`
})
})
</script>

View File

@@ -0,0 +1,24 @@
<html>
<head>
<title>{{ name }}</title>
</head>
<body>
<h2>图片预览_{{ name }}<a href="../">返回上级../</a></h2>
<div id="content"></div>
</body>
<script>
fetch('https://greendam.ww3.tw/api/image/list/{{ name }}/')
.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 content_Document = `<img src="${item.url_path}" alt="${item.filename}" style="width: 10%;" loading="lazy">${item.id}`
document.getElementById('content').innerHTML += content_Document
})
})
</script>
</html>