1234567891011121314151617181920212223242526272829303132333435 |
- module.exports ={
- index(context,done) {
- return this.list(context,done)
- },
- list(context,done) {
- var tbl = [];
- for(var k in context.manager.registry) {
- var v = context.manager.registry[k];
- if(v == undefined) {
- continue;
- }
- tbl.push({
- id: v.id,
- name:v.name,
- state: v.info.state,
- package: (v.info.pkgInfo)?v.info.pkgInfo.name:"",
- version: (v.info.pkgInfo)?v.info.pkgInfo.version:"",
- author: ((v.info.pkgInfo)?v.info.pkgInfo.author.name:"") || "?",
- modulePath: v.modulePath,
- });
- }
- tbl = tbl.sort((a,b) => { return a.id - b.id});
- done(tbl);
- }
- }
|