Website: Osquery schema tables updates (#7964)

* update syntax highlighting, fix scrollbars on safari and firefox, expand mobile nav when searching

* use purpose="" instead of css class

* Update osquery-table-details.ejs

* make type column uppercase
This commit is contained in:
Eric 2022-09-27 14:34:37 -05:00 committed by GitHub
parent 749ff9ec2b
commit 2eb24b974a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View file

@ -58,6 +58,12 @@ parasails.registerPage('osquery-table-details', {
$(el).html(replacementHMTL);
}
});
// Adding [purpose="line-break"] to SQL keywords if they are one of: SELECT, WHERE, FROM, JOIN. (case-insensitive)
$('.hljs-keyword').each((i, el)=>{
for(i in el.innerText.match(/select|where|from|join/gi)) {
$(el).attr({'purpose':'line-break'});
}
});
})();
// Adjust the height of the sidebar navigation to match the height of the html partial
(()=>{

View file

@ -46,6 +46,7 @@
border: 1px solid @core-vibrant-blue;
}
[purpose='mobile-nav'] {
scrollbar-width: none;
padding-top: 16px;
overflow-y: scroll;
height: 100%;
@ -72,10 +73,11 @@
font-size: 14px;
line-height: 14px;
}
[purpose='left-sidebar']::-webkit-scrollbar, [purpose='table-of-contents']::-webkit-scrollbar {
[purpose='left-sidebar']::-webkit-scrollbar, [purpose='table-of-contents']::-webkit-scrollbar, [purpose='mobile-nav']::-webkit-scrollbar {
display: none;
}
[purpose='left-sidebar'] {
scrollbar-width: none;
background: #FFF;
min-width: 245px;
max-width: 250px;
@ -89,6 +91,7 @@
}
}
[purpose='table-of-contents'] {
scrollbar-width: none;
padding-top: 16px;
padding-bottom: 120px;
margin-top: 16px;
@ -201,9 +204,8 @@
.hljs-keyword { // SQL keywords (SELECT, FROM, WHERE, IN, etc.)
color: #AE6DDF;
white-space: pre;
break-before: always;
}
.hljs-keyword:not(:first-of-type)::before {
[purpose='line-break']:not(:first-of-type)::before {
content: '\a';
}
.hljs-attr { // For table and column names
@ -262,6 +264,9 @@
}
}
}
td:nth-child(2) {
text-transform: uppercase;
}
}
li, p, h4 {
word-break: break-word;

View file

@ -22,7 +22,7 @@
<div class="d-flex">
<div purpose="search">
<img style="height: 16px; width: 16px;" class="d-inline mr-2" alt="search" src="/images/icon-search-16x16@2x.png">
<input placeholder="Search tables" v-model="search">
<input placeholder="Search tables" v-model="search" @input="showTableNav = true">
</div>
</div>
</div>