forked from x/icebergs
add some
This commit is contained in:
parent
729a502161
commit
70e91d3822
@ -49,7 +49,7 @@ func init() {
|
||||
auth := smtp.PlainAuth("", msg.Append(USERNAME), msg.Append(PASSWORD), kit.Split(msg.Append(SERVICE), ice.DF)[0])
|
||||
m.Logs(EMAIL, SEND, string(content)).Warn(smtp.SendMail(msg.Append(SERVICE), auth, msg.Append(USERNAME), kit.Split(m.Option(TO)), content))
|
||||
}},
|
||||
}, mdb.DevDataAction("name,service,username,password"), mdb.HashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,service,username", ice.ACTION, SEND)), Hand: func(m *ice.Message, arg ...string) {
|
||||
}, mdb.DevDataAction("name,service,username,password"), mdb.ImportantHashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,service,username", ice.ACTION, SEND)), Hand: func(m *ice.Message, arg ...string) {
|
||||
if mdb.HashSelect(m, arg...); len(arg) == 0 && m.Length() == 0 {
|
||||
m.EchoInfoButton(ice.Info.Template(m, "email.html"), mdb.CREATE, mdb.DEV_REQUEST)
|
||||
} else if len(arg) == 0 {
|
||||
|
@ -125,7 +125,7 @@ func init() {
|
||||
m.Push(ice.CMD, cmd).Push("actions", kit.Join(action))
|
||||
})
|
||||
}},
|
||||
}, mdb.HashAction(mdb.SHORT, mdb.NAME)), Hand: func(m *ice.Message, arg ...string) {
|
||||
}, mdb.ImportantHashAction(mdb.SHORT, mdb.NAME)), Hand: func(m *ice.Message, arg ...string) {
|
||||
_role_list(m, kit.Select("", arg, 0), kit.Slice(arg, 1)...).PushAction(mdb.DELETE)
|
||||
}},
|
||||
})
|
||||
|
@ -120,7 +120,7 @@ func init() {
|
||||
RenderMain(m)
|
||||
}
|
||||
}},
|
||||
}, mdb.HashAction(mdb.FIELD, "time,hash,type,name,text,usernick,username,userrole", mdb.EXPIRE, mdb.DAYS)), Hand: func(m *ice.Message, arg ...string) {
|
||||
}, mdb.ImportantHashAction(mdb.FIELD, "time,hash,type,name,text,usernick,username,userrole", mdb.EXPIRE, mdb.DAYS)), Hand: func(m *ice.Message, arg ...string) {
|
||||
if kit.IsIn(m.Option(ice.MSG_USERROLE), aaa.ROOT, aaa.TECH) || len(arg) > 0 && arg[0] != "" {
|
||||
mdb.HashSelect(m, arg...)
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ const TOKEN = "token"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
TOKEN: {Help: "令牌桶", Actions: mdb.HashAction(mdb.SHORT, mdb.UNIQ, mdb.EXPIRE, mdb.MONTH)},
|
||||
TOKEN: {Help: "令牌桶", Actions: mdb.ImportantHashAction(mdb.SHORT, mdb.UNIQ, mdb.EXPIRE, mdb.MONTH)},
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
package webview
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
@ -93,9 +96,18 @@ func Run(cb func(*WebView) ice.Any) {
|
||||
}
|
||||
kit.If(!view.Menu(), func() { view.navigate(ice.Pulse.Cmdv(web.SPIDE, ice.OPS, web.CLIENT_ORIGIN)) })
|
||||
}
|
||||
|
||||
var log io.WriteCloser
|
||||
|
||||
func Log(str string, arg ...ice.Any) { fmt.Fprintln(log, kit.Format(str, arg...), kit.FileLine(2, 3)) }
|
||||
|
||||
func RunServe() {
|
||||
kit.Setenv(cli.PATH, "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin")
|
||||
kit.Chdir(kit.HomePath(ice.CONTEXTS))
|
||||
for _, p := range []string{ice.Info.Make.Path, kit.HomePath(ice.CONTEXTS)} {
|
||||
kit.Chdir(p)
|
||||
log, _ = os.Create(path.Join(p, "webview.log"))
|
||||
Log("what %v", p)
|
||||
}
|
||||
wait := make(chan bool, 1)
|
||||
ice.Pulse.Optionv(web.SERVE_START, func() { wait <- true })
|
||||
go ice.Run(ice.SERVE, ice.START)
|
||||
|
Loading…
x
Reference in New Issue
Block a user