From 72943d78a9c5070bd20bac6c2969312f68c64e0f Mon Sep 17 00:00:00 2001 From: shylinux Date: Sun, 30 Jul 2023 23:43:18 +0800 Subject: [PATCH] add some --- base/mdb/hash.go | 6 ++++++ base/web/flows.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/base/mdb/hash.go b/base/mdb/hash.go index cb1c8138..8dc2cfab 100644 --- a/base/mdb/hash.go +++ b/base/mdb/hash.go @@ -163,6 +163,12 @@ func StatusHashAction(arg ...Any) ice.Actions { func ClearOnExitHashAction() ice.Actions { return ice.MergeActions(ice.Actions{ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { Conf(m, m.PrefixKey(), HASH, "") }}}) } +func ExportHashAction() ice.Actions { + return ice.Actions{ + ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { HashImport(m, arg) }}, + ice.CTX_EXIT: {Hand: func(m *ice.Message, arg ...string) { HashExport(m, arg) }}, + } +} func HashKey(m *ice.Message) string { if m.Option(HASH) != "" { diff --git a/base/web/flows.go b/base/web/flows.go index b6e96538..d4f480be 100644 --- a/base/web/flows.go +++ b/base/web/flows.go @@ -21,7 +21,7 @@ func init() { mdb.MODIFY: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(mdb.MODIFY, m.PrefixKey(), kit.KeyHash(m.Option(mdb.ZONE)), mdb.HASH, m.OptionSimple(mdb.HASH), arg) }}, - }, ctx.CmdAction(), mdb.HashAction(mdb.SHORT, mdb.ZONE, mdb.FIELD, "time,zone", mdb.FIELDS, "time,hash,space,index,args,prev,from,status")), Hand: func(m *ice.Message, arg ...string) { + }, ctx.CmdAction(), mdb.ExportHashAction(), mdb.HashAction(mdb.SHORT, mdb.ZONE, mdb.FIELD, "time,zone", mdb.FIELDS, "time,hash,space,index,args,prev,from,status")), Hand: func(m *ice.Message, arg ...string) { if arg = kit.Slice(arg, 0, 2); len(arg) == 0 || arg[0] == "" { mdb.HashSelect(m) } else {