mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-23 00:00:52 +00:00
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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user