mirror of
https://github.com/fleetdm/fleet
synced 2026-05-13 03:59:14 +00:00
Closes: https://github.com/fleetdm/fleet/issues/35983 Changes: - Updated the Fleet website's `builtStaticContent.appLibrary` configuration to include Fleet-maintained apps for Windows - Added platform filters and Windows apps to the /software-catalog page - Updated the URLs for Fleet maintained app detail pages to include the app's platform, and added redirects for all changed URLs.
51 lines
1.1 KiB
JavaScript
Vendored
51 lines
1.1 KiB
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View app library',
|
|
|
|
|
|
description: 'Display "App library" page.',
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
viewTemplatePath: 'pages/app-library'
|
|
},
|
|
badConfig: { responseType: 'badConfig' },
|
|
},
|
|
|
|
|
|
fn: async function () {
|
|
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.appLibrary) || !sails.config.builtStaticContent.appLibrary) {
|
|
throw {badConfig: 'builtStaticContent.appLibrary'};
|
|
}
|
|
|
|
let allApps = sails.config.builtStaticContent.appLibrary;
|
|
|
|
let macOsApps = _.filter(allApps, (app)=>{
|
|
return app.platform === 'darwin';
|
|
});
|
|
macOsApps = _.sortBy(macOsApps, (app)=>{
|
|
return app.name.toLowerCase();
|
|
});
|
|
|
|
let windowsApps = _.filter(allApps, (app)=>{
|
|
return app.platform === 'windows';
|
|
});
|
|
windowsApps = _.sortBy(windowsApps, (app)=>{
|
|
return app.name.toLowerCase();
|
|
});
|
|
// Respond with view.
|
|
return {
|
|
allApps,
|
|
windowsApps,
|
|
macOsApps,
|
|
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|