1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-01 19:19:24 +08:00
This commit is contained in:
harveyshao 2022-11-18 14:40:42 +08:00
parent e2f4769e95
commit 6c10855648
8 changed files with 32 additions and 42 deletions

View File

@ -12,16 +12,22 @@ import (
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/gdb"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/tcp"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/toolkits/file"
)
func Upload(m *ice.Message) *ice.Message {
if up := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); len(up) < 2 {
m.Cmdy(CACHE, UPLOAD)
}
if up := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); len(up) == 0 {
return m
} else if len(up) < 2 {
msg := m.Cmd(CACHE, UPLOAD)
m.Option(ice.MSG_UPLOAD, msg.Append(mdb.HASH), msg.Append(mdb.NAME), msg.Append(nfs.SIZE))
return msg
} else {
return m.Cmd(CACHE, up[0])
}
}
func PushNotice(m *ice.Message, arg ...ice.Any) {
if m.Option(ice.MSG_DAEMON) == "" {

View File

@ -166,9 +166,8 @@ func RenderCmd(m *ice.Message, cmd string, arg ...ice.Any) {
var _main_template = `<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=0.8,maximum-scale=0.8,user-scalable=no"/>
<meta charset="utf-8">
<title>volcanos</title>
<meta name="viewport" content="width=device-width,initial-scale=0.8,maximum-scale=0.8,user-scalable=no">
<meta charset="utf-8"><title>volcanos</title>
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
<link rel="stylesheet" href="/page/cache.css">
<link rel="stylesheet" href="/page/index.css">
@ -183,7 +182,7 @@ var _main_template = `<!DOCTYPE html>
var _cmd_template = `<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=0.8,maximum-scale=0.8,user-scalable=no">
<meta charset="utf-8">
<meta charset="utf-8"><title>volcanos</title>
<link rel="stylesheet" href="/page/can.css">
</head>
<body>

View File

@ -5,7 +5,6 @@ import (
"shylinux.com/x/icebergs/base/aaa"
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
)
@ -22,10 +21,7 @@ func _action_exec(m *ice.Message, river, storm, index string, arg ...string) {
}).Length() == 0, ice.ErrNotRight, index, arg) {
return
}
if m.Option(ice.MSG_UPLOAD) != "" {
_action_upload(m)
}
if !ctx.PodCmd(m, index, arg) {
if web.Upload(m); !ctx.PodCmd(m, index, arg) {
m.Cmdy(index, arg)
}
}
@ -62,15 +58,9 @@ func _action_share(m *ice.Message, arg ...string) {
m.Cmdy(ctx.COMMAND, msg.Append(mdb.NAME))
break
}
if arg[1] = msg.Append(mdb.NAME); m.Option(ice.MSG_UPLOAD) != "" {
_action_upload(m)
web.Upload(m)
m.Cmdy(msg.Append(mdb.NAME), arg[2:])
}
m.Cmdy(arg[1:])
}
}
func _action_upload(m *ice.Message) {
msg := m.Cmdy(web.CACHE, web.UPLOAD)
m.Option(ice.MSG_UPLOAD, msg.Append(mdb.HASH), msg.Append(mdb.NAME), msg.Append(nfs.SIZE))
}
const ACTION = "action"

View File

@ -6,23 +6,22 @@ search.go
action.go
river.go
storm.go
pod.go
cmd.go
grant.go
sso.go
pod.go
cmd.go
favor.go
iframe.go
keyboard.go
location.go
location.shy
div.go
topic.go
website.go
template.go
location.go
location.shy
trans.go
room.go
meet.go
room.go
oauth

View File

@ -57,13 +57,14 @@ func init() {
mdb.HashCreate(m, m.OptionSimple())
}},
web.UPLOAD: {Hand: func(m *ice.Message, arg ...string) {
web.Upload(m).Cmd("", mdb.CREATE, m.AppendSimple(mdb.TYPE, mdb.NAME, mdb.TEXT))
msg := web.Upload(m)
m.Cmd("", mdb.CREATE, msg.AppendSimple(mdb.TYPE, mdb.NAME, mdb.TEXT))
}},
web.DOWNLOAD: {Hand: func(m *ice.Message, arg ...string) {
ctx.ProcessOpen(m, web.MergeURL2(m, web.SHARE_LOCAL+m.Option(mdb.TEXT), "filename", m.Option(mdb.NAME)))
}},
web.DISPLAY: {Help: "预览", Hand: func(m *ice.Message, arg ...string) {
if link := web.SHARE_LOCAL+m.Option(mdb.TEXT); _favor_is_image(m, m.Option(mdb.NAME), m.Option(mdb.TYPE)) {
if link := web.SHARE_LOCAL + m.Option(mdb.TEXT); _favor_is_image(m, m.Option(mdb.NAME), m.Option(mdb.TYPE)) {
m.EchoImages(link)
} else if _favor_is_video(m, m.Option(mdb.NAME), m.Option(mdb.TYPE)) {
m.EchoVideos(link)

View File

@ -27,7 +27,7 @@ func init() {
func KeyboardAction() ice.Actions {
return ice.Actions{
KEYBOARD: {Help: "远程控制", Hand: func(m *ice.Message, arg ...string) {
KEYBOARD: {Hand: func(m *ice.Message, arg ...string) {
hash := m.Cmdx("web.chat.keyboard", mdb.CREATE, web.SPACE, m.Option(ice.MSG_DAEMON), ctx.INDEX, m.Option(ctx.INDEX), "input", "")
link := tcp.ReplaceLocalhost(m, web.MergePodCmd(m, "", "web.chat.keyboard", mdb.HASH, hash))
m.Push(mdb.NAME, link).PushQRCode(mdb.TEXT, link)

View File

@ -1,8 +1,5 @@
chapter "源码"
code.go
code.shy
section "流程"
install.go
upgrade.go
webpack.go
@ -11,7 +8,6 @@ autogen.go
compile.go
publish.go
section "工具"
favor.go
xterm.go
xterm.shy
@ -22,7 +18,6 @@ bench.go
oauth.go
case.go
section "语言"
c.go
sh.go
py.go

View File

@ -1,6 +1,6 @@
chapter "团队"
field web.team.todo
field web.team.epic
field web.team.task
field web.team.plan
team.shy
team.go
plan.go
task.go
todo.go
epic.go