Add maintenance page

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2026-02-01 13:55:52 +08:00
parent 74413c844a
commit 1500821f3e
4 changed files with 79 additions and 1 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ import (
func index(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "common/announce.html", gin.H{
"title": "Love Live! 学园偶像祭 本地服务器",
"title": "Love Live! 学园偶像祭",
"content": template.HTML(`目前开发完毕的功能包括:<br><ul><li>登录</li><li>相册</li><li>编队</li><li>饰品</li><li>宝石</li><li>Live</li><li>个人信息设置</li><li>官方漫画</li><ul><br>
其他功能仍在开发中,有报错属于正常现象。<br><br>
侵权联系:<a href="https://space.bilibili.com/671443">梦路_YumeMichi @bilibili</a> 进行删除。`),
+1
View File
@@ -13,6 +13,7 @@ import (
_ "honoka-chan/internal/handler/lbonus"
_ "honoka-chan/internal/handler/live"
_ "honoka-chan/internal/handler/login"
_ "honoka-chan/internal/handler/maintenance"
_ "honoka-chan/internal/handler/multiunit"
_ "honoka-chan/internal/handler/museum"
_ "honoka-chan/internal/handler/notice"
@@ -0,0 +1,20 @@
package maintenance
import (
"honoka-chan/internal/router"
"html/template"
"net/http"
"github.com/gin-gonic/gin"
)
func maintenance(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "common/maintenance.html", gin.H{
"title": "Love Live! 学园偶像祭",
"content": template.HTML(`系统维护中,请稍后重试!`),
})
}
func init() {
router.AddHandler("/", "GET", "/resources/maintenace/maintenance.php", maintenance)
}
+57
View File
@@ -0,0 +1,57 @@
{{ define "common/maintenance.html" }}
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=880, target-densitydpi=device-dpi, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<title>{{ .title }}</title>
<link rel="stylesheet" href="/static/css/base.css">
<link rel="stylesheet" href="/static/css/window.css">
<link rel="stylesheet" href="/static/css/perfect-scrollbar.css">
<link rel="stylesheet" href="/static/css/ll-perfect-scrollbar.css">
<style>
h2 {
color: red;
font-size: 100%;
}
p+p {
margin-top: 1em;
}
.update-link {
color: #0be;
display: block;
font-size: 150%;
margin: 20px auto;
text-align: center;
}
.notice {
color: red;
}
</style>
</head>
<body class="no-back">
<div id="outer">
<div id="inner">
<div id="header">
<h1>{{ .title }}</h1>
</div>
<div id="body">
<p>{{ .content }}</p>
</div>
</div>
</div>
<script src="/static/js/perfect-scrollbar.min.js"></script>
<script>
new PerfectScrollbar('#body', { suppressScrollX: true });
</script>
</body>
</html>
{{ end }}