1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

fix: copy log ansi character parsing and html decode (#2621)

This commit is contained in:
Akash Ramaswamy
2023-12-23 20:18:22 +05:30
committed by GitHub
parent 9e5b6a88e2
commit 7a0fc84842
3 changed files with 7 additions and 3 deletions

View File

@@ -9,7 +9,7 @@
></div> ></div>
<log-message-actions <log-message-actions
class="duration-250 absolute -right-1 opacity-0 transition-opacity delay-150 group-hover/entry:opacity-100" class="duration-250 absolute -right-1 opacity-0 transition-opacity delay-150 group-hover/entry:opacity-100"
:message="logEntry.message" :message="decodeXML(stripAnsi(logEntry.message))"
:log-entry="logEntry" :log-entry="logEntry"
/> />
</div> </div>
@@ -17,6 +17,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { SimpleLogEntry } from "@/models/LogEntry"; import { SimpleLogEntry } from "@/models/LogEntry";
import AnsiConvertor from "ansi-to-html"; import AnsiConvertor from "ansi-to-html";
import stripAnsi from "strip-ansi";
import { decodeXML } from "entities";
const ansiConvertor = new AnsiConvertor({ escapeXML: false, fg: "var(--text-color)" }); const ansiConvertor = new AnsiConvertor({ escapeXML: false, fg: "var(--text-color)" });
defineProps<{ defineProps<{

View File

@@ -59,6 +59,7 @@
"postcss": "^8.4.32", "postcss": "^8.4.32",
"postcss-mixins": "^9.0.4", "postcss-mixins": "^9.0.4",
"splitpanes": "^3.1.5", "splitpanes": "^3.1.5",
"strip-ansi": "^7.1.0",
"tailwindcss": "^3.4.0", "tailwindcss": "^3.4.0",
"unplugin-auto-import": "^0.17.2", "unplugin-auto-import": "^0.17.2",
"unplugin-icons": "^0.18.1", "unplugin-icons": "^0.18.1",

5
pnpm-lock.yaml generated
View File

@@ -98,6 +98,9 @@ dependencies:
splitpanes: splitpanes:
specifier: ^3.1.5 specifier: ^3.1.5
version: 3.1.5 version: 3.1.5
strip-ansi:
specifier: ^7.1.0
version: 7.1.0
tailwindcss: tailwindcss:
specifier: ^3.4.0 specifier: ^3.4.0
version: 3.4.0(ts-node@10.9.2) version: 3.4.0(ts-node@10.9.2)
@@ -1879,7 +1882,6 @@ packages:
/ansi-regex@6.0.1: /ansi-regex@6.0.1:
resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==}
engines: {node: '>=12'} engines: {node: '>=12'}
dev: true
/ansi-styles@4.3.0: /ansi-styles@4.3.0:
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
@@ -4645,7 +4647,6 @@ packages:
engines: {node: '>=12'} engines: {node: '>=12'}
dependencies: dependencies:
ansi-regex: 6.0.1 ansi-regex: 6.0.1
dev: true
/strip-final-newline@2.0.0: /strip-final-newline@2.0.0:
resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}