2024-11-27 19:43:23 +00:00
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
friendlyName: 'View app details',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description: 'Display "App details" page.',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inputs: {
|
|
|
|
|
appIdentifier: {
|
|
|
|
|
type: 'string',
|
|
|
|
|
required: true,
|
2025-07-09 22:02:11 +00:00
|
|
|
description: 'the identifier of an app in Fleet\'s maintained software catalog.',
|
2024-11-27 19:43:23 +00:00
|
|
|
example: '1password'
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
exits: {
|
|
|
|
|
|
|
|
|
|
success: {
|
|
|
|
|
viewTemplatePath: 'pages/app-details'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
badConfig: {
|
|
|
|
|
responseType: 'badConfig'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
notFound: {
|
|
|
|
|
responseType: 'notFound'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn: async function ({appIdentifier}) {
|
|
|
|
|
|
|
|
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.appLibrary) || !sails.config.builtStaticContent.appLibrary) {
|
|
|
|
|
throw {badConfig: 'builtStaticContent.appLibrary'};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let thisApp = _.find(sails.config.builtStaticContent.appLibrary, { identifier: appIdentifier });
|
|
|
|
|
if (!thisApp) {
|
|
|
|
|
throw 'notFound';
|
|
|
|
|
}
|
|
|
|
|
// FUTURE: make these better.
|
2025-07-09 22:02:11 +00:00
|
|
|
let pageTitleForMeta = thisApp.name + ' | Fleet software catalog';
|
2024-11-27 19:43:23 +00:00
|
|
|
// let pageDescriptionForMeta = 'TODO'
|
|
|
|
|
|
|
|
|
|
// Respond with view.
|
|
|
|
|
return {
|
|
|
|
|
thisApp,
|
|
|
|
|
// pageDescriptionForMeta,
|
|
|
|
|
pageTitleForMeta,
|
2025-02-03 12:13:26 +00:00
|
|
|
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
2024-11-27 19:43:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|