diff --git a/core/chat/header.go b/core/chat/header.go index 2e8a56e6..45035f73 100644 --- a/core/chat/header.go +++ b/core/chat/header.go @@ -27,6 +27,15 @@ func init() { LOGIN: {Name: "login", Help: "用户登录", Hand: func(m *ice.Message, arg ...string) { m.Echo(m.Option(ice.MSG_USERNAME)) }}, + + "pack": {Name: "pack", Help: "打包", Hand: func(m *ice.Message, arg ...string) { + if f, p, e := kit.Create("usr/volcanos/cache_data.js"); m.Assert(e) { + defer f.Close() + data := kit.UnMarshal(m.Option("content")) + f.WriteString(`Volcanos.meta.pack = ` + kit.Formats(data)) + m.Echo(p) + } + }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Echo(m.Conf(HEADER, TITLE)) }}, diff --git a/core/code/pack.go b/core/code/pack.go index ca5613a4..88944f64 100644 --- a/core/code/pack.go +++ b/core/code/pack.go @@ -126,6 +126,7 @@ func init() { js, p, e := kit.Create("usr/volcanos/cache.js") m.Assert(e) defer js.Close() + m.Echo(p) css, _, e := kit.Create("usr/volcanos/cache.css") m.Assert(e) @@ -147,9 +148,36 @@ func init() { js.WriteString(`_can_name = "` + path.Join("/", k) + "\"\n") js.WriteString(m.Cmdx(nfs.CAT, "usr/volcanos/"+k)) } - js.WriteString(`_can_name = ""` + "\n") - m.Echo(p) + + if f, p, e := kit.Create("usr/volcanos/cache.html"); m.Assert(e) { + m.Debug("%v ", p) + f.WriteString(fmt.Sprintf(` + +
+ + +