2024-11-27 19:43:23 +00:00
|
|
|
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;
|
2025-12-04 18:02:05 +00:00
|
|
|
|
|
|
|
|
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)=>{
|
2025-11-20 23:37:46 +00:00
|
|
|
return app.name.toLowerCase();
|
|
|
|
|
});
|
2024-11-27 19:43:23 +00:00
|
|
|
// Respond with view.
|
2025-02-03 12:13:26 +00:00
|
|
|
return {
|
|
|
|
|
allApps,
|
2025-12-04 18:02:05 +00:00
|
|
|
windowsApps,
|
|
|
|
|
macOsApps,
|
2025-02-03 12:13:26 +00:00
|
|
|
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
|
|
|
|
};
|
2024-11-27 19:43:23 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|