mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-12-15 18:40:16 +00:00
feat: Web UI
update: 校验Rule-Provider是否有重名 modify: 修改meta默认模板 modify: 根据Clash筛选返回配置中的节点类型
This commit is contained in:
12
api/route.go
12
api/route.go
@@ -1,13 +1,25 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"github.com/gin-gonic/gin"
|
||||
"html/template"
|
||||
"sub2clash/api/controller"
|
||||
"sub2clash/middleware"
|
||||
)
|
||||
|
||||
//go:embed templates/*
|
||||
var templates embed.FS
|
||||
|
||||
func SetRoute(r *gin.Engine) {
|
||||
r.Use(middleware.ZapLogger())
|
||||
// 使用内嵌的模板文件
|
||||
r.SetHTMLTemplate(template.Must(template.New("").ParseFS(templates, "templates/*")))
|
||||
r.GET(
|
||||
"/", func(c *gin.Context) {
|
||||
c.HTML(200, "index.html", nil)
|
||||
},
|
||||
)
|
||||
r.GET(
|
||||
"/clash", func(c *gin.Context) {
|
||||
controller.SubmodHandler(c)
|
||||
|
||||
Reference in New Issue
Block a user