forked from x/ContextOS
opt code
This commit is contained in:
parent
1a577a7826
commit
256c60b57c
2
go.mod
2
go.mod
@ -2,7 +2,7 @@ module shylinux.com/x/contexts
|
|||||||
|
|
||||||
go 1.11
|
go 1.11
|
||||||
|
|
||||||
require shylinux.com/x/ice v0.7.0
|
require shylinux.com/x/ice v0.6.8
|
||||||
|
|
||||||
require (
|
require (
|
||||||
shylinux.com/x/golang-story v0.3.4
|
shylinux.com/x/golang-story v0.3.4
|
||||||
|
0
src/hi/base.js
Normal file
0
src/hi/base.js
Normal file
5
src/hi/base.sh
Normal file
5
src/hi/base.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
show() {
|
||||||
|
echo "base sh"
|
||||||
|
}
|
34
src/hi/he.js
Normal file
34
src/hi/he.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
Volcanos("onimport", {help: "导入数据", list: [
|
||||||
|
{type: "button", name: "list"},
|
||||||
|
{type: "button", name: "back"},
|
||||||
|
{type: "button", name: "show"},
|
||||||
|
], _init: function(can, msg, cb, target) {
|
||||||
|
can.page.Modify(can, can._legend, "示例")
|
||||||
|
msg.Push("hi", "hello")
|
||||||
|
msg.Push("he", "world")
|
||||||
|
msg.Echo("hello world")
|
||||||
|
can.onmotion.clear(can)
|
||||||
|
can.onappend.table(can, msg)
|
||||||
|
can.onappend.board(can, msg)
|
||||||
|
can.base.isFunc(cb) && cb(msg)
|
||||||
|
}})
|
||||||
|
Volcanos("onaction", {help: "操作数据", list: ["show", "some"],
|
||||||
|
_trans: {show: "展示", some: "其它"},
|
||||||
|
show: function(event, can) { var msg = can.request(event)
|
||||||
|
msg.Push("value", 200)
|
||||||
|
msg.Push("value", 300)
|
||||||
|
msg.Push("value", 300)
|
||||||
|
msg.Push("value", 300)
|
||||||
|
msg.Push("value", 400)
|
||||||
|
msg.Option("height", 400)
|
||||||
|
can.onappend._output(can.sup, msg, "/plugin/story/pie.js")
|
||||||
|
},
|
||||||
|
some: function(event, can) { var msg = can.request(event)
|
||||||
|
msg.Push("hi", "hello")
|
||||||
|
msg.Push("hi", "hello")
|
||||||
|
msg.Push("hi", "hello")
|
||||||
|
msg.Push("hi", "hello")
|
||||||
|
msg.Push("hi", "hello")
|
||||||
|
can.onappend.table(can, msg)
|
||||||
|
},
|
||||||
|
})
|
18
src/hi/hi.go
Normal file
18
src/hi/hi.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package hi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"shylinux.com/x/ice"
|
||||||
|
)
|
||||||
|
|
||||||
|
type hi struct {
|
||||||
|
ice.Zone
|
||||||
|
|
||||||
|
list string `name:"list zone id auto insert" help:"hi"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h hi) List(m *ice.Message, arg ...string) {
|
||||||
|
h.Zone.List(m, arg...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { ice.Cmd("web.code.hi.hi", hi{}) }
|
||||||
|
|
10
src/hi/hi.js
Normal file
10
src/hi/hi.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, cb, target) {
|
||||||
|
msg.Push("hi", "hello")
|
||||||
|
msg.Push("he", "hello")
|
||||||
|
msg.Echo("hello world!\n")
|
||||||
|
msg.Echo("hello world!\n")
|
||||||
|
msg.Echo("hello world!\n")
|
||||||
|
|
||||||
|
can.onmotion.clear(can), can.onappend.table(can, msg), can.onappend.board(can, msg)
|
||||||
|
can.base.isFunc(cb) && cb(msg)
|
||||||
|
}})
|
1
src/hi/hi.py
Normal file
1
src/hi/hi.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
print "hello world"
|
10
src/hi/hi.sh
Normal file
10
src/hi/hi.sh
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
source hi/base.sh
|
||||||
|
date
|
||||||
|
uptime
|
||||||
|
uname
|
||||||
|
echo "hello world"
|
||||||
|
echo "hello world"
|
||||||
|
echo "hello world"
|
||||||
|
env
|
9
src/hi/hi.shy
Normal file
9
src/hi/hi.shy
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
chapter "hi"
|
||||||
|
|
||||||
|
field "hi" web.code.hi.hi
|
||||||
|
field "hi" web.code.hi.hi
|
||||||
|
field "hi" web.code.hi.hi
|
||||||
|
field "hi" web.code.hi.hi
|
||||||
|
field "hi" web.code.hi.hi
|
||||||
|
field "hi" web.code.hi.hi
|
||||||
|
field "hi" web.code.hi.hi
|
@ -1,6 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
_ "shylinux.com/x/contexts/src/hi"
|
||||||
|
|
||||||
"shylinux.com/x/ice"
|
"shylinux.com/x/ice"
|
||||||
|
|
||||||
_ "shylinux.com/x/icebergs/misc/alpha"
|
_ "shylinux.com/x/icebergs/misc/alpha"
|
||||||
|
@ -40,3 +40,4 @@ find . -name "*.css" -exec sed -i 's/: /:/g' {} +
|
|||||||
`
|
`
|
||||||
|
|
||||||
source hi/hi.shy
|
source hi/hi.shy
|
||||||
|
source hi/hi.shy
|
@ -3,14 +3,7 @@ hi
|
|||||||
nfs.dir
|
nfs.dir
|
||||||
cli.qrcode
|
cli.qrcode
|
||||||
cli.runtime
|
cli.runtime
|
||||||
cli.runtime
|
|
||||||
cli.runtime
|
|
||||||
cli.runtime
|
|
||||||
cli.runtime
|
|
||||||
web.code.hi.hi
|
web.code.hi.hi
|
||||||
he
|
he
|
||||||
cli.runtime
|
cli.runtime
|
||||||
web.code.hi.hi
|
web.code.hi.hi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user