forked from Aatoz/Sileo
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
112 lines (109 loc) · 2.65 KB
/
Copy pathindex.html
File metadata and controls
112 lines (109 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title id="homeTitle">大奶源</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
.container {
width: 30%;
margin: 20px auto;
background-color: #fff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 0px;
}
table, th, td {
border: 1px solid #ddd;
text-align: center;
}
th, td {
padding: 10px;
text-align: left;
}
/* 设置第三列(下载链接)的固定宽度 */
table td:nth-child(1) {
width: 300px; /* 你可以根据需要调整这个宽度 */
}
th {
background-color: #555;
color: #fff;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
@media (max-width: 600px) {
.container {
width: 100%;
margin: 0;
padding: 0px;
}
th, td {
padding: 5px;
font-size: 14px;
}
}
</style>
</head>
<body>
<div class="container">
<h1 id="formTitle"></h1>
<table id="dataTable">
<thead>
<tr>
<th>插件</th>
</tr>
</thead>
<tbody>
<!-- 表格数据将被动态插入这里 -->
</tbody>
</table>
</div>
<script>
// 使用 fetch 发送 GET 请求到指定的接口
fetch('/arm64.json')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json(); // 解析 JSON 数据
})
.then(data => {
// 设置表单标题
document.getElementById('homeTitle').textContent = "小奶源";
// 获取表格的 tbody 元素
var tbody = document.getElementById('dataTable').getElementsByTagName('tbody')[0];
// 遍历数据并添加到表格中
var index = 1;
data.data.forEach(function(item) {
var row = tbody.insertRow(); // 创建新行
// 创建单元格并填充数据
var nameCell = row.insertCell(0);
var downloadLink = document.createElement('a');
downloadLink.textContent = index+". "+item.Name+"-"+item.Architecture.replace('iphoneos-','')+'.deb';
downloadLink.href = item.path;
downloadLink.setAttribute('target', '_blank'); // 在新标签页中打开下载链接
nameCell.appendChild(downloadLink);
index++;
});
})
.catch(error => {
console.error('There has been a problem with your fetch operation:', error);
});
</script>
</body>
</html>