@ziuus/vanta 0.2.1 → 0.3.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 +107 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Your machine, one pane.**
|
|
6
6
|
|
|
7
|
-
A fast, aesthetic terminal system dashboard in Rust.
|
|
7
|
+
A fast, aesthetic terminal system dashboard in Rust. The most complete keyboard-driven terminal dashboard — one pane, six modes, zero mouse.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@ziuus/vanta)
|
|
10
10
|
[](https://github.com/ziuus/vanta/actions/workflows/ci.yml)
|
|
@@ -185,6 +185,112 @@ matrix = true
|
|
|
185
185
|
video = true
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
+
## Custom Widgets
|
|
189
|
+
|
|
190
|
+
Add your own data panels to the Dashboard without recompiling Vanta.
|
|
191
|
+
Each `[[custom_widgets]]` entry in `config.toml` runs a command or reads a file in the background and displays the result.
|
|
192
|
+
|
|
193
|
+
### Quick examples
|
|
194
|
+
|
|
195
|
+
**Raspberry Pi voltage:**
|
|
196
|
+
|
|
197
|
+
```toml
|
|
198
|
+
[[custom_widgets]]
|
|
199
|
+
id = "pi_voltage"
|
|
200
|
+
title = "Pi Battery"
|
|
201
|
+
source = "command"
|
|
202
|
+
command = "vcgencmd measure_volts"
|
|
203
|
+
renderer = "value"
|
|
204
|
+
refresh = 2.0
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Raspberry Pi CPU temperature (millidegrees → degrees with min/max):**
|
|
208
|
+
|
|
209
|
+
```toml
|
|
210
|
+
[[custom_widgets]]
|
|
211
|
+
id = "pi_temp"
|
|
212
|
+
title = "CPU Temp"
|
|
213
|
+
source = "command"
|
|
214
|
+
command = "cat /sys/class/thermal/thermal_zone0/temp"
|
|
215
|
+
renderer = "gauge"
|
|
216
|
+
refresh = 2.0
|
|
217
|
+
min = 0
|
|
218
|
+
max = 100000
|
|
219
|
+
unit = "m°C"
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Linux battery percentage (gauge renderer):**
|
|
223
|
+
|
|
224
|
+
```toml
|
|
225
|
+
[[custom_widgets]]
|
|
226
|
+
id = "battery"
|
|
227
|
+
title = "Battery"
|
|
228
|
+
source = "file"
|
|
229
|
+
path = "/sys/class/power_supply/BAT0/capacity"
|
|
230
|
+
renderer = "gauge"
|
|
231
|
+
refresh = 1.0
|
|
232
|
+
min = 0
|
|
233
|
+
max = 100
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Any shell command as plain text:**
|
|
237
|
+
|
|
238
|
+
```toml
|
|
239
|
+
[[custom_widgets]]
|
|
240
|
+
id = "uptime_cmd"
|
|
241
|
+
title = "Uptime"
|
|
242
|
+
source = "command"
|
|
243
|
+
command = "uptime -p"
|
|
244
|
+
renderer = "text"
|
|
245
|
+
refresh = 10.0
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Docker running containers:**
|
|
249
|
+
|
|
250
|
+
```toml
|
|
251
|
+
[[custom_widgets]]
|
|
252
|
+
id = "docker_count"
|
|
253
|
+
title = "Containers"
|
|
254
|
+
source = "command"
|
|
255
|
+
command = "docker ps -q"
|
|
256
|
+
renderer = "text"
|
|
257
|
+
refresh = 5.0
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### All options
|
|
261
|
+
|
|
262
|
+
| Key | Required | Default | Description |
|
|
263
|
+
|-----|----------|---------|-------------|
|
|
264
|
+
| `id` | ✓ | — | Unique identifier (used for focus/zoom). |
|
|
265
|
+
| `title` | ✓ | — | Panel title shown in the border. |
|
|
266
|
+
| `source` | — | `command` | `command` or `file`. |
|
|
267
|
+
| `command` | when `source = "command"` | — | Command to run (supports quoted args; no shell). |
|
|
268
|
+
| `path` | when `source = "file"` | — | File to read (e.g. `/sys/class/…`). |
|
|
269
|
+
| `renderer` | — | `value` | `value` · `text` · `gauge` · `bar` · `graph`. |
|
|
270
|
+
| `refresh` | — | `5.0` | Seconds between fetches (0.1 – 3600). |
|
|
271
|
+
| `unit` | — | none | Unit suffix appended to `value` displays (e.g. `"V"`). |
|
|
272
|
+
| `min` | — | `0` | Range minimum for `gauge` and `bar`. |
|
|
273
|
+
| `max` | — | `100` | Range maximum for `gauge` and `bar`. |
|
|
274
|
+
| `enabled` | — | `true` | Set `false` to hide without removing the entry. |
|
|
275
|
+
|
|
276
|
+
### Renderers
|
|
277
|
+
|
|
278
|
+
| Name | Shows |
|
|
279
|
+
|------|-------|
|
|
280
|
+
| `value` | Single value, centred and bold. Appends `unit` if set. |
|
|
281
|
+
| `text` | Raw text output, word-wrapped. |
|
|
282
|
+
| `gauge` | Horizontal bar `████░░ 82%` normalised to `min`/`max`. |
|
|
283
|
+
| `bar` | Horizontal bar without percentage label. |
|
|
284
|
+
| `graph` | Scrolling history graph using Vanta's block-character primitives. |
|
|
285
|
+
|
|
286
|
+
### How it works
|
|
287
|
+
|
|
288
|
+
- Each widget runs on its own background thread at its own `refresh` interval. The render loop (30 fps) only reads a cached result — it never blocks on I/O.
|
|
289
|
+
- Commands are executed directly (no `sh -c`). Arguments with spaces can be quoted: `command = 'grep -r "error" /var/log'`.
|
|
290
|
+
- Commands that hang are killed after 10 seconds. Crashed commands, missing files, and parse errors are shown as status messages (`Command failed`, `Unavailable`, `Invalid value`, `Timeout`, `Loading…`) — they never crash Vanta.
|
|
291
|
+
- Custom widgets appear as a horizontal row at the bottom of the Dashboard page. They participate in normal Tab focus and Enter zoom like any built-in panel.
|
|
292
|
+
- Set `VANTA_DEBUG=1` before running Vanta to see per-widget error messages on stderr.
|
|
293
|
+
|
|
188
294
|
## Architecture
|
|
189
295
|
|
|
190
296
|
All telemetry is collected on a single background sampler thread (`/proc`, `/sys`,
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziuus/vanta",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Aesthetic Rust TUI system dashboard — CPU, memory, disk, network, GPU, processes, now-playing, clock and visualizer in one terminal pane",
|
|
5
5
|
"bin": {
|
|
6
6
|
"vanta": "bin/vanta.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"prepack": "cp ../README.md ../LICENSE . && sed -i 's|src=\"docs/|src=\"https://raw.githubusercontent.com/ziuus/vanta/main/docs/|g' README.md",
|
|
10
|
+
"release": "node sync-version.js && npm publish --access public",
|
|
10
11
|
"postinstall": "node install.js"
|
|
11
12
|
},
|
|
12
13
|
"files": [
|