kubefc 0.1.0
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/README.md +320 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +95 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/App.d.ts +17 -0
- package/dist/components/App.js +346 -0
- package/dist/components/App.js.map +1 -0
- package/dist/components/LogViewer.d.ts +18 -0
- package/dist/components/LogViewer.js +335 -0
- package/dist/components/LogViewer.js.map +1 -0
- package/dist/hooks/useLogBuffer.d.ts +16 -0
- package/dist/hooks/useLogBuffer.js +27 -0
- package/dist/hooks/useLogBuffer.js.map +1 -0
- package/dist/hooks/useLogFilter.d.ts +22 -0
- package/dist/hooks/useLogFilter.js +45 -0
- package/dist/hooks/useLogFilter.js.map +1 -0
- package/dist/k8s/client.d.ts +11 -0
- package/dist/k8s/client.js +134 -0
- package/dist/k8s/client.js.map +1 -0
- package/dist/kfc-darwin-arm64 +0 -0
- package/dist/utils/cache.d.ts +2 -0
- package/dist/utils/cache.js +40 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/colorize.d.ts +1 -0
- package/dist/utils/colorize.js +165 -0
- package/dist/utils/colorize.js.map +1 -0
- package/dist/utils/logFilter.d.ts +36 -0
- package/dist/utils/logFilter.js +102 -0
- package/dist/utils/logFilter.js.map +1 -0
- package/dist/utils/logHighlight.d.ts +16 -0
- package/dist/utils/logHighlight.js +49 -0
- package/dist/utils/logHighlight.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
const CACHE_FILE = path.join(os.homedir(), '.kfc_cache.json');
|
|
5
|
+
let memoryCache = { deployments: {} };
|
|
6
|
+
let isLoaded = false;
|
|
7
|
+
function loadCache() {
|
|
8
|
+
if (isLoaded)
|
|
9
|
+
return;
|
|
10
|
+
try {
|
|
11
|
+
if (fs.existsSync(CACHE_FILE)) {
|
|
12
|
+
const content = fs.readFileSync(CACHE_FILE, 'utf-8');
|
|
13
|
+
memoryCache = JSON.parse(content);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch (e) {
|
|
17
|
+
// ignore errors
|
|
18
|
+
}
|
|
19
|
+
isLoaded = true;
|
|
20
|
+
}
|
|
21
|
+
function saveCache() {
|
|
22
|
+
try {
|
|
23
|
+
fs.writeFileSync(CACHE_FILE, JSON.stringify(memoryCache, null, 2));
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
// ignore
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function getCachedDeployments(context, namespace) {
|
|
30
|
+
loadCache();
|
|
31
|
+
const key = `${context}:${namespace}`;
|
|
32
|
+
return memoryCache.deployments[key] || null;
|
|
33
|
+
}
|
|
34
|
+
export function setCachedDeployments(context, namespace, deployments) {
|
|
35
|
+
loadCache();
|
|
36
|
+
const key = `${context}:${namespace}`;
|
|
37
|
+
memoryCache.deployments[key] = deployments;
|
|
38
|
+
saveCache();
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/utils/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,iBAAiB,CAAC,CAAC;AAM9D,IAAI,WAAW,GAAc,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AACjD,IAAI,QAAQ,GAAG,KAAK,CAAC;AAErB,SAAS,SAAS;IACd,IAAI,QAAQ;QAAE,OAAO;IACrB,IAAI,CAAC;QACD,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACrD,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,gBAAgB;IACpB,CAAC;IACD,QAAQ,GAAG,IAAI,CAAC;AACpB,CAAC;AAED,SAAS,SAAS;IACd,IAAI,CAAC;QACD,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,SAAS;IACb,CAAC;AACL,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,SAAiB;IACnE,SAAS,EAAE,CAAC;IACZ,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,SAAS,EAAE,CAAC;IACtC,OAAO,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,SAAiB,EAAE,WAAqB;IAC1F,SAAS,EAAE,CAAC;IACZ,MAAM,GAAG,GAAG,GAAG,OAAO,IAAI,SAAS,EAAE,CAAC;IACtC,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;IAC3C,SAAS,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function colorizeLogLine(line: string): string;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
// ASP.NET Core log format: [13:29:11.454 INF]
|
|
3
|
+
const aspNetLogPattern = /\[(\d{2}:\d{2}:\d{2}\.\d+)\s+(INF|ERR|WRN|DBG|TRC|FATAL|ERROR|WARN|WARNING|INFO|DEBUG|TRACE)\]/;
|
|
4
|
+
export function colorizeLogLine(line) {
|
|
5
|
+
let result = line;
|
|
6
|
+
// Handle ASP.NET Core log format: [13:29:11.454 INF]
|
|
7
|
+
const aspNetMatch = result.match(aspNetLogPattern);
|
|
8
|
+
if (aspNetMatch) {
|
|
9
|
+
const [fullMatch, time, level] = aspNetMatch;
|
|
10
|
+
const coloredTime = chalk.blue(time);
|
|
11
|
+
let coloredLevel;
|
|
12
|
+
// Color based on log level
|
|
13
|
+
const upperLevel = level.toUpperCase();
|
|
14
|
+
if (upperLevel.includes('ERR') || upperLevel.includes('FATAL')) {
|
|
15
|
+
coloredLevel = chalk.red.bold(level);
|
|
16
|
+
}
|
|
17
|
+
else if (upperLevel.includes('WRN') || upperLevel.includes('WARN')) {
|
|
18
|
+
coloredLevel = chalk.yellow.bold(level);
|
|
19
|
+
}
|
|
20
|
+
else if (upperLevel.includes('INF') || upperLevel.includes('INFO') || upperLevel.includes('SUCCESS')) {
|
|
21
|
+
coloredLevel = chalk.green.bold(level);
|
|
22
|
+
}
|
|
23
|
+
else if (upperLevel.includes('DBG') || upperLevel.includes('DEBUG')) {
|
|
24
|
+
coloredLevel = chalk.cyan.bold(level);
|
|
25
|
+
}
|
|
26
|
+
else if (upperLevel.includes('TRC') || upperLevel.includes('TRACE')) {
|
|
27
|
+
coloredLevel = chalk.gray.bold(level);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
coloredLevel = chalk.white(level);
|
|
31
|
+
}
|
|
32
|
+
const coloredBracket = chalk.gray('[') + coloredTime + ' ' + coloredLevel + chalk.gray(']');
|
|
33
|
+
result = result.replace(fullMatch, coloredBracket);
|
|
34
|
+
}
|
|
35
|
+
// Check if line is JSON
|
|
36
|
+
const trimmed = result.trim();
|
|
37
|
+
if (trimmed.startsWith('{') || trimmed.startsWith('[')) {
|
|
38
|
+
try {
|
|
39
|
+
const parsed = JSON.parse(trimmed);
|
|
40
|
+
return colorizeJSON(parsed);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Not valid JSON, continue with regular colorization
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Apply syntax highlighting to the rest
|
|
47
|
+
result = colorizeSyntax(result);
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
function colorizeSyntax(text) {
|
|
51
|
+
// Store already colored segments to avoid re-coloring
|
|
52
|
+
const segments = [];
|
|
53
|
+
// Pattern matching with non-overlapping replacement
|
|
54
|
+
const patterns = [
|
|
55
|
+
// HTTP status codes (with context)
|
|
56
|
+
{
|
|
57
|
+
regex: /StatusCode:\s*(\d{3})/gi,
|
|
58
|
+
colorFn: (match) => {
|
|
59
|
+
const code = parseInt(match.match(/\d{3}/)?.[0] || '0');
|
|
60
|
+
const num = match.match(/\d{3}/)?.[0] || '';
|
|
61
|
+
if (code >= 200 && code < 300)
|
|
62
|
+
return match.replace(num, chalk.green(num));
|
|
63
|
+
if (code >= 300 && code < 400)
|
|
64
|
+
return match.replace(num, chalk.cyan(num));
|
|
65
|
+
if (code >= 400 && code < 500)
|
|
66
|
+
return match.replace(num, chalk.yellow(num));
|
|
67
|
+
if (code >= 500)
|
|
68
|
+
return match.replace(num, chalk.red(num));
|
|
69
|
+
return match;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
// Duration values
|
|
73
|
+
{
|
|
74
|
+
regex: /Duration:\s*[\d.]+/gi,
|
|
75
|
+
colorFn: (match) => chalk.red(match)
|
|
76
|
+
},
|
|
77
|
+
// HTTP methods
|
|
78
|
+
{
|
|
79
|
+
regex: /\b(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)\b/g,
|
|
80
|
+
colorFn: (match) => chalk.blue(match)
|
|
81
|
+
},
|
|
82
|
+
// API paths
|
|
83
|
+
{
|
|
84
|
+
regex: /\/api\/[a-zA-Z0-9_\-./]*/g,
|
|
85
|
+
colorFn: (match) => chalk.magenta(match)
|
|
86
|
+
},
|
|
87
|
+
// URLs (before general paths)
|
|
88
|
+
{
|
|
89
|
+
regex: /https?:\/\/[^\s"]+/g,
|
|
90
|
+
colorFn: (match) => chalk.blue.underline(match)
|
|
91
|
+
},
|
|
92
|
+
// UUIDs
|
|
93
|
+
{
|
|
94
|
+
regex: /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,
|
|
95
|
+
colorFn: (match) => chalk.yellow(match)
|
|
96
|
+
},
|
|
97
|
+
// IP addresses
|
|
98
|
+
{
|
|
99
|
+
regex: /\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,
|
|
100
|
+
colorFn: (match) => chalk.magenta(match)
|
|
101
|
+
},
|
|
102
|
+
// JSON-like quoted strings (simple approach)
|
|
103
|
+
{
|
|
104
|
+
regex: /"([^"\\]|\\.)*"/g,
|
|
105
|
+
colorFn: (match) => chalk.green(match)
|
|
106
|
+
},
|
|
107
|
+
// Booleans
|
|
108
|
+
{
|
|
109
|
+
regex: /\b(true|false)\b/g,
|
|
110
|
+
colorFn: (match) => chalk.yellow(match)
|
|
111
|
+
},
|
|
112
|
+
// Null
|
|
113
|
+
{
|
|
114
|
+
regex: /\bnull\b/g,
|
|
115
|
+
colorFn: (match) => chalk.gray(match)
|
|
116
|
+
},
|
|
117
|
+
// Numbers (last to avoid conflicts)
|
|
118
|
+
{
|
|
119
|
+
regex: /\b\d+\.?\d*\b/g,
|
|
120
|
+
colorFn: (match) => chalk.cyan(match)
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
let result = text;
|
|
124
|
+
// Apply patterns one by one
|
|
125
|
+
for (const { regex, colorFn } of patterns) {
|
|
126
|
+
result = result.replace(regex, colorFn);
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
function colorizeJSON(obj, indent = 0) {
|
|
131
|
+
const indentStr = ' '.repeat(indent);
|
|
132
|
+
if (obj === null) {
|
|
133
|
+
return chalk.gray('null');
|
|
134
|
+
}
|
|
135
|
+
if (typeof obj === 'boolean') {
|
|
136
|
+
return chalk.yellow(String(obj));
|
|
137
|
+
}
|
|
138
|
+
if (typeof obj === 'number') {
|
|
139
|
+
return chalk.cyan(String(obj));
|
|
140
|
+
}
|
|
141
|
+
if (typeof obj === 'string') {
|
|
142
|
+
return chalk.green(`"${obj}"`);
|
|
143
|
+
}
|
|
144
|
+
if (Array.isArray(obj)) {
|
|
145
|
+
if (obj.length === 0) {
|
|
146
|
+
return chalk.gray('[]');
|
|
147
|
+
}
|
|
148
|
+
const items = obj.map(item => `${indentStr} ${colorizeJSON(item, indent + 1)}`);
|
|
149
|
+
return chalk.gray('[') + '\n' + items.join(',\n') + '\n' + indentStr + chalk.gray(']');
|
|
150
|
+
}
|
|
151
|
+
if (typeof obj === 'object') {
|
|
152
|
+
const keys = Object.keys(obj);
|
|
153
|
+
if (keys.length === 0) {
|
|
154
|
+
return chalk.gray('{}');
|
|
155
|
+
}
|
|
156
|
+
const items = keys.map(key => {
|
|
157
|
+
const coloredKey = chalk.cyan(`"${key}"`);
|
|
158
|
+
const coloredValue = colorizeJSON(obj[key], indent + 1);
|
|
159
|
+
return `${indentStr} ${coloredKey}: ${coloredValue}`;
|
|
160
|
+
});
|
|
161
|
+
return chalk.gray('{') + '\n' + items.join(',\n') + '\n' + indentStr + chalk.gray('}');
|
|
162
|
+
}
|
|
163
|
+
return String(obj);
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=colorize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorize.js","sourceRoot":"","sources":["../../src/utils/colorize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,8CAA8C;AAC9C,MAAM,gBAAgB,GAAG,gGAAgG,CAAC;AAE1H,MAAM,UAAU,eAAe,CAAC,IAAY;IAC3C,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,qDAAqD;IACrD,MAAM,WAA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AAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC5B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;YAC1C,MAAM,YAAY,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;YACxD,OAAO,GAAG,SAAS,KAAK,UAAU,KAAK,YAAY,EAAE,CAAC;QACvD,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log filtering utilities
|
|
3
|
+
* Pure functions for filtering and processing log lines
|
|
4
|
+
*/
|
|
5
|
+
export interface BufferedLine {
|
|
6
|
+
podPrefix: string;
|
|
7
|
+
line: string;
|
|
8
|
+
coloredLine: string;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
}
|
|
11
|
+
export interface FilteredLine {
|
|
12
|
+
bufferedLine: BufferedLine;
|
|
13
|
+
isMatch: boolean;
|
|
14
|
+
index: number;
|
|
15
|
+
}
|
|
16
|
+
export interface FilterOptions {
|
|
17
|
+
pattern: string;
|
|
18
|
+
ignoreCase: boolean;
|
|
19
|
+
invert: boolean;
|
|
20
|
+
contextLines: number;
|
|
21
|
+
beforeLines: number;
|
|
22
|
+
afterLines: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Check if a line should be shown based on filter criteria
|
|
26
|
+
* @note This creates a new RegExp every call. For bulk filtering, use filterLines.
|
|
27
|
+
*/
|
|
28
|
+
export declare function shouldShowLine(line: string, pattern: string, ignoreCase: boolean, invert: boolean): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Filter lines based on pattern and context
|
|
31
|
+
*/
|
|
32
|
+
export declare function filterLines(lines: BufferedLine[], pattern: string, ignoreCase: boolean, invert: boolean, contextLines: number, beforeLines: number, afterLines: number): FilteredLine[];
|
|
33
|
+
/**
|
|
34
|
+
* Get indices of lines that should be shown with context
|
|
35
|
+
*/
|
|
36
|
+
export declare function getContextIndices(matchIndices: Set<number>, totalLines: number, before: number, after: number): Set<number>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log filtering utilities
|
|
3
|
+
* Pure functions for filtering and processing log lines
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check if a line should be shown based on filter criteria
|
|
7
|
+
* @note This creates a new RegExp every call. For bulk filtering, use filterLines.
|
|
8
|
+
*/
|
|
9
|
+
export function shouldShowLine(line, pattern, ignoreCase, invert) {
|
|
10
|
+
if (!pattern)
|
|
11
|
+
return true;
|
|
12
|
+
try {
|
|
13
|
+
const regex = new RegExp(pattern, ignoreCase ? 'i' : '');
|
|
14
|
+
const matches = regex.test(line);
|
|
15
|
+
return invert ? !matches : matches;
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
// Fallback for invalid regex: show line (safer than hiding)
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Filter lines based on pattern and context
|
|
24
|
+
*/
|
|
25
|
+
export function filterLines(lines, pattern, ignoreCase, invert, contextLines, beforeLines, afterLines) {
|
|
26
|
+
if (!pattern) {
|
|
27
|
+
return lines.map((line, index) => ({
|
|
28
|
+
bufferedLine: line,
|
|
29
|
+
isMatch: false,
|
|
30
|
+
index,
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
let regex;
|
|
34
|
+
try {
|
|
35
|
+
regex = new RegExp(pattern, ignoreCase ? 'i' : '');
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
// Invalid regex: return all lines as non-matches (same as no filter)
|
|
39
|
+
return lines.map((line, index) => ({
|
|
40
|
+
bufferedLine: line,
|
|
41
|
+
isMatch: false,
|
|
42
|
+
index,
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
// Find matching lines
|
|
46
|
+
const matchIndices = new Set();
|
|
47
|
+
lines.forEach((line, index) => {
|
|
48
|
+
const matches = regex.test(line.line);
|
|
49
|
+
const isMatch = invert ? !matches : matches;
|
|
50
|
+
if (isMatch) {
|
|
51
|
+
matchIndices.add(index);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// Add context lines
|
|
55
|
+
const linesToShow = new Set();
|
|
56
|
+
const before = contextLines > 0 ? contextLines : beforeLines;
|
|
57
|
+
const after = contextLines > 0 ? contextLines : afterLines;
|
|
58
|
+
matchIndices.forEach((matchIdx) => {
|
|
59
|
+
// Add the match itself
|
|
60
|
+
linesToShow.add(matchIdx);
|
|
61
|
+
// Add before context
|
|
62
|
+
for (let i = Math.max(0, matchIdx - before); i < matchIdx; i++) {
|
|
63
|
+
linesToShow.add(i);
|
|
64
|
+
}
|
|
65
|
+
// Add after context
|
|
66
|
+
for (let i = matchIdx + 1; i <= Math.min(lines.length - 1, matchIdx + after); i++) {
|
|
67
|
+
linesToShow.add(i);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
// Convert to array and sort
|
|
71
|
+
const result = [];
|
|
72
|
+
Array.from(linesToShow)
|
|
73
|
+
.sort((a, b) => a - b)
|
|
74
|
+
.forEach((index) => {
|
|
75
|
+
result.push({
|
|
76
|
+
bufferedLine: lines[index],
|
|
77
|
+
isMatch: matchIndices.has(index),
|
|
78
|
+
index,
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get indices of lines that should be shown with context
|
|
85
|
+
*/
|
|
86
|
+
export function getContextIndices(matchIndices, totalLines, before, after) {
|
|
87
|
+
const indices = new Set();
|
|
88
|
+
matchIndices.forEach((matchIdx) => {
|
|
89
|
+
// Add the match itself
|
|
90
|
+
indices.add(matchIdx);
|
|
91
|
+
// Add before context
|
|
92
|
+
for (let i = Math.max(0, matchIdx - before); i < matchIdx; i++) {
|
|
93
|
+
indices.add(i);
|
|
94
|
+
}
|
|
95
|
+
// Add after context
|
|
96
|
+
for (let i = matchIdx + 1; i <= Math.min(totalLines - 1, matchIdx + after); i++) {
|
|
97
|
+
indices.add(i);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return indices;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=logFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logFilter.js","sourceRoot":"","sources":["../../src/utils/logFilter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwBH;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC7B,IAAY,EACZ,OAAe,EACf,UAAmB,EACnB,MAAe;IAEf,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,IAAI,CAAC;QACJ,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IACpC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,4DAA4D;QAC5D,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAC1B,KAAqB,EACrB,OAAe,EACf,UAAmB,EACnB,MAAe,EACf,YAAoB,EACpB,WAAmB,EACnB,UAAkB;IAElB,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,KAA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;QACjC,uBAAuB;QACvB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEtB,qBAAqB;QACrB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC;QAED,oBAAoB;QACpB,KAAK,IAAI,CAAC,GAAG,QAAQ,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACjF,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log highlighting utilities
|
|
3
|
+
* Functions for highlighting matching text in log lines
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Highlight matching text in a line with yellow background
|
|
7
|
+
*/
|
|
8
|
+
export declare function highlightMatches(text: string, pattern: string, ignoreCase: boolean): string;
|
|
9
|
+
/**
|
|
10
|
+
* Check if text contains a match for the pattern
|
|
11
|
+
*/
|
|
12
|
+
export declare function hasMatch(text: string, pattern: string, ignoreCase: boolean): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Get all matches in a text
|
|
15
|
+
*/
|
|
16
|
+
export declare function getMatches(text: string, pattern: string, ignoreCase: boolean): string[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log highlighting utilities
|
|
3
|
+
* Functions for highlighting matching text in log lines
|
|
4
|
+
*/
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
/**
|
|
7
|
+
* Highlight matching text in a line with yellow background
|
|
8
|
+
*/
|
|
9
|
+
export function highlightMatches(text, pattern, ignoreCase) {
|
|
10
|
+
if (!pattern)
|
|
11
|
+
return text;
|
|
12
|
+
try {
|
|
13
|
+
const regex = new RegExp(pattern, ignoreCase ? 'gi' : 'g');
|
|
14
|
+
return text.replace(regex, (match) => chalk.black.bgYellow(match));
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
// If regex is invalid, return original text
|
|
18
|
+
return text;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if text contains a match for the pattern
|
|
23
|
+
*/
|
|
24
|
+
export function hasMatch(text, pattern, ignoreCase) {
|
|
25
|
+
if (!pattern)
|
|
26
|
+
return false;
|
|
27
|
+
try {
|
|
28
|
+
const regex = new RegExp(pattern, ignoreCase ? 'i' : '');
|
|
29
|
+
return regex.test(text);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get all matches in a text
|
|
37
|
+
*/
|
|
38
|
+
export function getMatches(text, pattern, ignoreCase) {
|
|
39
|
+
if (!pattern)
|
|
40
|
+
return [];
|
|
41
|
+
try {
|
|
42
|
+
const regex = new RegExp(pattern, ignoreCase ? 'gi' : 'g');
|
|
43
|
+
return text.match(regex) || [];
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=logHighlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logHighlight.js","sourceRoot":"","sources":["../../src/utils/logHighlight.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC/B,IAAY,EACZ,OAAe,EACf,UAAmB;IAEnB,IAAI,CAAC,O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|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kubefc",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Kubernetes Follow Colorful - Follow Kubernetes deployment logs with style",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"kubefc": "./dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"dev": "tsx src/cli.tsx",
|
|
15
|
+
"start": "node dist/cli.js",
|
|
16
|
+
"prepublishOnly": "npm run build",
|
|
17
|
+
"test": "npm run build && node dist/cli.js --version"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"kubernetes",
|
|
21
|
+
"k8s",
|
|
22
|
+
"logs",
|
|
23
|
+
"kubectl",
|
|
24
|
+
"cli",
|
|
25
|
+
"ink",
|
|
26
|
+
"typescript"
|
|
27
|
+
],
|
|
28
|
+
"author": "iml88503",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=14"
|
|
36
|
+
},
|
|
37
|
+
"os": [
|
|
38
|
+
"darwin",
|
|
39
|
+
"linux",
|
|
40
|
+
"win32"
|
|
41
|
+
],
|
|
42
|
+
"cpu": [
|
|
43
|
+
"x64",
|
|
44
|
+
"arm64"
|
|
45
|
+
],
|
|
46
|
+
"main": "index.js",
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@kubernetes/client-node": "^1.4.0",
|
|
49
|
+
"chalk": "^5.6.2",
|
|
50
|
+
"commander": "^14.0.2",
|
|
51
|
+
"execa": "^9.6.1",
|
|
52
|
+
"ink": "^6.6.0",
|
|
53
|
+
"ink-select-input": "^6.2.0",
|
|
54
|
+
"ink-spinner": "^5.0.0",
|
|
55
|
+
"meow": "^14.0.0",
|
|
56
|
+
"react": "^19.2.4"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/node": "^25.1.0",
|
|
60
|
+
"@types/react": "^19.2.10",
|
|
61
|
+
"tsx": "^4.21.0",
|
|
62
|
+
"typescript": "^5.9.3"
|
|
63
|
+
}
|
|
64
|
+
}
|