wifi.js 1020 B

123456789101112131415161718192021222324252627282930
  1. module.exports.name = 'wifi'
  2. module.exports.description = 'List associated wifi networks and their usage information'
  3. // Specify this reporter requires a backup.
  4. // The second parameter to func() is now a backup instead of the path to one.
  5. module.exports.requiresBackup = true
  6. // Specify this reporter supports the promises API for allowing chaining of reports.
  7. module.exports.usesPromises = true
  8. module.exports.func = function (program, backup, resolve, reject) {
  9. backup.getWifiList()
  10. .then((items) => {
  11. var result = program.formatter.format(items['List of known networks'], {
  12. program: program,
  13. columns: {
  14. 'Last Joined': el => el.lastJoined,
  15. 'Last AutoJoined': el => el.lastAutoJoined,
  16. 'SSID': el => el.SSID_STR,
  17. 'BSSID': el => el.BSSID,
  18. 'Security': el => el.SecurityMode || '',
  19. 'Hidden': el => el.HIDDEN_NETWORK || '',
  20. 'Enabled': el => el.enabled
  21. }
  22. })
  23. resolve(result)
  24. })
  25. .catch(reject)
  26. }