Initial commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
谢宇宁
2026-10-22 14:47:17 +07:00
co-authored by Claude Opus 5.5
commit 3639d2184a
574 changed files with 61690 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package web
import (
"net/http"
"videoweb/app/service/configser"
"github.com/gin-gonic/gin"
)
var dialogTemplates = map[string]string{
"download": "downloadAppDialog",
"search": "searchDialog",
}
// DialogFragment renders only the requested dialog body. Styles and behavior
// are loaded by dialogLoader.js after the first user interaction.
func DialogFragment(c *gin.Context) {
name := c.Param("name")
templateName, ok := dialogTemplates[name]
if !ok {
c.Status(http.StatusNotFound)
return
}
data := gin.H{}
if name == "download" {
data["appConfig"] = configser.FetchAppConfigVMOrEmpty(c)
}
c.Header("Cache-Control", "private, max-age=300")
c.HTML(http.StatusOK, templateName, data)
}