From 58a38d095a65b8a4efc0045b6f8390bb039180e3 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Mon, 5 Apr 2021 03:46:24 +0800 Subject: [PATCH] opt some --- base/web/spide.go | 5 +++-- core/code/inner.go | 5 ++++- core/wiki/chart.go | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/base/web/spide.go b/base/web/spide.go index b91b2e9d..e8b34231 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -90,7 +90,7 @@ func init() { SPIDE: {Name: SPIDE, Help: "蜘蛛侠", Value: kit.Data(kit.MDB_SHORT, "client.name")}, }, Commands: map[string]*ice.Command{ - SPIDE: {Name: "spide client.name action=raw,msg,save,cache method=GET,PUT,POST,DELETE url format=form,part,json,data,file arg auto 创建", Help: "蜘蛛侠", Action: map[string]*ice.Action{ + SPIDE: {Name: "spide client.name action=raw,msg,save,cache method=GET,PUT,POST,DELETE url format=form,part,json,data,file arg 执行:button create", Help: "蜘蛛侠", Action: map[string]*ice.Action{ mdb.CREATE: {Name: "create name address", Help: "添加", Hand: func(m *ice.Message, arg ...string) { if arg[0] != "name" { m.Option("name", arg[0]) @@ -301,7 +301,8 @@ func init() { case SPIDE_RAW: if b, e := ioutil.ReadAll(res.Body); m.Assert(e) { - m.Echo(string(b)) + m.Echo(kit.Formats(kit.UnMarshal(string(b)))) + // m.Echo(string(b)) } case SPIDE_MSG: diff --git a/core/code/inner.go b/core/code/inner.go index aa51837a..efadaaa3 100644 --- a/core/code/inner.go +++ b/core/code/inner.go @@ -104,7 +104,7 @@ func init() { "log", "true", "err", "true", "md", "true", "license", "true", "makefile", "true", - "ini", "true", "conf", "true", "toml", "true", + "ini", "true", "conf", "true", "toml", "true", "yaml", "true", ), "plug", kit.Dict( "s", kit.Dict( @@ -135,6 +135,9 @@ func init() { "css", kit.Dict( SUFFIX, kit.Dict("{", COMMENT), ), + "yaml", kit.Dict( + PREFIX, kit.Dict("#", COMMENT), + ), "md", kit.Dict(), "makefile", kit.Dict( diff --git a/core/wiki/chart.go b/core/wiki/chart.go index 7ac5fe41..6b6e9658 100644 --- a/core/wiki/chart.go +++ b/core/wiki/chart.go @@ -174,7 +174,12 @@ func (b *Label) Draw(m *ice.Message, x, y int) Chart { } // 输出 - if m.Option("compact") != "true" { + switch m.Option("compact") { + case "max": + item.Width = b.Width/len(line) - b.MarginX + case "true": + + default: item.Width = b.max[i] } item.Draw(m, left, top)