From 2ba1e2e22ed34f69b3e9d8b57d6cd010edce0d29 Mon Sep 17 00:00:00 2001 From: KOMATA <20227709+HynoR@users.noreply.github.com> Date: Mon, 5 Jan 2026 14:49:09 +0800 Subject: [PATCH] fix: Update regex patterns for log highlighting in custom component (#11556) * fix: Update regex patterns for log highlighting in custom component * feat: Add new regex pattern for HTTP status codes highlighting in custom log component * refactor: Update HTTP status code regex patterns in custom log component for improved highlighting --- .../log/custom-hightlight/index.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/log/custom-hightlight/index.vue b/frontend/src/components/log/custom-hightlight/index.vue index f8c8a71fd..2518ea33b 100644 --- a/frontend/src/components/log/custom-hightlight/index.vue +++ b/frontend/src/components/log/custom-hightlight/index.vue @@ -41,27 +41,36 @@ const nginxRules: TokenRule[] = [ pattern: /\[(crit|error)\]/g, color: '#E74C3C', }, - { type: 'path', - pattern: /(?<=[\s"])\/[^"\s]+(?:\.\w+)?(?:\?\w+=\w+)?/g, + pattern: /(?<=[\s"])\/[^\s"]*/g, color: '#B87A2B', }, { type: 'http-method', - pattern: /(?<=)(?:GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)(?=\s)/g, + pattern: /\b(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\b/g, color: '#27AE60', }, { type: 'status-success', - pattern: /\s(2\d{2})\s/g, + pattern: /(?<=")\s(2\d{2})\b/g, color: '#2ECC71', }, { type: 'status-error', - pattern: /\s([45]\d{2})\s/g, + pattern: /(?<=")\s([45]\d{2})\b/g, color: '#E74C3C', }, + { + type: 'status-redirect', + pattern: /(?<=")\s(3\d{2})\b/g, + color: '#F39C12', + }, + { + type: 'status-info', + pattern: /(?<=")\s(1\d{2})\b/g, + color: '#268785', + }, { type: 'process-info', pattern: /\d+#\d+/g,