status.js 745 B

12345678910111213141516171819202122232425262728293031323334353637
  1. console.log("Reloading controller");
  2. module.exports = {
  3. memory(context,done) {
  4. // Wait call?
  5. //
  6. // Get first result
  7. var [ret] = context.manager.call("hci-monitor:getStat");
  8. done(ret.result);
  9. },
  10. bundles(context,done) {
  11. var tbl = [];
  12. for(var k in context.manager.registry) {
  13. var v = context.manager.registry[k];
  14. if(v == undefined) {
  15. continue;
  16. }
  17. tbl.push({
  18. id: v.id,
  19. name:v.name,
  20. state: v.info.state,
  21. package: (v.info.pkgInfo)?v.info.pkgInfo.name:"",
  22. version: (v.info.pkgInfo)?v.info.pkgInfo.version:"",
  23. author: ((v.info.pkgInfo)?v.info.pkgInfo.author.name:"") || "?",
  24. modulePath: v.modulePath,
  25. });
  26. }
  27. tbl = tbl.sort((a,b) => { return a.id - b.id});
  28. done(tbl);
  29. }
  30. }