mirror of
https://shylinux.com/x/icebergs
synced 2025-05-01 19:19:24 +08:00
opt chat
This commit is contained in:
parent
e2f4769e95
commit
6c10855648
@ -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
|
||||||
|
} 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])
|
||||||
}
|
}
|
||||||
return m
|
|
||||||
}
|
}
|
||||||
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) == "" {
|
||||||
|
@ -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>
|
||||||
|
@ -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,16 +58,10 @@ 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"
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -50,20 +50,21 @@ func init() {
|
|||||||
"getClipboardData": {Name: "favor create", Help: "粘贴"},
|
"getClipboardData": {Name: "favor create", Help: "粘贴"},
|
||||||
"getLocation": {Name: "favor create", Help: "定位"},
|
"getLocation": {Name: "favor create", Help: "定位"},
|
||||||
"scanQRCode": {Name: "favor create", Help: "扫码"},
|
"scanQRCode": {Name: "favor create", Help: "扫码"},
|
||||||
"record1": {Name: "favor upload", Help: "截图"},
|
"record1": {Name: "favor upload", Help: "截图"},
|
||||||
"record2": {Name: "favor upload", Help: "录屏"},
|
"record2": {Name: "favor upload", Help: "录屏"},
|
||||||
mdb.CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.OptionDefault(mdb.TYPE, mdb.LINK, mdb.NAME, kit.ParseURL(m.Option(mdb.TEXT)).Host)
|
m.OptionDefault(mdb.TYPE, mdb.LINK, mdb.NAME, kit.ParseURL(m.Option(mdb.TEXT)).Host)
|
||||||
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)))
|
||||||
}},
|
}},
|
||||||
web.DISPLAY: {Help: "预览", Hand: func(m *ice.Message, arg ...string) {
|
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)
|
m.EchoImages(link)
|
||||||
} else if _favor_is_video(m, m.Option(mdb.NAME), m.Option(mdb.TYPE)) {
|
} else if _favor_is_video(m, m.Option(mdb.NAME), m.Option(mdb.TYPE)) {
|
||||||
m.EchoVideos(link)
|
m.EchoVideos(link)
|
||||||
|
@ -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)
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user