1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
root 2025-02-02 23:53:03 +08:00
parent 00d0a3f449
commit 54211e220d
2 changed files with 11 additions and 2 deletions

View File

@ -21,6 +21,7 @@ const (
USR_IMAGE = "usr/image/" USR_IMAGE = "usr/image/"
USR_COVER = "usr/cover/" USR_COVER = "usr/cover/"
USR_AVATAR = "usr/avatar/" USR_AVATAR = "usr/avatar/"
USR_MATERIAL = "usr/material/"
USR_ICONS = "usr/icons/" USR_ICONS = "usr/icons/"
USR_ICONS_AVATAR = "usr/icons/avatar.jpg" USR_ICONS_AVATAR = "usr/icons/avatar.jpg"
USR_ICONS_BACKGROUND = "usr/icons/background.jpg" USR_ICONS_BACKGROUND = "usr/icons/background.jpg"
@ -88,11 +89,12 @@ func init() {
}, chat.FavorAction(), WikiAction("", "ico|png|PNG|gif|jpg|JPG|jpeg|mp4|m4v|mov|MOV|webm|mp3"), mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path,name,cover")), Hand: func(m *ice.Message, arg ...string) { }, chat.FavorAction(), WikiAction("", "ico|png|PNG|gif|jpg|JPG|jpeg|mp4|m4v|mov|MOV|webm|mp3"), mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path,name,cover")), Hand: func(m *ice.Message, arg ...string) {
if len(kit.Slice(arg, 0, 1)) == 0 { if len(kit.Slice(arg, 0, 1)) == 0 {
if mdb.HashSelect(m); aaa.IsTechOrRoot(m) { if mdb.HashSelect(m); aaa.IsTechOrRoot(m) {
m.Push(nfs.PATH, USR_AVATAR).Push(mdb.NAME, "头像库").Push(COVER, USR_ICONS_AVATAR) // m.Push(nfs.PATH, USR_AVATAR).Push(mdb.NAME, "头像库").Push(COVER, USR_ICONS_AVATAR)
m.Push(nfs.PATH, USR_LOCAL_IMAGE).Push(mdb.NAME, "私有库").Push(COVER, USR_ICONS_BACKGROUND) m.Push(nfs.PATH, USR_LOCAL_IMAGE).Push(mdb.NAME, "私有库").Push(COVER, USR_ICONS_BACKGROUND)
} }
m.Push(nfs.PATH, USR_IMAGE).Push(mdb.NAME, "图片库").Push(COVER, USR_ICONS_BACKGROUND) m.Push(nfs.PATH, USR_IMAGE).Push(mdb.NAME, "图片库").Push(COVER, USR_ICONS_BACKGROUND)
m.Push(nfs.PATH, USR_COVER).Push(mdb.NAME, "封面库").Push(COVER, USR_ICONS_BACKGROUND) m.Push(nfs.PATH, USR_COVER).Push(mdb.NAME, "封面库").Push(COVER, USR_ICONS_BACKGROUND)
m.Push(nfs.PATH, USR_MATERIAL).Push(mdb.NAME, "素材库").Push(COVER, SRC_MAIN)
m.Push(nfs.PATH, USR_ICONS).Push(mdb.NAME, "图标库").Push(COVER, SRC_MAIN) m.Push(nfs.PATH, USR_ICONS).Push(mdb.NAME, "图标库").Push(COVER, SRC_MAIN)
} else { } else {
if _wiki_list(m, kit.Slice(arg, 0, 1)...); arg[0] == USR_ICONS { if _wiki_list(m, kit.Slice(arg, 0, 1)...); arg[0] == USR_ICONS {

View File

@ -1,6 +1,9 @@
package wiki package wiki
import ( import (
"path"
"strings"
ice "shylinux.com/x/icebergs" ice "shylinux.com/x/icebergs"
) )
@ -8,7 +11,11 @@ const VIDEO = "video"
func init() { func init() {
Index.MergeCommands(ice.Commands{ Index.MergeCommands(ice.Commands{
VIDEO: {Name: "video path", Help: "视频", Hand: func(m *ice.Message, arg ...string) { VIDEO: {Name: "video path", Help: "视频", Actions: ice.Actions{
"material": {Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(VIDEO, path.Join("usr/material", strings.TrimPrefix(path.Dir(m.Option("_script")), "usr/"), arg[0]))
}},
}, Hand: func(m *ice.Message, arg ...string) {
arg = _name(m, arg) arg = _name(m, arg)
_image_show(m, arg[0], arg[1], arg[2:]...) _image_show(m, arg[0], arg[1], arg[2:]...)
}}, }},