module.exports = { friendlyName: 'View patch progress', description: 'Display "Patch progress" page.', exits: { success: { viewTemplatePath: 'pages/patch-progress' } }, fn: async function () { // Look for any configured Operating System let teamsInformation = await Host.find().select(['teamDisplayName', 'teamApid']); // console.log(teamsInformation) // Build a list of teams in the Fleet instance using host records. let teamsInFleetInstance = []; for(let team of teamsInformation) { let teamToDisplay = { name: team.teamDisplayName, id: team.teamApid, }; teamsInFleetInstance.push(teamToDisplay); } let teamsToDisplay = _.uniq(teamsInFleetInstance, 'id'); let osComplianceInfo = await sails.helpers.getComplianceInformation.with({complianceType: 'operatingSystem' }); let chromeComplianceInfo = await sails.helpers.getComplianceInformation.with({complianceType: 'chrome' }); let safariComplianceInfo = await sails.helpers.getComplianceInformation.with({complianceType: 'safari' }); let firefoxComplianceInfo = await sails.helpers.getComplianceInformation.with({complianceType: 'firefox' }); let microsoftOfficeComplianceInfo = await sails.helpers.getComplianceInformation.with({complianceType: 'microsoftOffice' }); let flashComplianceInfo = await sails.helpers.getComplianceInformation.with({complianceType: 'flash' }); let patchProgress = { operatingSystem: osComplianceInfo.patchProgress, chrome: chromeComplianceInfo.patchProgress, safari: safariComplianceInfo.patchProgress, firefox: firefoxComplianceInfo.patchProgress, microsoftOffice: microsoftOfficeComplianceInfo.patchProgress, flash: flashComplianceInfo.patchProgress, }; // Used to populate the