Skip to content

Commit

Permalink
Merge branch 'master' into eliminate_unnecessary_bracketing
Browse files Browse the repository at this point in the history
Signed-off-by: Gergely Karácsonyi <64634678+mrgarris0n@users.noreply.github.com>
  • Loading branch information
mrgarris0n authored May 13, 2024
2 parents 1980852 + b54ec22 commit 19711ef
Show file tree
Hide file tree
Showing 26 changed files with 719 additions and 274 deletions.
30 changes: 30 additions & 0 deletions _data/external_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ sn-prod-binaries-dl:
url: https://www.syslog-ng.com/products/open-source-log-management/3rd-party-binaries.aspx
title: [ "syslog-ng Open Source Edition installation packages" ]

sn-blogs:
id: sn-blogs
url: https://syslog-ng.com/blog/
title: [ "syslog-ng blogs" ]

mm-site:
id: mm-site
url: https://mademistakes.com/work/minimal-mistakes-jekyll-theme/
title: [ "Minimal Mistakes" ]

mm-javascripts:
id: mm-javascripts
url: https://mmistakes.github.io/minimal-mistakes/docs/javascript/
Expand Down Expand Up @@ -142,3 +152,23 @@ lunr-search-help:
id: lunr-search-help
url: https://lunrjs.com/guides/searching.html
title: [ "Lunar search help" ]

grafana-loki:
id: grafana-loki
url: https://grafana.com/docs/loki/latest/
title: [ "Grafana Loki" ]

grafana-loki-endpoint:
id: grafana-loki-endpoint
url: https://grafana.com/docs/loki/latest/reference/loki-http-api/#push-log-entries-to-loki
title: [ "Grafana Loki HTTP endpoint" ]

app-default-cred:
id: app-default-cred
url: https://cloud.google.com/docs/authentication/application-default-credentials
title: [ "Application Default Credentials" ]

grpc-core:
id: grpc-core
url: https://grpc.github.io/grpc/core/group__grpc__arg__keys.html
title: [ "GRPC Core library documentation" ]
14 changes: 13 additions & 1 deletion _data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ admin-guide-nav:
subnav:
- title: "wildcard-file() source options"
url: /admin-guide/060_Sources/030_Wildcard-file/000_Wildcard-file_options
- title: "Jellyfin"
url: /admin-guide/060_Sources/035_Jellyfin/README
subnav:
- title: "kubernetes"
url: /admin-guide/060_Sources/040_Kubernetes/README
subnav:
Expand Down Expand Up @@ -384,6 +387,11 @@ admin-guide-nav:
subnav:
- title: "logmatic() destination options"
url: /admin-guide/070_Destinations/120_Logmatic_io/000_Logmatic_options
- title: "Loki"
url: /admin-guide/070_Destinations/125_Loki/README
subnav:
- title: "loki() destination options"
url: /admin-guide/070_Destinations/125_Loki/001_Loki_options
- title: "mongodb"
url: /admin-guide/070_Destinations/130_MongoDB/README
subnav:
Expand Down Expand Up @@ -1239,4 +1247,8 @@ doc-guide-nav:
url: /doc-guide/02_Tools/README
subnav:
- title: "Self made helper tools"
url: /doc-guide/02_Tools/01_Our_helpers
url: /doc-guide/02_Tools/01_Self_made_tools/README
subnav:
- title: "Self made tools testing"
url: /doc-guide/02_Tools/01_Self_made_tools/01_Tests/README
subnav:
10 changes: 3 additions & 7 deletions _includes/doc/admin-guide/manpages-footnote.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
The syslog-ng.conf manual page
The syslog-ng manual page

>**NOTE:** For the detailed documentation of syslog-ng OSE see
>[syslog-ng OSE Documentation page](https://www.syslog-ng.com/).
>
>If you experience any problems or need help with syslog-ng OSE, visit
>the [syslog-ng mailing list](https://lists.balabit.hu/mailman/listinfo/syslog-ng).
>
>For news and notifications about syslog-ng OSE, visit the [syslog-ng blogs](https://syslog-ng.com/blog/).
>**NOTE:**
>If you experience any problems or need help with syslog-ng OSE, visit the syslog-ng mailing list. \
>For news and notifications about syslog-ng OSE, visit the syslog-ng blogs.
{: .notice--info}
15 changes: 15 additions & 0 deletions _includes/doc/admin-guide/options/channel-args.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## channel-args()

| Type:| |
|Default:| |

*Description:* The `channel-args()` option is available in gRPC-based drivers. The option accepts name-value pairs and sets channel arguments defined in the GRPC Core library documentation.

### Example: channel-args() declaration

```config
channel-args(
"grpc.loadreporting" => 1
"grpc.minimal_stack" => 0
)
```
24 changes: 24 additions & 0 deletions _includes/doc/admin-guide/options/gRPC-keep-alive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## keep-alive()

This option configures the forwarding of [gRPC keepalive pings](https://grpc.io/docs/guides/keepalive/) in syslog-ng OSE.

### max-pings-without-data()

| Type:| integer|
|Default:| |

*Description:* This option definies the maximum number of gRPC pings that are allowed to be sent when there is no data/header frame. Any pings succeeding this limit are not sent. Setting this option to `0` disables this restriction and keep sending pings.

### time()

| Type:| number[milliseconds]|
|Default:| |

*Description:* syslog-ng OSE sends a gRPC keepalive ping after the amount of time defined in the `time()` option elapsed.

### timeout()

| Type:| number[milliseconds]|
|Default:| 10|

*Description:* The time syslog-ng OSE waits for an acknowledgement.
105 changes: 73 additions & 32 deletions _js/custom/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ $(function () {
var tocMenuElement = tocElement.querySelector('.toc__menu');
if (null == tocMenuElement || false == tocMenuElement.hasChildNodes)
shouldHide = true;
}
if (shouldHide) {
// TOC is autogenerated via 'include toc.html' so its size is not known prior the call of toc.html
// Signal emptiness, css will hide if needed based on it and config settings
// NOTE: Not hiding directly here to behave the same way like the left sidebar does
tocElement.classList.add('empty');
if (shouldHide) {
// TOC is autogenerated via 'include toc.html' so its size is not known prior the call of toc.html
// Signal emptiness, css will hide if needed based on it and config settings
// NOTE: Not hiding directly here to behave the same way like the left sidebar does
tocElement.classList.add('empty');
}
}
}

Expand Down Expand Up @@ -298,7 +298,7 @@ $(function () {
// Add anchors for headings
// -------------
function addPageAnchors() {
// FIXME: This magic 6 must be maintained together now with generate_links.rb (and other places ?!)
// FIXME: This magic 6 must be maintained together now with generate_links.rb (and other places ?!), eliminate it!
$('.page__content').find('h1, h2, h3, h4, h5, h6').each(function () {
var id = $(this).attr('id');
if (id) {
Expand All @@ -312,21 +312,37 @@ $(function () {
});
}

function alterPageForTooltip(content, fullPageContent) {
// To support page links even better if possible in case the page has no description / subtitle, but has some text
// right after the title and before the first heading is presented, it will be treated as the description and will be handled here.
// This part should also handle the case when only the title presented. (a.k.a. not showing the tooltip in that case),
// also responsible to create a uniform look and fell both for page title tooltips and other link tooltips.
//
function alterContentForTooltip(content, url, isFullPageContent) {
let tempContainer = document.createElement('div');
tempContainer.innerHTML = content;

if (fullPageContent)
hideTocIfNotNeeded(tempContainer, true);
hideTocIfNotNeeded(tempContainer, true);

// Remove/Override some default title style formatting to look better in the tooltip
const pageTitle = tempContainer.querySelector('#page-title');
if (pageTitle)
pageTitle.style.marginTop = '1em';

const pageSubtitle = tempContainer.querySelector('#page-subtitle');
if (pageSubtitle)
pageSubtitle.style.borderBottom = '0px';
var pageTitle = tempContainer.querySelector('#page-title');
if (pageTitle == null) {
// If there is no page title, replace the first heading with an item looks and behaves like the page title
// to have similar result both for page title tooltips and other link item tooltips
// FIXME: This magic 6 must be maintained together now with generate_links.rb (and other places ?!), eliminate it!
var firstHeading = tempContainer.querySelector("h2, h3, h4, h5, h6");
if (firstHeading) {
// Everything bellow must exist, so intentionally there's no error handling, let it rise
pageTitle = document.querySelector('#page-title').cloneNode(true);
pageTitle.id = firstHeading.id;

const anchorElement = pageTitle.querySelector("a");
anchorElement.textContent = firstHeading.textContent;
anchorElement.href = url;

tempContainer.replaceChild(pageTitle, firstHeading);
}
}
pageTitle.style.marginTop = '1em';

var newContent = tempContainer.innerHTML
// remove unnecessary, reqursive inner content tooltips
Expand All @@ -350,22 +366,37 @@ $(function () {
newContent => {
var startHeading = newContent.querySelector('#' + startHeadingId);
if (startHeading) {
var content = startHeading.outerHTML; // Include the starting <h> element itself
var content = '';
var heading = startHeading.outerHTML; // Include the starting <h> element itself
var nextSibling = startHeading.nextElementSibling;

// Collect all siblings until the next heading or the end of the document
// FIXME: This magic 6 must be maintained together now with generate_links.rb (and other places ?!)
// If handling a page title it will not have next sibling normally at all (we are removed and handling differently the description from the generated page)
// In that case the description is all the normal texts parts in the content, from the top (right bellow the title) to the first heading <h1-6>, try to get, it if there's any.
// If not presented, drop the whole content, return an empty one (a.k.a. do not show title only tooltips)
if (nextSibling == null && false == hasAnchor) {
startHeading = newContent.querySelector('.page__content');
nextSibling = startHeading.firstElementChild;
// First element is the TOC, skip it to be able to produce an empty content
if (nextSibling && nextSibling.classList.contains('sidebar__right'))
nextSibling = nextSibling.nextElementSibling;
}
// Collect all siblings until the next heading or the end of the initial content
// FIXME: This magic 6 must be maintained together now with generate_links.rb (and other places ?!), eliminate it!
while (nextSibling && nextSibling.tagName !== 'H1' && nextSibling.tagName !== 'H2' && nextSibling.tagName !== 'H3' && nextSibling.tagName !== 'H4' && nextSibling.tagName !== 'H5' && nextSibling.tagName !== 'H6') {
content += nextSibling.outerHTML;
nextSibling = nextSibling.nextElementSibling;
}

if (content.length != 0 || hasAnchor)
content = heading + content;

onSuccess(content);
}
else
console.error('Start heading not found by ID: ' + startHeadingId);
onError('Start heading not found by ID: ' + startHeadingId);
},
error => {
error(error);
onError(error);
}
);
}
Expand Down Expand Up @@ -402,10 +433,10 @@ $(function () {
tooltip.style.setProperty(posName, newPosition);
}

function showTooltip(event, tooltipText, fullPageContent) {
function showTooltip(event, tooltipText, isFullPageContent) {
tooltip.innerHTML = tooltipText.innerHTML;

if (fullPageContent)
if (isFullPageContent)
tooltip.classList.add("full-content-tooltip");
else
tooltip.classList.remove("full-content-tooltip");
Expand Down Expand Up @@ -470,7 +501,7 @@ $(function () {
element.appendChild(tooltipText);

element.addEventListener('mouseover', function (event) {
var fullPageContent = element.classList.contains('full-content-tooltip');
var isFullPageContent = element.classList.contains('full-content-tooltip');

tooltipTarget = element;

Expand All @@ -481,26 +512,36 @@ $(function () {
function onSuccess(newContent) {
if (typeof (newContent) === 'object' && 'innerHTML' in newContent)
newContent = newContent.innerHTML;
newContent = alterPageForTooltip(newContent, fullPageContent);

// cache for reuse
tooltipText.innerHTML = newContent;
showTooltip(event, tooltipText, fullPageContent);
newContent = alterContentForTooltip(newContent, url. isFullPageContent);

if (newContent.length > 0) {
// cache for reuse
tooltipText.innerHTML = newContent;
showTooltip(event, tooltipText, isFullPageContent);
}
else {
// Quick navigation from another link with tooltip to this link would keep alive the previous tooltip
// force close it, as we don't have tooltip for the current and this is the live hovered one.
hideTooltip(false);
}
}

function onError(error) {
// Quick navigation from another link with tooltip to this failing link would keep alive the previous tooltip
// force close it, as we don't have tooltip for the current and this is the live hovered one.
hideTooltip(false);
console.error('Error loading the tooltip content!' + error);
}

if (fullPageContent) {
if (isFullPageContent) {
loadContentFromUrl(url, newContent => onSuccess(newContent), error => onError(error));
}
else {
loadContentPartFrom(url, newContent => onSuccess(newContent), error => onError(error));
}
}
else
showTooltip(event, tooltipText, fullPageContent);
showTooltip(event, tooltipText, isFullPageContent);
});
});

Expand Down
Loading

0 comments on commit 19711ef

Please sign in to comment.