forked from yushijinhun/authlib-injector.yushi.moe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
145 lines (123 loc) · 4.04 KB
/
index.html
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>获取 authlib-injector</title>
<link rel="icon" href="img/favicon.png">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
.navbar {
margin-bottom: 30px;
}
#versionInfo .table th {
width: 10%;
}
#versionInfoSHA256 {
word-break: break-all;
}
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
}
</style>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">authlib-injector</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">下载</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/yushijinhun/authlib-injector/wiki">Wiki</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/yushijinhun/authlib-injector">GitHub</a>
</li>
</ul>
</div>
</nav>
<!---->
<main role="main" class="container">
<!-- [[IF_BMCLAPI]]
<div class="alert alert-info">
这是由 BMCLAPI 提供的镜像站。若要访问源站,请点击<a href="https://authlib-injector.yushi.moe/">此处</a>。
</div>
-->
<h2>最新版本</h2>
<div id="loadingPlaceholder">
<span class="text-secondary">正在获取版本信息...</span>
</div>
<div id="loadingErrorAlert" class="alert alert-danger d-none" role="alert">
无法获取版本信息
</div>
<div id="versionInfo" class="card d-none">
<div class="card-body">
<table class="table table-sm table-hover table-borderless">
<tbody>
<tr>
<th scope="row">文件名</th>
<td id="versionInfoFileName">$fileName</td>
</tr>
<tr>
<th scope="row">版本号</th>
<td id="versionInfoVersion">$version</td>
</tr>
<tr>
<th scope="row">构建编号</th>
<td id="versionInfoBuildNumber">$buildNumber</td>
</tr>
<tr>
<th scope="row">SHA-256</th>
<td id="versionInfoSHA256">$sha256</td>
</tr>
</tbody>
</table>
<a id="versionInfoDownloadBtn" href="$downloadUrl" class="btn btn-outline-primary">下载</a>
</div>
</div>
</main>
<footer class="footer mt-auto py-3">
<div class="container">
<span class="text-muted">
Powered by <a href="https://github.com/yushijinhun/authlib-injector.yushi.moe">GitHub Pages</a><!-- [[IF_BMCLAPI]] and <a href="https://bmclapidoc.bangbang93.com/">BMCLAPI</a>-->.
</span>
</div>
</footer>
<script>
fetch("artifact/latest.json", {
cache: "no-cache",
mode: "cors"
})
.then(response => response.json())
.then(versionInfo => {
document.getElementById("versionInfoFileName").textContent = versionInfo.download_url.split("/").pop();
document.getElementById("versionInfoVersion").textContent = versionInfo.version;
document.getElementById("versionInfoBuildNumber").textContent = versionInfo.build_number;
document.getElementById("versionInfoSHA256").textContent = versionInfo.checksums.sha256;
document.getElementById("versionInfoDownloadBtn").setAttribute("href", versionInfo.download_url);
document.getElementById("versionInfo").classList.remove("d-none");
})
.catch(error => {
console.error("Failed to fetch version info: " + error);
document.getElementById("loadingErrorAlert").classList.remove("d-none");
})
.then(() => document.getElementById("loadingPlaceholder").classList.add("d-none"));
</script>
</body>
</html>