1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-02 03:29:25 +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/ctx"
"shylinux.com/x/icebergs/base/gdb" "shylinux.com/x/icebergs/base/gdb"
"shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/tcp" "shylinux.com/x/icebergs/base/tcp"
kit "shylinux.com/x/toolkits" kit "shylinux.com/x/toolkits"
"shylinux.com/x/toolkits/file" "shylinux.com/x/toolkits/file"
) )
func Upload(m *ice.Message) *ice.Message { func Upload(m *ice.Message) *ice.Message {
if up := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); len(up) < 2 { if up := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); len(up) == 0 {
m.Cmdy(CACHE, UPLOAD)
}
return m 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) { func PushNotice(m *ice.Message, arg ...ice.Any) {
if m.Option(ice.MSG_DAEMON) == "" { 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> var _main_template = `<!DOCTYPE html>
<head> <head>
<meta name="viewport" content="width=device-width,initial-scale=0.8,maximum-scale=0.8,user-scalable=no"/> <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>
<title>volcanos</title>
<link rel="shortcut icon" type="image/ico" href="/favicon.ico"> <link rel="shortcut icon" type="image/ico" href="/favicon.ico">
<link rel="stylesheet" href="/page/cache.css"> <link rel="stylesheet" href="/page/cache.css">
<link rel="stylesheet" href="/page/index.css"> <link rel="stylesheet" href="/page/index.css">
@ -183,7 +182,7 @@ var _main_template = `<!DOCTYPE html>
var _cmd_template = `<!DOCTYPE html> var _cmd_template = `<!DOCTYPE html>
<head> <head>
<meta name="viewport" content="width=device-width,initial-scale=0.8,maximum-scale=0.8,user-scalable=no"> <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"> <link rel="stylesheet" href="/page/can.css">
</head> </head>
<body> <body>

View File

@ -5,7 +5,6 @@ import (
"shylinux.com/x/icebergs/base/aaa" "shylinux.com/x/icebergs/base/aaa"
"shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
"shylinux.com/x/icebergs/base/web" "shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits" 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) { }).Length() == 0, ice.ErrNotRight, index, arg) {
return return
} }
if m.Option(ice.MSG_UPLOAD) != "" { if web.Upload(m); !ctx.PodCmd(m, index, arg) {
_action_upload(m)
}
if !ctx.PodCmd(m, index, arg) {
m.Cmdy(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)) m.Cmdy(ctx.COMMAND, msg.Append(mdb.NAME))
break break
} }
if arg[1] = msg.Append(mdb.NAME); m.Option(ice.MSG_UPLOAD) != "" { web.Upload(m)
_action_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" const ACTION = "action"

View File

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

View File

@ -57,7 +57,8 @@ func init() {
mdb.HashCreate(m, m.OptionSimple()) mdb.HashCreate(m, m.OptionSimple())
}}, }},
web.UPLOAD: {Hand: func(m *ice.Message, arg ...string) { 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) { 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))) ctx.ProcessOpen(m, web.MergeURL2(m, web.SHARE_LOCAL+m.Option(mdb.TEXT), "filename", m.Option(mdb.NAME)))

View File

@ -27,7 +27,7 @@ func init() {
func KeyboardAction() ice.Actions { func KeyboardAction() ice.Actions {
return 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", "") 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)) link := tcp.ReplaceLocalhost(m, web.MergePodCmd(m, "", "web.chat.keyboard", mdb.HASH, hash))
m.Push(mdb.NAME, link).PushQRCode(mdb.TEXT, link) m.Push(mdb.NAME, link).PushQRCode(mdb.TEXT, link)

View File

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

View File

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