mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Website: enable search on policy and vital pages. (#25728)
Related to: #25718 Changes: - Added search to vitals and policy pages.
This commit is contained in:
parent
3060f452c2
commit
9bac36c1d8
7 changed files with 46 additions and 48 deletions
26
website/assets/js/pages/policy-details.page.js
vendored
26
website/assets/js/pages/policy-details.page.js
vendored
|
|
@ -15,19 +15,19 @@ parasails.registerPage('policy-details', {
|
|||
mounted: async function () {
|
||||
// Note: Docsearch will be disabled on this page until a search index has been created for it.
|
||||
// Note: Docsearch will only be enabled if sails.config.custom.algoliaPublicKey is set. If the value is undefined, the documentation search will be disabled.
|
||||
// if(this.algoliaPublicKey) {
|
||||
// docsearch({
|
||||
// appId: 'NZXAYZXDGH',
|
||||
// apiKey: this.algoliaPublicKey,
|
||||
// indexName: 'fleetdm',
|
||||
// container: '#docsearch-query',
|
||||
// placeholder: 'Search',
|
||||
// debug: false,
|
||||
// searchParameters: {
|
||||
// 'facetFilters': ['section:queries']
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
if(this.algoliaPublicKey) {
|
||||
docsearch({
|
||||
appId: 'NZXAYZXDGH',
|
||||
apiKey: this.algoliaPublicKey,
|
||||
indexName: 'fleetdm',
|
||||
container: '#docsearch-query',
|
||||
placeholder: 'Search',
|
||||
debug: false,
|
||||
searchParameters: {
|
||||
'facetFilters': ['section:policies']
|
||||
},
|
||||
});
|
||||
}
|
||||
let columnNamesForThisQuery = [];
|
||||
let tableNamesForThisQuery = [];
|
||||
if(this.columnNamesForSyntaxHighlighting){
|
||||
|
|
|
|||
26
website/assets/js/pages/policy-library.page.js
vendored
26
website/assets/js/pages/policy-library.page.js
vendored
|
|
@ -13,19 +13,19 @@ parasails.registerPage('policy-library', {
|
|||
//…
|
||||
},
|
||||
mounted: async function () {
|
||||
// if(this.algoliaPublicKey) { // Note: Docsearch will only be enabled if sails.config.custom.algoliaPublicKey is set. If the value is undefined, the documentation search will be disabled.
|
||||
// docsearch({
|
||||
// appId: 'NZXAYZXDGH',
|
||||
// apiKey: this.algoliaPublicKey,
|
||||
// indexName: 'fleetdm',
|
||||
// container: '#docsearch-query',
|
||||
// placeholder: 'Search',
|
||||
// debug: false,
|
||||
// searchParameters: {
|
||||
// 'facetFilters': ['section:queries']
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
if(this.algoliaPublicKey) { // Note: Docsearch will only be enabled if sails.config.custom.algoliaPublicKey is set. If the value is undefined, the documentation search will be disabled.
|
||||
docsearch({
|
||||
appId: 'NZXAYZXDGH',
|
||||
apiKey: this.algoliaPublicKey,
|
||||
indexName: 'fleetdm',
|
||||
container: '#docsearch-query',
|
||||
placeholder: 'Search',
|
||||
debug: false,
|
||||
searchParameters: {
|
||||
'facetFilters': ['section:policies']
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
|
|
|
|||
28
website/assets/js/pages/vital-details.page.js
vendored
28
website/assets/js/pages/vital-details.page.js
vendored
|
|
@ -20,22 +20,20 @@ parasails.registerPage('vital-details', {
|
|||
if(['#apple','#linux','#windows','#chrome'].includes(window.location.hash)){
|
||||
this.selectedPlatform = window.location.hash.split('#')[1];
|
||||
}
|
||||
|
||||
// Note: Docsearch will be disabled on this page until a search index has been created for it.
|
||||
// Note: Docsearch will only be enabled if sails.config.custom.algoliaPublicKey is set. If the value is undefined, the documentation search will be disabled.
|
||||
// if(this.algoliaPublicKey) {
|
||||
// docsearch({
|
||||
// appId: 'NZXAYZXDGH',
|
||||
// apiKey: this.algoliaPublicKey,
|
||||
// indexName: 'fleetdm',
|
||||
// container: '#docsearch-query',
|
||||
// placeholder: 'Search',
|
||||
// debug: false,
|
||||
// searchParameters: {
|
||||
// 'facetFilters': ['section:queries']
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
if(this.algoliaPublicKey) {
|
||||
docsearch({
|
||||
appId: 'NZXAYZXDGH',
|
||||
apiKey: this.algoliaPublicKey,
|
||||
indexName: 'fleetdm',
|
||||
container: '#docsearch-query',
|
||||
placeholder: 'Search',
|
||||
debug: false,
|
||||
searchParameters: {
|
||||
'facetFilters': ['section:vitals']
|
||||
},
|
||||
});
|
||||
}
|
||||
let columnNamesForThisQuery = [];
|
||||
let tableNamesForThisQuery = [];
|
||||
if(this.columnNamesForSyntaxHighlighting){
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@
|
|||
[purpose='policy-search'] {
|
||||
margin-top: 32px;
|
||||
width: 100%;
|
||||
.input-group {
|
||||
.input-group, .DocSearch-Button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
website/views/pages/policy-details.ejs
vendored
4
website/views/pages/policy-details.ejs
vendored
|
|
@ -10,7 +10,7 @@
|
|||
<span><%- policy.name %></span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div purpose="search" id="docsearch-query" class="d-flex">
|
||||
<div purpose="search" id="docsearch-query" class="d-flex">
|
||||
<div purpose="disabled-search" class="d-flex w-100">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div purpose="policy-details-and-sidebar" class="d-flex flex-lg-row flex-column">
|
||||
<div purpose="policy-details" class="d-flex flex-column">
|
||||
|
|
|
|||
4
website/views/pages/policy-library.ejs
vendored
4
website/views/pages/policy-library.ejs
vendored
|
|
@ -8,7 +8,7 @@
|
|||
<p>A collection of policies, OS settings, and scripts for macOS, Windows, and Linux.</p>
|
||||
<p>Contributions welcome <a target="_blank" href="https://github.com/fleetdm/fleet/blob/main/docs/01-Using-Fleet/standard-query-library/standard-query-library.yml">over on GitHub.</a></p>
|
||||
</div>
|
||||
<!-- <div purpose="policy-search" id="docsearch-query" class="d-flex">
|
||||
<div purpose="policy-search" id="docsearch-query" class="d-flex">
|
||||
<div purpose="disabled-search" class="d-flex">
|
||||
<div class="input-group d-flex flex-nowrap">
|
||||
<div class="input-group-prepend">
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div purpose="platform-filters" class="d-flex flex-row justify-content-center">
|
||||
<div purpose="platform-filter" :class="[selectedPlatform === 'macos' ? 'selected' : '']" class="d-flex flex-row justify-content-center align-items-center" @click="clickSelectPlatform('macos')">
|
||||
|
|
|
|||
4
website/views/pages/vital-details.ejs
vendored
4
website/views/pages/vital-details.ejs
vendored
|
|
@ -6,7 +6,7 @@
|
|||
<h2>Vitals</h2>
|
||||
<p>Fleet’s built-in queries for collecting and storing important device information.</p>
|
||||
</div>
|
||||
<!-- <div purpose="vitals-search" id="docsearch-query" class="d-flex">
|
||||
<div purpose="vitals-search" id="docsearch-query" class="d-flex">
|
||||
<div purpose="disabled-search" class="d-flex">
|
||||
<div class="input-group d-flex flex-nowrap">
|
||||
<div class="input-group-prepend">
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div purpose="platform-filters" class="d-flex flex-row justify-content-center">
|
||||
<div purpose="platform-filter" :class="[selectedPlatform === 'apple' ? 'selected' : '']" class="d-flex flex-row justify-content-center align-items-center" @click="clickSelectPlatform('apple')">
|
||||
|
|
|
|||
Loading…
Reference in a new issue