bundles.js 615 B

1234567891011121314151617181920212223242526272829303132333435
  1. module.exports ={
  2. index(context,done) {
  3. return this.list(context,done)
  4. },
  5. list(context,done) {
  6. var tbl = [];
  7. for(var k in context.manager.registry) {
  8. var v = context.manager.registry[k];
  9. if(v == undefined) {
  10. continue;
  11. }
  12. tbl.push({
  13. id: v.id,
  14. name:v.name,
  15. state: v.info.state,
  16. package: (v.info.pkgInfo)?v.info.pkgInfo.name:"",
  17. version: (v.info.pkgInfo)?v.info.pkgInfo.version:"",
  18. author: ((v.info.pkgInfo)?v.info.pkgInfo.author.name:"") || "?",
  19. modulePath: v.modulePath,
  20. });
  21. }
  22. tbl = tbl.sort((a,b) => { return a.id - b.id});
  23. done(tbl);
  24. }
  25. }