Commit bc4bf8e7 authored by xuezj's avatar xuezj

获取仓库镜像信息

parent 21737355
...@@ -6,3 +6,13 @@ router.post('/', async (ctx) => { ...@@ -6,3 +6,13 @@ router.post('/', async (ctx) => {
const data = await ctx.container.repository_get(ctx.request.body.namespace) const data = await ctx.container.repository_get(ctx.request.body.namespace)
ctx.body = ctx.ok(data) ctx.body = ctx.ok(data)
}) })
router.post('/getTags', async (ctx) => {
const data = await ctx.container.tag_get(ctx.request.body.reponame)
ctx.body = ctx.ok(data)
})
router.get('/getNamespaceInfo', async (ctx) => {
const data = await ctx.container.getNamespaceInfo(ctx.request.query.namespace)
ctx.body = ctx.ok(data)
})
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "NODE_DEBUG=request NODE_ENV=env nodemon", "start": "NODE_ENV=env nodemon",
"lint": "eslint .", "lint": "eslint .",
"fix": "eslint --fix ." "fix": "eslint --fix ."
}, },
......
...@@ -14,6 +14,10 @@ class Container extends Client { ...@@ -14,6 +14,10 @@ class Container extends Client {
tag_get(reponame) { tag_get(reponame) {
return this.post('GetTagList', { reponame }) return this.post('GetTagList', { reponame })
} }
getNamespaceInfo(namespace) {
return this.post('GetNamespaceInfo', { namespace, limit: 50 })
}
} }
exports.create = function () { exports.create = function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment