mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Closes: https://github.com/fleetdm/fleet/issues/43578 Changes: - Renamed the /query-library page to be /report-library, and added a redirect - Renamed the query-detail template page to report-details, and added redirects for the query pages. - Updated the docs nav to link to the "reports" page instead of queries - Updated mentions of query/queries to be "report/reports" - Renamed the query generator to be the report generator, and added a redirect - Updated the sitemap to use the new URLs for report-related pages <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added dedicated "Reports" library and details pages and client bundles. * **Refactor** * Renamed "Queries" to "Reports" across UI, routes, page headings, and labels (legacy redirects added). * Updated generator branding from "Query robot" to "Report robot" and updated tooltips/messages. * **Chores** * Updated sitemap and navigation to reference /reports and report detail URLs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
45 lines
1.2 KiB
JavaScript
Vendored
45 lines
1.2 KiB
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View report library',
|
|
|
|
|
|
description: 'Display "Report library" page.',
|
|
|
|
|
|
exits: {
|
|
success: { viewTemplatePath: 'pages/docs/report-library' },
|
|
badConfig: { responseType: 'badConfig' },
|
|
},
|
|
|
|
|
|
fn: async function () {
|
|
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.queries)) {
|
|
throw {badConfig: 'builtStaticContent.queries'};
|
|
}
|
|
let reports = _.where(sails.config.builtStaticContent.queries, {kind: 'query'});
|
|
let macOsReports = _.filter(reports, (report)=>{
|
|
let platformsForThisReport = report.platform.split(', ');
|
|
return _.includes(platformsForThisReport, 'darwin');
|
|
});
|
|
let windowsReports = _.filter(reports, (report)=>{
|
|
let platformsForThisReport = report.platform.split(', ');
|
|
return _.includes(platformsForThisReport, 'windows');
|
|
});
|
|
let linuxReports = _.filter(reports, (report)=>{
|
|
let platformsForThisReport = report.platform.split(', ');
|
|
return _.includes(platformsForThisReport, 'linux');
|
|
});
|
|
// Respond with view.
|
|
return {
|
|
macOsReports,
|
|
windowsReports,
|
|
linuxReports,
|
|
algoliaPublicKey: sails.config.custom.algoliaPublicKey,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|