@gravito/zenith 1.1.2 → 1.1.3
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/CHANGELOG.md +15 -0
- package/README.md +77 -22
- package/README.zh-TW.md +88 -0
- package/dist/bin.js +64681 -15842
- package/dist/client/assets/index-C80c1frR.css +1 -0
- package/dist/client/assets/index-CrWem9u3.js +434 -0
- package/dist/server/index.js +64681 -15842
- package/package.json +9 -7
- package/postcss.config.js +4 -4
- package/src/client/Layout.tsx +36 -39
- package/src/client/Sidebar.tsx +7 -7
- package/src/client/ThroughputChart.tsx +31 -17
- package/src/client/WorkerStatus.tsx +56 -80
- package/src/client/components/ConfirmDialog.tsx +22 -14
- package/src/client/components/JobInspector.tsx +95 -162
- package/src/client/index.css +29 -31
- package/src/client/pages/LoginPage.tsx +33 -31
- package/src/client/pages/MetricsPage.tsx +65 -37
- package/src/client/pages/OverviewPage.tsx +30 -28
- package/src/client/pages/PulsePage.tsx +111 -190
- package/src/client/pages/QueuesPage.tsx +82 -83
- package/src/client/pages/SchedulesPage.tsx +56 -61
- package/src/client/pages/SettingsPage.tsx +118 -137
- package/src/client/pages/WorkersPage.tsx +101 -115
- package/src/server/services/CommandService.ts +8 -9
- package/src/server/services/PulseService.ts +61 -4
- package/src/server/services/QueueService.ts +293 -0
- package/src/shared/types.ts +38 -13
- package/tailwind.config.js +75 -68
- package/tsconfig.json +28 -37
- package/tsconfig.node.json +9 -11
- package/dist/client/assets/index-BSMp8oq_.js +0 -436
- package/dist/client/assets/index-BwxlHx-_.css +0 -1
- package/dist/client/index.html +0 -13
- package/src/client/index.html +0 -12
- /package/{ECOSYSTEM_EXPANSION_RFC.md → doc/ECOSYSTEM_EXPANSION_RFC.md} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @gravito/zenith
|
|
2
2
|
|
|
3
|
+
## 1.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Convert all workspace:\* dependencies to version numbers for npm publishing
|
|
8
|
+
|
|
9
|
+
- Fixed 144 workspace:\* dependencies across 58 packages
|
|
10
|
+
- Ensures all packages work properly when installed from npm
|
|
11
|
+
- Resolves issues with bunx and npm installation of CLI tools
|
|
12
|
+
- All internal dependencies now use explicit version constraints
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- @gravito/photon@1.0.1
|
|
16
|
+
- @gravito/stream@2.0.2
|
|
17
|
+
|
|
3
18
|
## 1.1.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,33 +1,88 @@
|
|
|
1
|
-
# @gravito/
|
|
1
|
+
# @gravito/zenith (Flux Console) 🧭
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Zero-config Control Plane and Monitoring Dashboard for Gravito Flux & Stream.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@gravito/zenith` (also known as **Flux Console**) is the official management interface for Gravito's asynchronous ecosystem. It provides real-time visibility into your queues, workers, and background jobs, enabling powerful operational control with zero configuration.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Worker Health**: Live CPU and RAM metrics.
|
|
9
|
-
- **Queue Management**: Pause/Resume queues, View Waiting/Delayed/Failed jobs.
|
|
10
|
-
- **DLQ Operations**: Batch retry or clear failed jobs directly from the UI.
|
|
11
|
-
- **Job Auditing & Search**: Permanent history via SQL (MySQL/SQLite) with global search.
|
|
12
|
-
- **Operational Log Archiving**: Persistent storage for system events and worker activities with history search.
|
|
13
|
-
- **Automated Alerting**: Slack notifications for failure spikes or backlog issues.
|
|
14
|
-
- **Batch Actions**: Flush delayed jobs, purge queues, and bulk operations.
|
|
15
|
-
- **Schedule Management**: Full UI for Cron jobs.
|
|
16
|
-
- **Zero-Config**: Built-in SQLite support for local auditing without a DB server.
|
|
7
|
+
## 🌟 Key Features
|
|
17
8
|
|
|
18
|
-
|
|
9
|
+
- **📊 Real-time Monitoring**: Visualize throughput, error rates, and queue latencies with live-updating charts.
|
|
10
|
+
- **👷 Worker Health**: Track CPU, RAM, and uptime for all active Gravito and Laravel workers in your cluster.
|
|
11
|
+
- **🛠️ Queue Management**: Pause/Resume queues and inspect jobs in Waiting, Delayed, or Failed states.
|
|
12
|
+
- **♻️ Dead Letter Queue (DLQ) Ops**: Batch retry or clear failed jobs directly from the UI with a single click.
|
|
13
|
+
- **🔍 Job Auditing & Search**: Deep search through historical jobs stored in SQL (SQLite/MySQL) or Redis.
|
|
14
|
+
- **📜 Operational Log Archiving**: Persistent storage and full-text search for worker activities and system events.
|
|
15
|
+
- **🚨 Automated Alerting**: Native integration with Slack, Discord, and Email for failure spikes or backlog thresholds.
|
|
16
|
+
- **📅 Schedule Management**: Full-featured UI to manage and trigger your `@gravito/stream` Cron jobs.
|
|
17
|
+
|
|
18
|
+
## 📦 Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bun add @gravito/zenith
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or run directly using `bunx`:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
bunx zenith
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 🚀 Quick Start
|
|
31
|
+
|
|
32
|
+
### 1. Launch the Dashboard
|
|
33
|
+
|
|
34
|
+
You can start the console using the built-in CLI. It will automatically connect to your local Redis.
|
|
19
35
|
|
|
20
36
|
```bash
|
|
21
|
-
# Start
|
|
22
|
-
|
|
37
|
+
# Start on default port 3000
|
|
38
|
+
bunx zenith start
|
|
23
39
|
|
|
24
|
-
#
|
|
25
|
-
|
|
40
|
+
# Custom configuration via env vars
|
|
41
|
+
REDIS_URL=redis://production:6379 DB_DRIVER=mysql zenith start
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Configure Monitoring
|
|
45
|
+
|
|
46
|
+
Register the **Pulse** agent in your Gravito application to report health metrics to Zenith.
|
|
26
47
|
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
```typescript
|
|
49
|
+
import { PlanetCore } from '@gravito/core'
|
|
50
|
+
import { OrbitStream } from '@gravito/stream'
|
|
51
|
+
import { QuasarAgent } from '@gravito/quasar' // Metrics reporter
|
|
52
|
+
|
|
53
|
+
const core = await PlanetCore.boot({
|
|
54
|
+
orbits: [
|
|
55
|
+
OrbitStream.configure({ /* ... */ }),
|
|
56
|
+
],
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// Start reporting to Zenith
|
|
60
|
+
const agent = new QuasarAgent({ service: 'orders-worker' })
|
|
61
|
+
await agent.start()
|
|
29
62
|
```
|
|
30
63
|
|
|
31
|
-
##
|
|
64
|
+
## 🛠️ Configuration
|
|
65
|
+
|
|
66
|
+
| Env Var | Default | Description |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `PORT` | `3000` | The port to run the dashboard on. |
|
|
69
|
+
| `REDIS_URL` | `redis://localhost:6379` | Connection string for your queue backend. |
|
|
70
|
+
| `DB_DRIVER` | `sqlite` | Persistence driver for job history (`sqlite` or `mysql`). |
|
|
71
|
+
| `AUTH_PASSWORD` | `none` | If set, enables password protection for the UI. |
|
|
72
|
+
|
|
73
|
+
## 🧩 Dashboard Sections
|
|
74
|
+
|
|
75
|
+
- **Overview**: High-level cluster health and job throughput.
|
|
76
|
+
- **Queues**: Detailed state of individual queues and job inspection.
|
|
77
|
+
- **Workers**: Live list of active process nodes and their resource usage.
|
|
78
|
+
- **Pulse**: Real-time heartbeat monitoring for all service instances.
|
|
79
|
+
- **Schedules**: Cron job definitions and execution history.
|
|
80
|
+
- **Metrics**: Long-term historical data for capacity planning.
|
|
81
|
+
|
|
82
|
+
## 🤝 Contributing
|
|
83
|
+
|
|
84
|
+
We welcome contributions! Please see our [Contributing Guide](../../CONTRIBUTING.md) for details.
|
|
85
|
+
|
|
86
|
+
## 📄 License
|
|
32
87
|
|
|
33
|
-
|
|
88
|
+
MIT © Carl Lee
|
package/README.zh-TW.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @gravito/zenith (Flux Console) 🧭
|
|
2
|
+
|
|
3
|
+
> 專為 Gravito Flux 與 Stream 設計的零配置控制面板與監控儀表板。
|
|
4
|
+
|
|
5
|
+
`@gravito/zenith` (又稱為 **Flux Console**) 是 Gravito 非同步生態系統的官方管理界面。它為您的隊列 (Queues)、工作者 (Workers) 以及背景任務提供即時的可視化監控,讓您能夠在零配置的情況下實現強大的營運控制。
|
|
6
|
+
|
|
7
|
+
## 🌟 核心特性
|
|
8
|
+
|
|
9
|
+
- **📊 即時監控**:透過動態更新的圖表,即時掌握任務吞吐量、錯誤率與隊列延遲。
|
|
10
|
+
- **👷 工作者健康狀況**:追蹤集群中所有活躍的 Gravito 與 Laravel Worker 的 CPU、記憶體佔用與運行時間。
|
|
11
|
+
- **🛠️ 隊列管理**:隨時暫停或恢復隊列,並深入檢查處於等待 (Waiting)、延遲 (Delayed) 或失敗 (Failed) 狀態的任務。
|
|
12
|
+
- **♻️ 死信隊列 (DLQ) 操作**:直接從 UI 批量重試或清除失敗任務,一鍵搞定。
|
|
13
|
+
- **🔍 任務審計與搜尋**:對存儲於 SQL (SQLite/MySQL) 或 Redis 中的歷史任務進行深度搜尋。
|
|
14
|
+
- **📜 營運日誌封存**:為 Worker 活動與系統事件提供持久化存儲與全文檢索。
|
|
15
|
+
- **🚨 自動化告警**:原生整合 Slack、Discord 與電子郵件,當錯誤率飆升或隊列堆積時自動通知。
|
|
16
|
+
- **📅 排程管理**:完整的 UI 界面來管理並手動觸發您的 `@gravito/stream` Cron 定時任務。
|
|
17
|
+
|
|
18
|
+
## 📦 安裝
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bun add @gravito/zenith
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
或者使用 `bunx` 直接執行:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
bunx zenith
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 🚀 快速上手
|
|
31
|
+
|
|
32
|
+
### 1. 啟動儀表板
|
|
33
|
+
|
|
34
|
+
您可以使用內建的 CLI 啟動控制台,它會自動嘗試連接至您的本地 Redis。
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# 在預設埠 3000 啟動
|
|
38
|
+
bunx zenith start
|
|
39
|
+
|
|
40
|
+
# 透過環境變數自定義配置
|
|
41
|
+
REDIS_URL=redis://production:6379 DB_DRIVER=mysql zenith start
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. 配置監控代理
|
|
45
|
+
|
|
46
|
+
在您的 Gravito 應用程式中註冊 **Pulse** 代理程式,以便向 Zenith 回報健康指標。
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { PlanetCore } from '@gravito/core'
|
|
50
|
+
import { OrbitStream } from '@gravito/stream'
|
|
51
|
+
import { QuasarAgent } from '@gravito/quasar' // 指標回報器
|
|
52
|
+
|
|
53
|
+
const core = await PlanetCore.boot({
|
|
54
|
+
orbits: [
|
|
55
|
+
OrbitStream.configure({ /* ... */ }),
|
|
56
|
+
],
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// 開始回報數據至 Zenith
|
|
60
|
+
const agent = new QuasarAgent({ service: 'orders-worker' })
|
|
61
|
+
await agent.start()
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 🛠️ 配置選項
|
|
65
|
+
|
|
66
|
+
| 環境變數 | 預設值 | 說明 |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `PORT` | `3000` | 儀表板運行的埠號。 |
|
|
69
|
+
| `REDIS_URL` | `redis://localhost:6379` | 隊列後端的連接字串。 |
|
|
70
|
+
| `DB_DRIVER` | `sqlite` | 歷史任務的持久化驅動 (`sqlite` 或 `mysql`)。 |
|
|
71
|
+
| `AUTH_PASSWORD` | `none` | 若設置,將為 UI 界面啟用密碼保護。 |
|
|
72
|
+
|
|
73
|
+
## 🧩 儀表板區塊
|
|
74
|
+
|
|
75
|
+
- **總覽 (Overview)**:集群整體的健康狀況與任務吞吐量。
|
|
76
|
+
- **隊列 (Queues)**:各別隊列的詳細狀態與任務檢查。
|
|
77
|
+
- **工作者 (Workers)**:運行中的進程節點列表及其資源佔用。
|
|
78
|
+
- **Pulse**:所有服務實例的即時心跳監控。
|
|
79
|
+
- **排程 (Schedules)**:Cron 任務定義與執行歷史。
|
|
80
|
+
- **指標 (Metrics)**:用於容量規劃的長期歷史數據。
|
|
81
|
+
|
|
82
|
+
## 🤝 參與貢獻
|
|
83
|
+
|
|
84
|
+
我們歡迎任何形式的貢獻!詳細資訊請參閱 [貢獻指南](../../CONTRIBUTING.md)。
|
|
85
|
+
|
|
86
|
+
## 📄 開源授權
|
|
87
|
+
|
|
88
|
+
MIT © Carl Lee
|