mirror of
https://github.com/fleetdm/fleet
synced 2026-05-05 22:39:17 +00:00
* add osquery tables page * update build script, add fleet schema folder * update layout and page script * add edit-page button, search, remove test attribute from fleet schema * update styles * syntax highlighting, update highlight.js, adjust layout * lint fixes * Update view-osquery-tables.js * requested changes from 1:1 * requested changes - Rename osquery-tables to osquery-table-details & update routes and policies - Update wildcard input and tables details route - Fix lint error - adjust self-calling functions in page script - rename function and adjust the order of functions in page script * add osquery tables to builtStaticContent.markdownPages * update schema folder readme * add redirect for /tables * update table input * remove comment from stylesheet, update syntax highlighting, use variable names from colors.less * update inputs in view action * Updates from PR review * fix lint error * update syntax highlighting, table page styles * Update build-static-content.js * requested changes from code review * Update build-static-content.js * fix build script error * remove string.replaceAll() Co-authored-by: Mike Thomas <[email protected]> Co-authored-by: Mike McNeil <[email protected]>
59 lines
1.5 KiB
JavaScript
Vendored
59 lines
1.5 KiB
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View osquery table details',
|
|
|
|
|
|
description: 'Display "Osquery table details" page.',
|
|
|
|
inputs: {
|
|
tableName : {
|
|
description: 'The slug of the osquery table that this user wants to display',
|
|
example: 'account_policy_data',
|
|
type: 'string',
|
|
required: true,
|
|
}
|
|
},
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
viewTemplatePath: 'pages/osquery-table-details'
|
|
},
|
|
badConfig: { responseType: 'badConfig' },
|
|
notFound: { responseType: 'notFound' },
|
|
|
|
},
|
|
|
|
|
|
fn: async function ({tableName}) {
|
|
|
|
if (!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.markdownPages) || !sails.config.builtStaticContent.compiledPagePartialsAppPath) {
|
|
throw {badConfig: 'builtStaticContent.markdownPages'};
|
|
}
|
|
let tableToDisplay = _.find(sails.config.builtStaticContent.markdownPages, { url: '/tables/' + tableName });
|
|
|
|
if (!tableToDisplay) {// If there's no EXACTLY matching content page, throw a 404.
|
|
throw 'notFound';
|
|
}
|
|
|
|
let pageTitleForMeta = '"'+tableToDisplay.title +'" in osquery | Fleet documentation';
|
|
let pageDescriptionForMeta = 'Read about how to use the "'+tableToDisplay.title+'" table with osquery and Fleet.';
|
|
|
|
|
|
let allTables = sails.config.builtStaticContent.markdownPages.filter((page)=>{
|
|
return !! _.startsWith(page.url, '/tables/');
|
|
});
|
|
// Respond with view.
|
|
return {
|
|
path: require('path'),
|
|
allTables,
|
|
tableToDisplay,
|
|
pageTitleForMeta,
|
|
pageDescriptionForMeta,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|