bgrun 3.3.1
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 +720 -0
- package/dashboard/app/api/logs/[name]/route.ts +17 -0
- package/dashboard/app/api/processes/[name]/route.ts +19 -0
- package/dashboard/app/api/processes/route.ts +150 -0
- package/dashboard/app/api/restart/[name]/route.ts +20 -0
- package/dashboard/app/api/start/route.ts +22 -0
- package/dashboard/app/api/stop/[name]/route.ts +16 -0
- package/dashboard/app/api/version/route.ts +8 -0
- package/dashboard/app/globals.css +1135 -0
- package/dashboard/app/layout.tsx +47 -0
- package/dashboard/app/page.client.tsx +554 -0
- package/dashboard/app/page.tsx +130 -0
- package/dist/index.js +1580 -0
- package/examples/bgr-startup.sh +40 -0
- package/package.json +60 -0
- package/src/api.ts +31 -0
- package/src/build.ts +26 -0
- package/src/commands/cleanup.ts +142 -0
- package/src/commands/details.ts +46 -0
- package/src/commands/list.ts +86 -0
- package/src/commands/logs.ts +49 -0
- package/src/commands/run.ts +151 -0
- package/src/commands/watch.ts +223 -0
- package/src/config.ts +37 -0
- package/src/db.ts +115 -0
- package/src/index.ts +349 -0
- package/src/logger.ts +29 -0
- package/src/platform.ts +440 -0
- package/src/schema.ts +2 -0
- package/src/server.ts +24 -0
- package/src/table.ts +230 -0
- package/src/types.ts +27 -0
- package/src/utils.ts +99 -0
- package/src/version.macro.ts +17 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BGR Dashboard — Home Page (Server Component)
|
|
3
|
+
*
|
|
4
|
+
* Renders the page shell with loading placeholders.
|
|
5
|
+
* Data is populated by page.client.tsx which polls /api/processes every 5s.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export default function DashboardPage() {
|
|
9
|
+
return (
|
|
10
|
+
<div>
|
|
11
|
+
{/* Toast Container */}
|
|
12
|
+
<div className="toast-container" id="toast-container"></div>
|
|
13
|
+
|
|
14
|
+
{/* Stats Grid */}
|
|
15
|
+
<div className="stats-grid">
|
|
16
|
+
<div className="stat-card">
|
|
17
|
+
<div className="stat-label">Total Processes</div>
|
|
18
|
+
<div className="stat-value" id="total-count">–</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div className="stat-card running">
|
|
21
|
+
<div className="stat-label">Running</div>
|
|
22
|
+
<div className="stat-value" id="running-count">–</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div className="stat-card stopped">
|
|
25
|
+
<div className="stat-label">Stopped</div>
|
|
26
|
+
<div className="stat-value" id="stopped-count">–</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
{/* Toolbar */}
|
|
31
|
+
<div className="toolbar">
|
|
32
|
+
<div className="toolbar-left">
|
|
33
|
+
<h2>Processes</h2>
|
|
34
|
+
<div className="search-wrapper">
|
|
35
|
+
<svg className="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
36
|
+
<circle cx="11" cy="11" r="8" />
|
|
37
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
38
|
+
</svg>
|
|
39
|
+
<input type="text" className="search-input" id="search-input" placeholder="Filter processes..." />
|
|
40
|
+
<span className="search-shortcut">/</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<button className="btn btn-primary" id="new-process-btn">
|
|
44
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
45
|
+
<line x1="12" y1="5" x2="12" y2="19" />
|
|
46
|
+
<line x1="5" y1="12" x2="19" y2="12" />
|
|
47
|
+
</svg>
|
|
48
|
+
New Process
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
{/* Process Table */}
|
|
53
|
+
<div className="table-container">
|
|
54
|
+
<table>
|
|
55
|
+
<thead>
|
|
56
|
+
<tr>
|
|
57
|
+
<th>Process</th>
|
|
58
|
+
<th>Status</th>
|
|
59
|
+
<th>PID</th>
|
|
60
|
+
<th>Port</th>
|
|
61
|
+
<th>Command</th>
|
|
62
|
+
<th>Runtime</th>
|
|
63
|
+
<th style={{ width: '120px' }}>Actions</th>
|
|
64
|
+
</tr>
|
|
65
|
+
</thead>
|
|
66
|
+
<tbody id="processes-table">
|
|
67
|
+
<tr>
|
|
68
|
+
<td colSpan={7}>
|
|
69
|
+
<div className="empty-state">
|
|
70
|
+
<div className="empty-icon">⚡</div>
|
|
71
|
+
<h3>Loading processes...</h3>
|
|
72
|
+
</div>
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
</tbody>
|
|
76
|
+
</table>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
{/* Detail Drawer Backdrop */}
|
|
80
|
+
<div className="drawer-backdrop" id="drawer-backdrop"></div>
|
|
81
|
+
|
|
82
|
+
{/* Detail Drawer */}
|
|
83
|
+
<div className="detail-drawer" id="detail-drawer">
|
|
84
|
+
<div className="drawer-header">
|
|
85
|
+
<h3>
|
|
86
|
+
<div className="process-icon" id="drawer-icon">?</div>
|
|
87
|
+
<span id="drawer-process-name">Process</span>
|
|
88
|
+
</h3>
|
|
89
|
+
<button className="drawer-close" id="drawer-close-btn">✕</button>
|
|
90
|
+
</div>
|
|
91
|
+
<div className="drawer-meta" id="drawer-meta"></div>
|
|
92
|
+
<div className="drawer-tabs">
|
|
93
|
+
<button className="drawer-tab active" data-tab="stdout">Stdout</button>
|
|
94
|
+
<button className="drawer-tab" data-tab="stderr">Stderr</button>
|
|
95
|
+
</div>
|
|
96
|
+
<div className="drawer-content">
|
|
97
|
+
<div className="drawer-logs" id="drawer-logs">No logs loaded</div>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
{/* New Process Modal */}
|
|
102
|
+
<div className="modal-overlay" id="new-process-modal">
|
|
103
|
+
<div className="modal">
|
|
104
|
+
<div className="modal-header">
|
|
105
|
+
<h3>New Process</h3>
|
|
106
|
+
<button className="modal-close" id="modal-close-btn">✕</button>
|
|
107
|
+
</div>
|
|
108
|
+
<div className="modal-body">
|
|
109
|
+
<div className="form-group">
|
|
110
|
+
<label htmlFor="process-name-input">Process Name</label>
|
|
111
|
+
<input type="text" id="process-name-input" placeholder="my-app" />
|
|
112
|
+
</div>
|
|
113
|
+
<div className="form-group">
|
|
114
|
+
<label htmlFor="process-command-input">Command</label>
|
|
115
|
+
<input type="text" id="process-command-input" placeholder="bun run dev" />
|
|
116
|
+
</div>
|
|
117
|
+
<div className="form-group">
|
|
118
|
+
<label htmlFor="process-directory-input">Working Directory</label>
|
|
119
|
+
<input type="text" id="process-directory-input" placeholder="/path/to/project" />
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
<div className="modal-footer">
|
|
123
|
+
<button className="btn btn-ghost" id="modal-cancel-btn">Cancel</button>
|
|
124
|
+
<button className="btn btn-primary" id="modal-create-btn">Create</button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
}
|