1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-04-28 23:26:46 +08:00
parent 9ecfc80f03
commit d0de69d086
2 changed files with 16 additions and 3 deletions

View File

@ -71,6 +71,18 @@ func Render(m *ice.Message, cmd string, args ...ice.Any) bool {
} }
RenderType(m.W, arg[0], kit.Select("", arg, 1)) RenderType(m.W, arg[0], kit.Select("", arg, 1))
RenderHeader(m.W, "Content-Disposition", fmt.Sprintf("filename=%s", kit.Select(path.Base(kit.Select(arg[0], m.Option("filename"))), arg, 2))) RenderHeader(m.W, "Content-Disposition", fmt.Sprintf("filename=%s", kit.Select(path.Base(kit.Select(arg[0], m.Option("filename"))), arg, 2)))
if m.Option("render") == "replace" {
res := m.Cmdx(nfs.CAT, arg[0])
fieldset := "fieldset." + m.Option(ctx.INDEX)
m.W.Write([]byte(kit.ReplaceAll(res,
"$project", fieldset+">div.output>div.project",
"$display", fieldset+">div.output>div.layout>div.display",
"$profile", fieldset+">div.output>div.layout>div.layout>div.profile",
"$content", fieldset+">div.output>div.layout>div.layout>div.content",
"$fieldset", fieldset, "$index", m.Option(ctx.INDEX),
)))
break
}
if _, e := nfs.DiskFile.StatFile(arg[0]); e == nil { if _, e := nfs.DiskFile.StatFile(arg[0]); e == nil {
http.ServeFile(m.W, m.R, kit.Path(arg[0])) http.ServeFile(m.W, m.R, kit.Path(arg[0]))
} else if f, e := nfs.PackFile.OpenFile(arg[0]); e == nil { } else if f, e := nfs.PackFile.OpenFile(arg[0]); e == nil {

View File

@ -214,6 +214,7 @@ const ( // MSG
MSG_PROCESS = "_process" MSG_PROCESS = "_process"
MSG_DISPLAY = "_display" MSG_DISPLAY = "_display"
MSG_DISPLAY_CSS = "_display_css"
MSG_TOOLKIT = "_toolkit" MSG_TOOLKIT = "_toolkit"
MSG_USERIP = "user.ip" MSG_USERIP = "user.ip"