fleet/website/api/controllers/docs/view-app-details.js
Eric e890981e1c
Website: Move documentation pages into docs/ folder, rename scripts to script-library (#42510)
Changes:
- Moved documentation pages into the docs/ folder
- Updated routes, poicies, and importer.less
- Renamed the "scripts" page to "script-library" to be consistent with
the other landing pages for YAML documentation
- removed a stray console.log() in the new-licence page script
2026-03-26 15:32:48 -05:00

61 lines
1.2 KiB
JavaScript
Vendored

module.exports = {
friendlyName: 'View app details',
description: 'Display "App details" page.',
inputs: {
appIdentifier: {
type: 'string',
required: true,
description: 'the identifier of an app in Fleet\'s maintained software catalog.',
example: '1password'
},
},
exits: {
success: {
viewTemplatePath: 'pages/docs/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.
let pageTitleForMeta = thisApp.name + ' | Fleet software catalog';
// let pageDescriptionForMeta = 'TODO'
// Respond with view.
return {
thisApp,
// pageDescriptionForMeta,
pageTitleForMeta,
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
};
}
};