mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-25 16:58:06 +08:00
add feature
This commit is contained in:
parent
e3c4301baf
commit
dc63f5ec62
3
src/plugin/feature/index.css
Normal file
3
src/plugin/feature/index.css
Normal file
@ -0,0 +1,3 @@
|
||||
fieldset.item.feature div.output {
|
||||
}
|
||||
|
36
src/plugin/feature/index.go
Normal file
36
src/plugin/feature/index.go
Normal file
@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"contexts/cli"
|
||||
"contexts/ctx"
|
||||
"toolkit"
|
||||
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
var Index = &ctx.Context{Name: `feature`, Help: `plugin`,
|
||||
Caches: map[string]*ctx.Cache{},
|
||||
Configs: map[string]*ctx.Config{
|
||||
"_index": &ctx.Config{Name: "index", Value: []interface{}{
|
||||
map[string]interface{}{"name": "demo", "help": "demo",
|
||||
"tmpl": "componet", "view": "", "init": "",
|
||||
"type": "public", "ctx": "demo", "cmd": "demo",
|
||||
"args": []interface{}{}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "value": "hello world"},
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
},
|
||||
},
|
||||
}},
|
||||
},
|
||||
Commands: map[string]*ctx.Command{
|
||||
"demo": {Name: "demo", Help: "demo", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||
m.Echo(kit.Select("hello world", arg, 0))
|
||||
return
|
||||
}},
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Print(cli.Index.Plugin(Index, os.Args[1:]))
|
||||
}
|
3
src/plugin/feature/index.js
Normal file
3
src/plugin/feature/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
Script["feature/index.js"] = function(field, option, output) {return {
|
||||
}}
|
||||
|
40
src/plugin/feature/index.shy
Normal file
40
src/plugin/feature/index.shy
Normal file
@ -0,0 +1,40 @@
|
||||
fun date "每一天" "index.js" "index.css" protected \
|
||||
text "love" name "table" imports plugin_table view tiny \
|
||||
text "2019-10-16" name "起始时间" \
|
||||
text "" name "截止时间" init date \
|
||||
button "日历" action auto \
|
||||
button "记录" cb data \
|
||||
button "展示" cb show \
|
||||
exports index ""
|
||||
|
||||
if $2 == "" || $3 == ""
|
||||
copy skip ssh.data show _ fields id when where what
|
||||
else
|
||||
copy skip cli.date $2 nature $3 space true format '<span class="%s">%s</span>' "s20060102"
|
||||
end
|
||||
end
|
||||
|
||||
kit progress "任务进度" public "web.team.task" progress \
|
||||
text "task" name table \
|
||||
feature detail prepare action cancel finish \
|
||||
button "查看"
|
||||
|
||||
kit create "创建任务" public "web.team.task" \
|
||||
text "task" name table \
|
||||
text "" name index \
|
||||
select "3" name level values 1 values 2 values 3 values 4 values 5 \
|
||||
select "prepare" name status values prepare values action values finish values cancel \
|
||||
text "" name begin_time init date \
|
||||
text "" name close_time init date \
|
||||
text "" name target view full \
|
||||
textarea "" name detail half "1.5" \
|
||||
button "添加"
|
||||
|
||||
kit select "查看任务" public "web.team.task" \
|
||||
text "task" name table imports pluing_table \
|
||||
text "" name index imports plugin_task_id action auto \
|
||||
button "查看" action auto \
|
||||
button "返回" cb Last \
|
||||
feature detail "修改" "复制" "下载" \
|
||||
exports task_id id
|
||||
|
Loading…
x
Reference in New Issue
Block a user