forked from x/icebergs
opt some
This commit is contained in:
parent
4ccf56a3d2
commit
b3b37b37d5
@ -54,7 +54,7 @@ func _dream_start(m *ice.Message, name string) {
|
||||
defer m.Sleep("1s")
|
||||
m.Options(cli.CMD_DIR, kit.Path(p), cli.CMD_ENV, kit.Simple(
|
||||
cli.CTX_OPS, Domain(tcp.LOCALHOST, m.Cmdv(SERVE, tcp.PORT)), cli.CTX_LOG, ice.VAR_LOG_BOOT_LOG, cli.CTX_PID, ice.VAR_LOG_ICE_PID,
|
||||
cli.PATH, cli.BinPath(p, ""), cli.USER, ice.Info.Username, kit.EnvSimple(cli.HOME, cli.TERM, cli.SHELL), mdb.Configv(m, cli.ENV),
|
||||
cli.PATH, cli.BinPath(p, ""), cli.USER, ice.Info.Username, kit.EnvSimple(cli.HOME, cli.TERM, cli.SHELL, "USERPROFILE"), mdb.Configv(m, cli.ENV),
|
||||
), cli.CMD_OUTPUT, path.Join(p, ice.VAR_LOG_BOOT_LOG), mdb.CACHE_CLEAR_ONEXIT, ice.TRUE)
|
||||
defer m.Options(cli.CMD_DIR, "", cli.CMD_ENV, "", cli.CMD_OUTPUT, "")
|
||||
gdb.Event(m, DREAM_CREATE, m.OptionSimple(mdb.NAME, mdb.TYPE))
|
||||
|
@ -105,7 +105,9 @@ func init() {
|
||||
PP(SHARE, CACHE): {Hand: func(m *ice.Message, arg ...string) { _share_cache(m, arg...) }},
|
||||
PP(SHARE, LOCAL): {Hand: func(m *ice.Message, arg ...string) { ShareLocalFile(m, arg...) }},
|
||||
PP(SHARE, PROXY): {Hand: func(m *ice.Message, arg ...string) { _share_proxy(m) }},
|
||||
PP(SHARE, TOAST): {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(SPACE, arg[0], kit.UnMarshal(m.Option(ice.ARG))) }},
|
||||
PP(SHARE, TOAST): {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Options(ice.LOG_DISABLE, ice.TRUE).Cmdy(SPACE, arg[0], kit.UnMarshal(m.Option(ice.ARG)))
|
||||
}},
|
||||
})
|
||||
}
|
||||
func IsNotValidShare(m *ice.Message, time string) bool {
|
||||
|
@ -6,7 +6,7 @@ fieldset.macos.desktop>div.output>fieldset.macos.searchs { position:absolute; }
|
||||
fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.icon.delete { display:none; }
|
||||
fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword input { width:320px; background-color:transparent; border:#404141 solid 1px; }
|
||||
fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword:hover { background-color:transparent; }
|
||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications { border-radius:0; height:calc(100% - 25px); width:250px; overflow:auto; position:absolute; top:25px; right:0; }
|
||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications { border-radius:0; height:calc(100% - 125px); width:250px; overflow:auto; position:absolute; top:25px; right:0; }
|
||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.action>div.item { margin-top:10px; }
|
||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.action>div.item input { background-color:transparent; }
|
||||
fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.output>div.item { margin-top:10px; margin-right:10px; min-height:60px; clear:both; }
|
||||
@ -75,6 +75,7 @@ body.dark fieldset.macos.desktop>div.output { background-color:unset; }
|
||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos { background-color:#08234ad1; }
|
||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.notifications { background-color:transparent; }
|
||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item { background-color:#08234ad1; }
|
||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.notifications>div.output>div.item { width:240px; }
|
||||
body.dark fieldset.macos.desktop>div.output>fieldset.macos.searchs a { color:silver; }
|
||||
body.dark fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#333434; }
|
||||
body.dark fieldset.macos.desktop>div.output>div.desktop fieldset input { background-color:#333434; border:#404141 solid 1px; }
|
||||
|
@ -28,12 +28,11 @@ Volcanos(chat.ONIMPORT, {
|
||||
can.onmotion.hidden(can, sub._target)
|
||||
}) },
|
||||
_notifications: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.notifications", style: html.OUTPUT}, function(sub) { can.ui.notifications = sub
|
||||
can.ConfHeight() < 800 && can.onmotion.delay(can, function() { can.onmotion.hidden(can, sub._target) }), can.onmotion.hidden(can, sub._target)
|
||||
sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) }
|
||||
can.ConfHeight() < 800 && can.onmotion.delay(can, function() { can.onmotion.hidden(can, sub._target) })
|
||||
can.onmotion.hidden(can, sub._target)
|
||||
}) },
|
||||
_dock: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.dock", style: html.OUTPUT}, function(sub) { can.ui.dock = sub
|
||||
sub.onexport.output = function(sub, msg) { can.page.style(can, sub._target, html.LEFT, can.base.Min((can.ConfWidth()-msg.Length()*80)/2, 0)) }
|
||||
sub.onexport.output = function(sub, msg) { can.onimport.layout(can) }
|
||||
sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) }
|
||||
}) },
|
||||
_item: function(can, item) { can.runAction(can.request(event, item), mdb.CREATE, [], function() { can.run(event, [], function(msg) {
|
||||
@ -50,9 +49,9 @@ Volcanos(chat.ONIMPORT, {
|
||||
target.ondragend = function() { can.onimport._item(can, window._drag_item) }
|
||||
},
|
||||
_window: function(can, item) { if (!item.index) { return }
|
||||
item.left = 100, item.top = 125, item.height = can.base.Min(can.ConfHeight()-400, 480, 800), item.width = can.base.Min(can.ConfWidth()-400, 640, 1000)
|
||||
if (can.ConfHeight() < 800) { item.top = 25, item.height = can.ConfHeight()-165 }
|
||||
if (can.user.isMobile) { item.left = 0, item.top = 25 }
|
||||
item.left = 100, item.top = 125, item.height = can.base.Min(can.ConfHeight()-345, 480, 800), item.width = can.base.Min(can.ConfWidth()-360, 640, 1000)
|
||||
if (can.ConfHeight() < 800) { item.top = 25, item.height = can.ConfHeight()-145, item.width = can.ConfWidth()-110 }
|
||||
if (can.user.isMobile) { item.left = 0, item.top = 25, item.height = can.ConfHeight()-145, item.width = can.ConfWidth() }
|
||||
can.onappend.plugin(can, item, function(sub) { can.ondetail.select(can, sub._target)
|
||||
var index = 0; can.core.Item({
|
||||
"#f95f57": function(event) { sub.onaction.close(event, sub) },
|
||||
@ -110,9 +109,7 @@ Volcanos(chat.ONFIGURE, {
|
||||
return {view: [html.ITEM, "", value.name],
|
||||
onclick: function() { can.onimport.session(can, can.base.Obj(value.args, [])) },
|
||||
oncontextmenu: function(event) { can.user.carteRight(event, can, {
|
||||
open: function() {
|
||||
can.user.open(can.misc.MergePodCmd(can, {cmd: "desktop", session: value.name}))
|
||||
},
|
||||
open: function() { can.user.open(can.misc.MergePodCmd(can, {cmd: "desktop", session: value.name})) },
|
||||
remove: function() { can.runActionCommand(event, "session", [mdb.REMOVE, value.name], function() { can.user.toastSuccess(can, "session removed") }) },
|
||||
}, [], function() {}, _carte) },
|
||||
}
|
||||
|
@ -16,5 +16,12 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { can.onmotion.clear(can), c
|
||||
"add to dock": function() { can.sup.onappend.dock(item) },
|
||||
}, []) }, draggable: true, ondragstart: function(event) { window._drag_item = item },
|
||||
})}) },
|
||||
layout: function(can) { can.ui.layout(can.ConfHeight(), can.ConfWidth()) },
|
||||
layout: function(can) {
|
||||
var width = can.ConfWidth()-(can.ui? can.ui.project.offsetWidth: 0)
|
||||
var margin = width%80/parseInt(width/80)/2
|
||||
can.page.SelectChild(can, can.ui.content, mdb.FOREACH, function(target) {
|
||||
can.page.style(can, target, html.MARGIN, margin)
|
||||
})
|
||||
can.ui.layout(can.ConfHeight(), can.ConfWidth())
|
||||
},
|
||||
})
|
||||
|
@ -36,6 +36,7 @@ func _autogen_module(m *ice.Message, file string) { m.Cmd(nfs.DEFS, file, nfs.Te
|
||||
func _autogen_import(m *ice.Message, main string, ctx string, mod string) {
|
||||
// m.Cmd(nfs.DEFS, main, nfs.Template(m, ice.SRC_MAIN_GO))
|
||||
m.Cmd(nfs.DEFS, ice.MAKEFILE, m.Cmdx(nfs.CAT, ice.MAKEFILE))
|
||||
m.Cmd(nfs.DEFS, ice.LICENSE, m.Cmdx(nfs.CAT, ice.LICENSE))
|
||||
m.Cmd(nfs.DEFS, main, m.Cmdx(nfs.CAT, ice.SRC_MAIN_GO))
|
||||
begin, done, list := false, false, []string{}
|
||||
m.Cmd(nfs.CAT, main, func(line string, index int) {
|
||||
|
@ -69,6 +69,15 @@ const XTERM = "xterm"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
XTERM: {Name: "xterm hash auto", Help: "命令行", Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.IsSearchForEach(m, arg, func() []string {
|
||||
if nfs.Exists(m, "/bin/bash") {
|
||||
return []string{ssh.SHELL, BASH, "/bin/bash"}
|
||||
} else {
|
||||
return []string{ssh.SHELL, SH, "/bin/sh"}
|
||||
}
|
||||
})
|
||||
}},
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
switch mdb.HashInputs(m, arg); arg[0] {
|
||||
case mdb.TYPE:
|
||||
|
@ -91,7 +91,7 @@ func init() {
|
||||
wiki.AddChart(CHAIN, func(m *ice.Message) wiki.Chart {
|
||||
m.Option(wiki.FONT_SIZE, "18")
|
||||
m.Option(wiki.MARGINX, "60")
|
||||
m.Option(wiki.MARGINY, "20")
|
||||
m.Option(wiki.MARGINY, "16")
|
||||
m.Option(wiki.PADDING, "10")
|
||||
wiki.AddGroupOption(m, SHIP, wiki.FILL, cli.GLASS)
|
||||
return &Chain{}
|
||||
|
@ -160,7 +160,9 @@ func init() {
|
||||
} else if config, err := config.LoadConfig(config.GlobalScope); err == nil && config.User.Email == "" && mdb.Config(m, aaa.EMAIL) == "" {
|
||||
m.Action(CONFIGS).Echo("please config email and name. ").EchoButton(CONFIGS)
|
||||
} else if len(arg) == 0 {
|
||||
m.Option(aaa.EMAIL, kit.Select(mdb.Config(m, aaa.EMAIL), config.User.Email))
|
||||
if config != nil {
|
||||
m.Option(aaa.EMAIL, kit.Select(mdb.Config(m, aaa.EMAIL), config.User.Email))
|
||||
}
|
||||
m.Cmdy(REPOS, STATUS).Action(PULL, PUSH, "oauth", CONFIGS)
|
||||
} else {
|
||||
m.Cmdy(REPOS, arg[0], MASTER, INDEX, m.Cmdv(REPOS, arg[0], MASTER, INDEX, nfs.FILE))
|
||||
|
@ -34,7 +34,9 @@ func Render(m *Message, cmd string, args ...Any) string {
|
||||
}
|
||||
kit.For(kit.Split(k), func(k string) { list = append(list, kit.Format(`<input type="button" name="%s" value="%s">`, k, k)) })
|
||||
case Map:
|
||||
kit.For(k, func(k, v string) { list = append(list, kit.Format(`<input type="button" name="%s" value="%s">`, k, v)) })
|
||||
kit.For(k, func(k, v string) {
|
||||
list = append(list, kit.Format(`<input type="button" name="%s" value="%s">`, k, kit.Select(k, v, m.Option(MSG_LANGUAGE) == "zh")))
|
||||
})
|
||||
default:
|
||||
list = append(list, Render(m, RENDER_BUTTON, kit.LowerCapital(kit.Format(k))))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user