Website: Remove "explore data" pages (#19777)
Related to: https://github.com/fleetdm/confidential/issues/5573 Changes: - Deleted /explore-data pages and related files - Added redirects for removed pages. - Removed all explore data related website configuration in the build-static-content script. - Removed the explore data section of the custom configuration.
This commit is contained in:
+3
-21
@@ -24,7 +24,7 @@ module.exports = {
|
||||
let builtStaticContent = {};
|
||||
let rootRelativeUrlPathsSeen = [];
|
||||
let baseHeadersForGithubRequests;
|
||||
let osqueryTables = [];
|
||||
|
||||
if(githubAccessToken) {// If a github token was provided, set headers for requests to GitHub.
|
||||
baseHeadersForGithubRequests = {
|
||||
'User-Agent': 'Fleet-Standard-Query-Library',
|
||||
@@ -674,8 +674,7 @@ module.exports = {
|
||||
let keywordsForSyntaxHighlighting = [];
|
||||
keywordsForSyntaxHighlighting.push(table.name);
|
||||
if(!table.hidden) { // If a table has `"hidden": true` the table won't be shown in the final schema, and we'll ignore it
|
||||
// If the table is not hidden, we'l ladd it to our osquery tables configuration.
|
||||
let tableInfoForQueryReports = { name: table.name, columns: [], platforms: table.platforms};
|
||||
|
||||
// Start building the markdown string for this table.
|
||||
let tableMdString = '\n## '+table.name;
|
||||
if(table.evented){
|
||||
@@ -684,28 +683,13 @@ module.exports = {
|
||||
}
|
||||
// Add the tables description to the markdown string and start building the table in the markdown string
|
||||
tableMdString += '\n\n'+table.description+'\n\n|Column | Type | Description |\n|-|-|-|\n';
|
||||
if(table.description !== ''){
|
||||
let tableDescriptionForQueryReports = table.description;
|
||||
if(table.notes){
|
||||
tableDescriptionForQueryReports += '\n\n**Notes:**\n\n'+table.notes;
|
||||
}
|
||||
let htmlDescriptionForTableInfo = await sails.helpers.strings.toHtml.with({mdString: tableDescriptionForQueryReports, addIdsToHeadings: false});
|
||||
tableInfoForQueryReports.description = htmlDescriptionForTableInfo;
|
||||
}
|
||||
|
||||
// Iterate through the columns of the table, we'll add a row to the markdown table element for each column in this schema table
|
||||
for(let column of _.sortBy(table.columns, 'name')) {
|
||||
// Create an object for this column to add to the osqueryTables config.
|
||||
let columnInfoForQueryReports = {
|
||||
name: column.name
|
||||
};
|
||||
let columnDescriptionForTable = '';// Set the initial value of the description that will be added to the table for this column.
|
||||
if(column.description) {
|
||||
columnDescriptionForTable = column.description;
|
||||
// Convert the markdown description for this table into HTML for tooltips on /try-fleet/explore-data/* pages
|
||||
columnInfoForQueryReports.description = await sails.helpers.strings.toHtml.with({mdString: column.description, addIdsToHeadings: false});
|
||||
}
|
||||
tableInfoForQueryReports.columns.push(columnInfoForQueryReports);
|
||||
// Replacing pipe characters and newlines with html entities in column descriptions to keep it from breaking markdown tables.
|
||||
columnDescriptionForTable = columnDescriptionForTable.replace(/\|/g, '|').replace(/\n/gm, ' ');
|
||||
|
||||
@@ -787,8 +771,7 @@ module.exports = {
|
||||
} else {
|
||||
await sails.helpers.fs.write(htmlOutputPath, htmlString);
|
||||
}
|
||||
// Add information about this table to the osqueryTables array
|
||||
osqueryTables.push(tableInfoForQueryReports);
|
||||
|
||||
// Add this table to the array of schemaTables in builtStaticContent.
|
||||
builtStaticContent.markdownPages.push({
|
||||
url: '/tables/'+encodeURIComponent(table.name),
|
||||
@@ -1078,7 +1061,6 @@ module.exports = {
|
||||
},
|
||||
|
||||
]);
|
||||
builtStaticContent.osqueryTables = osqueryTables;
|
||||
// ██████╗ ███████╗██████╗ ██╗ █████╗ ██████╗███████╗ ███████╗ █████╗ ██╗██╗ ███████╗██████╗ ██████╗
|
||||
// ██╔══██╗██╔════╝██╔══██╗██║ ██╔══██╗██╔════╝██╔════╝ ██╔════╝██╔══██╗██║██║ ██╔════╝██╔══██╗██╔════╝██╗
|
||||
// ██████╔╝█████╗ ██████╔╝██║ ███████║██║ █████╗ ███████╗███████║██║██║ ███████╗██████╔╝██║ ╚═╝
|
||||
|
||||
Reference in New Issue
Block a user