From dc63f5ec6220cee47b39a6bd96976ebe60e4a970 Mon Sep 17 00:00:00 2001 From: shaoying Date: Sun, 17 Nov 2019 02:01:30 +0800 Subject: [PATCH] add feature --- src/plugin/feature/index.css | 3 +++ src/plugin/feature/index.go | 36 ++++++++++++++++++++++++++++++++ src/plugin/feature/index.js | 3 +++ src/plugin/feature/index.shy | 40 ++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 src/plugin/feature/index.css create mode 100644 src/plugin/feature/index.go create mode 100644 src/plugin/feature/index.js create mode 100644 src/plugin/feature/index.shy diff --git a/src/plugin/feature/index.css b/src/plugin/feature/index.css new file mode 100644 index 00000000..4a6b4c99 --- /dev/null +++ b/src/plugin/feature/index.css @@ -0,0 +1,3 @@ +fieldset.item.feature div.output { +} + diff --git a/src/plugin/feature/index.go b/src/plugin/feature/index.go new file mode 100644 index 00000000..9d6ba7e2 --- /dev/null +++ b/src/plugin/feature/index.go @@ -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:])) +} diff --git a/src/plugin/feature/index.js b/src/plugin/feature/index.js new file mode 100644 index 00000000..f937afb9 --- /dev/null +++ b/src/plugin/feature/index.js @@ -0,0 +1,3 @@ +Script["feature/index.js"] = function(field, option, output) {return { +}} + diff --git a/src/plugin/feature/index.shy b/src/plugin/feature/index.shy new file mode 100644 index 00000000..daad3588 --- /dev/null +++ b/src/plugin/feature/index.shy @@ -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 '%s' "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 +