1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-28 09:52:01 +08:00

opt add feature dream

This commit is contained in:
shaoying 2019-11-18 23:11:40 +08:00
parent b5292c33ce
commit fb56a62351
9 changed files with 36 additions and 20 deletions

View File

@ -104,9 +104,8 @@ ShyFavor() {
ShyPost cmd favor arg "`history|tail -n2|head -n1`" tab "${ctx_tab}" note "${ctx_note}" ShyPost cmd favor arg "`history|tail -n2|head -n1`" tab "${ctx_tab}" note "${ctx_note}"
} }
ShyFavors() { ShyFavors() {
[ "$READLINE_LINE" = "" ] && ShyPost cmd favor tab "$1" && return [ "$READLINE_LINE" != "" ] && set $READLINE_LINE && READLINE_LINE=""
ShyPost cmd favor tab "$1" >$READLINE_LINE ShyPost cmd favor tab "$1"
READLINE_LINE=""
} }
ShySync() { ShySync() {
[ "$ctx_sid" = "" ] && ShyLogin [ "$ctx_sid" = "" ] && ShyLogin
@ -172,6 +171,8 @@ ShyInit() {
*) *)
PS1="\!-$$-\t[\u@\h]\W\$ " PS1="\!-$$-\t[\u@\h]\W\$ "
PS1="\e[32m\!\e[0m-$$-\e[31m$SPY_OWNER\e[0m@\e[33m$SPY_ROLE\e[0m[\e[32m\t\e[0m]\W\$ " PS1="\e[32m\!\e[0m-$$-\e[31m$SPY_OWNER\e[0m@\e[33m$SPY_ROLE\e[0m[\e[32m\t\e[0m]\W\$ "
PS1="\!-$$-\t[\u@\h]\W\$ "
PS1="\!-$$-\u@\h[\t]\W\$ "
;; ;;
esac esac

View File

@ -71,7 +71,14 @@ fun! ShyFavors()
let msg = json_decode(ShyPost({"cmd": "favors"})) let msg = json_decode(ShyPost({"cmd": "favors"}))
let i = 0 let i = 0
for i in range(len(msg["tab"])) for i in range(len(msg["tab"]))
tabnew if msg["tab"][i] == ""
continue
endif
if exists(":TabooOpen")
execute "TabooOpen " . msg["tab"][i]
else
tabnew
endif
lexpr msg["fix"][i] lexpr msg["fix"][i]
lopen lopen
endfor endfor
@ -91,7 +98,7 @@ endfun
fun! ShyGrep(word) fun! ShyGrep(word)
if !exists("g:grep_dir") | let g:grep_dir = "./" | endif if !exists("g:grep_dir") | let g:grep_dir = "./" | endif
let g:grep_dir = input("dir: ", g:grep_dir, "file") let g:grep_dir = input("dir: ", g:grep_dir, "file")
execute "grep -rn --exclude tags --exclude '*.tags' " . a:word . " " . g:grep_dir execute "grep -rn --exclude tags --exclude '\..*' --exclude '*.tags' " . a:word . " " . g:grep_dir
endfun endfun
fun! ShyTag(word) fun! ShyTag(word)
execute "tag " . a:word execute "tag " . a:word

View File

@ -18,6 +18,7 @@ let g:ctrlp_cmd='CtrlPBuffer'
Plug 'vim-scripts/tComment' Plug 'vim-scripts/tComment'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
Plug 'gcmt/taboo.vim' Plug 'gcmt/taboo.vim'
set sessionoptions+=tabpages,globals
Plug 'fatih/vim-go' Plug 'fatih/vim-go'
Plug 'fatih/vim-go' Plug 'fatih/vim-go'
@ -30,7 +31,6 @@ Plug 'plasticboy/vim-markdown'
" Plug 'ntpeters/vim-better-whitespace' " Plug 'ntpeters/vim-better-whitespace'
" Plug 'easymotion/vim-easymotion' " Plug 'easymotion/vim-easymotion'
" "
" set sessionoptions+=tabpages,globals
" "
" let g:Tlist_WinWidth=45 " let g:Tlist_WinWidth=45
" let g:Tlist_Exit_OnlyWindow=1 " let g:Tlist_Exit_OnlyWindow=1

View File

@ -893,7 +893,7 @@ var Index = &ctx.Context{Name: "code", Help: "代码中心",
case "logout": case "logout":
m.Cmd("login", "exit") m.Cmd("login", "exit")
case "tasklet": case "tasklet":
m.Cmd("web.team.task", "create", "task", "3", "add", "action", m.Time(), m.Time("10m"), m.Option("arg"), m.Option("sub")) m.Cmd("ssh._route", m.Option("dream"), "web.team.task", "create", "task", "3", "add", "action", m.Time(), m.Time("10m"), m.Option("arg"), m.Option("sub"))
case "favors": case "favors":
data := map[string][]string{} data := map[string][]string{}

View File

@ -14,10 +14,10 @@ var Index = &ctx.Context{Name: "team", Help: "团队中心",
"task": {Name: "task create table level class status begin_time close_time target detail arg...", Help: "任务", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { "task": {Name: "task create table level class status begin_time close_time target detail arg...", Help: "任务", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
switch arg[0] { switch arg[0] {
case "progress": case "progress":
// 任务进度 if len(arg) > 2 && arg[1] != "" {
if len(arg) > 2 {
switch arg[2] { switch arg[2] {
case "prepare", "action", "cancel", "finish": case "prepare", "action", "cancel", "finish":
prefix := []string{"ssh._route", m.Option("dream"), "ssh.data", "update"}
time := "close_time" time := "close_time"
switch arg[2] { switch arg[2] {
case "prepare", "action": case "prepare", "action":
@ -28,10 +28,12 @@ var Index = &ctx.Context{Name: "team", Help: "团队中心",
time = "update_time" time = "update_time"
} }
m.Cmd("ssh.data", "update", m.Option("table"), arg[1], "status", arg[2], time, m.Time()) // 更新任务
m.Cmd(prefix, m.Option("table"), arg[1], "status", arg[2], time, m.Time())
arg = []string{arg[0], m.Option("table")} arg = []string{arg[0], m.Option("table")}
} }
} }
// 任务进度
m.Option("cache.limit", kit.Select("30", arg, 2)) m.Option("cache.limit", kit.Select("30", arg, 2))
m.Option("cache.offset", kit.Select("0", arg, 3)) m.Option("cache.offset", kit.Select("0", arg, 3))
m.Meta["append"] = []string{"prepare", "action", "cancel", "finish"} m.Meta["append"] = []string{"prepare", "action", "cancel", "finish"}
@ -55,7 +57,7 @@ var Index = &ctx.Context{Name: "team", Help: "团队中心",
arg = []string{arg[1]} arg = []string{arg[1]}
fallthrough fallthrough
default: default:
// 修改任务 // 更新任务
if len(arg) > 1 && arg[1] == "modify" { if len(arg) > 1 && arg[1] == "modify" {
m.Cmdy("ssh.data", "update", m.Option("table"), m.Option("index"), arg[2], arg[3]) m.Cmdy("ssh.data", "update", m.Option("table"), m.Option("index"), arg[2], arg[3])
break break

View File

@ -80,8 +80,8 @@ var Index = &ctx.Context{Name: "wiki", Help: "文档中心",
tmpl := template.New("render").Funcs(*ctx.LocalCGI(m, c)) tmpl := template.New("render").Funcs(*ctx.LocalCGI(m, c))
m.Confm("template", "list", func(index int, value string) { tmpl = template.Must(tmpl.Parse(value)) }) m.Confm("template", "list", func(index int, value string) { tmpl = template.Must(tmpl.Parse(value)) })
tmpl = template.Must(tmpl.ParseGlob(path.Join(m.Conf("route", "template_dir"), "/*.tmpl"))) tmpl = template.Must(tmpl.ParseGlob(path.Join(m.Cmdx("nfs.path", m.Conf("route", "template_dir")), "/*.tmpl")))
tmpl = template.Must(tmpl.ParseGlob(path.Join(m.Conf("route", "template_dir"), m.Cap("route"), "/*.tmpl"))) tmpl = template.Must(tmpl.ParseGlob(path.Join(m.Cmdx("nfs.path", m.Conf("route", "template_dir")), m.Cap("route"), "/*.tmpl")))
tmpl = template.Must(tmpl.ParseFiles(which)) tmpl = template.Must(tmpl.ParseFiles(which))
for i, v := range tmpl.Templates() { for i, v := range tmpl.Templates() {
m.Log("info", "%v, %v", i, v.Name()) m.Log("info", "%v, %v", i, v.Name())

View File

@ -14,14 +14,16 @@ fun date "每一天" "index.js" "index.css" protected \
end end
end end
kit progress "任务进度" public "web.team.task" progress \ kit progress "任务进度" public "ssh._route" _ "web.team.task" progress \
text "" name dream imports plugin_you \
text "task" name table \ text "task" name table \
text "30" name limit \ text "30" name limit \
text "0" name offset \ text "0" name offset \
feature detail action finish cancel prepare \ feature detail action finish cancel prepare \
button "查看" action auto button "查看" action auto
kit create "创建任务" public "web.team.task" create \ kit create "创建任务" public "ssh._route" _ "web.team.task" create \
text "" name dream imports plugin_you \
text "task" name table \ text "task" name table \
select "3" name level values 1 values 2 values 3 values 4 values 5 \ select "3" name level values 1 values 2 values 3 values 4 values 5 \
select "" name class values add values opt values fix \ select "" name class values add values opt values fix \
@ -32,7 +34,8 @@ kit create "创建任务" public "web.team.task" create \
textarea "" name detail half "4" \ textarea "" name detail half "4" \
button "添加" before br button "添加" before br
kit select "查看任务" public "web.team.task" \ kit select "查看任务" public "ssh._route" _ "web.team.task" \
text "" name dream imports plugin_you \
text "task" name table imports pluing_table \ text "task" name table imports pluing_table \
text "" name index imports plugin_task_id action auto \ text "" name index imports plugin_task_id action auto \
button "查看" action auto \ button "查看" action auto \

View File

@ -1,5 +1,5 @@
kit note "记事本" public "ssh._route" _ "web.wiki.note" \ kit note "记事本" public "ssh._route" _ "web.wiki.note" \
text "" name dream imports plugin_dream action auto \ text "" name dream imports plugin_you action auto \
text "miss.md" name story imports plugin_story view long action auto \ text "miss.md" name story imports plugin_story view long action auto \
button "查看" action auto \ button "查看" action auto \
button "返回" cb Last \ button "返回" cb Last \
@ -16,7 +16,7 @@ kit favor "收藏夹" public "ssh._route" _ "web.wiki.story" favor \
button "返回" cb Last button "返回" cb Last
kit commit "记录" public "ssh._route" _ "web.wiki.story" commit \ kit commit "记录" public "ssh._route" _ "web.wiki.story" commit \
text "" name dream imports plugin_dream \ text "" name dream imports plugin_you \
text "miss.md" name story imports plugin_story \ text "miss.md" name story imports plugin_story \
text "table" name sence \ text "table" name sence \
text "hello" name enjoy \ text "hello" name enjoy \
@ -24,11 +24,11 @@ kit commit "记录" public "ssh._route" _ "web.wiki.story" commit \
button "提交" button "提交"
kit branch "分支" public "ssh._route" _ "web.wiki.story" branch \ kit branch "分支" public "ssh._route" _ "web.wiki.story" branch \
text "" name dream imports plugin_dream \ text "" name dream imports plugin_you \
button "查看" button "查看"
kit remote "仓库" public "ssh._route" _ "web.wiki.story" remote \ kit remote "仓库" public "ssh._route" _ "web.wiki.story" remote \
text "" name dream imports plugin_dream \ text "" name dream imports plugin_you \
button "查看" button "查看"
kit xls "表格" "index.js" "index.css" private "web.wiki.xls" \ kit xls "表格" "index.js" "index.css" private "web.wiki.xls" \

View File

@ -1072,6 +1072,9 @@ function Plugin(page, pane, field, inits, runs) {
item.autocomplete = "off" item.autocomplete = "off"
break break
} }
kit.List((item.clist||"").split(" "), function(value) {
kit.classList.add(item, value)
})
kit.classList.add(item, item.view) kit.classList.add(item, item.view)
return Inputs(plugin, input, item, plugin.View(option, "input", input)[input.name], option).target return Inputs(plugin, input, item, plugin.View(option, "input", input)[input.name], option).target
}), }),