forked from x/icebergs
opt some
This commit is contained in:
parent
ef5b8d7890
commit
0600cd4e32
60
build.sh
Executable file
60
build.sh
Executable file
@ -0,0 +1,60 @@
|
||||
#! /bin/sh
|
||||
|
||||
ice_sh=${ice_sh:="ice.sh"}
|
||||
|
||||
prepare() {
|
||||
[ -f main.go ] || cat >> main.go <<END
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/shylinux/icebergs"
|
||||
_ "github.com/shylinux/icebergs/base"
|
||||
_ "github.com/shylinux/icebergs/core"
|
||||
_ "github.com/shylinux/icebergs/misc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
println(ice.Run())
|
||||
}
|
||||
END
|
||||
|
||||
[ -f go.mod ] || go mod init ${PWD##**/}
|
||||
|
||||
[ -f ${ice_sh} ] || cat >> ${ice_sh} <<END
|
||||
#! /bin/sh
|
||||
|
||||
export PATH=\${PWD}/bin:\${PWD}:\$PATH
|
||||
prepare() {
|
||||
which ice.bin && return
|
||||
curl -s https://shylinux.com/publish/ice.bin -o bin/ice.bin
|
||||
}
|
||||
start() {
|
||||
prepare && while true; do
|
||||
date && ice.bin \$@ 2>boot.log && echo -e "\n\nrestarting..." || break
|
||||
done
|
||||
}
|
||||
restart() {
|
||||
kill -2 \`cat var/run/shy.pid\`
|
||||
}
|
||||
shutdown() {
|
||||
kill -3 \`cat var/run/shy.pid\`
|
||||
}
|
||||
|
||||
cmd=\$1 && shift
|
||||
[ -z "\$cmd" ] && cmd=start
|
||||
\$cmd \$*
|
||||
END
|
||||
chmod u+x ${ice_sh}
|
||||
|
||||
[ -f Makefile ] || cat >> Makefile <<END
|
||||
all:
|
||||
go build -o bin/ice.bin main.go && chmod u+x bin/ice.bin && ./${ice_sh} restart
|
||||
END
|
||||
}
|
||||
|
||||
build() {
|
||||
[ "$1" != "" ] && mkdir $1 && cd $1
|
||||
prepare && go build -o bin/ice.bin main.go && chmod u+x bin/ice.bin && ./${ice_sh}
|
||||
}
|
||||
|
||||
build $*
|
38
core/team/miss.js
Normal file
38
core/team/miss.js
Normal file
@ -0,0 +1,38 @@
|
||||
Volcanos("onimport", {help: "导入数据", list: [],
|
||||
init: function(can, msg, cb, output, option) {output.innerHTML = "";
|
||||
if (!msg.append || msg.append.length == 0) {
|
||||
var code = can.page.Append(can, output, [{view: ["code", "div", msg.Result()]}]).code;
|
||||
return typeof cb == "function" && cb(msg), code;
|
||||
}
|
||||
|
||||
var table = can.page.AppendTable(can, output, msg, msg.append);
|
||||
table.oncontextmenu = function(event) {var target = event.target; var data = target.dataset;
|
||||
switch (event.target.tagName) {
|
||||
case "SPAN":
|
||||
can.user.carte(event, shy("", can.ondetail, can.feature.detail || can.ondetail.list, function(event, cmd, meta) {
|
||||
var id = data.id;
|
||||
can.run(event, [id, cmd], function(msg) {
|
||||
can.onimport.init(can, msg, cb, output, option)
|
||||
can.user.toast(cmd+"成功");
|
||||
}, true)
|
||||
}))
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
break
|
||||
case "TH":
|
||||
case "TR":
|
||||
case "TABLE":
|
||||
}
|
||||
}
|
||||
return typeof cb == "function" && cb(msg), table;
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {help: "组件交互", list: [],
|
||||
})
|
||||
Volcanos("onchoice", {help: "组件菜单", list: [],
|
||||
})
|
||||
Volcanos("ondetail", {help: "组件详情", list: [],
|
||||
})
|
||||
Volcanos("onexport", {help: "导出数据", list: [],
|
||||
})
|
||||
|
16
core/team/stat.js
Normal file
16
core/team/stat.js
Normal file
@ -0,0 +1,16 @@
|
||||
Volcanos("onimport", {help: "导入数据", list: [],
|
||||
init: function(can, msg, cb, output, option) {output.innerHTML = "";
|
||||
msg.Table(function(value, index) {
|
||||
can.page.Append(can, output, [{view: ["stat", "div", "hello"]}])
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {help: "组件交互", list: [],
|
||||
})
|
||||
Volcanos("onchoice", {help: "组件菜单", list: [],
|
||||
})
|
||||
Volcanos("ondetail", {help: "组件详情", list: [],
|
||||
})
|
||||
Volcanos("onexport", {help: "导出数据", list: [],
|
||||
})
|
||||
|
@ -1,9 +0,0 @@
|
||||
github.com/gomarkdown/markdown v0.0.0-20191207194928-fbea82c4bb03 h1:m13UZm540+0yrpGOIXd7q4AvPGQPSTo+2jxrBK26o64=
|
||||
github.com/gomarkdown/markdown v0.0.0-20191207194928-fbea82c4bb03/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU=
|
||||
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/shylinux/icebergs v0.0.0-20191214121808-47bb65632d9d h1:154JIv2bSmesyjggRhH1lQKZ6WmvnvDQfWvQiWqvAbk=
|
||||
github.com/shylinux/icebergs v0.0.0-20191214121808-47bb65632d9d/go.mod h1:lDuCMlmptkcvDfdAfRGo/Dt0xLS/cOaIXnliLYwpFWA=
|
||||
github.com/shylinux/toolkits v0.0.0-20191205193931-8b65f7e78477 h1:xwu6cGDBy/ZCrVklmCqSgx9O7Hr1v+hkzsIh1yc0hxg=
|
||||
github.com/shylinux/toolkits v0.0.0-20191205193931-8b65f7e78477/go.mod h1:e1dV0lMyoKz4Luib6XyMNpfpn5Sn7POnq7XTT4wfN7k=
|
||||
golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ=
|
Loading…
x
Reference in New Issue
Block a user