mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 03:58:28 +02:00
webhook APIs
This commit is contained in:
1 parent
2f08e9f048
commit
55ddf225bb
12 files changed
+138
-78
No files matched your search
@@ -13,7 +13,7 @@ github.com/go-sql-driver/mysql = commit:a197e5d405
|
||||
github.com/go-xorm/core = commit:4813c0110d
|
||||
github.com/go-xorm/xorm = commit:97e7703766
|
||||
github.com/gogits/chardet = commit:2404f77725
|
||||
github.com/gogits/go-gogs-client = commit:92e76d616a
|
||||
github.com/gogits/go-gogs-client =
|
||||
github.com/lib/pq = commit:0dad96c0b9
|
||||
github.com/macaron-contrib/binding = commit:de6ed78668
|
||||
github.com/macaron-contrib/cache = commit:cd824f6f2d
|
||||
|
||||
@@ -529,7 +529,10 @@ settings.add_webhook_desc = Gogs will send a <code>POST</code> request to the UR
|
||||
settings.payload_url = Payload URL
|
||||
settings.content_type = Content Type
|
||||
settings.secret = Secret
|
||||
settings.event_desc = Upon which events should this webhook be triggered?
|
||||
settings.slack_username = Username
|
||||
settings.slack_icon_url = Icon URL
|
||||
settings.slack_color = Color
|
||||
settings.event_desc = When should this webhook be triggered?
|
||||
settings.event_push_only = Just the <code>push</code> event.
|
||||
settings.event_send_everything = I need <strong>everything</strong>.
|
||||
settings.event_choose = Let me choose what I need.
|
||||
|
||||
@@ -325,7 +325,9 @@ repo_lang=仓库语言
|
||||
repo_lang_helper=请选择 .gitignore 文件
|
||||
license=授权许可
|
||||
license_helper=请选择授权许可文件
|
||||
init_readme=使用 README.md 文件初始化仓库
|
||||
readme=自述文档
|
||||
readme_helper=请选择自述文档模板
|
||||
auto_init=使用选定的文件和模板初始化仓库
|
||||
create_repo=创建仓库
|
||||
default_branch=默认分支
|
||||
mirror_interval=镜像同步周期(小时)
|
||||
@@ -527,8 +529,17 @@ settings.add_webhook_desc=我们会通过 <code>POST</code> 请求将订阅事
|
||||
settings.payload_url=推送地址
|
||||
settings.content_type=数据格式
|
||||
settings.secret=密钥文本
|
||||
settings.slack_username=服务名称
|
||||
settings.slack_icon_url=图标 URL
|
||||
settings.slack_color=颜色代码
|
||||
settings.event_desc=请设置您希望触发 Web 钩子的事件:
|
||||
settings.event_push_only=只推送 <code>push</code> 事件。
|
||||
settings.event_send_everything=请把 <strong>一切</strong> 都给我
|
||||
settings.event_choose=我的命运自己主宰
|
||||
settings.event_create=创建
|
||||
settings.event_create_desc=创建分支或标签
|
||||
settings.event_push=推送
|
||||
settings.event_push_desc=Git 仓库推送
|
||||
settings.active=是否激活
|
||||
settings.active_helper=当指定事件发生时我们将会触发此 Web 钩子。
|
||||
settings.add_hook_success=Web 钩子添加成功!
|
||||
|
||||
+21
-7
@@ -97,11 +97,16 @@ type Webhook struct {
|
||||
Updated time.Time `xorm:"UPDATED"`
|
||||
}
|
||||
|
||||
// GetEvent handles conversion from Events to HookEvent.
|
||||
func (w *Webhook) GetEvent() {
|
||||
w.HookEvent = &HookEvent{}
|
||||
if err := json.Unmarshal([]byte(w.Events), w.HookEvent); err != nil {
|
||||
log.Error(4, "webhook.GetEvent(%d): %v", w.ID, err)
|
||||
func (w *Webhook) AfterSet(colName string, _ xorm.Cell) {
|
||||
var err error
|
||||
switch colName {
|
||||
case "events":
|
||||
w.HookEvent = &HookEvent{}
|
||||
if err = json.Unmarshal([]byte(w.Events), w.HookEvent); err != nil {
|
||||
log.Error(3, "Unmarshal[%d]: %v", w.ID, err)
|
||||
}
|
||||
case "created":
|
||||
w.Created = regulateTimeZone(w.Created)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +142,17 @@ func (w *Webhook) HasPushEvent() bool {
|
||||
(w.ChooseEvents && w.HookEvents.Push)
|
||||
}
|
||||
|
||||
func (w *Webhook) EventsArray() []string {
|
||||
events := make([]string, 0, 2)
|
||||
if w.HasCreateEvent() {
|
||||
events = append(events, "create")
|
||||
}
|
||||
if w.HasPushEvent() {
|
||||
events = append(events, "push")
|
||||
}
|
||||
return events
|
||||
}
|
||||
|
||||
// CreateWebhook creates a new web hook.
|
||||
func CreateWebhook(w *Webhook) error {
|
||||
_, err := x.Insert(w)
|
||||
@@ -382,8 +398,6 @@ func PrepareWebhooks(repo *Repository, event HookEventType, p api.Payloader) err
|
||||
}
|
||||
|
||||
for _, w := range ws {
|
||||
w.GetEvent()
|
||||
|
||||
switch event {
|
||||
case HOOK_EVENT_CREATE:
|
||||
if !w.HasCreateEvent() {
|
||||
|
||||
+10
-12
@@ -13,22 +13,20 @@ import (
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
"github.com/gogits/gogs/modules/git"
|
||||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const (
|
||||
SLACK_COLOR string = "#dd4b39"
|
||||
)
|
||||
|
||||
type SlackMeta struct {
|
||||
Channel string `json:"channel"`
|
||||
Channel string `json:"channel"`
|
||||
Username string `json:"username"`
|
||||
IconURL string `json:"icon_url"`
|
||||
Color string `json:"color"`
|
||||
}
|
||||
|
||||
type SlackPayload struct {
|
||||
Channel string `json:"channel"`
|
||||
Text string `json:"text"`
|
||||
Username string `json:"username"`
|
||||
IconUrl string `json:"icon_url"`
|
||||
IconURL string `json:"icon_url"`
|
||||
UnfurlLinks int `json:"unfurl_links"`
|
||||
LinkNames int `json:"link_names"`
|
||||
Attachments []SlackAttachment `json:"attachments"`
|
||||
@@ -75,8 +73,8 @@ func getSlackCreatePayload(p *api.CreatePayload, slack *SlackMeta) (*SlackPayloa
|
||||
return &SlackPayload{
|
||||
Channel: slack.Channel,
|
||||
Text: text,
|
||||
Username: setting.AppName,
|
||||
IconUrl: setting.AppUrl + "/img/favicon.png",
|
||||
Username: slack.Username,
|
||||
IconURL: slack.IconURL,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -113,13 +111,13 @@ func getSlackPushPayload(p *api.PushPayload, slack *SlackMeta) (*SlackPayload, e
|
||||
}
|
||||
}
|
||||
|
||||
slackAttachments := []SlackAttachment{{Color: SLACK_COLOR, Text: attachmentText}}
|
||||
slackAttachments := []SlackAttachment{{Color: slack.Color, Text: attachmentText}}
|
||||
|
||||
return &SlackPayload{
|
||||
Channel: slack.Channel,
|
||||
Text: text,
|
||||
Username: setting.AppName,
|
||||
IconUrl: setting.AppUrl + "/img/favicon.png",
|
||||
Username: slack.Username,
|
||||
IconURL: slack.IconURL,
|
||||
Attachments: slackAttachments,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -99,6 +99,9 @@ func (f *NewWebhookForm) Validate(ctx *macaron.Context, errs binding.Errors) bin
|
||||
type NewSlackHookForm struct {
|
||||
PayloadURL string `binding:"Required`
|
||||
Channel string `binding:"Required"`
|
||||
Username string
|
||||
IconURL string
|
||||
Color string
|
||||
WebhookForm
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package base
|
||||
|
||||
const DOC_URL = "http://gogs.io/docs"
|
||||
const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki"
|
||||
|
||||
type (
|
||||
TplName string
|
||||
|
||||
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x92\xdb\x48\x8e\xe7\xff\x7c\x0a\xb6\x37\x7c\x76\x47\x94\xe5\xe8\xee\xb8\x8f\x98\xb0\xdd\x57\xae\x6a\x7f\xcc\xba\x5c\xb5\xae\xf2\xcc\xcd\x39\x1c\x1c\x4a\x64\x49\x1c\x4b\xa4\x9a\xa4\x2c\x6b\x36\x36\xe2\x5e\xe3\x5e\xef\x9e\xe4\x80\x1f\x80\xfc\x20\xa9\xb2\x3d\xbb\x71\xf7\x8f\x94\xcc\x44\x7e\x21\x91\x48\x00\x89\xcc\xcc\xb7\xdb\xac\x28\xbb\x45\xfa\x34\x3d\x4d\xb7\x79\x55\xaf\xcb\xae\x4b\xbb\x72\x7d\xfb\x68\xd5\x74\x7d\x59\xa4\x2f\xab\x9e\xbe\xdb\xcf\xd5\xa2\x4c\x92\x55\xb3\x29\x09\xf4\x15\xfd\x25\x45\xde\xad\xe6\x4d\xde\x16\x14\x71\x6e\xe1\xa4\xfc\xb2\x5d\x37\x2d\x03\xfd\x26\xa1\x64\x55\xae\xb7\x9c\x87\xfe\x92\xae\x5a\xd6\x59\x55\xd3\xe7\x35\x85\xd2\xd7\x75\xd2\x35\x8b\x2a\x5f\x67\x41\x02\x22\x2c\xfd\x0f\xe9\xcf\x75\x91\x5e\xf7\xe5\x36\x7d\xd2\x6d\xf2\xf5\xfa\x59\xde\x21\x4b\x5f\xa6\xf9\x62\xd1\xec\xea\xfe\xc9\x63\x49\x90\xc2\x9b\x5d\x6f\xa5\x5f\xee\x7a\x89\xdb\x6d\x2d\xea\xfd\x36\x69\xcb\x65\x45\x1d\x6b\x29\xea\x9d\x06\x93\x7d\x39\xef\xaa\x9e\x1b\xfd\x67\x09\x25\x9f\xcb\xb6\xab\x1a\x6e\xcf\x9f\x24\x94\x6c\xf3\x25\x03\x5c\xd1\x5f\xd2\x97\x9b\xed\x3a\x47\x86\x1b\x0d\x26\xeb\xbc\x5e\xee\x04\xe6\x8d\x06\x93\x45\x5b\x52\x52\x56\x97\x7b\x8a\x3d\xc3\x47\x4a\x1f\xb3\xd9\x2c\xd9\x11\x4e\xb3\x6d\xdb\xdc\x56\xeb\x32\xcb\xeb\x22\xdb\x08\xd6\xde\x53\x7c\xaa\xf1\x29\xc5\xa7\x1c\x8f\x6e\x94\x05\x21\x28\xcb\x3b\xed\x0b\x0d\x0d\xe1\x2b\xef\x12\x14\x55\xe7\x1b\xcb\xcd\xc1\xa4\xdc\xe4\xd5\x9a\x07\xe1\x11\x07\xa8\xf1\x5d\xb7\x6f\x30\x54\x57\x1a\x24\x44\x64\xfd\x61\x5b\x02\x0f\x8f\x6e\x28\x94\x2c\xf2\x6d\xbf\x58\xe5\xdc\x56\x09\x25\x04\xb4\x6d\x08\x21\x4d\x7b\x00\x9c\x7d\x24\x4d\xbb\xcc\xeb\xea\xef\x79\x2f\x48\xba\x0c\x3e\x93\x4d\xd5\xb6\x0d\xe3\xf7\x02\x81\x84\x7a\x9c\x71\x39\x14\xf3\x96\x30\x11\x94\xc2\x29\x9b\x6a\xd9\x0a\x2a\x39\xf1\x02\x5f\x5c\x0a\xa7\xdd\x36\xed\x27\x4d\x78\xc1\xc1\x41\x56\x6a\x84\xa6\xc6\xf5\xe7\x35\x21\x5f\x53\x2f\xf0\x11\x01\x74\x49\x5e\x6c\x08\x95\xdb\xbc\x2e\x19\x47\xa7\xfc\x45\x78\xa1\xaf\x44\x69\x2a\xeb\xca\xbe\xaf\xea\x25\x23\xfb\x54\xa2\xd2\x6b\x8d\x4a\x82\x34\x17\x77\x68\x76\x6e\x38\x29\xfe\x2f\xf4\x99\x5e\xc9\xa7\xa4\x05\x99\x90\xe8\x72\x72\x4f\xba\xec\xb6\x2c\x0b\xe9\x4b\x97\xbe\xa0\x70\xb2\xdd\xad\xd7\x84\xb5\xdf\x77\x65\xd7\x73\xa6\x2b\xfa\xa6\xfe\xcb\x77\x52\x75\x1d\x05\x28\xfa\x35\x02\x09\x0d\x5d\xbd\x40\x67\xce\x10\x48\x92\x0f\x5d\x99\xb7\x8b\xd5\xc7\x44\xfe\xd1\x56\x0e\x30\xed\x1d\x1b\x54\x26\x24\x25\x22\xa9\xc1\x2a\x48\x16\x4d\xc1\x1f\x67\xf4\x47\x45\x57\x75\xd7\xd3\x8c\xfb\x98\x68\x80\xc1\x24\x24\x03\xd0\x57\x3d\xb0\xa0\x91\x98\xbe\x1d\x8f\x60\xfa\xa2\x6a\xbb\xfe\x51\x5f\x11\xb1\xbe\xdb\xd5\x09\xf7\x8f\x66\x5b\x56\xcc\x8d\x09\xbd\x6c\x08\x45\x88\x6e\xa9\x7f\x17\x87\xeb\x7f\x79\x73\x92\x5e\x11\x27\x5a\xb6\x25\x85\x53\x2a\x83\xfe\x28\xcf\x2f\xb3\x84\x72\x59\x4d\xe7\x79\x9f\xcf\xf3\xae\xf4\x68\xe5\x44\xa1\x6e\x97\x06\x1a\x67\xae\x06\x0e\xd6\xf5\x51\x7f\xa7\x66\x08\x95\xa1\xf3\xca\x95\xf1\x96\x27\x17\xc5\x33\x53\x43\xe6\xab\x75\xc9\xf1\x54\x54\xfa\xfa\xed\xdb\xcb\xf3\xe7\x69\x59\x2f\xab\xba\x4c\xf7\x55\xbf\x4a\x77\xfd\xed\x7f\xcb\x96\x65\x5d\xb6\xc4\xe3\x16\x55\x4a\x73\xaa\x25\x4a\x48\x89\xb0\xa5\x73\xb3\xa4\xeb\xd6\x34\xf7\x81\xde\xeb\xeb\x37\xe9\x05\xa3\x78\x9b\xf7\x2b\x34\xa4\x5f\x25\xdd\xef\x6b\x46\x91\xab\xf0\x66\x55\xa6\xa0\x32\x00\x35\xb7\x86\x8f\xb4\xd0\x36\xce\x92\xb2\x6d\x33\x62\x4b\xfd\x21\xd3\xcc\x5a\xde\x10\x52\x8a\x20\xd2\xa9\x9b\x3e\x9d\x97\x29\xf2\xcc\x92\xc4\x1a\x6c\xd8\x3d\xdd\x6e\xd7\xd5\x42\xe6\xfa\x4b\x49\xf3\x88\xe6\x15\x44\xb1\x14\xc2\x01\x51\x96\x16\xa0\x8b\xd8\x33\xcf\x87\x34\x62\x20\xc8\xbf\x2a\x89\x01\xae\x76\x4b\x61\x7b\xeb\x66\x57\xfc\x00\x4a\xb5\xd6\x7b\x42\x4d\xdf\x35\xd4\x60\x60\xc7\x01\xf8\x2a\x4e\x89\xe2\x78\xd1\x6a\xcb\x4d\x43\x7c\xc5\x11\x7b\x45\x04\xb5\xaf\x28\x91\x7a\xda\xe5\x9f\x69\xbe\xf5\x4d\xda\xaf\xaa\x2e\x2d\x88\xd8\x16\x5c\x30\x4d\x8d\x1d\x2d\x17\x42\x16\x44\xa0\x42\x1a\x16\x17\x8f\x01\xa0\x36\x3b\xa2\xa6\x15\x15\xc6\x8b\x11\xaf\x9c\x54\xe4\x54\x3b\xd1\x25\x2a\x07\xf4\x4d\x94\xdb\x10\x57\x66\xbe\x79\x8e\x80\x7e\x87\xe5\x53\xab\xf2\xdb\x5b\x6a\x55\x47\x54\xf1\x2a\x5d\xac\x1b\x22\xa9\xf7\xef\xde\x74\x4c\x30\xab\x6c\xdb\xb4\x58\xe6\x28\xe9\x8a\x82\x2e\x2e\x40\x34\x43\xd4\xbb\xcd\x9c\xbe\xf6\xab\x8a\x38\x00\xd0\xce\x39\x78\x35\xa7\x58\xaa\x62\xd7\xd1\x10\x9e\xa4\x44\xc2\xd4\x03\x42\x19\x08\x80\xfb\x50\x54\x5d\x3e\xa7\xb1\x67\xf0\x5b\x5a\xb6\x76\x2d\x91\xd5\xaa\xef\xb7\x56\xf3\xab\x9b\x9b\x2b\xa9\xda\xc5\xde\x55\x77\x1e\x50\x06\xc6\x60\xcd\x0b\x6f\x9d\x36\xf5\x0c\x44\xb2\x6b\xd7\x03\xfa\xa1\xbe\x5a\xca\x11\xbc\x70\x13\x1e\xf3\xcf\xb5\x47\x0f\xf0\xdc\x91\x74\xb2\x07\x35\x11\x8e\x4b\x2c\x80\x44\xd4\xcd\x96\xcb\x0d\xa8\xfa\x52\x23\x3c\x29\x63\xd1\x74\xe9\xb2\x74\x52\x2a\x64\x9f\x80\xfd\x6f\xa8\xc3\xca\x46\xae\x2f\x08\x0d\xe0\x25\x88\xbd\x6d\x9b\x0d\xc5\xbe\xa0\x3f\x1f\xe1\x9b\x7f\xc1\xe5\x01\x26\x2f\x0a\xe2\x6f\xdd\x49\xfa\xee\xc5\x59\xfa\x9f\x7f\xf9\xf9\xe7\x59\xfa\xba\xe7\x99\xc8\xc4\xf9\x37\x26\x2a\x0a\xca\x1a\xee\x40\x89\x65\xf4\x44\x77\xf7\x78\x66\xdd\x4b\x9f\x2Line truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x92\xdb\x48\x8e\xe7\xff\x7c\x0a\xb6\x37\x7c\x76\x47\x94\xe5\xe8\xee\xb8\x8f\x98\xb0\xdd\x57\xae\x6a\x7f\xcc\xba\x5c\xb5\xae\xf2\xcc\xcd\x39\x1c\x1c\x4a\x64\x49\x1c\x4b\xa4\x9a\xa4\x2c\x6b\x36\x36\xe2\x5e\xe3\x5e\xef\x9e\xe4\x80\x1f\x80\xfc\x20\xa9\xb2\x3d\xbb\x71\xf7\x8f\x94\xcc\x44\x7e\x21\x91\x48\x24\x12\x89\xcc\xb7\xdb\xac\x28\xbb\x45\xfa\x34\x3d\x4d\xb7\x79\x55\xaf\xcb\xae\x4b\xbb\x72\x7d\xfb\x68\xd5\x74\x7d\x59\xa4\x2f\xab\x9e\xbe\xdb\xcf\xd5\xa2\x4c\x92\x55\xb3\x29\x09\xf4\x15\xfd\x25\x45\xde\xad\xe6\x4d\xde\x16\x14\x71\x6e\xe1\xa4\xfc\xb2\x5d\x37\x2d\x03\xfd\x26\xa1\x64\x55\xae\xb7\x9c\x87\xfe\x92\xae\x5a\xd6\x59\x55\xd3\xe7\x35\x85\xd2\xd7\x75\xd2\x35\x8b\x2a\x5f\x67\x41\x02\x22\x2c\xfd\x0f\xe9\xcf\x75\x91\x5e\xf7\xe5\x36\x7d\xd2\x6d\xf2\xf5\xfa\x59\xde\x21\x4b\x5f\xa6\xf9\x62\xd1\xec\xea\xfe\xc9\x63\x49\x90\xc2\x9b\x5d\x6f\xa5\x5f\xee\x7a\x89\xdb\x6d\x2d\xea\xfd\x36\x69\xcb\x65\x45\x1d\x6b\x29\xea\x9d\x06\x93\x7d\x39\xef\xaa\x9e\x1b\xfd\x67\x09\x25\x9f\xcb\xb6\xab\x1a\x6e\xcf\x9f\x24\x94\x6c\xf3\x25\x03\x5c\xd1\x5f\xd2\x97\x9b\xed\x3a\x47\x86\x1b\x0d\x26\xeb\xbc\x5e\xee\x04\xe6\x8d\x06\x93\x45\x5b\x52\x52\x56\x97\x7b\x8a\x3d\xc3\x47\x4a\x1f\xb3\xd9\x2c\xd9\x11\x4e\xb3\x6d\xdb\xdc\x56\xeb\x32\xcb\xeb\x22\xdb\x08\xd6\xde\x53\x7c\xaa\xf1\x29\xc5\xa7\x1c\x8f\x6e\x94\x05\x21\x28\xcb\x3b\xed\x0b\x0d\x0d\xe1\x2b\xef\x12\x14\x55\xe7\x1b\xcb\xcd\xc1\xa4\xdc\xe4\xd5\x9a\x07\xe1\x11\x07\xa8\xf1\x5d\xb7\x6f\x30\x54\x57\x1a\x24\x44\x64\xfd\x61\x5b\x02\x0f\x8f\x6e\x28\x94\x2c\xf2\x6d\xbf\x58\xe5\xdc\x56\x09\x25\x04\xb4\x6d\x08\x21\x4d\x7b\x00\x9c\x7d\x24\x4d\xbb\xcc\xeb\xea\xef\x79\x2f\x48\xba\x0c\x3e\x93\x4d\xd5\xb6\x0d\xe3\xf7\x02\x81\x84\x7a\x9c\x71\x39\x14\xf3\x96\x30\x11\x94\xc2\x29\x9b\x6a\xd9\x0a\x2a\x39\xf1\x02\x5f\x5c\x0a\xa7\xdd\x36\xed\x27\x4d\x78\xc1\xc1\x41\x56\x6a\x84\xa6\xc6\xf5\xe7\x35\x21\x5f\x53\x2f\xf0\x11\x01\x74\x49\x5e\x6c\x08\x95\xdb\xbc\x2e\x19\x47\xa7\xfc\x45\x78\xa1\xaf\x44\x69\x2a\xeb\xca\xbe\xaf\xea\x25\x23\xfb\x54\xa2\xd2\x6b\x8d\x4a\x82\x34\x17\x77\x68\x76\x6e\x38\x29\xfe\x2f\xf4\x99\x5e\xc9\xa7\xa4\x05\x99\x90\xe8\x72\x72\x4f\xba\xec\xb6\x2c\x0b\xe9\x4b\x97\xbe\xa0\x70\xb2\xdd\xad\xd7\x84\xb5\xdf\x77\x65\xd7\x73\xa6\x2b\xfa\xa6\xfe\xcb\x77\x52\x75\x1d\x05\x28\xfa\x35\x02\x09\x0d\x5d\xbd\x40\x67\xce\x10\x48\x92\x0f\x5d\x99\xb7\x8b\xd5\xc7\x44\xfe\xd1\x56\x0e\x30\xed\x1d\x1b\x54\x26\x24\x25\x22\xa9\xc1\x2a\x48\x16\x4d\xc1\x1f\x67\xf4\x47\x45\x57\x75\xd7\xd3\x8c\xfb\x98\x68\x80\xc1\x24\x24\x03\xd0\x57\x3d\xb0\xa0\x91\x98\xbe\x1d\x8f\x60\xfa\xa2\x6a\xbb\xfe\x51\x5f\x11\xb1\xbe\xdb\xd5\x09\xf7\x8f\x66\x5b\x56\xcc\x8d\x09\xbd\x6c\x08\x45\x88\x6e\xa9\x7f\x17\x87\xeb\x7f\x79\x73\x92\x5e\x11\x27\x5a\xb6\x25\x85\x53\x2a\x83\xfe\x28\xcf\x2f\xb3\x84\x72\x59\x4d\xe7\x79\x9f\xcf\xf3\xae\xf4\x68\xe5\x44\xa1\x6e\x97\x06\x1a\x67\xae\x06\x0e\xd6\xf5\x51\x7f\xa7\x66\x08\x95\xa1\xf3\xca\x95\xf1\x96\x27\x17\xc5\x33\x53\x43\xe6\xab\x75\xc9\xf1\x54\x54\xfa\xfa\xed\xdb\xcb\xf3\xe7\x69\x59\x2f\xab\xba\x4c\xf7\x55\xbf\x4a\x77\xfd\xed\x7f\xcb\x96\x65\x5d\xb6\xc4\xe3\x16\x55\x4a\x73\xaa\x25\x4a\x48\x89\xb0\xa5\x73\xb3\xa4\xeb\xd6\x34\xf7\x81\xde\xeb\xeb\x37\xe9\x05\xa3\x78\x9b\xf7\x2b\x34\xa4\x5f\x25\xdd\xef\x6b\x46\x91\xab\xf0\x66\x55\xa6\xa0\x32\x00\x35\xb7\x86\x8f\xb4\xd0\x36\xce\x92\xb2\x6d\x33\x62\x4b\xfd\x21\xd3\xcc\x5a\xde\x10\x52\x8a\x20\xd2\xa9\x9b\x3e\x9d\x97\x29\xf2\xcc\x92\xc4\x1a\x6c\xd8\x3d\xdd\x6e\xd7\xd5\x42\xe6\xfa\x4b\x49\xf3\x88\xe6\x15\x44\xb1\x14\xc2\x01\x51\x96\x16\xa0\x8b\xd8\x33\xcf\x87\x34\x62\x20\xc8\xbf\x2a\x89\x01\xae\x76\x4b\x61\x7b\xeb\x66\x57\xfc\x00\x4a\xb5\xd6\x7b\x42\x4d\xdf\x35\xd4\x60\x60\xc7\x01\xf8\x2a\x4e\x89\xe2\x78\xd1\x6a\xcb\x4d\x43\x7c\xc5\x11\x7b\x45\x04\xb5\xaf\x28\x91\x7a\xda\xe5\x9f\x69\xbe\xf5\x4d\xda\xaf\xaa\x2e\x2d\x88\xd8\x16\x5c\x30\x4d\x8d\x1d\x2d\x17\x42\x16\x44\xa0\x42\x1a\x16\x17\x8f\x01\xa0\x36\x3b\xa2\xa6\x15\x15\xc6\x8b\x11\xaf\x9c\x54\xe4\x54\x3b\xd1\x25\x2a\x07\xf4\x4d\x94\xdb\x10\x57\x66\xbe\x79\x8e\x80\x7e\x87\xe5\x53\xab\xf2\xdb\x5b\x6a\x55\x47\x54\xf1\x2a\x5d\xac\x1b\x22\xa9\xf7\xef\xde\x74\x4c\x30\xab\x6c\xdb\xb4\x58\xe6\x28\xe9\x8a\x82\x2e\x2e\x40\x34\x43\xd4\xbb\xcd\x9c\xbe\xf6\xab\x8a\x38\x00\xd0\xce\x39\x78\x35\xa7\x58\xaa\x62\xd7\xd1\x10\x9e\xa4\x44\xc2\xd4\x03\x42\x19\x08\x80\xfb\x50\x54\x5d\x3e\xa7\xb1\x67\xf0\x5b\x5a\xb6\x76\x2d\x91\xd5\xaa\xef\xb7\x56\xf3\xab\x9b\x9b\x2b\xa9\xda\xc5\xde\x55\x77\x1e\x50\x06\xc6\x60\xcd\x0b\x6f\x9d\x36\xf5\x0c\x44\xb2\x6b\xd7\x03\xfa\xa1\xbe\x5a\xca\x11\xbc\x70\x13\x1e\xf3\xcf\xb5\x47\x0f\xf0\xdc\x91\x74\xb2\x07\x35\x11\x8e\x4b\x2c\x80\x44\xd4\xcd\x96\xcb\x0d\xa8\xfa\x52\x23\x3c\x29\x63\xd1\x74\xe9\xb2\x74\x52\x2a\x64\x9f\x80\xfd\x6f\xa8\xc3\xca\x46\xae\x2f\x08\x0d\xe0\x25\x88\xbd\x6d\x9b\x0d\xc5\xbe\xa0\x3f\x1f\xe1\x9b\x7f\xc1\xe5\x01\x26\x2f\x0a\xe2\x6f\xdd\x49\xfa\xee\xc5\x59\xfa\x9f\x7f\xf9\xf9\xe7\x59\xfa\xba\xe7\x99\xc8\xc4\xf9\x37\x26\x2a\x0a\xca\x1a\xee\x40\x89\x65\xf4\x44\x77\xf7\x78\x66\xdd\x4b\x9f\x2Line truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 39705, mode: os.FileMode(420), modTime: time.Unix(1440769324, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 39791, mode: os.FileMode(420), modTime: time.Unix(1440814918, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
@@ -4564,7 +4564,7 @@ func confLocaleLocale_ruRuIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_zhCnIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x7d\xd9\x72\x5b\x47\x96\xe0\x3b\x23\xf8\x0f\x08\x77\x28\xfc\x64\x2a\x5c\x15\xb3\x3c\x08\x9a\x71\xdb\xd5\xae\x9a\x28\xbb\x3c\x25\x57\xf4\x83\xc3\x01\x83\xc0\x25\x89\x16\x80\x8b\xc2\x05\x24\xb3\x3a\x3a\x82\x94\x44\x12\x14\x77\x89\x12\x25\x91\x14\x45\x9a\x14\xa9\x85\x8b\x36\x8a\x24\xb8\x7c\x4c\xe1\x5e\x00\x4f\xfe\x85\x39\x5b\xe6\xcd\xbb\x80\xb2\x7b\x6a\xe6\x45\x22\x6e\x9e\xdc\x4e\x9e\x3c\x5b\x9e\x3c\x99\x2e\x95\x52\x59\xcb\xc9\x24\xdd\x95\xa3\xc6\xd1\x74\xe2\x4b\x3b\xd1\xda\xdd\x6e\x6d\x0d\x35\x1f\xdd\x6a\x8d\x3d\x77\x6f\x3f\x4b\x7c\x99\xab\x24\xbc\xa5\x29\xf7\xf6\x6a\x77\x57\x77\xd7\x80\x5d\xb0\x92\xed\xa7\xf7\xdb\xab\xef\xba\xbb\xb2\x69\x67\xa0\xd7\x4e\x97\xb3\x49\x6f\x7a\xd3\xad\xed\xb7\x97\xd7\xbc\xe5\xb3\xee\x2e\xeb\xc7\x52\xde\x2e\x5b\xf0\x75\xad\xf9\x76\x0d\x2a\x59\xf9\x52\xd2\x3d\xd8\x81\xe6\xba\xbb\x9c\x5c\x7f\x31\x95\x2b\x26\x9b\x0f\xeb\xee\xc9\x3d\xf8\x6d\x67\x72\xe9\x7c\x4a\x7f\x5e\x3f\x6d\x1c\xad\xbb\x07\xb3\xee\xcc\x7b\x06\xf9\xf9\xf8\x51\xf3\xe5\xcb\xc4\x6f\x12\xde\xf6\x46\xe2\x92\x53\x48\xe7\xf3\x97\xdd\x91\x37\xad\xe1\x79\x86\xba\x74\x91\xbf\x49\xd3\x76\xb5\x92\x6c\x0f\x0d\xb9\x63\x47\xf2\xa1\x5a\x4a\x7a\x6f\xb6\xdc\xd1\xc9\xee\xae\xb2\xd5\x9f\x73\x2a\x56\x59\x7f\xb8\x6e\xf5\x3a\xb9\x8a\x95\x74\x77\x1e\x78\xf7\x0f\x9b\x27\x73\xcd\x17\x0f\xbb\xbb\xae\x59\x65\x27\x67\x17\x93\xee\xc9\x5d\x77\x7c\xaa\x39\x5e\xf3\x96\x5e\x76\x77\x95\xd2\xfd\x30\xf5\xd5\x77\x30\xcb\xee\xae\x8a\x55\x28\xe5\xd3\x50\xd3\xdb\x5a\xa5\x39\xe7\xd3\xc5\xfe\x2a\x42\x30\xfe\xda\x43\xe3\xed\xd5\xc3\xee\xae\x4c\xd9\x02\xa8\x54\xd1\xba\x9e\x74\x6b\x8b\x6e\xfd\xc8\xbb\xbf\x07\xb8\xed\xe9\xe9\xe9\xee\xaa\x3a\x56\x39\x55\x2a\xdb\x7d\xb9\xbc\x95\x4a\x17\xb3\xa9\x02\x22\xad\x39\xbf\xe5\xd5\xde\x37\xce\x56\xbd\xe1\x5d\x77\xe6\xb6\xb7\xf8\xd6\x5d\x7f\xc4\x53\xb1\xb2\x80\xa1\x54\xda\x49\xba\xef\x5f\x33\x6e\x18\x18\x17\x06\x1b\x2b\xa6\x0b\xaa\xbe\x3b\x3b\x05\xeb\x50\x48\xe7\xf2\xc9\xf6\x8d\x9d\xe6\xce\x2b\x1c\xbf\xe3\x5c\xb7\x61\xb1\xdc\xdd\xd1\xe6\x93\x61\xc4\x46\xaa\x32\x58\x82\x1a\xab\x3b\xad\x9d\x75\xf5\x35\x93\x2e\x55\x32\x03\xe9\x64\xfb\xf9\x64\x6b\x77\x98\x3e\x21\x68\xc9\x06\x44\xd9\xe5\xc1\x64\xa3\x7e\xd7\x3d\xba\xdb\xdd\x65\x97\xfb\xd3\xc5\xdc\xdf\xd2\x15\xc4\x54\xb3\x7e\xab\x59\x1f\xeb\xee\x2a\xe4\xca\x65\xbb\x9c\x6c\xdf\x5b\x72\x6f\xce\x74\x77\xc1\xb4\x53\x58\x35\x30\x77\xd5\x00\x16\x16\x72\xfd\x65\xc4\x62\xeb\x6c\xb8\xb9\x59\x77\xd7\xef\xb7\x6f\x6e\x99\xe5\x7d\x76\xf9\x6a\xa0\xb2\xf7\xf6\xb4\x39\xbf\x62\x82\xc0\x38\x02\x10\x7a\x28\xe9\x22\x2c\x07\x15\x37\x77\x56\x9b\xb3\xa3\x5e\x6d\xce\x28\x4e\x67\x0b\x80\xcb\x52\xba\x68\xe5\xa5\x5c\x51\x6f\x3a\x93\xb1\xab\xc5\x4a\xca\xb1\x2a\x95\x5c\xb1\x1f\xb0\x7d\x30\x0b\x18\x6d\xed\x9c\x36\x4f\x76\x60\x21\xe2\x3f\x0f\xda\x55\xbd\x98\xc9\xc6\xc1\xf3\xc6\xd1\x11\xaf\xa1\x14\xe9\x6a\xbc\x3e\xaa\x1a\xcd\xc1\x49\xf5\x59\x16\x6c\xa2\xa5\x21\x98\x82\xf7\xb6\xee\xde\xde\x82\xe5\xaa\xe6\xf3\x80\xbc\xbf\x56\x2d\xa7\x02\x9d\xcd\xd6\xdc\xc3\xfd\xd6\xee\x7b\xef\xd5\x8d\xee\xae\x9c\xe3\xc0\x67\x20\x83\x0d\x77\xea\x1e\x8f\x1e\x9b\xca\xa4\x8b\x19\x98\x8e\x3b\x73\xdf\xdb\xaf\xe1\x87\xef\x1c\x2b\x5d\xce\x0c\x7c\x8f\xa3\xc6\x3f\x92\xde\xec\x12\xec\x48\xa2\xbe\x98\x25\x45\x1a\x4a\x2a\x92\xa2\x3e\xa4\x0b\x68\xda\xce\xc2\xb4\xea\x3f\x09\x3d\x7c\x97\x2b\x3a\x15\xd8\x74\xd0\xb2\xfc\x05\x5b\x68\xbc\xf5\xd3\x88\xde\x1f\xb9\x4a\x9e\x18\x85\xf7\x72\xb5\x75\x36\xdb\x5a\x9d\xe4\xf2\xe6\xd6\x84\x7b\x34\x83\xbd\xff\xb5\x0a\x1b\x2f\x95\xed\x65\xfe\xf3\xa5\xdd\xef\x24\xdc\x91\xe1\xd6\xce\x81\x3b\x3b\xdd\x7c\xb1\xeb\xdd\xdb\xf3\xa6\x76\x60\x58\x8d\x83\xa3\xc4\x57\x83\x57\xfe\xf7\x1f\xff\x3e\x34\xfc\x8d\xed\x54\xfa\xcb\x16\xfc\x48\x78\xb5\xfb\x09\xf8\x1f\xda\xf8\xed\xdf\x87\x00\x25\xd0\x10\xf7\xa9\x2b\x2a\x14\x63\x09\x92\xb9\x2e\x68\xbe\xaa\xbb\x8f\x27\x90\x97\x39\x95\xa4\xd1\x4f\xdd\x5b\x3a\x12\x24\xf8\xb0\x82\x0d\xbd\x79\x42\x25\x6a\xd7\x40\x27\xb4\xfb\x74\x31\x6c\xc0\xe6\xe6\x1e\x15\x20\xfb\x83\x36\xdd\xa7\x37\xbc\xc7\x4b\xde\x8d\xad\xc6\xc9\x19\x54\xe6\x49\xfd\x7c\x0c\xbb\xec\xbd\x7c\xf9\xc3\xd7\x5f\xff\xe9\x8b\x7f\x4e\xb8\xc7\xf7\xbc\xbb\xd3\x8d\xfa\x06\x6c\xff\x44\xb5\xd2\xf7\xdf\x53\xfd\x56\xd1\x2a\x03\x93\xcc\xe4\x12\xee\xf6\x42\xf3\xe5\xd3\xf6\xe2\x28\xcd\xda\x71\xf2\xc0\x35\x60\x69\xae\x5c\x01\x94\x6c\xad\xba\xc7\x33\x38\xd6\xca\x80\x3f\x10\xef\xfe\x58\xa3\xbe\xdf\x7a\xbf\xeb\x9e\xde\x82\x0a\x7f\xcd\x23\xda\x65\x48\x82\xc0\x84\x3f\x29\xd8\x61\x06\x3c\xf5\x61\x95\xcb\x29\xe0\x76\x95\xc1\x94\x54\xa6\xf6\xb9\x6a\x22\xb6\x9b\xc6\xc1\x54\xeb\xe6\x09\x2c\x5c\xf3\xd9\x11\x35\xd1\xdd\xa5\x66\xc0\x6b\xe4\x1e\xcd\xc3\x7c\x41\xe6\x00\x63\x55\xcb\x84\xa2\x88\x50\x28\x85\x82\x3f\xf5\x59\x63\xf1\xec\x05\x94\x36\x27\x6e\x78\x13\x27\xed\x91\xf7\xcd\x1b\x2f\xf4\xa6\xe6\x2a\xed\x85\xe7\xcd\xc7\xd3\xb0\xd9\x1b\xf5\x97\x3f\x1f\x0f\x33\xa1\xf3\x98\x99\xce\xbd\x27\x87\xcd\xc5\x1d\x92\x3d\xba\x48\xb5\xee\x8d\x0f\x79\x4b\xe3\x24\xf3\x5a\x67\x4b\x40\xac\x5c\xa5\x7d\xf3\xc4\xdd\x1b\x6d\xad\xbd\x70\xb7\x1f\x78\xf3\x20\xa0\xa6\x5b\xbb\x1b\xdc\x08\xcd\xaf\x5Line truncated
|
||||
var _confLocaleLocale_zhCnIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x7d\xd9\x72\x1b\x47\xb6\xe0\xbb\x22\xf4\x0f\x15\xbe\xa1\xf0\x93\xe5\x70\x77\xcc\xf2\x20\x68\xa6\xaf\xfb\x5e\x77\x4f\xb4\xdd\x9e\x96\x3b\xee\x83\xc3\x01\x83\x40\x91\xc4\x15\x80\x42\xa3\x00\xc9\xec\x1b\x37\x82\x94\x44\x12\x14\x77\x89\x12\x25\x91\x14\x45\x9a\x14\x69\x4a\x5c\x64\x49\x14\x49\x70\xf9\x98\x46\x15\x80\x27\xff\xc2\x9c\x2d\xb3\xb2\x16\x50\x76\x4f\xcf\xbc\x48\x44\xe5\xc9\xed\x64\xe6\xd9\xf2\x9c\x93\x99\x72\x39\x9d\xb3\xdd\x6c\xca\x5b\x3e\x6a\x1e\x4d\x59\x9f\x39\x56\x7b\x77\xbb\xbd\x39\xd8\x7a\x72\xa7\x3d\xba\xe5\xdd\xfd\xc1\xfa\x2c\x5f\xb5\xfc\xc5\x49\xef\xee\xca\xc5\x0b\x17\x2f\xf4\x3b\x45\x3b\xd5\x79\xfe\xb0\xb3\xf2\xf6\xe2\x85\x5c\xc6\xed\xef\x71\x32\x95\x5c\xca\x9f\xda\xf0\xea\xfb\x9d\xa5\x55\x7f\xe9\xec\xe2\x05\xfb\xbb\x72\xc1\xa9\xd8\xf0\x75\xb5\xf5\x66\x15\x2a\xd9\x85\x72\xca\x3b\xd8\x81\xe6\x2e\x5e\x70\xf3\x7d\xa5\x74\xbe\x94\x6a\x3d\x6e\x78\x27\x0f\xe0\xb7\x93\xcd\x67\x0a\x69\xfd\x79\xed\xb4\x79\xb4\xe6\x1d\xcc\x78\xd3\xef\x18\xe4\xa7\xe3\x27\xad\x97\x2f\xad\x5f\x59\xfe\xf6\xba\x75\xc5\x2d\x66\x0a\x85\xab\xde\xf0\xeb\xf6\xd0\x1c\x43\x5d\xf9\x98\xbf\x49\xd3\x4e\xad\x9a\xea\x0c\x0e\x7a\xa3\x47\xf2\xa1\x56\x4e\xf9\xaf\x37\xbd\x91\x89\x8b\x17\x2a\x76\x5f\xde\xad\xda\x15\xfd\xe1\xa6\xdd\xe3\xe6\xab\x76\xca\xdb\x79\xe4\x3f\x3c\x6c\x9d\xcc\xb6\x5e\x3c\xbe\x78\xe1\x86\x5d\x71\xf3\x4e\x29\xe5\x9d\xdc\xf7\xc6\x26\x5b\x63\x75\x7f\xf1\xe5\xc5\x0b\xe5\x4c\x1f\x4c\x7d\xe5\x2d\xcc\xf2\xe2\x85\xaa\x5d\x2c\x17\x32\x50\xd3\xdf\x5c\xa1\x39\x17\x32\xa5\xbe\x1a\x42\x30\xfe\x3a\x83\x63\x9d\x95\xc3\x8b\x17\xb2\x15\x1b\xa0\xd2\x25\xfb\x66\xca\xab\x2f\x78\x8d\x23\xff\xe1\x1e\xe0\xf6\xf2\xe5\xcb\x17\x2f\xd4\x5c\xbb\x92\x2e\x57\x9c\xde\x7c\xc1\x4e\x67\x4a\xb9\x74\x11\x91\xd6\x9a\xdb\xf4\xeb\xef\x9a\x67\x2b\xfe\xd0\xae\x37\x7d\xd7\x5f\x78\xe3\xad\x3d\xe1\xa9\xd8\x39\xc0\x50\x3a\xe3\xa6\xbc\x77\x3f\x32\x6e\x18\x18\x17\x06\x1b\x2b\x65\x8a\xaa\xbe\x37\x33\x09\xeb\x50\xcc\xe4\x0b\xa9\xce\xad\x9d\xd6\xce\x2b\x1c\xbf\xeb\xde\x74\x60\xb1\xbc\xdd\x91\xd6\xb3\x21\xc4\x46\xba\x3a\x50\x86\x1a\x2b\x3b\xed\x9d\x35\xf5\x35\x9b\x29\x57\xb3\xfd\x99\x54\x67\x6b\xa2\xbd\x3b\x44\x9f\x10\xb4\xec\x00\xa2\x9c\xca\x40\xaa\xd9\xb8\xef\x1d\xdd\xbf\x78\xc1\xa9\xf4\x65\x4a\xf9\xbf\x66\xaa\x88\xa9\x56\xe3\x4e\xab\x31\x7a\xf1\x42\x31\x5f\xa9\x38\x95\x54\xe7\xc1\xa2\x77\x7b\xfa\xe2\x05\x98\x76\x1a\xab\x86\xe6\xae\x1a\xc0\xc2\x62\xbe\xaf\x82\x58\x6c\x9f\x0d\xb5\x36\x1a\xde\xda\xc3\xce\xed\x4d\xb3\xbc\xd7\xa9\x5c\x0f\x55\xf6\xdf\x9c\xb6\xe6\x96\x4d\x10\x18\x47\x08\x42\x0f\x25\x53\x82\xe5\xa0\xe2\xd6\xce\x4a\x6b\x66\xc4\xaf\xcf\x1a\xc5\x99\x5c\x11\x70\x59\xce\x94\xec\x82\x94\xab\xdd\x9b\xc9\x66\x9d\x5a\xa9\x9a\x76\xed\x6a\x35\x5f\xea\x03\x6c\x1f\xcc\x00\x46\xdb\x3b\xa7\xad\x93\x1d\x58\x88\xe4\xcf\x03\x4e\x4d\x2f\x66\xaa\x79\xb0\xd5\x3c\x3a\xe2\x35\x94\x22\x5d\x8d\xd7\x47\x55\xa3\x39\xb8\xe9\x5e\xdb\x86\x43\xb4\x38\x08\x53\xf0\xdf\x34\xbc\xbb\x9b\xb0\x5c\xb5\x42\x01\x90\xf7\x97\x9a\xed\x56\xa1\xb3\x99\xba\x77\xb8\xdf\xde\x7d\xe7\xbf\xba\x75\xf1\x42\xde\x75\xe1\x33\x6c\x83\x75\x6f\xf2\x01\x8f\x1e\x9b\xca\x66\x4a\x59\x98\x8e\x37\xfd\xd0\xdf\xaf\xe3\x87\xaf\x5d\x3b\x53\xc9\xf6\x7f\x83\xa3\xc6\x3f\x52\xfe\xcc\x22\x9c\x48\xda\x7d\x09\x4b\x8a\x7b\x28\xa5\xb6\x14\xf5\x21\x5d\x40\xd3\x4e\x0e\xa6\xd5\xf8\x5e\xf6\xc3\xd7\xf9\x92\x5b\x85\x43\x07\x2d\xcb\x5f\x70\x84\xc6\xda\xdf\x0f\xeb\xf3\x91\xaf\x16\x88\x50\xf8\x2f\x57\xda\x67\x33\xed\x95\x09\x2e\x6f\x6d\x8e\x7b\x47\xd3\xd8\xfb\x5f\x6a\x70\xf0\xd2\xb9\x1e\xa6\x3f\x9f\x39\x7d\xae\xe5\x0d\x0f\xb5\x77\x0e\xbc\x99\xa9\xd6\x8b\x5d\xff\xc1\x9e\x3f\xb9\x03\xc3\x6a\x1e\x1c\x59\x9f\x0f\x5c\xfb\xdf\x7f\xf8\xdb\xe0\xd0\x97\x8e\x5b\xed\xab\xd8\xf0\xc3\xf2\xeb\x0f\x2d\xf8\x1f\xda\xf8\xf5\xdf\x06\x01\x25\xd0\x10\xf7\xa9\x2b\x2a\x14\x63\x09\x6e\x73\x5d\xd0\x7a\xd5\xf0\x9e\x8e\x23\x2d\x73\xab\x29\xa3\x9f\x86\xbf\x78\x24\x48\x08\x60\x05\x1b\xfa\xf0\x44\x4a\xd4\xa9\x81\x4e\xe8\xf4\xe9\x62\x38\x80\xad\x8d\x3d\x2a\x40\xf2\x07\x6d\x7a\xcf\x6f\xf9\x4f\x17\xfd\x5b\x9b\xcd\x93\x33\xa8\xcc\x93\xfa\xe9\x18\x4e\xd9\x3b\xf9\xf2\xfb\x2f\xbe\xf8\xe3\x6f\xff\xd9\xf2\x8e\x1f\xf8\xf7\xa7\x9a\x8d\x75\x38\xfe\x56\xad\xda\xfb\xdf\xd3\x7d\x76\xc9\xae\x00\x91\xcc\xe6\x2d\x6f\x7b\xbe\xf5\xf2\x79\x67\x61\x84\x66\xed\xba\x05\xa0\x1a\xb0\x34\xd7\xae\x01\x4a\x36\x57\xbc\xe3\x69\x1c\x6b\xb5\x3f\x18\x88\xff\x70\xb4\xd9\xd8\x6f\xbf\xdb\xf5\x4e\xef\x40\x85\xbf\x14\x10\xed\x32\x24\x41\xa0\x15\x4c\x0a\x4e\x98\x01\x4f\x7d\xd8\x95\x4a\x1a\xa8\x5d\x75\x20\x2d\x95\xa9\x7d\xae\x6a\x25\x76\xd3\x3c\x98\x6c\xdf\x3e\x81\x85\x6b\xfd\x70\x44\x4d\x5c\xbc\xa0\x66\xc0\x6b\xe4\x1d\xcd\xc1\x7c\x81\xe7\x00\x61\x55\xcb\x84\xac\x88\x50\x28\x85\x82\x3f\xf5\x59\x63\xf1\xec\x05\x94\xb6\xc6\x6f\xf9\xe3\x27\x9d\xe1\x77\xad\x5b\x2f\xf4\xa1\xe6\x2a\x9d\xf9\xad\xd6\xd3\x29\x38\xec\xcd\xc6\xcb\x9f\x8e\x87\x78\xa3\xf3\x98\x79\x9f\xfb\xcf\x0e\x5b\x0b\x3b\xc4\x7b\x74\x91\x6a\xdd\x1f\x1b\xf4\x17\xc7\x88\xe7\xb5\xcf\x16\x61\xb3\x72\x95\xce\xed\x13\x6f\x6f\xa4\xbd\xfa\xc2\xdb\x7e\xe4\xcf\x01\x83\x9a\x6a\xef\xaLine truncated
|
||||
|
||||
func confLocaleLocale_zhCnIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4579,7 +4579,7 @@ func confLocaleLocale_zhCnIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_zh-CN.ini", size: 38783, mode: os.FileMode(493), modTime: time.Unix(1440714696, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_zh-CN.ini", size: 39233, mode: os.FileMode(493), modTime: time.Unix(1440786516, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ package v1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
|
||||
@@ -14,8 +17,33 @@ import (
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
)
|
||||
|
||||
// GET /repos/:username/:reponame/hooks
|
||||
// https://developer.github.com/v3/repos/hooks/#list-hooks
|
||||
// ToApiHook converts webhook to API format.
|
||||
func ToApiHook(repoLink string, w *models.Webhook) *api.Hook {
|
||||
config := map[string]string{
|
||||
"url": w.URL,
|
||||
"content_type": w.ContentType.Name(),
|
||||
}
|
||||
if w.HookTaskType == models.SLACK {
|
||||
s := w.GetSlackHook()
|
||||
config["channel"] = s.Channel
|
||||
config["username"] = s.Username
|
||||
config["icon_url"] = s.IconURL
|
||||
config["color"] = s.Color
|
||||
}
|
||||
|
||||
return &api.Hook{
|
||||
ID: w.ID,
|
||||
Type: w.HookTaskType.Name(),
|
||||
URL: fmt.Sprintf("%s/settings/hooks/%d", repoLink, w.ID),
|
||||
Active: w.IsActive,
|
||||
Config: config,
|
||||
Events: w.EventsArray(),
|
||||
Updated: w.Updated,
|
||||
Created: w.Created,
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#list-hooks
|
||||
func ListRepoHooks(ctx *middleware.Context) {
|
||||
hooks, err := models.GetWebhooksByRepoId(ctx.Repo.Repository.ID)
|
||||
if err != nil {
|
||||
@@ -25,31 +53,13 @@ func ListRepoHooks(ctx *middleware.Context) {
|
||||
|
||||
apiHooks := make([]*api.Hook, len(hooks))
|
||||
for i := range hooks {
|
||||
h := &api.Hook{
|
||||
ID: hooks[i].ID,
|
||||
Type: hooks[i].HookTaskType.Name(),
|
||||
Active: hooks[i].IsActive,
|
||||
Config: make(map[string]string),
|
||||
}
|
||||
|
||||
// Currently, onle have push event.
|
||||
h.Events = []string{"push"}
|
||||
|
||||
h.Config["url"] = hooks[i].URL
|
||||
h.Config["content_type"] = hooks[i].ContentType.Name()
|
||||
if hooks[i].HookTaskType == models.SLACK {
|
||||
s := hooks[i].GetSlackHook()
|
||||
h.Config["channel"] = s.Channel
|
||||
}
|
||||
|
||||
apiHooks[i] = h
|
||||
apiHooks[i] = ToApiHook(ctx.Repo.RepoLink, hooks[i])
|
||||
}
|
||||
|
||||
ctx.JSON(200, &apiHooks)
|
||||
}
|
||||
|
||||
// POST /repos/:username/:reponame/hooks
|
||||
// https://developer.github.com/v3/repos/hooks/#create-a-hook
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#create-a-hook
|
||||
func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) {
|
||||
if !models.IsValidHookTaskType(form.Type) {
|
||||
ctx.JSON(422, &base.ApiJsonErr{"invalid hook type", base.DOC_URL})
|
||||
@@ -72,7 +82,11 @@ func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) {
|
||||
ContentType: models.ToHookContentType(form.Config["content_type"]),
|
||||
Secret: form.Config["secret"],
|
||||
HookEvent: &models.HookEvent{
|
||||
PushOnly: true, // Only support it now.
|
||||
ChooseEvents: true,
|
||||
HookEvents: models.HookEvents{
|
||||
Create: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_CREATE)),
|
||||
Push: com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PUSH)),
|
||||
},
|
||||
},
|
||||
IsActive: form.Active,
|
||||
HookTaskType: models.ToHookTaskType(form.Type),
|
||||
@@ -84,7 +98,10 @@ func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) {
|
||||
return
|
||||
}
|
||||
meta, err := json.Marshal(&models.SlackMeta{
|
||||
Channel: channel,
|
||||
Channel: channel,
|
||||
Username: form.Config["username"],
|
||||
IconURL: form.Config["icon_url"],
|
||||
Color: form.Config["color"],
|
||||
})
|
||||
if err != nil {
|
||||
ctx.JSON(500, &base.ApiJsonErr{"slack: JSON marshal failed: " + err.Error(), base.DOC_URL})
|
||||
@@ -101,25 +118,10 @@ func CreateRepoHook(ctx *middleware.Context, form api.CreateHookOption) {
|
||||
return
|
||||
}
|
||||
|
||||
apiHook := &api.Hook{
|
||||
ID: w.ID,
|
||||
Type: w.HookTaskType.Name(),
|
||||
Events: []string{"push"},
|
||||
Active: w.IsActive,
|
||||
Config: map[string]string{
|
||||
"url": w.URL,
|
||||
"content_type": w.ContentType.Name(),
|
||||
},
|
||||
}
|
||||
if w.HookTaskType == models.SLACK {
|
||||
s := w.GetSlackHook()
|
||||
apiHook.Config["channel"] = s.Channel
|
||||
}
|
||||
ctx.JSON(201, apiHook)
|
||||
ctx.JSON(201, ToApiHook(ctx.Repo.RepoLink, w))
|
||||
}
|
||||
|
||||
// PATCH /repos/:username/:reponame/hooks/:id
|
||||
// https://developer.github.com/v3/repos/hooks/#edit-a-hook
|
||||
// https://github.com/gogits/go-gogs-client/wiki/Repositories#edit-a-hook
|
||||
func EditRepoHook(ctx *middleware.Context, form api.EditHookOption) {
|
||||
w, err := models.GetWebhookByID(ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
@@ -142,7 +144,10 @@ func EditRepoHook(ctx *middleware.Context, form api.EditHookOption) {
|
||||
if w.HookTaskType == models.SLACK {
|
||||
if channel, ok := form.Config["channel"]; ok {
|
||||
meta, err := json.Marshal(&models.SlackMeta{
|
||||
Channel: channel,
|
||||
Channel: channel,
|
||||
Username: form.Config["username"],
|
||||
IconURL: form.Config["icon_url"],
|
||||
Color: form.Config["color"],
|
||||
})
|
||||
if err != nil {
|
||||
ctx.JSON(500, &base.ApiJsonErr{"slack: JSON marshal failed: " + err.Error(), base.DOC_URL})
|
||||
@@ -153,17 +158,25 @@ func EditRepoHook(ctx *middleware.Context, form api.EditHookOption) {
|
||||
}
|
||||
}
|
||||
|
||||
// Update events
|
||||
w.PushOnly = false
|
||||
w.SendEverything = false
|
||||
w.ChooseEvents = true
|
||||
w.Create = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_CREATE))
|
||||
w.Push = com.IsSliceContainsStr(form.Events, string(models.HOOK_EVENT_PUSH))
|
||||
if err = w.UpdateEvent(); err != nil {
|
||||
ctx.JSON(500, &base.ApiJsonErr{"UpdateEvent: " + err.Error(), base.DOC_URL})
|
||||
return
|
||||
}
|
||||
|
||||
if form.Active != nil {
|
||||
w.IsActive = *form.Active
|
||||
}
|
||||
|
||||
// FIXME: edit events
|
||||
if err := models.UpdateWebhook(w); err != nil {
|
||||
ctx.JSON(500, &base.ApiJsonErr{"UpdateWebhook: " + err.Error(), base.DOC_URL})
|
||||
return
|
||||
}
|
||||
|
||||
ctx.JSON(200, map[string]interface{}{
|
||||
"ok": true,
|
||||
})
|
||||
ctx.JSON(200, ToApiHook(ctx.Repo.RepoLink, w))
|
||||
}
|
||||
@@ -396,7 +396,10 @@ func SlackHooksNewPost(ctx *middleware.Context, form auth.NewSlackHookForm) {
|
||||
}
|
||||
|
||||
meta, err := json.Marshal(&models.SlackMeta{
|
||||
Channel: form.Channel,
|
||||
Channel: form.Channel,
|
||||
Username: form.Username,
|
||||
IconURL: form.IconURL,
|
||||
Color: form.Color,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Handle(500, "Marshal", err)
|
||||
@@ -452,7 +455,6 @@ func checkWebhook(ctx *middleware.Context) (*OrgRepoCtx, *models.Webhook) {
|
||||
default:
|
||||
ctx.Data["HookType"] = "gogs"
|
||||
}
|
||||
w.GetEvent()
|
||||
|
||||
ctx.Data["History"], err = w.History(1)
|
||||
if err != nil {
|
||||
@@ -530,7 +532,10 @@ func SlackHooksEditPost(ctx *middleware.Context, form auth.NewSlackHookForm) {
|
||||
}
|
||||
|
||||
meta, err := json.Marshal(&models.SlackMeta{
|
||||
Channel: form.Channel,
|
||||
Channel: form.Channel,
|
||||
Username: form.Username,
|
||||
IconURL: form.IconURL,
|
||||
Color: form.Color,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Handle(500, "Marshal", err)
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<div class="inline required field {{if .Err_RepoName}}error{{end}}">
|
||||
<label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
|
||||
<input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required>
|
||||
<span class="help">{{.i18n.Tr "repo.repo_name_helper"}}</span>
|
||||
<span class="help">{{.i18n.Tr "repo.repo_name_helper" | Safe}}</span>
|
||||
</div>
|
||||
<div class="inline field">
|
||||
<label>{{.i18n.Tr "repo.visibility"}}</label>
|
||||
|
||||
@@ -8,7 +8,20 @@
|
||||
</div>
|
||||
<div class="required field {{if .Err_Channel}}error{{end}}">
|
||||
<label for="channel">{{.i18n.Tr "repo.settings.slack_channel"}}</label>
|
||||
<input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="#general" required>
|
||||
<input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="e.g. #general" required>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="username">{{.i18n.Tr "repo.settings.slack_username"}}</label>
|
||||
<input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="e.g. Gogs">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="icon_url">{{.i18n.Tr "repo.settings.slack_icon_url"}}</label>
|
||||
<input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="e.g. https://example.com/img/favicon.png">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="color">{{.i18n.Tr "repo.settings.slack_color"}}</label>
|
||||
<input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="e.g. #dd4b39, good, warning, danger">
|
||||
</div>
|
||||
{{template "repo/settings/hook_settings" .}}
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user