ttma1046
2015-11-06 18:37:08 +08:00
不会 curl 的, 快快地写个 jquery, $.ajax()你的 gitlab 的网址加 api 地址会吗?
比如你要看 commits
$.ajax({
url: "http://你的 gitlab 网址 /api/v3/projects/:id/repository/commits", //连接参考楼上 gitlab 的 api doc
method: "GET"
})
.done(function( data ) {
var commitHistory = data;
// 然后就随便玩这个 data object,比如说把你要的 commit message 信息画在网页上阿,等等。。
});
// 这里的 data 应该长这个型
[
{
"id": "ed899a2f4b50b4370feeea94676502b42383c746",
"short_id": "ed899a2f4b5",
"title": "Replace sanitize with escape once",
"author_name": "Dmitriy Zaporozhets",
"author_email": "dzaporozhets@sphereconsultinginc.com",
"created_at": "2012-09-20T11:50:22+03:00",
"message": "Replace sanitize with escape once"
},
{
"id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
"short_id": "6104942438c",
"title": "Sanitize for network graph",
"author_name": "randx",
"author_email": "dmitriy.zaporozhets@gmail.com",
"created_at": "2012-09-20T09:06:12+03:00",
"message": "Sanitize for network graph"
}
]