chore: rename project grot -> grom
Grafana's mascot and AI helper are both named Grot (grafana.com/grot) — a name collision flagged on the r/grafana launch thread. grom (Polish: thunder) keeps the short Slavic name without squatting on Grafana's brand. Renames the Go module, cmd dir, binary, brew cask, docs, examples, and dev docs. Old repo URL redirects; module path is new as of v0.2.0.
This commit is contained in:
1 parent
0afe1708b4
commit
e2c65d426e
37 files changed
+113
-113
No files matched your search
+1
-1
@@ -6,4 +6,4 @@ coverage.html
|
||||
.DS_Store
|
||||
|
||||
# built binary
|
||||
/grot
|
||||
/grom
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
version: 2
|
||||
|
||||
project_name: grot
|
||||
project_name: grom
|
||||
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
- main: ./cmd/grot
|
||||
- main: ./cmd/grom
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos: [darwin, linux]
|
||||
@@ -37,12 +37,12 @@ homebrew_casks:
|
||||
owner: qf-studio
|
||||
name: homebrew-tap
|
||||
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
|
||||
homepage: https://github.com/qf-studio/grot
|
||||
homepage: https://github.com/qf-studio/grom
|
||||
description: btop-style terminal dashboards for Prometheus & Grafana
|
||||
# Unsigned binary: strip the quarantine bit so Gatekeeper doesn't block it.
|
||||
hooks:
|
||||
post:
|
||||
install: |
|
||||
if system_command("/usr/bin/xattr", args: ["-h"]).exit_status == 0
|
||||
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/grot"]
|
||||
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/grom"]
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
.PHONY: build build-all run demo test test-coverage lint fmt clean install deps release help
|
||||
|
||||
BINARY_NAME=grot
|
||||
BINARY_NAME=grom
|
||||
VERSION?=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
||||
BUILD_TIME=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
LDFLAGS=-ldflags "-X main.version=$(VERSION) -X main.buildTime=$(BUILD_TIME)"
|
||||
@@ -9,14 +9,14 @@ all: build
|
||||
|
||||
build:
|
||||
@echo "Building $(BINARY_NAME)..."
|
||||
go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/grot
|
||||
go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/grom
|
||||
|
||||
build-all:
|
||||
@echo "Building for all platforms..."
|
||||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-darwin-amd64 ./cmd/grot
|
||||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-darwin-arm64 ./cmd/grot
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-linux-amd64 ./cmd/grot
|
||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-linux-arm64 ./cmd/grot
|
||||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-darwin-amd64 ./cmd/grom
|
||||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-darwin-arm64 ./cmd/grom
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-linux-amd64 ./cmd/grom
|
||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build $(LDFLAGS) -o bin/$(BINARY_NAME)-linux-arm64 ./cmd/grom
|
||||
|
||||
run: build
|
||||
./bin/$(BINARY_NAME)
|
||||
@@ -53,7 +53,7 @@ clean:
|
||||
rm -f coverage.out coverage.html
|
||||
|
||||
install:
|
||||
go install $(LDFLAGS) ./cmd/grot
|
||||
go install $(LDFLAGS) ./cmd/grom
|
||||
|
||||
# Release — tag-only; CI (goreleaser) is the sole publisher.
|
||||
# Usage: make release V=0.1.0
|
||||
@@ -72,7 +72,7 @@ endif
|
||||
@echo "✅ Tag v$(V) pushed. CI publishes the release."
|
||||
|
||||
help:
|
||||
@echo "grot Makefile:"
|
||||
@echo "grom Makefile:"
|
||||
@echo " make build Build the binary"
|
||||
@echo " make build-all Build for all platforms"
|
||||
@echo " make demo Build and render the demo gallery"
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# grot
|
||||
# grom
|
||||
|
||||
[](https://github.com/qf-studio/grot/actions/workflows/ci.yml)
|
||||
[](https://github.com/qf-studio/grot/releases)
|
||||
[](LICENSE)
|
||||
[](https://github.com/qf-studio/grom/actions/workflows/ci.yml)
|
||||
[](https://github.com/qf-studio/grom/releases)
|
||||
[](LICENSE)
|
||||
|
||||
**btop-style terminal dashboards for Prometheus & Grafana.**
|
||||
|
||||
grot renders Prometheus metrics as polished terminal dashboards — braille
|
||||
grom renders Prometheus metrics as polished terminal dashboards — braille
|
||||
charts, gradient meters, threshold-colored stats. Point it at your existing
|
||||
Grafana dashboard JSON and get the same layout in your terminal.
|
||||
|
||||

|
||||

|
||||
|
||||
> Status: early release, under active development.
|
||||
|
||||
@@ -20,36 +20,36 @@ Grafana dashboard JSON and get the same layout in your terminal.
|
||||
is abandoned (2019) and limited to termdash's fixed widgets.
|
||||
- [btop](https://github.com/aristocratos/btop) proves terminal dashboards can
|
||||
be beautiful — but it only shows system metrics.
|
||||
- Nothing renders *your* Grafana dashboards in the terminal. grot does.
|
||||
- Nothing renders *your* Grafana dashboards in the terminal. grom does.
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
brew install --cask qf-studio/tap/grot # macOS / Linux
|
||||
go install github.com/qf-studio/grot/cmd/grot@latest
|
||||
brew install --cask qf-studio/tap/grom # macOS / Linux
|
||||
go install github.com/qf-studio/grom/cmd/grom@latest
|
||||
```
|
||||
|
||||
Prebuilt binaries for darwin/linux (amd64 + arm64) on the
|
||||
[releases page](https://github.com/qf-studio/grot/releases).
|
||||
[releases page](https://github.com/qf-studio/grom/releases).
|
||||
|
||||
## Quick start
|
||||
|
||||
```bash
|
||||
# Widget gallery with fake data — no Prometheus needed
|
||||
grot demo --theme tokyo-night
|
||||
grom demo --theme tokyo-night
|
||||
|
||||
# Works against ANY Prometheus (only uses `up` + scrape_* metrics)
|
||||
grot run --config examples/prometheus.yaml --prom http://localhost:9090
|
||||
grom run --config examples/prometheus.yaml --prom http://localhost:9090
|
||||
|
||||
# Render your existing Grafana dashboard in the terminal
|
||||
grot run --grafana-json my-dashboard.json --prom http://localhost:9090
|
||||
grom run --grafana-json my-dashboard.json --prom http://localhost:9090
|
||||
|
||||
# What maps? Validate an import without running it
|
||||
grot import my-dashboard.json # summary + warnings
|
||||
grot import --check my-dashboard.json # non-zero exit on any warning (CI)
|
||||
grom import my-dashboard.json # summary + warnings
|
||||
grom import --check my-dashboard.json # non-zero exit on any warning (CI)
|
||||
|
||||
# One static frame to stdout (snapshots, docs, cron)
|
||||
grot run -c dashboard.yaml --prom http://localhost:9090 --once
|
||||
grom run -c dashboard.yaml --prom http://localhost:9090 --once
|
||||
```
|
||||
|
||||
## Keys
|
||||
@@ -102,7 +102,7 @@ widgets:
|
||||
|
||||
Notes:
|
||||
|
||||
- `grid` is optional — omit it everywhere and grot auto-flows widgets into
|
||||
- `grid` is optional — omit it everywhere and grom auto-flows widgets into
|
||||
rows with responsive breakpoints (1 column < 80 cols, 2 < 140, 4 beyond).
|
||||
- **timeseries** always query a range (step auto-sized to the chart width);
|
||||
**stat** joins in with `sparkline: true` (value + trend band); gauges and
|
||||
@@ -116,10 +116,10 @@ Working examples: [`examples/prometheus.yaml`](examples/prometheus.yaml)
|
||||
|
||||
## Grafana import
|
||||
|
||||
`grot run --grafana-json` / `grot import` accept a dashboard JSON export —
|
||||
`grom run --grafana-json` / `grom import` accept a dashboard JSON export —
|
||||
bare or API-wrapped (`{"dashboard": {...}}`).
|
||||
|
||||
| Grafana | grot |
|
||||
| Grafana | grom |
|
||||
|---|---|
|
||||
| `stat`, `gauge`, `bargauge`, `timeseries` panels | 1:1 widgets |
|
||||
| `gridPos` | 24-column layout, scaled to your terminal |
|
||||
@@ -142,7 +142,7 @@ bare or API-wrapped (`{"dashboard": {...}}`).
|
||||
## Development
|
||||
|
||||
```bash
|
||||
make build # build ./bin/grot
|
||||
make build # build ./bin/grom
|
||||
make demo # render the widget gallery
|
||||
make test # go test -race
|
||||
make lint # golangci-lint
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/term"
|
||||
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
func demoCmd() *cobra.Command {
|
||||
@@ -176,7 +176,7 @@ func renderDemo(th theme.Theme, width int) string {
|
||||
empty.Render(otherW, row4H, th, false),
|
||||
)
|
||||
|
||||
header := th.AccentStyle().Bold(true).Render(" grot") +
|
||||
header := th.AccentStyle().Bold(true).Render(" grom") +
|
||||
th.DimStyle().Render(" · demo gallery · theme: "+th.Name)
|
||||
|
||||
return header + "\n" + row1 + "\n" + row2 + "\n" + row3 + "\n" + row4
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grot/internal/grafana"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
"github.com/qf-studio/grom/internal/grafana"
|
||||
)
|
||||
|
||||
func importCmd() *cobra.Command {
|
||||
@@ -1,4 +1,4 @@
|
||||
// grot — a btop-style terminal dashboard for Prometheus & Grafana.
|
||||
// grom — a btop-style terminal dashboard for Prometheus & Grafana.
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -15,9 +15,9 @@ var (
|
||||
|
||||
func main() {
|
||||
root := &cobra.Command{
|
||||
Use: "grot",
|
||||
Short: "grot — btop-style terminal dashboards for Prometheus & Grafana",
|
||||
Long: `grot renders Prometheus metrics as polished terminal dashboards.
|
||||
Use: "grom",
|
||||
Short: "grom — btop-style terminal dashboards for Prometheus & Grafana",
|
||||
Long: `grom renders Prometheus metrics as polished terminal dashboards.
|
||||
Import your existing Grafana dashboard JSON or write a simple YAML config.`,
|
||||
SilenceUsage: true,
|
||||
}
|
||||
@@ -29,7 +29,7 @@ Import your existing Grafana dashboard JSON or write a simple YAML config.`,
|
||||
Use: "version",
|
||||
Short: "Print version",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("grot %s (built %s)\n", version, buildTime)
|
||||
fmt.Printf("grom %s (built %s)\n", version, buildTime)
|
||||
},
|
||||
})
|
||||
|
||||
@@ -8,12 +8,12 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/term"
|
||||
|
||||
"github.com/qf-studio/grot/internal/app"
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grot/internal/datasource/prom"
|
||||
"github.com/qf-studio/grot/internal/grafana"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/internal/app"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
"github.com/qf-studio/grom/internal/datasource/prom"
|
||||
"github.com/qf-studio/grom/internal/grafana"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
func runCmd() *cobra.Command {
|
||||
+2
-2
@@ -11,12 +11,12 @@ Set Padding 12
|
||||
Set WindowBar Colorful
|
||||
|
||||
Hide
|
||||
Type "go build -o grot ./cmd/grot && clear"
|
||||
Type "go build -o grom ./cmd/grom && clear"
|
||||
Enter
|
||||
Sleep 3s
|
||||
Show
|
||||
|
||||
Type "./grot run --config examples/pilot.yaml --prom http://localhost:9093"
|
||||
Type "./grom run --config examples/pilot.yaml --prom http://localhost:9093"
|
||||
Sleep 500ms
|
||||
Enter
|
||||
Sleep 4s
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
# grot native dashboard config — Pilot metrics from Prometheus.
|
||||
# grom native dashboard config — Pilot metrics from Prometheus.
|
||||
# A btop-style overview: headline stats, a gauge + bar gauge, and two charts.
|
||||
# Run: grot run --config examples/pilot.yaml --prom http://localhost:9093
|
||||
# Run: grom run --config examples/pilot.yaml --prom http://localhost:9093
|
||||
title: pilot
|
||||
theme: pilot
|
||||
refresh: 10s
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# grot dashboard that works against ANY Prometheus — no exporters required.
|
||||
# grom dashboard that works against ANY Prometheus — no exporters required.
|
||||
# It uses only `up` and the scrape_* metrics Prometheus attaches to every
|
||||
# target it scrapes. If your Prometheus also scrapes itself (the default
|
||||
# packaged config), swap in richer prometheus_* metrics where you like.
|
||||
#
|
||||
# Run: grot run --config examples/prometheus.yaml --prom http://localhost:9090
|
||||
# Run: grom run --config examples/prometheus.yaml --prom http://localhost:9090
|
||||
title: prometheus
|
||||
theme: tokyo-night
|
||||
refresh: 10s
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module github.com/qf-studio/grot
|
||||
module github.com/qf-studio/grom
|
||||
|
||||
go 1.25.0
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ package app
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
// BuildWidget constructs a renderable widget from a spec.
|
||||
|
||||
@@ -3,8 +3,8 @@ package app
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
func fptr(v float64) *float64 { return &v }
|
||||
|
||||
@@ -4,10 +4,10 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grot/internal/datasource"
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
"github.com/qf-studio/grom/internal/datasource"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
// FetchWidget runs every query in spec and returns the combined result.
|
||||
|
||||
@@ -3,7 +3,7 @@ package app
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
)
|
||||
|
||||
func TestUseRange(t *testing.T) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package app
|
||||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
)
|
||||
|
||||
// Rect is a widget's placement in terminal cells, top-left origin.
|
||||
|
||||
@@ -3,7 +3,7 @@ package app
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
)
|
||||
|
||||
func specs(types ...config.WidgetType) []config.WidgetSpec {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
)
|
||||
|
||||
// helpBindings lists the dashboard keybindings shown by the ? overlay.
|
||||
|
||||
@@ -10,10 +10,10 @@ import (
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grot/internal/datasource"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
"github.com/qf-studio/grom/internal/datasource"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
// rangePresets are the windows the +/- keys step through.
|
||||
@@ -32,7 +32,7 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
// Model is grot's Bubble Tea application: a focusable, zoomable grid of widgets
|
||||
// Model is grom's Bubble Tea application: a focusable, zoomable grid of widgets
|
||||
// backed by a polling datasource. Fetches run as concurrent Cmds guarded so a
|
||||
// slow query never blocks Update or stacks up behind itself.
|
||||
type Model struct {
|
||||
@@ -131,7 +131,7 @@ func (m Model) View() string {
|
||||
if !m.ready {
|
||||
return ""
|
||||
}
|
||||
header := headerLine(coalesce(m.dash.Title, "grot"), m.th, formatRange(m.rng), m.zoomed, m.staleNames(), m.width)
|
||||
header := headerLine(coalesce(m.dash.Title, "grom"), m.th, formatRange(m.rng), m.zoomed, m.staleNames(), m.width)
|
||||
if m.helpShown {
|
||||
return header + "\n" + helpView(m.th, m.width, m.contentHeight())
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grot/internal/datasource"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
"github.com/qf-studio/grom/internal/datasource"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
// fakeDS returns canned data and counts calls.
|
||||
|
||||
@@ -8,17 +8,17 @@ import (
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
// StaticFrame renders a one-shot header + grid at the given viewport, with no
|
||||
// focus. Widgets must already hold their fetched results.
|
||||
func StaticFrame(dash *config.Dashboard, widgets []widget.Widget, th theme.Theme, termW, termH int) string {
|
||||
rects := GridLayout(dash.Widgets, termW, termH)
|
||||
title := coalesce(dash.Title, "grot")
|
||||
title := coalesce(dash.Title, "grom")
|
||||
header := headerLine(title, th, formatRange(dash.Range.Duration()), false, nil, termW)
|
||||
return header + "\n" + composeGrid(widgets, rects, th, -1)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Package config defines grot's canonical dashboard model and a YAML loader.
|
||||
// Package config defines grom's canonical dashboard model and a YAML loader.
|
||||
// Both native YAML configs and (later) Grafana JSON import produce a Dashboard.
|
||||
package config
|
||||
|
||||
@@ -20,12 +20,12 @@ const (
|
||||
TypeGauge WidgetType = "gauge"
|
||||
TypeBarGauge WidgetType = "bargauge"
|
||||
TypeTimeSeries WidgetType = "timeseries"
|
||||
// TypePlaceholder marks a panel grot cannot render (produced by the Grafana
|
||||
// TypePlaceholder marks a panel grom cannot render (produced by the Grafana
|
||||
// importer for unsupported panel types). It carries no queries.
|
||||
TypePlaceholder WidgetType = "placeholder"
|
||||
)
|
||||
|
||||
// Dashboard is grot's canonical dashboard model.
|
||||
// Dashboard is grom's canonical dashboard model.
|
||||
type Dashboard struct {
|
||||
Title string `yaml:"title"`
|
||||
Theme string `yaml:"theme"`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Package datasource defines the boundary grot's widgets query against. The
|
||||
// Package datasource defines the boundary grom's widgets query against. The
|
||||
// interface lives here (the consumer side); concrete backends such as
|
||||
// datasource/prom implement it.
|
||||
package datasource
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
// Instant requests a single-value (vector) query evaluated at At. A zero At
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
promv1 "github.com/prometheus/client_golang/api/prometheus/v1"
|
||||
"github.com/prometheus/common/model"
|
||||
|
||||
"github.com/qf-studio/grot/internal/datasource"
|
||||
"github.com/qf-studio/grot/pkg/tui/widget"
|
||||
"github.com/qf-studio/grom/internal/datasource"
|
||||
"github.com/qf-studio/grom/pkg/tui/widget"
|
||||
)
|
||||
|
||||
// Client queries a Prometheus server.
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/prometheus/common/model"
|
||||
|
||||
"github.com/qf-studio/grot/internal/datasource"
|
||||
"github.com/qf-studio/grom/internal/datasource"
|
||||
)
|
||||
|
||||
// stubServer returns a Prometheus-shaped API server serving canned responses
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Package grafana imports a Grafana dashboard JSON export into grot's canonical
|
||||
// config.Dashboard. It maps the panel subset grot renders (stat, gauge,
|
||||
// Package grafana imports a Grafana dashboard JSON export into grom's canonical
|
||||
// config.Dashboard. It maps the panel subset grom renders (stat, gauge,
|
||||
// bargauge, timeseries) 1:1, promotes row children, and represents everything
|
||||
// else as a placeholder in its original grid slot, collecting warnings.
|
||||
package grafana
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
)
|
||||
|
||||
// Import reads and converts a Grafana dashboard JSON file.
|
||||
@@ -111,7 +111,7 @@ func convertPanel(p rawPanel) (*config.WidgetSpec, string) {
|
||||
return spec, ""
|
||||
}
|
||||
|
||||
// mapType maps a Grafana panel type to a grot widget type.
|
||||
// mapType maps a Grafana panel type to a grom widget type.
|
||||
func mapType(t string) (config.WidgetType, bool) {
|
||||
switch t {
|
||||
case "stat":
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/qf-studio/grot/internal/config"
|
||||
"github.com/qf-studio/grom/internal/config"
|
||||
)
|
||||
|
||||
func TestImportPilotDashboard(t *testing.T) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Package theme defines grot's color themes. A Theme is a small set of
|
||||
// Package theme defines grom's color themes. A Theme is a small set of
|
||||
// semantic color tokens; render primitives derive lipgloss styles from it.
|
||||
package theme
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
)
|
||||
|
||||
// BarGauge shows one horizontal bar per series, scaled to the max value:
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
)
|
||||
|
||||
// Gauge shows a value as a horizontal meter with threshold coloring:
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package widget
|
||||
|
||||
import (
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
)
|
||||
|
||||
// Placeholder fills a panel slot grot cannot render — an unsupported Grafana
|
||||
// Placeholder fills a panel slot grom cannot render — an unsupported Grafana
|
||||
// panel type — with a quiet centered note, so an imported dashboard keeps its
|
||||
// layout instead of leaving a hole.
|
||||
type Placeholder struct {
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
)
|
||||
|
||||
// Stat shows a single large value with threshold coloring and an optional
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
)
|
||||
|
||||
// TimeSeries renders series as a braille area chart — the btop texture:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Package widget provides grot's renderable dashboard widgets: Stat, Gauge,
|
||||
// Package widget provides grom's renderable dashboard widgets: Stat, Gauge,
|
||||
// BarGauge, and TimeSeries. Widgets receive query results and render
|
||||
// themselves into an exact w×h cell rectangle.
|
||||
package widget
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/qf-studio/grot/pkg/tui/render"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/render"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
)
|
||||
|
||||
// Point is a single sample.
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/qf-studio/grot/pkg/tui/theme"
|
||||
"github.com/qf-studio/grom/pkg/tui/theme"
|
||||
)
|
||||
|
||||
func result(vals ...float64) QueryResult {
|
||||
|
||||
Reference in new issue
Block a user