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-08-09 15:14:53 +08:00
parent c676c9d024
commit 268d363a57
2 changed files with 8 additions and 2 deletions

View File

@ -173,13 +173,19 @@ const DIR = "dir"
func init() { func init() {
Index.MergeCommands(ice.Commands{ Index.MergeCommands(ice.Commands{
DIR: {Name: "dir path field auto upload", Help: "目录", Actions: ice.Actions{ DIR: {Name: "dir path field auto upload what", Help: "目录", Actions: ice.Actions{
mdb.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) { mdb.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy("web.cache", "upload_watch", m.Option(PATH)) m.Cmdy("web.cache", "upload_watch", m.Option(PATH))
}}, }},
TRASH: {Name: "trash", Help: "删除", Hand: func(m *ice.Message, arg ...string) { TRASH: {Name: "trash", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(TRASH, mdb.CREATE, m.Option(PATH)) m.Cmdy(TRASH, mdb.CREATE, m.Option(PATH))
}}, }},
"what": {Name: "trash", Help: "what", Hand: func(m *ice.Message, arg ...string) {
m.Option(DIR_ROOT, "usr/volcanos/plugin/local/code/inner/")
m.Option(DIR_DEEP, "true")
m.Cmdy(DIR, PWD)
m.Sort("path")
}},
}, Hand: func(m *ice.Message, arg ...string) { }, Hand: func(m *ice.Message, arg ...string) {
if m.Option(DIR_ROOT) != "" { if m.Option(DIR_ROOT) != "" {
m.Logs(mdb.SELECT, DIR_ROOT, m.Option(DIR_ROOT)) m.Logs(mdb.SELECT, DIR_ROOT, m.Option(DIR_ROOT))

View File

@ -17,7 +17,7 @@ import (
func _binpack_file(m *ice.Message, w io.Writer, arg ...string) { // file name func _binpack_file(m *ice.Message, w io.Writer, arg ...string) { // file name
if f, e := nfs.OpenFile(m, arg[0]); e == nil { if f, e := nfs.OpenFile(m, arg[0]); e == nil {
defer f.Close() defer f.Close()
if b, e := ioutil.ReadAll(f); e == nil && len(b) > 0 { if b, _ := ioutil.ReadAll(f); len(b) > 0 {
fmt.Fprintf(w, " \"%s\": \"%s\",\n", kit.Select(arg[0], arg, 1), base64.StdEncoding.EncodeToString(b)) fmt.Fprintf(w, " \"%s\": \"%s\",\n", kit.Select(arg[0], arg, 1), base64.StdEncoding.EncodeToString(b))
return return
} }