Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b5df206ca |
3 changed files with 7 additions and 3 deletions
|
|
@ -1 +1 @@
|
||||||
__version__ = "0.2.1"
|
__version__ = "0.2.2"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from typing import Deque
|
from typing import Deque
|
||||||
|
|
||||||
|
from rich.markup import escape
|
||||||
from textual.app import ComposeResult
|
from textual.app import ComposeResult
|
||||||
from textual.containers import Container
|
from textual.containers import Container
|
||||||
from textual.widgets import RichLog, Static
|
from textual.widgets import RichLog, Static
|
||||||
|
|
@ -66,8 +67,11 @@ class LogsTab(Container):
|
||||||
Severity.OTHER: theme.BORDER_TITLE,
|
Severity.OTHER: theme.BORDER_TITLE,
|
||||||
}
|
}
|
||||||
color = color_for[line.severity]
|
color = color_for[line.severity]
|
||||||
|
# Raw log lines often contain literal brackets like
|
||||||
|
# `[/path/to/file]` which Rich's markup parser tries to interpret
|
||||||
|
# as closing tags. Escape so they render as text.
|
||||||
src = f"[dim]{line.source:<8}[/]"
|
src = f"[dim]{line.source:<8}[/]"
|
||||||
return f"{src} [{color}]{line.raw}[/]"
|
return f"{src} [{color}]{escape(line.raw)}[/]"
|
||||||
|
|
||||||
def _rerender(self) -> None:
|
def _rerender(self) -> None:
|
||||||
self.log_view.clear()
|
self.log_view.clear()
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "dsmview"
|
name = "dsmview"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
description = "TUI SSH monitor for Synology DSM 7.x"
|
description = "TUI SSH monitor for Synology DSM 7.x"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue