forked from x/ContextOS
tce mod web.list 添加了顺序表
This commit is contained in:
parent
9416b86ed6
commit
0c069d3e97
@ -32,7 +32,8 @@ type WEB struct {
|
|||||||
*http.ServeMux
|
*http.ServeMux
|
||||||
*http.Server
|
*http.Server
|
||||||
|
|
||||||
list map[string]string
|
list map[string]string
|
||||||
|
list_key []string
|
||||||
|
|
||||||
*ctx.Message
|
*ctx.Message
|
||||||
*ctx.Context
|
*ctx.Context
|
||||||
@ -391,8 +392,10 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
|
|
||||||
switch len(arg) {
|
switch len(arg) {
|
||||||
case 0:
|
case 0:
|
||||||
for k, v := range web.list {
|
for _, k := range web.list_key {
|
||||||
m.Echo("%s: %s\n", k, v)
|
if v, ok := web.list[k]; ok {
|
||||||
|
m.Echo("%s: %s\n", k, v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
msg := m.Spawn(m.Target()).Cmd("get", web.list[arg[0]])
|
msg := m.Spawn(m.Target()).Cmd("get", web.list[arg[0]])
|
||||||
@ -402,6 +405,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
case "add":
|
case "add":
|
||||||
m.Capi("count", 1)
|
m.Capi("count", 1)
|
||||||
web.list[m.Cap("count")] = arg[1]
|
web.list[m.Cap("count")] = arg[1]
|
||||||
|
web.list_key = append(web.list_key, m.Cap("count"))
|
||||||
case "del":
|
case "del":
|
||||||
delete(web.list, arg[1])
|
delete(web.list, arg[1])
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user