mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
consistent use of the _url in REST API
This commit is contained in:
parent
bdd99041f4
commit
dbf0fa6ee0
11 changed files with 23 additions and 19 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<ul ng-if="user">
|
<ul ng-if="user">
|
||||||
<li>
|
<li>
|
||||||
<img ng-src="{{ user.avatar }}" />
|
<img ng-src="{{ user.avatar_url }}" />
|
||||||
</li>
|
</li>
|
||||||
<li ng-init="show=false">
|
<li ng-init="show=false">
|
||||||
<a href="#" ng-click="show=true">
|
<a href="#" ng-click="show=true">
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<ul class="list cozy" ng-show="!waiting && !error">
|
<ul class="list cozy" ng-show="!waiting && !error">
|
||||||
<a class="row row-repo" ng-repeat="repo in repos | orderBy:'full_name' | filter: search_text" ng-href="/{{ repo.full_name }}">
|
<a class="row row-repo" ng-repeat="repo in repos | orderBy:'full_name' | filter: search_text" ng-href="/{{ repo.full_name }}">
|
||||||
<div class="column-avatar">
|
<div class="column-avatar">
|
||||||
<img ng-src="{{ repo.avatar }}" />
|
<img ng-src="{{ repo.avatar_url }}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="column-fill">
|
<div class="column-fill">
|
||||||
<h2>{{ repo.name }}</h2>
|
<h2>{{ repo.name }}</h2>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<ul class="list cozy user-list">
|
<ul class="list cozy user-list">
|
||||||
<li class="row row-user" ng-repeat="user in users | orderBy:'login' | filter: search_text">
|
<li class="row row-user" ng-repeat="user in users | orderBy:'login' | filter: search_text">
|
||||||
<div class="column-avatar">
|
<div class="column-avatar">
|
||||||
<img ng-src="{{ user.avatar || 'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&f=y' }}" />
|
<img ng-src="{{ user.avatar_url || 'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&f=y' }}" />
|
||||||
</div>
|
</div>
|
||||||
<div class="column-fill">
|
<div class="column-fill">
|
||||||
<h2>{{ user.login }} <small ng-if="user.admin" class="label label-success">Admin</small></h2>
|
<h2>{{ user.login }} <small ng-if="user.admin" class="label label-success">Admin</small></h2>
|
||||||
|
|
|
@ -812,7 +812,7 @@ definitions:
|
||||||
{
|
{
|
||||||
"login": "Octocat",
|
"login": "Octocat",
|
||||||
"email": "octocat@github.com",
|
"email": "octocat@github.com",
|
||||||
"avatar": "7194e8d48fa1d2b689f99443b767316c",
|
"avatar_url": "http://www.gravatar.com/avatar/7194e8d48fa1d2b689f99443b767316c",
|
||||||
"admin": false,
|
"admin": false,
|
||||||
"active": true
|
"active": true
|
||||||
}
|
}
|
||||||
|
@ -821,7 +821,7 @@ definitions:
|
||||||
type: string
|
type: string
|
||||||
email:
|
email:
|
||||||
type: string
|
type: string
|
||||||
avatar:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
admin:
|
admin:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
@ -929,6 +929,7 @@ definitions:
|
||||||
"head_commit": {
|
"head_commit": {
|
||||||
"sha": "d101ef3ed6e973b039c3fd5ccdec378b0fa8684c",
|
"sha": "d101ef3ed6e973b039c3fd5ccdec378b0fa8684c",
|
||||||
"ref": "refs\/heads\/master",
|
"ref": "refs\/heads\/master",
|
||||||
|
"link_url": "https:\/\/github.com\/drone\/drone\/commit\/d101ef3ed6",
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"message": "updated the README.md file",
|
"message": "updated the README.md file",
|
||||||
"timestamp": "",
|
"timestamp": "",
|
||||||
|
|
|
@ -302,7 +302,7 @@ func (g *GitHub) push(r *http.Request) (*common.Hook, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return &common.Hook{Repo: repo, Commit: commit}, nil
|
return &common.Hook{Event: "push", Repo: repo, Commit: commit}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ¯\_(ツ)_/¯
|
// ¯\_(ツ)_/¯
|
||||||
|
@ -385,7 +385,7 @@ func (g *GitHub) pullRequest(r *http.Request) (*common.Hook, error) {
|
||||||
// Author.Login
|
// Author.Login
|
||||||
// Author.Email
|
// Author.Email
|
||||||
|
|
||||||
return &common.Hook{Repo: repo, Commit: c, PullRequest: pr}, nil
|
return &common.Hook{Event: "pull_request", Repo: repo, Commit: c, PullRequest: pr}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type pushHook struct {
|
type pushHook struct {
|
||||||
|
|
|
@ -256,7 +256,7 @@ func (g *Gitlab) Hook(req *http.Request) (*common.Hook, error) {
|
||||||
|
|
||||||
func mergeRequest(parsed *gogitlab.HookPayload, req *http.Request) (*common.Hook, error) {
|
func mergeRequest(parsed *gogitlab.HookPayload, req *http.Request) (*common.Hook, error) {
|
||||||
var hook = new(common.Hook)
|
var hook = new(common.Hook)
|
||||||
|
hook.Event = "pull_request"
|
||||||
hook.Repo = &common.Repo{}
|
hook.Repo = &common.Repo{}
|
||||||
hook.Repo.Owner = req.FormValue("owner")
|
hook.Repo.Owner = req.FormValue("owner")
|
||||||
hook.Repo.Name = req.FormValue("name")
|
hook.Repo.Name = req.FormValue("name")
|
||||||
|
@ -295,6 +295,7 @@ func push(parsed *gogitlab.HookPayload, req *http.Request) (*common.Hook, error)
|
||||||
var cloneUrl = parsed.Repository.GitHttpUrl
|
var cloneUrl = parsed.Repository.GitHttpUrl
|
||||||
|
|
||||||
var hook = new(common.Hook)
|
var hook = new(common.Hook)
|
||||||
|
hook.Event = "push"
|
||||||
hook.Repo = &common.Repo{}
|
hook.Repo = &common.Repo{}
|
||||||
hook.Repo.Owner = req.FormValue("owner")
|
hook.Repo.Owner = req.FormValue("owner")
|
||||||
hook.Repo.Name = req.FormValue("name")
|
hook.Repo.Name = req.FormValue("name")
|
||||||
|
|
|
@ -11,8 +11,9 @@ const (
|
||||||
|
|
||||||
type Build struct {
|
type Build struct {
|
||||||
ID int64
|
ID int64
|
||||||
RepoID int64 `json:"-" sql:"unique:ux_build_number,index:ix_build_repo_id"`
|
RepoID int64 `json:"id" sql:"unique:ux_build_number,index:ix_build_repo_id"`
|
||||||
Number int `json:"number" sql:"unique:ux_build_number"`
|
Number int `json:"number" sql:"unique:ux_build_number"`
|
||||||
|
Event string `json:"event"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Started int64 `json:"started_at"`
|
Started int64 `json:"started_at"`
|
||||||
Finished int64 `json:"finished_at"`
|
Finished int64 `json:"finished_at"`
|
||||||
|
@ -26,14 +27,14 @@ type Build struct {
|
||||||
type PullRequest struct {
|
type PullRequest struct {
|
||||||
Number int `json:"number,omitempty"`
|
Number int `json:"number,omitempty"`
|
||||||
Title string `json:"title,omitempty"`
|
Title string `json:"title,omitempty"`
|
||||||
Link string `json:"link,omitempty"`
|
Link string `json:"link_url,omitempty"`
|
||||||
Base *Commit `json:"base_commit,omitempty"`
|
Base *Commit `json:"base_commit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Commit struct {
|
type Commit struct {
|
||||||
Sha string `json:"sha"`
|
Sha string `json:"sha"`
|
||||||
Ref string `json:"ref"`
|
Ref string `json:"ref"`
|
||||||
Link string `json:"link,omitempty"`
|
Link string `json:"link_url,omitempty"`
|
||||||
Branch string `json:"branch" sql:"index:ix_commit_branch"`
|
Branch string `json:"branch" sql:"index:ix_commit_branch"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
Timestamp string `json:"timestamp,omitempty"`
|
Timestamp string `json:"timestamp,omitempty"`
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Hook struct {
|
type Hook struct {
|
||||||
|
Event string
|
||||||
Repo *Repo
|
Repo *Repo
|
||||||
Commit *Commit
|
Commit *Commit
|
||||||
PullRequest *PullRequest
|
PullRequest *PullRequest
|
||||||
|
|
|
@ -6,7 +6,7 @@ type Repo struct {
|
||||||
Owner string `json:"owner" sql:"unique:ux_repo_owner_name"`
|
Owner string `json:"owner" sql:"unique:ux_repo_owner_name"`
|
||||||
Name string `json:"name" sql:"unique:ux_repo_owner_name"`
|
Name string `json:"name" sql:"unique:ux_repo_owner_name"`
|
||||||
FullName string `json:"full_name" sql:"unique:ux_repo_full_name"`
|
FullName string `json:"full_name" sql:"unique:ux_repo_full_name"`
|
||||||
Avatar string `json:"avatar"`
|
Avatar string `json:"avatar_url"`
|
||||||
Self string `json:"self_url"`
|
Self string `json:"self_url"`
|
||||||
Link string `json:"link_url"`
|
Link string `json:"link_url"`
|
||||||
Clone string `json:"clone_url"`
|
Clone string `json:"clone_url"`
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type Status struct {
|
type Status struct {
|
||||||
ID int64 `meddler:"status_id,pk" json:"-"`
|
ID int64 `json:"-"`
|
||||||
CommitID int64 `meddler:"commit_id" json:"-"`
|
CommitID int64 `json:"-"`
|
||||||
State string `meddler:"status_state" json:"state"`
|
State string `json:"status"`
|
||||||
Link string `meddler:"status_link" json:"target_url"`
|
Link string `json:"target_url"`
|
||||||
Desc string `meddler:"status_desc" json:"description"`
|
Desc string `json:"description"`
|
||||||
Context string `meddler:"status_context" json:"context"`
|
Context string `json:"context"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ type User struct {
|
||||||
Token string `json:"-"`
|
Token string `json:"-"`
|
||||||
Secret string `json:"-"`
|
Secret string `json:"-"`
|
||||||
Email string `json:"email,omitempty"`
|
Email string `json:"email,omitempty"`
|
||||||
Avatar string `json:"avatar,omitempty"`
|
Avatar string `json:"avatar_url,omitempty"`
|
||||||
Active bool `json:"active,omitempty"`
|
Active bool `json:"active,omitempty"`
|
||||||
Admin bool `json:"admin,omitempty"`
|
Admin bool `json:"admin,omitempty"`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue