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])
|
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))
|
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 {
|
if mdb.HashSelect(m, arg...); len(arg) == 0 && m.Length() == 0 {
|
||||||
m.EchoInfoButton(ice.Info.Template(m, "email.html"), mdb.CREATE, mdb.DEV_REQUEST)
|
m.EchoInfoButton(ice.Info.Template(m, "email.html"), mdb.CREATE, mdb.DEV_REQUEST)
|
||||||
} else if len(arg) == 0 {
|
} else if len(arg) == 0 {
|
||||||
|
@ -125,7 +125,7 @@ func init() {
|
|||||||
m.Push(ice.CMD, cmd).Push("actions", kit.Join(action))
|
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)
|
_role_list(m, kit.Select("", arg, 0), kit.Slice(arg, 1)...).PushAction(mdb.DELETE)
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -120,7 +120,7 @@ func init() {
|
|||||||
RenderMain(m)
|
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] != "" {
|
if kit.IsIn(m.Option(ice.MSG_USERROLE), aaa.ROOT, aaa.TECH) || len(arg) > 0 && arg[0] != "" {
|
||||||
mdb.HashSelect(m, arg...)
|
mdb.HashSelect(m, arg...)
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ const TOKEN = "token"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
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
|
package webview
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"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)) })
|
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() {
|
func RunServe() {
|
||||||
kit.Setenv(cli.PATH, "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin")
|
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)
|
wait := make(chan bool, 1)
|
||||||
ice.Pulse.Optionv(web.SERVE_START, func() { wait <- true })
|
ice.Pulse.Optionv(web.SERVE_START, func() { wait <- true })
|
||||||
go ice.Run(ice.SERVE, ice.START)
|
go ice.Run(ice.SERVE, ice.START)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user