Add Claude integration to dashboard
Add comprehensive Claude Code monitoring and realtime streaming to the K8s dashboard. Includes API endpoints for health, stats, summary, inventory, and live event streaming. Frontend provides overview, usage, inventory, debug, and live feed views.
This commit is contained in:
24
dashboard/internal/claude/tail.go
Normal file
24
dashboard/internal/claude/tail.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package claude
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func TailLastNLines(path string, n int) ([]string, error) {
|
||||
content, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
lines := strings.Split(string(content), "\n")
|
||||
|
||||
var result []string
|
||||
for i := len(lines) - 1; i >= 0 && len(result) < n; i-- {
|
||||
if lines[i] != "" {
|
||||
result = append(result, lines[i])
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
Reference in New Issue
Block a user