@loglayer/transport-pretty-terminal 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -345,6 +345,7 @@ var DetailView = class {
345
345
  }
346
346
  render() {
347
347
  console.clear();
348
+ console.log("\n".repeat(5));
348
349
  if (this.config.isJsonView) {
349
350
  if (this.config.entry.data) {
350
351
  console.log(JSON.stringify(JSON.parse(this.config.entry.data)));
@@ -409,9 +410,10 @@ ${this.config.config.separatorColor("TAB to return to detailed view")}`);
409
410
  const footerHeight = footerContent.length;
410
411
  const scrollIndicatorLines = 2;
411
412
  const bufferSpace = 4;
413
+ const topPadding = 2;
412
414
  const availableHeight = Math.max(
413
415
  0,
414
- process.stdout.rows - headerHeight - footerHeight - scrollIndicatorLines - bufferSpace
416
+ process.stdout.rows - headerHeight - footerHeight - scrollIndicatorLines - bufferSpace - topPadding
415
417
  );
416
418
  for (const line of headerContent) {
417
419
  console.log(line);
@@ -426,6 +428,8 @@ ${this.config.config.separatorColor("TAB to return to detailed view")}`);
426
428
  }
427
429
  if (this.config.scrollPos + availableHeight < mainContent.length) {
428
430
  console.log(chalk3.dim("\u2193 More content below"));
431
+ } else {
432
+ console.log(chalk3.dim("End of content"));
429
433
  }
430
434
  for (const line of footerContent) {
431
435
  console.log(line);
@@ -439,9 +443,10 @@ ${this.config.config.separatorColor("TAB to return to detailed view")}`);
439
443
  const footerHeight = 5;
440
444
  const scrollIndicatorLines = 2;
441
445
  const bufferSpace = 2;
446
+ const topPadding = 2;
442
447
  const availableHeight = Math.max(
443
448
  0,
444
- process.stdout.rows - headerHeight - footerHeight - scrollIndicatorLines - bufferSpace
449
+ process.stdout.rows - headerHeight - footerHeight - scrollIndicatorLines - bufferSpace - topPadding
445
450
  );
446
451
  return Math.max(0, this.detailViewContent.length - availableHeight);
447
452
  }
@@ -462,13 +467,11 @@ var SelectionView = class {
462
467
  }
463
468
  render() {
464
469
  console.clear();
465
- const headerHeight = this.config.filterText ? 2 : 0;
470
+ console.log("\n".repeat(5));
471
+ const filterHeight = this.config.filterText ? 2 : 0;
466
472
  const footerHeight = 2;
467
- const availableHeight = process.stdout.rows - headerHeight - footerHeight;
468
- if (this.config.filterText) {
469
- console.log(chalk4.cyan("Filter:"), chalk4.white(this.config.filterText));
470
- console.log(chalk4.dim("\u2500".repeat(this.termWidth)));
471
- }
473
+ const topPadding = 5;
474
+ const availableHeight = process.stdout.rows - filterHeight - footerHeight - topPadding;
472
475
  if (this.config.logs.length === 0) {
473
476
  console.log(chalk4.yellow("No matching logs found"));
474
477
  } else {
@@ -512,6 +515,10 @@ var SelectionView = class {
512
515
  }
513
516
  }
514
517
  console.log(chalk4.dim("\nType to filter \u2022 Enter to view details \u2022 TAB to exit"));
518
+ if (this.config.filterText) {
519
+ console.log(chalk4.dim("\u2500".repeat(this.termWidth)));
520
+ console.log(chalk4.cyan("Filter:"), chalk4.white(this.config.filterText));
521
+ }
515
522
  }
516
523
  };
517
524