fleet/website/api/controllers/view-app-details.js
Eric 84d222d16d
Website: add navigation and search bar to documentation pages (#25795)
Closes #25655

Changes:
- Created a new component: `<docs-nav-and-search>`, a component that
displays links to documentation pages and a search bar.
- Added the `<docs-nav-and-search>` component to documentation pages,
query pages, policy pages, vitals pages, app library pages, and osquery
schema documentation pages.
- Updated the documentation template page to match the latest
wireframes.
- Updated the osquery schema documentation pages to match the latest
wireframes.

---------

Co-authored-by: Mike Thomas <[email protected]>
2025-02-03 21:13:26 +09: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 app library.',
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.
let pageTitleForMeta = thisApp.name + ' | Fleet app library';
// let pageDescriptionForMeta = 'TODO'
// Respond with view.
return {
thisApp,
// pageDescriptionForMeta,
pageTitleForMeta,
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
};
}
};