Skip to content

Commit 19711ef

Browse files
authored
Merge branch 'master' into eliminate_unnecessary_bracketing
Signed-off-by: Gergely Karácsonyi <[email protected]>
2 parents 1980852 + b54ec22 commit 19711ef

File tree

26 files changed

+719
-274
lines changed

26 files changed

+719
-274
lines changed

_data/external_links.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ sn-prod-binaries-dl:
5858
url: https://www.syslog-ng.com/products/open-source-log-management/3rd-party-binaries.aspx
5959
title: [ "syslog-ng Open Source Edition installation packages" ]
6060

61+
sn-blogs:
62+
id: sn-blogs
63+
url: https://syslog-ng.com/blog/
64+
title: [ "syslog-ng blogs" ]
65+
66+
mm-site:
67+
id: mm-site
68+
url: https://mademistakes.com/work/minimal-mistakes-jekyll-theme/
69+
title: [ "Minimal Mistakes" ]
70+
6171
mm-javascripts:
6272
id: mm-javascripts
6373
url: https://mmistakes.github.io/minimal-mistakes/docs/javascript/
@@ -142,3 +152,23 @@ lunr-search-help:
142152
id: lunr-search-help
143153
url: https://lunrjs.com/guides/searching.html
144154
title: [ "Lunar search help" ]
155+
156+
grafana-loki:
157+
id: grafana-loki
158+
url: https://grafana.com/docs/loki/latest/
159+
title: [ "Grafana Loki" ]
160+
161+
grafana-loki-endpoint:
162+
id: grafana-loki-endpoint
163+
url: https://grafana.com/docs/loki/latest/reference/loki-http-api/#push-log-entries-to-loki
164+
title: [ "Grafana Loki HTTP endpoint" ]
165+
166+
app-default-cred:
167+
id: app-default-cred
168+
url: https://cloud.google.com/docs/authentication/application-default-credentials
169+
title: [ "Application Default Credentials" ]
170+
171+
grpc-core:
172+
id: grpc-core
173+
url: https://grpc.github.io/grpc/core/group__grpc__arg__keys.html
174+
title: [ "GRPC Core library documentation" ]

_data/navigation.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ admin-guide-nav:
152152
subnav:
153153
- title: "wildcard-file() source options"
154154
url: /admin-guide/060_Sources/030_Wildcard-file/000_Wildcard-file_options
155+
- title: "Jellyfin"
156+
url: /admin-guide/060_Sources/035_Jellyfin/README
157+
subnav:
155158
- title: "kubernetes"
156159
url: /admin-guide/060_Sources/040_Kubernetes/README
157160
subnav:
@@ -384,6 +387,11 @@ admin-guide-nav:
384387
subnav:
385388
- title: "logmatic() destination options"
386389
url: /admin-guide/070_Destinations/120_Logmatic_io/000_Logmatic_options
390+
- title: "Loki"
391+
url: /admin-guide/070_Destinations/125_Loki/README
392+
subnav:
393+
- title: "loki() destination options"
394+
url: /admin-guide/070_Destinations/125_Loki/001_Loki_options
387395
- title: "mongodb"
388396
url: /admin-guide/070_Destinations/130_MongoDB/README
389397
subnav:
@@ -1239,4 +1247,8 @@ doc-guide-nav:
12391247
url: /doc-guide/02_Tools/README
12401248
subnav:
12411249
- title: "Self made helper tools"
1242-
url: /doc-guide/02_Tools/01_Our_helpers
1250+
url: /doc-guide/02_Tools/01_Self_made_tools/README
1251+
subnav:
1252+
- title: "Self made tools testing"
1253+
url: /doc-guide/02_Tools/01_Self_made_tools/01_Tests/README
1254+
subnav:

_includes/doc/admin-guide/manpages-footnote.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
The syslog-ng.conf manual page
44
The syslog-ng manual page
55

6-
>**NOTE:** For the detailed documentation of syslog-ng OSE see
7-
>[syslog-ng OSE Documentation page](https://www.syslog-ng.com/).
8-
>
9-
>If you experience any problems or need help with syslog-ng OSE, visit
10-
>the [syslog-ng mailing list](https://lists.balabit.hu/mailman/listinfo/syslog-ng).
11-
>
12-
>For news and notifications about syslog-ng OSE, visit the [syslog-ng blogs](https://syslog-ng.com/blog/).
6+
>**NOTE:**
7+
>If you experience any problems or need help with syslog-ng OSE, visit the syslog-ng mailing list. \
8+
>For news and notifications about syslog-ng OSE, visit the syslog-ng blogs.
139
{: .notice--info}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## channel-args()
2+
3+
| Type:| |
4+
|Default:| |
5+
6+
*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.
7+
8+
### Example: channel-args() declaration
9+
10+
```config
11+
channel-args(
12+
"grpc.loadreporting" => 1
13+
"grpc.minimal_stack" => 0
14+
)
15+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## keep-alive()
2+
3+
This option configures the forwarding of [gRPC keepalive pings](https://grpc.io/docs/guides/keepalive/) in syslog-ng OSE.
4+
5+
### max-pings-without-data()
6+
7+
| Type:| integer|
8+
|Default:| |
9+
10+
*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.
11+
12+
### time()
13+
14+
| Type:| number[milliseconds]|
15+
|Default:| |
16+
17+
*Description:* syslog-ng OSE sends a gRPC keepalive ping after the amount of time defined in the `time()` option elapsed.
18+
19+
### timeout()
20+
21+
| Type:| number[milliseconds]|
22+
|Default:| 10|
23+
24+
*Description:* The time syslog-ng OSE waits for an acknowledgement.

_js/custom/navigation.js

Lines changed: 73 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ $(function () {
2424
var tocMenuElement = tocElement.querySelector('.toc__menu');
2525
if (null == tocMenuElement || false == tocMenuElement.hasChildNodes)
2626
shouldHide = true;
27-
}
28-
if (shouldHide) {
29-
// TOC is autogenerated via 'include toc.html' so its size is not known prior the call of toc.html
30-
// Signal emptiness, css will hide if needed based on it and config settings
31-
// NOTE: Not hiding directly here to behave the same way like the left sidebar does
32-
tocElement.classList.add('empty');
27+
if (shouldHide) {
28+
// TOC is autogenerated via 'include toc.html' so its size is not known prior the call of toc.html
29+
// Signal emptiness, css will hide if needed based on it and config settings
30+
// NOTE: Not hiding directly here to behave the same way like the left sidebar does
31+
tocElement.classList.add('empty');
32+
}
3333
}
3434
}
3535

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

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

319-
if (fullPageContent)
320-
hideTocIfNotNeeded(tempContainer, true);
324+
hideTocIfNotNeeded(tempContainer, true);
321325

322326
// Remove/Override some default title style formatting to look better in the tooltip
323-
const pageTitle = tempContainer.querySelector('#page-title');
324-
if (pageTitle)
325-
pageTitle.style.marginTop = '1em';
326-
327-
const pageSubtitle = tempContainer.querySelector('#page-subtitle');
328-
if (pageSubtitle)
329-
pageSubtitle.style.borderBottom = '0px';
327+
var pageTitle = tempContainer.querySelector('#page-title');
328+
if (pageTitle == null) {
329+
// If there is no page title, replace the first heading with an item looks and behaves like the page title
330+
// to have similar result both for page title tooltips and other link item tooltips
331+
// FIXME: This magic 6 must be maintained together now with generate_links.rb (and other places ?!), eliminate it!
332+
var firstHeading = tempContainer.querySelector("h2, h3, h4, h5, h6");
333+
if (firstHeading) {
334+
// Everything bellow must exist, so intentionally there's no error handling, let it rise
335+
pageTitle = document.querySelector('#page-title').cloneNode(true);
336+
pageTitle.id = firstHeading.id;
337+
338+
const anchorElement = pageTitle.querySelector("a");
339+
anchorElement.textContent = firstHeading.textContent;
340+
anchorElement.href = url;
341+
342+
tempContainer.replaceChild(pageTitle, firstHeading);
343+
}
344+
}
345+
pageTitle.style.marginTop = '1em';
330346

331347
var newContent = tempContainer.innerHTML
332348
// remove unnecessary, reqursive inner content tooltips
@@ -350,22 +366,37 @@ $(function () {
350366
newContent => {
351367
var startHeading = newContent.querySelector('#' + startHeadingId);
352368
if (startHeading) {
353-
var content = startHeading.outerHTML; // Include the starting <h> element itself
369+
var content = '';
370+
var heading = startHeading.outerHTML; // Include the starting <h> element itself
354371
var nextSibling = startHeading.nextElementSibling;
355372

356-
// Collect all siblings until the next heading or the end of the document
357-
// FIXME: This magic 6 must be maintained together now with generate_links.rb (and other places ?!)
373+
// 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)
374+
// 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.
375+
// If not presented, drop the whole content, return an empty one (a.k.a. do not show title only tooltips)
376+
if (nextSibling == null && false == hasAnchor) {
377+
startHeading = newContent.querySelector('.page__content');
378+
nextSibling = startHeading.firstElementChild;
379+
// First element is the TOC, skip it to be able to produce an empty content
380+
if (nextSibling && nextSibling.classList.contains('sidebar__right'))
381+
nextSibling = nextSibling.nextElementSibling;
382+
}
383+
// Collect all siblings until the next heading or the end of the initial content
384+
// FIXME: This magic 6 must be maintained together now with generate_links.rb (and other places ?!), eliminate it!
358385
while (nextSibling && nextSibling.tagName !== 'H1' && nextSibling.tagName !== 'H2' && nextSibling.tagName !== 'H3' && nextSibling.tagName !== 'H4' && nextSibling.tagName !== 'H5' && nextSibling.tagName !== 'H6') {
359386
content += nextSibling.outerHTML;
360387
nextSibling = nextSibling.nextElementSibling;
361388
}
389+
390+
if (content.length != 0 || hasAnchor)
391+
content = heading + content;
392+
362393
onSuccess(content);
363394
}
364395
else
365-
console.error('Start heading not found by ID: ' + startHeadingId);
396+
onError('Start heading not found by ID: ' + startHeadingId);
366397
},
367398
error => {
368-
error(error);
399+
onError(error);
369400
}
370401
);
371402
}
@@ -402,10 +433,10 @@ $(function () {
402433
tooltip.style.setProperty(posName, newPosition);
403434
}
404435

405-
function showTooltip(event, tooltipText, fullPageContent) {
436+
function showTooltip(event, tooltipText, isFullPageContent) {
406437
tooltip.innerHTML = tooltipText.innerHTML;
407438

408-
if (fullPageContent)
439+
if (isFullPageContent)
409440
tooltip.classList.add("full-content-tooltip");
410441
else
411442
tooltip.classList.remove("full-content-tooltip");
@@ -470,7 +501,7 @@ $(function () {
470501
element.appendChild(tooltipText);
471502

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

475506
tooltipTarget = element;
476507

@@ -481,26 +512,36 @@ $(function () {
481512
function onSuccess(newContent) {
482513
if (typeof (newContent) === 'object' && 'innerHTML' in newContent)
483514
newContent = newContent.innerHTML;
484-
newContent = alterPageForTooltip(newContent, fullPageContent);
485-
486-
// cache for reuse
487-
tooltipText.innerHTML = newContent;
488-
showTooltip(event, tooltipText, fullPageContent);
515+
newContent = alterContentForTooltip(newContent, url. isFullPageContent);
516+
517+
if (newContent.length > 0) {
518+
// cache for reuse
519+
tooltipText.innerHTML = newContent;
520+
showTooltip(event, tooltipText, isFullPageContent);
521+
}
522+
else {
523+
// Quick navigation from another link with tooltip to this link would keep alive the previous tooltip
524+
// force close it, as we don't have tooltip for the current and this is the live hovered one.
525+
hideTooltip(false);
526+
}
489527
}
490528

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

495-
if (fullPageContent) {
536+
if (isFullPageContent) {
496537
loadContentFromUrl(url, newContent => onSuccess(newContent), error => onError(error));
497538
}
498539
else {
499540
loadContentPartFrom(url, newContent => onSuccess(newContent), error => onError(error));
500541
}
501542
}
502543
else
503-
showTooltip(event, tooltipText, fullPageContent);
544+
showTooltip(event, tooltipText, isFullPageContent);
504545
});
505546
});
506547

0 commit comments

Comments
 (0)