mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt some
This commit is contained in:
parent
87bb0d8dbc
commit
a63831976b
@ -15,20 +15,19 @@ const DATA = "data"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
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) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
case mdb.TYPE:
|
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) {
|
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("fields")))+ice.NL+kit.Join(kit.Split(m.Option(mdb.VALUE)))+ice.NL)
|
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) {
|
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)
|
m.Cmd(nfs.PUSH, path.Join(m.Config(nfs.PATH), arg[0]), kit.Join(arg[1:], ice.FS)+ice.NL)
|
||||||
}},
|
}}, "draw": {Help: "绘图"},
|
||||||
"draw": {Name: "draw", Help: "绘图"},
|
|
||||||
}, WikiAction(ice.USR_LOCAL_EXPORT, nfs.CSV)), Hand: func(m *ice.Message, arg ...string) {
|
}, WikiAction(ice.USR_LOCAL_EXPORT, nfs.CSV)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if !_wiki_list(m, arg...) {
|
if !_wiki_list(m, arg...) {
|
||||||
CSV(m, m.Cmdx(nfs.CAT, arg[0])).StatusTimeCount()
|
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 {
|
func CSV(m *ice.Message, text string, head ...string) *ice.Message {
|
||||||
bio := bytes.NewBufferString(text)
|
r := csv.NewReader(bytes.NewBufferString(text))
|
||||||
r := csv.NewReader(bio)
|
|
||||||
|
|
||||||
if len(head) == 0 {
|
if len(head) == 0 {
|
||||||
head, _ = r.Read()
|
head, _ = r.Read()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user