mirror of
https://github.com/lollipopkit/server_box_monitor.git
synced 2025-01-09 04:10:01 +08:00
#6 fix: bark
push
This commit is contained in:
parent
66b35205d6
commit
c521a4087a
@ -236,25 +236,25 @@ const (
|
||||
)
|
||||
|
||||
type PushIfaceBark struct {
|
||||
Server string `json:"server"`
|
||||
Title string `json:"title"`
|
||||
Body string `json:"body"`
|
||||
Level barkLevel `json:"level"`
|
||||
BodyRegex string `json:"body_regex"`
|
||||
Code int `json:"code"`
|
||||
Server string `json:"server"`
|
||||
Key string `json:"key"`
|
||||
Title PushFormat `json:"title"`
|
||||
Body PushFormat `json:"body"`
|
||||
Level barkLevel `json:"level"`
|
||||
BodyRegex string `json:"body_regex"`
|
||||
Code int `json:"code"`
|
||||
}
|
||||
|
||||
func (p PushIfaceBark) push(args []*PushPair) error {
|
||||
body := p.Body
|
||||
for _, arg := range args {
|
||||
body = strings.Replace(body, arg.key, arg.value, 1)
|
||||
}
|
||||
body := p.Body.Format(args)
|
||||
title := p.Title.Format(args)
|
||||
if len(p.Server) == 0 {
|
||||
p.Server = "https://api.day.app"
|
||||
}
|
||||
url := path.Join(
|
||||
p.Server,
|
||||
p.Title,
|
||||
p.Key,
|
||||
title,
|
||||
body,
|
||||
)
|
||||
if len(p.Level) != 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user