up
This commit is contained in:
@@ -93,6 +93,22 @@ func serveIndex(c *gin.Context) {
|
|||||||
c.String(http.StatusOK, indexHTML)
|
c.String(http.StatusOK, indexHTML)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// serveHome 主页(meshmap 占位)
|
||||||
|
func serveHome(c *gin.Context) {
|
||||||
|
c.Header("Content-Type", "text/html; charset=utf-8")
|
||||||
|
c.String(http.StatusOK, `<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head><meta charset="UTF-8"><title>meshgo</title></head>
|
||||||
|
<body style="font-family:sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f0f2f5">
|
||||||
|
<div style="text-align:center">
|
||||||
|
<h1 style="font-size:48px;color:#1677ff;margin-bottom:8px">meshmap</h1>
|
||||||
|
<p style="color:#888;margin-bottom:24px">Mesh Network Map · 网格拓扑可视化</p>
|
||||||
|
<a href="/admin/mqtt" style="display:inline-block;padding:10px 24px;background:#1677ff;color:#fff;text-decoration:none;border-radius:6px;font-size:14px">MQTT 管理面板</a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>`)
|
||||||
|
}
|
||||||
|
|
||||||
// handleStats 返回实时统计(JSON)
|
// handleStats 返回实时统计(JSON)
|
||||||
func handleStats(c *gin.Context) {
|
func handleStats(c *gin.Context) {
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
|||||||
Reference in New Issue
Block a user