fleet/website/api/controllers/view-app-library.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

36 lines
727 B
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;
allApps = _.sortBy(allApps, 'name');
// Respond with view.
return {
allApps,
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
};
}
};