1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
harveyshao 2022-11-05 23:31:24 +08:00
parent 87bb0d8dbc
commit a63831976b

View File

@ -15,20 +15,19 @@ const DATA = "data"
func init() {
Index.MergeCommands(ice.Commands{
DATA: {Name: "data path type@key fields auto create push save draw", Help: "数据表格", Actions: ice.MergeActions(ice.Actions{
DATA: {Name: "data path type@key field auto create push save draw", Help: "数据表格", Actions: ice.MergeActions(ice.Actions{
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
switch arg[0] {
case mdb.TYPE:
m.Push(arg[0], "折线图", "比例图")
m.Push(arg[0], "比例图", "折线图")
}
}},
mdb.CREATE: {Name: "create path fields value", Hand: func(m *ice.Message, arg ...string) {
m.Cmd("", nfs.SAVE, m.Option(nfs.PATH), kit.Join(kit.Split(m.Option("fields")))+ice.NL+kit.Join(kit.Split(m.Option(mdb.VALUE)))+ice.NL)
mdb.CREATE: {Name: "create path field value", Hand: func(m *ice.Message, arg ...string) {
m.Cmd("", nfs.SAVE, m.Option(nfs.PATH), kit.Join(kit.Split(m.Option(mdb.FIELD)))+ice.NL+kit.Join(kit.Split(m.Option(mdb.VALUE)))+ice.NL)
}},
nfs.PUSH: {Name: "push path record", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
m.Cmd(nfs.PUSH, path.Join(m.Config(nfs.PATH), arg[0]), kit.Join(arg[1:], ice.FS)+ice.NL)
}},
"draw": {Name: "draw", Help: "绘图"},
}}, "draw": {Help: "绘图"},
}, WikiAction(ice.USR_LOCAL_EXPORT, nfs.CSV)), Hand: func(m *ice.Message, arg ...string) {
if !_wiki_list(m, arg...) {
CSV(m, m.Cmdx(nfs.CAT, arg[0])).StatusTimeCount()
@ -37,9 +36,7 @@ func init() {
})
}
func CSV(m *ice.Message, text string, head ...string) *ice.Message {
bio := bytes.NewBufferString(text)
r := csv.NewReader(bio)
r := csv.NewReader(bytes.NewBufferString(text))
if len(head) == 0 {
head, _ = r.Read()
}