diff --git a/website/api/controllers/try-fleet/view-explore-data.js b/website/api/controllers/try-fleet/view-explore-data.js deleted file mode 100644 index e170169934..0000000000 --- a/website/api/controllers/try-fleet/view-explore-data.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = { - - - friendlyName: 'View explore data', - - - description: 'Display "Explore data" page.', - - - exits: { - - success: { - viewTemplatePath: 'pages/try-fleet/explore-data' - } - - }, - - - fn: async function () { - - // Respond with view. - return {}; - - } - - -}; diff --git a/website/api/controllers/try-fleet/view-query-report.js b/website/api/controllers/try-fleet/view-query-report.js deleted file mode 100644 index efa6265bbe..0000000000 --- a/website/api/controllers/try-fleet/view-query-report.js +++ /dev/null @@ -1,236 +0,0 @@ -module.exports = { - - - friendlyName: 'View query report', - - - description: 'Display "Query report" page.', - - inputs: { - - hostPlatform: { - type: 'string', - required: true, - description: 'The platform of the host to display results for', - extendedDescription: '', - isIn: ['macos', 'linux', 'windows'] - }, - - tableName: { - type: 'string', - required: true, - description: 'The name of the osquery table to show results for.', - }, - - }, - - - exits: { - - success: { - viewTemplatePath: 'pages/try-fleet/query-report' - }, - - badConfig: { - responseType: 'badConfig' - }, - - redirect: { - description: 'The requesting user is not logged in.', - responseType: 'redirect' - }, - - invalidTable: { - responseType: 'notFound', - description: 'No osquery table with the specified name could be found.' - }, - - }, - - - fn: async function ({hostPlatform, tableName}) { - - if(!_.isObject(sails.config.builtStaticContent) || !_.isArray(sails.config.builtStaticContent.osqueryTables)){ - throw {badConfig: 'builtStaticContent.osqueryTables'}; - } - - // If the requesting user is not logged in, redirect them to the /try-fleet/register page with the specified hostPlatform added as a query parameter. - if(!this.req.me){ - throw {redirect: `/register?targetPlatform=${encodeURIComponent(hostPlatform)}` }; - } - - if(!sails.config.custom.queryIdsByTableName){ - throw new Error('Missing config variable: The dictionary of query ids required to use the query-report page is missing! (sails.config.custom.queryIdsByTableName)'); - } - - if(!sails.config.custom.hostIdsByHostPlatform){ - throw new Error('Missing config variable: The dictionary of host ids required to use the query-report page is missing! (sails.config.custom.hostIdsByHostPlatform)'); - } - - if(!sails.config.custom.teamApidForQueryReports){ - throw new Error('Missing config variable: The id of the team the query report page gets results for is missing! (sails.config.custom.teamApidForQueryReports)'); - } - - if(!sails.config.custom.fleetBaseUrlForQueryReports){ - throw new Error('Missing config variable: The URL of the fleet instance used for query reports is missing! (sails.config.custom.fleetBaseUrlForQueryReports)'); - } - - if(!sails.config.custom.fleetTokenForQueryReports){ - throw new Error('Missing config variable: The API token for requests to the Fleet instance used for queyr reports is missing! (sails.config.custom.fleetTokenForQueryReports)'); - } - - // ┬ ┬┌─┐┌─┐┌┬┐ ┬┌┐┌┌─┐┌─┐┬─┐┌┬┐┌─┐┌┬┐┬┌─┐┌┐┌ - // ├─┤│ │└─┐ │ ││││├┤ │ │├┬┘│││├─┤ │ ││ ││││ - // ┴ ┴└─┘└─┘ ┴ ┴┘└┘└ └─┘┴└─┴ ┴┴ ┴ ┴ ┴└─┘┘└┘ - let hostIdsByHostPlatform = sails.config.custom.hostIdsByHostPlatform; - // Get the ID of the host we'll be showing results for. - let selectedHostId = hostIdsByHostPlatform[hostPlatform]; - - // Send an HTTP request to get the host details for hosts on the query report team. - let hostsOnQueryReportTeamApiResponse = await sails.helpers.http.get.with({ - url: sails.config.custom.fleetBaseUrlForQueryReports+'/api/v1/fleet/hosts?team_id='+encodeURIComponent(sails.config.custom.teamApidForQueryReports), - headers: { - Authorization: `Bearer ${sails.config.custom.fleetTokenForQueryReports}` - } - }) - .intercept((error)=>{ - return new Error(`When sending an API request to ${sails.config.custom.fleetBaseUrlForQueryReports}/api/v1/fleet/hosts?team_id=${sails.config.custom.teamApidForQueryReports} to get information about hosts on the query report team, an error occured: ${error.stack}`); - }); - if(hostsOnQueryReportTeamApiResponse.hosts.length < 1) { - throw new Error(`Error! When view-query-report sent a request to ${sails.config.custom.fleetBaseUrlForQueryReports} to get information about the hosts on the query reports team, the API response contained no hosts.`); - } - - let hostsOnTheQueryReportTeam = hostsOnQueryReportTeamApiResponse.hosts; - let hostsAvailableToQuery = []; - - // Get information about these hosts for the host selector dropdown. - for(let host of hostsOnTheQueryReportTeam) { - let hostInfoForDropdownSelector = { - name: host.hostname, - platform: undefined, - }; - if(host.platform === 'windows'){ - hostInfoForDropdownSelector.platform = 'Windows'; - } else if(host.platform === 'darwin'){ - hostInfoForDropdownSelector.platform = 'macOS'; - } else { - hostInfoForDropdownSelector.platform = 'Linux'; - } - hostsAvailableToQuery.push(hostInfoForDropdownSelector); - } - - // Get the host from the host response - let hostToGetReportFor = _.find(hostsOnTheQueryReportTeam, {'id': selectedHostId}); - // Convert the host's memory from bytes into GB. - let hostsMemoryInGb = hostToGetReportFor.memory / (1024 * 1024 * 1024); - - // If the host's memory is not a whole number of GB, we'll show the first two decimal places. - if(Math.floor(hostsMemoryInGb) !== hostsMemoryInGb){ - hostsMemoryInGb = hostsMemoryInGb.toFixed(2); - } - // Build a dictionary containing information about this host. - let hostDetails = { - os: hostToGetReportFor.os_version, - hardwareType: hostToGetReportFor.hardware_model, - memory: hostsMemoryInGb+'GB', - processor: hostToGetReportFor.cpu_type, - osqueryVersion: hostToGetReportFor.osquery_version, - name: hostToGetReportFor.hostname, - }; - - // ┌─┐┌─┐┌─┐ ┬ ┬┌─┐┬─┐┬ ┬ ┌┬┐┌─┐┌┐ ┬ ┌─┐┌─┐ - // │ │└─┐│─┼┐│ │├┤ ├┬┘└┬┘ │ ├─┤├┴┐│ ├┤ └─┐ - // └─┘└─┘└─┘└└─┘└─┘┴└─ ┴ ┴ ┴ ┴└─┘┴─┘└─┘└─┘ - - // Get the IDs of the queries for this team. - let queryIdsByTableName = sails.config.custom.queryIdsByTableName; - - // Build an array of osquery tables to display, - let osqueryTablesToDisplay = []; - // Only show tables that are compatible with the hosts platform, and that have query ids associated with them in the queryIdsByTableName dictionary. - // This is so when new tables are added, they will only be displayed if they have a query associated with them. - if(hostPlatform === 'macos'){ - osqueryTablesToDisplay = _.filter(sails.config.builtStaticContent.osqueryTables, (table)=>{ - return _.contains(table.platforms, 'darwin') && queryIdsByTableName[`${table.name}`] !== undefined; - }); - } else if(hostPlatform === 'linux'){ - osqueryTablesToDisplay = _.filter(sails.config.builtStaticContent.osqueryTables, (table)=>{ - return _.contains(table.platforms, 'linux') && queryIdsByTableName[`${table.name}`] !== undefined; - }); - } else if(hostPlatform === 'windows'){ - osqueryTablesToDisplay = _.filter(sails.config.builtStaticContent.osqueryTables, (table)=>{ - return _.contains(table.platforms, 'windows') && queryIdsByTableName[`${table.name}`] !== undefined; - }); - } - - // If the specified table does not exist, or is not compatible with the selected host - if(!_.contains(_.pluck(osqueryTablesToDisplay, 'name'), tableName)){ - throw 'invalidTable'; - } - let specifiedOsqueryTable = _.find(osqueryTablesToDisplay, {'name': tableName}); - - // ┌─┐ ┬ ┬┌─┐┬─┐┬ ┬ ┬─┐┌─┐┌─┐┬ ┬┬ ┌┬┐┌─┐ - // │─┼┐│ │├┤ ├┬┘└┬┘ ├┬┘├┤ └─┐│ ││ │ └─┐ - // └─┘└└─┘└─┘┴└─ ┴ ┴└─└─┘└─┘└─┘┴─┘┴ └─┘ - - let queryIdToGetReportFor = queryIdsByTableName[`${tableName}`]; - // Send an HTTP request to get the query report for the query for this table. - let queryReportResponse = await sails.helpers.http.get.with({ - url: sails.config.custom.fleetBaseUrlForQueryReports+'/api/v1/fleet/queries/'+encodeURIComponent(queryIdToGetReportFor)+'/report', - headers: { - Authorization: `Bearer ${sails.config.custom.fleetTokenForQueryReports}` - } - }) - .intercept((error)=>{ - return new Error(`When sending an API request to ${sails.config.custom.fleetBaseUrlForQueryReports}/api/v1/fleet/queries/${queryIdToGetReportFor}/report to get the latest query report for the ${tableName} table, an error occured: ${error.stack}`); - }); - - let queryResults = queryReportResponse.results; - // Group the query results by the host that reported them. - let queryResultsByHostIds = _.groupBy(queryResults, 'host_id'); - // Default these to empty arrays, if there are no results for this host, we'll send an empty array of results array to the page and show the user an empty state. - let reportForThisHost = []; - let reportWithSortedColumns = []; - let topResultLastFetchedAt = 0; - - // Process the query results for this host (If there are any) - if(queryResultsByHostIds[selectedHostId]) { - let resultsForThisHost = queryResultsByHostIds[selectedHostId]; - // Sort the results by their last fetched value. - let resultsOrderedByLastFetched = _.sortByOrder(resultsForThisHost, 'last_fetched'); - // Get a timestamp of when the last result was fetched from the host. - topResultLastFetchedAt = Date.parse(resultsOrderedByLastFetched[0].last_fetched); - // Get an array of the every columns dictionary in the results of this host. - let unsortedReportForThisHost = _.pluck(resultsOrderedByLastFetched, 'columns'); - // Iterate through the results to sort the columns by their order in the osquery schema. - for(let result of unsortedReportForThisHost) { - let sortedColumns = {}; - // Reorder the results by the order of the columns in hte osquery schema, and add the new sorted dictionary to the reportWithSortedColumns array. - specifiedOsqueryTable.columns.forEach(column => { - - if (result[column.name] !== undefined) { - sortedColumns[column.name] = result[column.name]; - } - }); - reportWithSortedColumns.push(sortedColumns); - } - // Break the results into smaller arrays with 20 values each for table pagination - reportForThisHost = _.chunk(reportWithSortedColumns, 20); - } - - - // Respond with view. - return { - lastFetchedAt: topResultLastFetchedAt, - queryReportPages: reportForThisHost, - osqueryTables: osqueryTablesToDisplay, - hostPlatform, - tableName, - osqueryTableInfo: specifiedOsqueryTable, - hostDetails, hostsAvailableToQuery, - }; - - } - - -}; diff --git a/website/assets/js/pages/try-fleet/explore-data.page.js b/website/assets/js/pages/try-fleet/explore-data.page.js deleted file mode 100644 index bc237e3f11..0000000000 --- a/website/assets/js/pages/try-fleet/explore-data.page.js +++ /dev/null @@ -1,25 +0,0 @@ -parasails.registerPage('explore-data', { - // ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗ - // ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣ - // ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝ - data: { - //… - }, - - // ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗ - // ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣ - // ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝ - beforeMount: function() { - //… - }, - mounted: async function() { - //… - }, - - // ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗ - // ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗ - // ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝ - methods: { - //… - } -}); diff --git a/website/assets/js/pages/try-fleet/query-report.page.js b/website/assets/js/pages/try-fleet/query-report.page.js deleted file mode 100644 index f3d76c9494..0000000000 --- a/website/assets/js/pages/try-fleet/query-report.page.js +++ /dev/null @@ -1,115 +0,0 @@ -parasails.registerPage('query-report', { - // ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗ - // ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣ - // ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝ - data: { - pageToDisplay: 0, - numberOfPages: undefined, - selectedTable: undefined, - selectedHost: undefined, - tableToDisplay: undefined, - tableHeaders: undefined, - hostToDisplayResultsFor: undefined, - hostPlatformFriendlyName: '', - hostInfo: {}, - }, - - // ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗ - // ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣ - // ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝ - beforeMount: function() { - this.selectedHost = this.hostPlatform; - this.hostInfo = this.hostDetails; - if(this.selectedHost === 'macos'){ - this.hostPlatformFriendlyName = 'macOS'; - } - if(this.selectedHost === 'windows'){ - this.hostPlatformFriendlyName = 'Windows'; - } - if(this.selectedHost === 'linux'){ - this.hostPlatformFriendlyName = 'Linux'; - } - this.numberOfPages = this.queryReportPages.length; - this.tableToDisplay = this.tableName; - this.selectedTable = this.tableToDisplay; - this.hostToDisplayResultsFor = this.selectedHost; - this.tableHeaders = []; - if(this.numberOfPages !== 0){ - let columnsToShow = _.keys(this.queryReportPages[this.pageToDisplay][0]); - for(let column in columnsToShow){ - let columnName = columnsToShow[column]; - let columnDefinition = _.find(this.osqueryTableInfo.columns, {name: columnName}); - let columnInfo = {name: columnName, description: columnDefinition.description}; - this.tableHeaders.push(columnInfo); - } - } - - }, - mounted: async function() { - if(this.numberOfPages > 0){ - this.addTableEdgeShadow(); - $('[data-toggle="tooltip"]').tooltip(); - } - }, - - watch: { - selectedTable: function(val){ - if(val !== this.tableToDisplay){ - this.goto(`/try-fleet/explore-data/${this.selectedHost}/${this.selectedTable}`); - } - }, - hostToDisplayResultsFor: function(val){ - if(val !== this.selectedHost){ - if(val === 'Linux'){ - this.goto(`/try-fleet/explore-data/linux/apparmor_events`); - } else if(val === 'Windows'){ - this.goto(`/try-fleet/explore-data/windows/appcompat_shims`); - } else { - this.goto(`/try-fleet/explore-data/macos/account_policy_data`); - } - } - } - }, - - // ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗ - // ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗ - // ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝ - methods: { - addTableEdgeShadow: function() { - let tableContainer = document.querySelector('.table-responsive'); - if(tableContainer) { - let isEdgeOfResultsTableVisible = tableContainer.scrollWidth - tableContainer.scrollLeft === tableContainer.clientWidth; - if (!isEdgeOfResultsTableVisible) { - tableContainer.classList.add('right-edge-shadow'); - } - - tableContainer.addEventListener('scroll', (event)=>{ - let container = event.target; - let isScrolledFullyToLeft = container.scrollLeft === 0; - let isScrolledFullyToRight = (container.scrollWidth - container.scrollLeft <= container.clientWidth + 1); - // Update the class on the table container based on how much the table is scrolled. - if (isScrolledFullyToLeft) { - container.classList.remove('edge-shadow', 'left-edge-shadow'); - container.classList.add('right-edge-shadow'); - } else if (isScrolledFullyToRight) { - container.classList.remove('edge-shadow', 'right-edge-shadow'); - container.classList.add('left-edge-shadow'); - } else if(!isScrolledFullyToRight && !isScrolledFullyToLeft) { - container.classList.remove('left-edge-shadow', 'right-edge-shadow'); - container.classList.add('edge-shadow'); - } - }); - } - }, - clickChangePage: function(page){ - this.pageToDisplay = page - 1; - let tableContainer = document.querySelector('.table-responsive'); - window.scrollTo({ - top: tableContainer.offsetTop - 90, - left: 0, - behavior: 'smooth', - }); - }, - - } -}); diff --git a/website/assets/styles/importer.less b/website/assets/styles/importer.less index e6624efd3d..7bc353d322 100644 --- a/website/assets/styles/importer.less +++ b/website/assets/styles/importer.less @@ -74,7 +74,5 @@ @import 'pages/try-fleet/waitlist.less'; @import 'pages/admin/sandbox-waitlist.less'; @import 'pages/integrations.less'; -@import 'pages/try-fleet/query-report.less'; -@import 'pages/try-fleet/explore-data.less'; @import 'pages/start.less'; diff --git a/website/assets/styles/pages/try-fleet/explore-data.less b/website/assets/styles/pages/try-fleet/explore-data.less deleted file mode 100644 index a89455a8e2..0000000000 --- a/website/assets/styles/pages/try-fleet/explore-data.less +++ /dev/null @@ -1,104 +0,0 @@ -#explore-data { - [purpose='page-container'] { - max-width: 1200px; - padding-top: 120px; - padding-left: 100px; - padding-right: 100px; - } - [purpose='page-title'] { - text-align: center; - h1 { - font-size: 48px; - font-weight: 800; - line-height: 57.6px; - } - p { - color: @core-fleet-black-75; - font-size: 14px; - font-weight: 400; - line-height: 21px; - margin-bottom: 24px; - } - } - a { - color: @core-fleet-black-75; - } - a:hover { - text-decoration: none; - [purpose='explore-data-card'] { - box-shadow: 0px 4px 16px 0px #E2E4EA; - } - } - [purpose='explore-data-card'] { - padding: 43px 52px; - margin-left: 12px; - margin-right: 12px; - border-radius: 12px; - box-shadow: none; - } - - [purpose='card-body'] { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - text-align: center; - width: 240px; - h4 { - font-size: 16px; - font-style: normal; - font-weight: 800; - line-height: 19.2px; - margin-bottom: 4px; - } - p { - margin-bottom: 0px; - } - img { - height: 60px; - width: auto; - margin-bottom: 16px; - } - } - @media (max-width: 1201px) { - [purpose='page-container'] { - padding-left: 60px; - padding-right: 60px; - } - [purpose='card-body'] { - width: unset; - } - } - @media (max-width: 991px) { - [purpose='page-container'] { - padding-left: 40px; - padding-right: 40px; - } - [purpose='explore-data-card'] { - padding: 32px; - } - } - @media (max-width: 767px) { - [purpose='page-container'] { - padding-top: 40px; - padding-left: 24px; - padding-right: 24px; - } - [purpose='card-body'] { - width: 240px; - } - [purpose='explore-data-card'] { - padding: 43px 52px; - margin-bottom: 24px; - margin-left: 0; - margin-right: 0; - border-radius: 12px; - box-shadow: none; - } - } - @media (max-width: 450px) { - [purpose='card-body'] { - width: 100%; - } - } -} diff --git a/website/assets/styles/pages/try-fleet/query-report.less b/website/assets/styles/pages/try-fleet/query-report.less deleted file mode 100644 index 2b761eeadb..0000000000 --- a/website/assets/styles/pages/try-fleet/query-report.less +++ /dev/null @@ -1,394 +0,0 @@ -#query-report { - - h1 { - font-size: 24px; - font-weight: 800; - line-height: 28.8px; - margin-bottom: 8px; - } - - p { - color: @core-fleet-black-75; - font-size: 14px; - line-height: 21px; - } - - strong { - color: @core-fleet-black; - } - - a { - color: @core-vibrant-blue; - &:hover { - text-decoration: none; - } - } - - hr { - margin-top: 40px; - margin-bottom: 40px; - } - - [purpose='page-container'] { - max-width: 1200px; - padding-top: 40px; - padding-bottom: 40px; - padding-left: 80px; - padding-right: 80px; - } - - [purpose='host-details-card'] { - margin-bottom: 60px; - box-shadow: none; - border-radius: 8px; - padding: 40px; - - } - - [purpose='host-details'] { - div:not(:last-of-type) { - margin-right: 40px; - } - } - - [purpose='host-selector'] { - margin-right: 16px; - min-width: 150px; - height: 40px; - border-radius: 8px; - padding: 8px 12px; - background: #FAFAFA; - border: 1px solid @core-vibrant-blue-15; - cursor: pointer; - } - - [purpose='host-selector-dropwdown'] { - cursor: pointer; - width: 150px; - } - - [purpose='query-results-container'] { - width: calc(~'100% - 267px - 80px'); - flex-grow: 1; - padding-right: 40px; - padding-left: 20px; - } - - [purpose='table-selector'] { - width: 370px; - height: 40px; - border-radius: 8px; - padding: 8px 12px; - background: #FAFAFA; - border: 1px solid @core-vibrant-blue-15; - cursor: pointer; - } - - [purpose='table-selector-dropwdown'] { - width: 370px; - cursor: pointer; - max-height: 400px; - overflow-y: scroll; - } - - .edge-shadow { - box-shadow: -4px 0 3px 0px rgba(0, 0, 0, 0.07) inset, 4px 0 3px 0px rgba(0, 0, 0, 0.07) inset; - } - - .right-edge-shadow { - box-shadow: -4px 0px 3px 0px rgba(0, 0, 0, 0.07) inset; - } - - .left-edge-shadow { - box-shadow: 4px 0 3px 0px rgba(0, 0, 0, 0.07) inset; - } - - [purpose='table-description'] { - margin-top: 24px; - word-break: break-word; - color: @core-fleet-black-75; - font-size: 14px; - p:first-child { - font-size: 16px; - margin-bottom: 24px; - } - ul { - padding-inline-start: 16px; - } - li { - padding-bottom: 8px; - } - code:not(.bash):not(.hljs):not(.nohighlight):not(.mermaid) { - background: #F1F0FF; - padding: 4px 8px; - font-family: @code-font; - font-size: 13px; - line-height: 16px; - color: @core-fleet-black; - } - pre { - code { - background: none; - padding: 0px; - font-family: @code-font; - font-size: 13px; - line-height: 16px; - color: @core-fleet-black; - } - padding: 24px; - border: 1px solid #E2E4EA; - border-radius: 6px; - margin: 0px 0px 40px; - font-family: @code-font; - background: #F9FAFC; - white-space: break-spaces; - } - p, a { - font-size: 14px; - } - } - [purpose='table-container'] { - margin-bottom: 24px; - z-index: 0; - position: relative; - border-radius: 8px; - border: 1px solid #D6DCE2; - } - [purpose='query-result-table'] { - margin-bottom: 0px; - p { - color: @core-fleet-black-75; - font-size: 14px; - line-height: 21px; - margin-bottom: 0px; - white-space: nowrap; - } - [purpose='column-name'] { - p { - font-weight: 700; - text-transform: capitalize; - border-bottom: 1px dashed; - display: inline; - } - } - tbody { - color: #515774; - border-radius: 8px; - td { - max-height: 48px; - height: 48px; - padding-left: 16px; - padding-right: 16px; - border-right: 1px solid @border-lt-gray; - border-top: 1px solid @border-lt-gray; - position: relative; - } - tr { - td:last-child { - border-right: none; - } - } - tr:first-child { - td { - border-top: none; - background-color: rgba(0, 43, 128, 0.0235294); - // background-color: #F9FAFC - } - td:first-child { - border-top-left-radius: 8px; - } - td:last-child { - border-top-right-radius: 8px; - } - } - tr:last-child { - td:first-child { - border-bottom-left-radius: 8px; - } - td:last-child { - border-bottom-right-radius: 8px; - } - } - } - } - [purpose='page-indicator'] { - margin-bottom: 40px; - a:not(:first-of-type) { - padding-left: 8px; - } - a:not(:last-of-type) { - padding-right: 8px; - } - a { - color: @core-vibrant-blue; - font-weight: 700; - white-space: nowrap; - cursor: pointer; - user-select: none; - [purpose='previous-chevron'] { - display: inline; - height: 8px; - width: 4px; - margin-right: 8px; - } - [purpose='next-chevron'] { - display: inline; - height: 8px; - width: 4px; - margin-left: 8px; - } - } - } - - [purpose='call-to-action-container'] { - width: 269px; - margin-left: 20px; - [purpose='call-to-action-card'] { - padding: 16px; - border-radius: 8px; - box-shadow: none; - } - [purpose='banner-text'] { - h3 { - font-size: 20px; - font-weight: 800; - line-height: 24px; - margin-bottom: 24px; - } - p { - margin-bottom: 24px; - font-size: 14px; - font-style: normal; - font-weight: 400; - line-height: 21px; - } - a { - color: #FFF; - height: 48px; - font-size: 16px; - font-weight: 700; - line-height: 21px; - margin-bottom: 24px; - } - [purpose='fleetctl-link'] { - a { - color: @core-vibrant-blue; - font-size: 14px; - font-weight: 400; - line-height: 21px; - text-align: center; - margin-bottom: 4px; - height: auto; - } - p { - font-size: 12px; - font-weight: 400; - line-height: 18px; - text-align: center; - margin-bottom: 8px; - } - - } - - } - [purpose='banner-image'] { - height: auto; - width: 100%; - img { - margin-bottom: 24px; - height: auto; - width: 100%; - } - } - } - - @media (max-width: 1201px) { - // <1201 width: - } - @media (max-width: 991px) { - // <992 width: - // - The pages padding is reduced: 80px » 40px - // - The available-data div's horizontal padding is reduced to 0 - // - The call to action banner's width is reduced: 269px » 214px - [purpose='page-container'] { - padding-left: 40px; - padding-right: 40px; - } - [purpose='query-results-container'] { - padding-right: 0px; - padding-left: 0px; - } - [purpose='call-to-action-container'] { - width: 214px; - } - - } - @media (max-width: 767px) { - // <768px width: - // - The layout of the page shifts to a column layout. - // - the padding of the host-details-card is reduced. - // - The host selector's width is set to 100% - // - The call to action's width is increased to 100% and it is now stacked under the table - // - The available-data div's width is increased to 100% - [purpose='host-details-card'] { - padding: 32px 24px; - } - [purpose='host-details'] { - div:not(:last-of-type) { - margin-right: unset; - } - } - [purpose='host-selector-container'] { - width: 100%; - } - [purpose='host-selector'] { - margin-right: unset; - width: 100%; - } - [purpose='host-selector-dropwdown'] { - width: calc(~'100% - 48px'); - cursor: pointer; - } - [purpose='query-results-container'] { - width: 100%; - } - [purpose='call-to-action-container'] { - max-width: unset; - width: 100%; - margin-left: 0px; - [purpose='banner-image'] { - img { - height: auto; - width: 100%; - } - } - } - } - @media (max-width: 576px) { - // <577px width: - // - The page's padding is reduced to 20px. - // - The table selector's width is increased to 100% - [purpose='page-container'] { - padding-top: 20px; - padding-left: 20px; - padding-right: 20px; - } - [purpose='table-selector'] { - width: 100%; - } - [purpose='table-selector-dropwdown'] { - width: calc(~'100% - 40px'); - overflow-x: hidden; - .dropdown-item { - padding-left: 8px; - padding-right: 16px; - span { - max-width: calc(~'100% - 40px'); - white-space: break-spaces; - } - } - } - } -} - - diff --git a/website/config/custom.js b/website/config/custom.js index eb2ab10129..682b35fb47 100644 --- a/website/config/custom.js +++ b/website/config/custom.js @@ -307,27 +307,6 @@ module.exports.custom = { // (both in Fleet's query console and on fleetdm.com) versionOfOsquerySchemaToUseWhenGeneratingDocumentation: '5.12.1', - // ███████╗██╗ ██╗██████╗ ██╗ ██████╗ ██████╗ ███████╗ ██████╗ █████╗ ████████╗ █████╗ - // ██╔════╝╚██╗██╔╝██╔══██╗██║ ██╔═══██╗██╔══██╗██╔════╝ ██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗ - // █████╗ ╚███╔╝ ██████╔╝██║ ██║ ██║██████╔╝█████╗ ██║ ██║███████║ ██║ ███████║ - // ██╔══╝ ██╔██╗ ██╔═══╝ ██║ ██║ ██║██╔══██╗██╔══╝ ██║ ██║██╔══██║ ██║ ██╔══██║ - // ███████╗██╔╝ ██╗██║ ███████╗╚██████╔╝██║ ██║███████╗ ██████╔╝██║ ██║ ██║ ██║ ██║ - // ╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ - // - // Config variables in this section are used for the /try-fleet/explore-data page on fleetdm.com - - // For sending requests to a Fleet instance: - // fleetBaseUrlForQueryReports: '…', - // fleetTokenForQueryReports: '…', - - // The API ID of the team of hosts created for query reports. - // teamApidForQueryReports: - - // A dictionary where each key is the name of an osquery table, and the value is the API ID of the query that selects all information from that table. e.g., {'account_policy_data': 2045, 'ad_config': 2047, …} - // queryIdsByTableName: {…} - - // A dictionary where each key is the lowercased platform, and the value is the API ID of a host. e.g., {'macos': 92, 'windows': 94, 'linux': 93} - // hostIdsByHostPlatform: {…} // ███╗ ███╗██╗███████╗ ██████╗ // ████╗ ████║██║██╔════╝██╔════╝ diff --git a/website/config/policies.js b/website/config/policies.js index 5d4552459d..5eeba3abdd 100644 --- a/website/config/policies.js +++ b/website/config/policies.js @@ -50,8 +50,6 @@ module.exports.policies = { 'deliver-mdm-demo-email': true, 'view-support': true, 'view-integrations': true, - 'try-fleet/view-explore-data': true, - 'try-fleet/view-query-report': true, 'deliver-talk-to-us-form-submission': true, 'get-human-interpretation-from-osquery-sql': true, 'customers/view-new-license': true, diff --git a/website/config/routes.js b/website/config/routes.js index 4f3ee77186..23108166bd 100644 --- a/website/config/routes.js +++ b/website/config/routes.js @@ -167,22 +167,6 @@ module.exports.routes = { } }, - 'GET /try-fleet/explore-data': { - action: 'try-fleet/view-explore-data', - locals: { - pageTitleForMeta: 'Explore real data | Fleet', - pageDescriptionForMeta: 'See live data collected from a real device enrolled in Fleet.', - } - }, - - 'GET /try-fleet/explore-data/:hostPlatform/:tableName': {// [?]: https://github.com/fleetdm/fleet/blob/97a0d419e1a25d2155606c09b9c483ae5067544e/website/api/controllers/try-fleet/view-query-report.js#L16 - action: 'try-fleet/view-query-report', - locals: { - pageTitleForMeta: 'Explore real data | Fleet', - pageDescriptionForMeta: 'See live data collected from a real device enrolled in Fleet.', - } - }, - 'GET /admin/email-preview': { action: 'admin/view-email-templates', locals: { @@ -452,6 +436,12 @@ module.exports.routes = { 'GET /docs/deploy/deploy-fleet-on-kubernetes': '/guides/deploy-fleet-on-kubernetes', 'GET /docs/using-fleet/mdm-macos-setup': '/docs/using-fleet/mdm-setup', 'GET /transparency': '/better', + 'GET /try-fleet/explore-data': '/tables/account_policy_data', + 'GET /try-fleet/explore-data/:hostPlatform/:tableName': { + fn: (req, res)=>{ + return res.redirect('/tables/'+req.param('tableName')); + } + }, // ╔╦╗╦╔═╗╔═╗ ╦═╗╔═╗╔╦╗╦╦═╗╔═╗╔═╗╔╦╗╔═╗ ┬ ╔╦╗╔═╗╦ ╦╔╗╔╦ ╔═╗╔═╗╔╦╗╔═╗ // ║║║║╚═╗║ ╠╦╝║╣ ║║║╠╦╝║╣ ║ ║ ╚═╗ ┌┼─ ║║║ ║║║║║║║║ ║ ║╠═╣ ║║╚═╗ diff --git a/website/scripts/build-static-content.js b/website/scripts/build-static-content.js index 098eecd1f5..3c29eb18ba 100644 --- a/website/scripts/build-static-content.js +++ b/website/scripts/build-static-content.js @@ -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; // ██████╗ ███████╗██████╗ ██╗ █████╗ ██████╗███████╗ ███████╗ █████╗ ██╗██╗ ███████╗██████╗ ██████╗ // ██╔══██╗██╔════╝██╔══██╗██║ ██╔══██╗██╔════╝██╔════╝ ██╔════╝██╔══██╗██║██║ ██╔════╝██╔══██╗██╔════╝██╗ // ██████╔╝█████╗ ██████╔╝██║ ███████║██║ █████╗ ███████╗███████║██║██║ ███████╗██████╔╝██║ ╚═╝ diff --git a/website/views/layouts/layout.ejs b/website/views/layouts/layout.ejs index d416310816..58108d5e53 100644 --- a/website/views/layouts/layout.ejs +++ b/website/views/layouts/layout.ejs @@ -546,8 +546,6 @@ - - diff --git a/website/views/pages/try-fleet/explore-data.ejs b/website/views/pages/try-fleet/explore-data.ejs deleted file mode 100644 index 35264ba50f..0000000000 --- a/website/views/pages/try-fleet/explore-data.ejs +++ /dev/null @@ -1,38 +0,0 @@ -
-
-
-

Explore real data

-

See live data collected from a real device enrolled in Fleet.

-
- -
-
-<%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %> diff --git a/website/views/pages/try-fleet/query-report.ejs b/website/views/pages/try-fleet/query-report.ejs deleted file mode 100644 index ca0ca38393..0000000000 --- a/website/views/pages/try-fleet/query-report.ejs +++ /dev/null @@ -1,128 +0,0 @@ -
-
- <% /* Host details card */%> -
-
-
-

Explore real data

-

See live data collected from a real {{hostPlatformFriendlyName}} device running Fleet.

-
-
- - -
-
-
-
-
-

Hardware model

-

{{hostInfo.hardwareType}}

-
-
-

Memory

-

{{hostInfo.memory}}

-
-

Processor

-

{{hostInfo.processor}}

-
-
-

Operating system

-

{{hostInfo.os}}

-
-
-

Osquery

-

{{hostInfo.osqueryVersion}}

-
-
-
- -
- <% /* Query results container (osquery table details, table selector, and query results table) */%> -
-

Available data

-
- - -
-
- <%- osqueryTableInfo.description %> -
-
-
-

Last fetched:

- <%// Query table %> -
- - - - - - - - - - -
-

{{column.name}}

-

{{column.name}}

-

{{columnValue}}

---

-
- <%// Page indicator %> -
- - <%// page indicator for < 5 pages %> - -
-
-
-

Your live query returned no results.

-
-
- <% /* Call to action */%> -
-
-
-

This is not Fleet

-
-
- Fleet cloud city -
-
-

This is not Fleet

-

This is a simple app built on the Fleet API to get a taste of the data. Get in our calendar to see what you can do with multiple hosts in the Fleet UI.

- Talk to us -
- Run Fleet locally -

(Requires Docker)

-
-
-
-
-
-
-
-<%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %>