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