@xeplr/monitor 0.1.3 → 1.0.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.
Files changed (67) hide show
  1. package/README.md +138 -125
  2. package/api/README.md +71 -0
  3. package/api/app.js +46 -0
  4. package/api/bin/auth.js +37 -0
  5. package/api/bin/www +72 -0
  6. package/api/db/setup.js +10 -0
  7. package/api/env.required.js +37 -0
  8. package/api/lib/host.js +188 -0
  9. package/api/lib/jobs.js +83 -0
  10. package/api/lib/services.js +67 -0
  11. package/api/lib/stats.js +362 -0
  12. package/{lib → api/lib}/systemd.js +75 -14
  13. package/api/migrations/0001_monitor.sql +43 -0
  14. package/api/migrations/0002_backup_connections.sql +26 -0
  15. package/api/migrations/0003_settings_audit.sql +18 -0
  16. package/api/migrations/0004_monitor_stats.sql +73 -0
  17. package/api/migrations/README.md +9 -0
  18. package/api/migrations-auth/0006_monitor.sql +56 -0
  19. package/api/migrations-auth/0007_monitor_home.sql +42 -0
  20. package/api/migrations-auth/0008_backups.sql +44 -0
  21. package/api/migrations-auth/0009_app_settings.sql +44 -0
  22. package/api/migrations-auth/0010_monitor_history.sql +22 -0
  23. package/api/models/index.js +18 -0
  24. package/api/package-lock.json +2839 -0
  25. package/api/package.json +39 -0
  26. package/api/production.env.example +61 -0
  27. package/api/routes/appSettings.js +73 -0
  28. package/api/routes/index.js +47 -0
  29. package/api/routes/monitor.js +196 -0
  30. package/api/setup.schema.js +166 -0
  31. package/deploy/control.sh +27 -0
  32. package/deploy/deploy.js +183 -0
  33. package/deploy/install.sh +177 -77
  34. package/deploy/settings.cjs +93 -0
  35. package/package.json +28 -47
  36. package/ui/.env +8 -0
  37. package/ui/README.md +29 -0
  38. package/ui/index.html +13 -0
  39. package/ui/package-lock.json +2094 -0
  40. package/ui/package.json +31 -0
  41. package/ui/pages.json +33 -0
  42. package/ui/public/logo-wide.svg +17 -0
  43. package/ui/public/logo.svg +10 -0
  44. package/ui/src/App.jsx +130 -0
  45. package/ui/src/api/monitor.js +6 -0
  46. package/ui/src/index.css +414 -0
  47. package/ui/src/main.jsx +27 -0
  48. package/ui/src/pages/Connections.jsx +9 -0
  49. package/ui/src/pages/Home.jsx +8 -0
  50. package/ui/src/pages/Monitor.jsx +9 -0
  51. package/ui/vite.config.js +56 -0
  52. package/bin/deploy.js +0 -181
  53. package/bin/server.js +0 -19
  54. package/bin/users.js +0 -86
  55. package/deploy/monitor.env.example +0 -16
  56. package/deploy/nginx.conf.example +0 -18
  57. package/deploy/sudoers.example +0 -13
  58. package/deploy/xeplr-monitor.service +0 -26
  59. package/index.js +0 -89
  60. package/lib/router.js +0 -179
  61. package/lib/services.js +0 -76
  62. package/lib/session.js +0 -78
  63. package/lib/store.js +0 -73
  64. package/lib/users.js +0 -119
  65. package/public/assets/index-BsBYpvNI.js +0 -18
  66. package/public/assets/index-DNZBwVTn.css +0 -1
  67. package/public/index.html +0 -15
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "xeplr-monitor-ui",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "preview": "vite preview",
10
+ "pages": "xeplr-factory pages .",
11
+ "prepare": "git -C .. config core.hooksPath .githooks 2>/dev/null || true"
12
+ },
13
+ "dependencies": {
14
+ "@tanstack/react-table": "^8.21.3",
15
+ "@xeplr/ui-account": "^1.5.2",
16
+ "@xeplr/ui-charts": "^1.2.1",
17
+ "@xeplr/ui-jobs": "^1.6.12",
18
+ "@xeplr/ui-monitor": "^0.5.0",
19
+ "@xeplr/ui-setup": "^0.1.0",
20
+ "@xeplr/ui-table": "^1.1.3",
21
+ "@xeplr/ui-utils": "^1.1.14",
22
+ "react": "^19.2.4",
23
+ "react-dom": "^19.2.4",
24
+ "react-router-dom": "^7.13.2"
25
+ },
26
+ "devDependencies": {
27
+ "@vitejs/plugin-react": "^5.2.0",
28
+ "@xeplr/ui-factory": "^1.8.9",
29
+ "vite": "^7.3.1"
30
+ }
31
+ }
package/ui/pages.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "routes": [
3
+ "src/App.jsx"
4
+ ],
5
+ "documents": [],
6
+ "webOnly": [
7
+ {
8
+ "path": "/home",
9
+ "menu": "Home",
10
+ "reason": "A page written by hand: the server's memory, CPU and disks are not a form (@xeplr/ui-monitor ServerPage)."
11
+ },
12
+ {
13
+ "path": "/monitor",
14
+ "menu": "Monitor",
15
+ "reason": "A page written by hand: services, their processes and live logs are not a form (@xeplr/ui-monitor)."
16
+ },
17
+ {
18
+ "path": "/jobs",
19
+ "menu": "Jobs",
20
+ "reason": "@xeplr/ui-jobs' own pages: the backup jobs' schedules and runs."
21
+ },
22
+ {
23
+ "path": "/connections",
24
+ "menu": "Backup connections",
25
+ "reason": "A page written by hand (@xeplr/ui-monitor ConnectionsPage): logins whose secrets go in and never come back out are not a generic form."
26
+ },
27
+ {
28
+ "path": "/settings/app",
29
+ "menu": "App settings",
30
+ "reason": "@xeplr/ui-setup's page: the install's own settings (database login, mail, folders) \u2014 a Super Admin tool, used on a computer."
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,17 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 48" width="200" height="48" role="img" aria-label="Xeplr Monitor">
2
+ <style>
3
+ .xm-word { fill: #1b1f27; }
4
+ .xm-sub { fill: #5d6675; }
5
+ @media (prefers-color-scheme: dark) { .xm-word { fill: #e6e8ec; } .xm-sub { fill: #9aa2b1; } }
6
+ </style>
7
+ <defs>
8
+ <linearGradient id="xm-gw" x1="0" y1="0" x2="1" y2="1">
9
+ <stop offset="0" stop-color="#14b8a6"/>
10
+ <stop offset="1" stop-color="#2563eb"/>
11
+ </linearGradient>
12
+ </defs>
13
+ <rect x="2" y="8" width="32" height="32" rx="8" fill="url(#xm-gw)"/>
14
+ <path d="M7.5 25.5h4.5l2.5-6 4 10.5 3-7.5 2 3h5" fill="none" stroke="#fff" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>
15
+ <text x="44" y="23" class="xm-word" font-family="system-ui, -apple-system, Segoe UI, Roboto, sans-serif" font-size="17" font-weight="650">Xeplr</text>
16
+ <text x="44" y="39" class="xm-sub" font-family="system-ui, -apple-system, Segoe UI, Roboto, sans-serif" font-size="12" font-weight="500" letter-spacing=".08em">MONITOR</text>
17
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="Xeplr Monitor">
2
+ <defs>
3
+ <linearGradient id="xm-g" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0" stop-color="#14b8a6"/>
5
+ <stop offset="1" stop-color="#2563eb"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <rect width="64" height="64" rx="14" fill="url(#xm-g)"/>
9
+ <path d="M11 35h9l5-12 8 21 6-15 4 6h10" fill="none" stroke="#fff" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round"/>
10
+ </svg>
package/ui/src/App.jsx ADDED
@@ -0,0 +1,130 @@
1
+ import { useMemo } from 'react'
2
+ import { Routes, Route, Outlet, Navigate, useNavigate } from 'react-router-dom'
3
+ import { authRoutes, authPath, authFetch, NavPage, ProtectedRoute } from '@xeplr/ui-account'
4
+ import { AppSettingsPage } from '@xeplr/ui-setup'
5
+ import Home from './pages/Home.jsx'
6
+ import Monitor from './pages/Monitor.jsx'
7
+ import Connections from './pages/Connections.jsx'
8
+ import { registerJobsUI } from '@xeplr/ui-jobs'
9
+
10
+ // The backup jobs' pages (@xeplr/ui-jobs, at /jobs), on this API (/api/jobs…).
11
+ // A job's dropdowns list the saved connections (routes/connections.js), by
12
+ // the kinds lib/backups.js's action names in `optionsFrom`.
13
+ const jobsUI = registerJobsUI({
14
+ apiBase: '/api',
15
+ optionSources: {
16
+ backupServers: { url: '/monitor/connections/servers', label: 'name' },
17
+ backupDatabases: { url: '/monitor/connections/databases', label: 'name' },
18
+ backupBuckets: { url: '/monitor/connections/buckets', label: 'name' }
19
+ }
20
+ })
21
+
22
+ // The rail is ICON-ONLY when collapsed, so a drawer item without one is
23
+ // invisible until somebody widens the rail. Same 24x24 stroke language the
24
+ // account library's own icons use.
25
+ const HomeIcon = (
26
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor"
27
+ strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
28
+ <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
29
+ <path d="M9 22V12h6v10" />
30
+ </svg>
31
+ )
32
+
33
+ const JobsIcon = (
34
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor"
35
+ strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
36
+ <circle cx="12" cy="12" r="9" />
37
+ <path d="M12 7v5l3 2" />
38
+ </svg>
39
+ )
40
+
41
+ const ConnectionsIcon = (
42
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor"
43
+ strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
44
+ <ellipse cx="12" cy="5" rx="8" ry="3" />
45
+ <path d="M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5" />
46
+ <path d="M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6" />
47
+ </svg>
48
+ )
49
+
50
+ const MonitorIcon = (
51
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor"
52
+ strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
53
+ <path d="M22 12h-4l-3 9L9 3l-3 9H2" />
54
+ </svg>
55
+ )
56
+
57
+ // Module-level (stable reference) so NavPage's memoization actually holds.
58
+ const notifications = { count: 0, onClick: () => {} }
59
+
60
+ // Rendered above the framework's built-in Profile / Change Password section.
61
+ // `key` is the menu row it matches (shown only to roles given that row); what
62
+ // people read is its label.
63
+ const settingsOverrides = [
64
+ { key: 'Admin', path: authPath('userRoles') },
65
+ // Super Admin only (migrations-auth/0009): the install's own settings —
66
+ // production.env — changed in place; the app restarts into them (@xeplr/ui-setup).
67
+ { key: 'App settings', path: '/settings/app' }
68
+ ]
69
+
70
+ // Layout route: NavPage and the routed page are independent siblings, and this
71
+ // holds no state of its own — lifting page state up here would re-render the
72
+ // nav on every unrelated change.
73
+ function Shell() {
74
+ const navigate = useNavigate()
75
+
76
+ // The drawer's catalog, by KEY. A key must match a `menus` row's name
77
+ // (migrations-auth/0006, 0007, 0008; Jobs is @xeplr/jobs' own row) — @xeplr/ui-account drops unknown keys
78
+ // SILENTLY, so a typo removes the item with no error anywhere. The text
79
+ // shown is the row's label, never written here. `path` is how the rail
80
+ // marks the page you are on.
81
+ const drawerItems = useMemo(() => [
82
+ { key: 'Home', icon: HomeIcon, path: '/home', clickHandler: () => navigate('/home') },
83
+ { key: 'Monitor', icon: MonitorIcon, path: '/monitor', clickHandler: () => navigate('/monitor') },
84
+ { key: 'Jobs', icon: JobsIcon, path: '/jobs', clickHandler: () => navigate('/jobs') },
85
+ { key: 'Backup connections', icon: ConnectionsIcon, path: '/connections', clickHandler: () => navigate('/connections') }
86
+ ], [navigate])
87
+
88
+ return (
89
+ <div className="app">
90
+ {/* The monitor's mark (a pulse) and wordmark — public/logo.svg, also the
91
+ tab's icon, and public/logo-wide.svg, which picks its text colour by
92
+ the system's light or dark (an image cannot follow currentColor). */}
93
+ <NavPage
94
+ logo="/logo.svg"
95
+ expandedLogo="/logo-wide.svg"
96
+ notifications={notifications}
97
+ settingsOverrides={settingsOverrides}
98
+ drawerItems={drawerItems}
99
+ />
100
+ <main className="main"><Outlet /></main>
101
+ </div>
102
+ )
103
+ }
104
+
105
+ export default function App() {
106
+ return (
107
+ <Routes>
108
+ {/* @xeplr/ui-account supplies every auth screen — login, register,
109
+ forgot/reset password, activate, profile, change password, and the
110
+ RBAC admin pages. We hand it our Shell so signed-in pages render in
111
+ our own chrome. */}
112
+ {authRoutes({}, { layout: <Shell /> })}
113
+
114
+ <Route element={<ProtectedRoute><Shell /></ProtectedRoute>}>
115
+ <Route path="/" element={<Navigate to="/home" replace />} />
116
+ {/* The server itself — migrations-auth/0007_monitor_home.sql grants who sees it. */}
117
+ <Route path="/home" element={<Home />} />
118
+ {/* The server's services — migrations-auth/0006_monitor.sql grants who sees it. */}
119
+ <Route path="/monitor" element={<Monitor />} />
120
+ {/* The backup jobs: schedule, runs, Run now — @xeplr/jobs' migrations-auth grants who sees them. */}
121
+ {jobsUI.routes}
122
+ {/* The logins the backups use — migrations-auth/0008_backups.sql: admins only. */}
123
+ <Route path="/connections" element={<Connections />} />
124
+ <Route path="/settings/app" element={<AppSettingsPage base="/api/app-settings" fetch={authFetch} statusUrl="/setup/status" />} />
125
+ </Route>
126
+
127
+ <Route path="*" element={<Navigate to="/auth/login" replace />} />
128
+ </Routes>
129
+ )
130
+ }
@@ -0,0 +1,6 @@
1
+ // The monitor is at /api/monitor — this app's own API (api/routes/monitor.js).
2
+ // authFetch and authEventStream carry the same sign-in as every other call.
3
+ import { authFetch, authEventStream } from '@xeplr/ui-account'
4
+ import { createMonitorApi } from '@xeplr/ui-monitor'
5
+
6
+ export const monitor = createMonitorApi({ fetch: authFetch, stream: authEventStream, base: '/api/monitor' })
@@ -0,0 +1,414 @@
1
+ :root {
2
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
3
+
4
+ /* The collapsed nav rail's width. It is `position: fixed`, so it sits on top
5
+ of the page rather than pushing it along — the app has to leave the room
6
+ itself. Without this the rail covers the first 60px of every screen, which
7
+ reads as text mysteriously cut off down the left edge rather than as a
8
+ layout problem. 48px: compact, like VS Code's activity bar — it must
9
+ match @xeplr/ui-account's collapsed rail. */
10
+ --app-rail-width: 48px;
11
+ }
12
+
13
+ /* ON A PHONE (below 640px) the rail becomes a bar across the top — see
14
+ @xeplr/ui-account's nav.css — so the page gives up its top instead of its
15
+ left: --xeplr-nav-bar-height, set by that stylesheet. The rest of this
16
+ file's phone rules are at the bottom. */
17
+
18
+ body { margin: 0; }
19
+
20
+ .app {
21
+ display: flex;
22
+ flex-direction: column;
23
+ min-height: 100vh;
24
+ padding-left: var(--app-rail-width); /* room for the fixed rail */
25
+ box-sizing: border-box;
26
+
27
+ /* THE PAGE HAS TO JOIN IN, and this belongs HERE rather than on `body`.
28
+ The theme wrapper puts its class on an element INSIDE body, so the
29
+ variables do not exist at body level — setting them there silently
30
+ resolves to nothing and you get a white page framed by dark chrome.
31
+ Everything works; it just looks like two products bolted together. */
32
+ background: var(--xeplr-bg-primary);
33
+ color: var(--xeplr-text-primary);
34
+ }
35
+
36
+ .main {
37
+ flex: 1;
38
+ padding: 24px 28px;
39
+ min-width: 0; /* lets wide tables scroll instead of stretching the page */
40
+ }
41
+
42
+ /* A readable block for anything the app prints raw. */
43
+ .main pre {
44
+ background: var(--xeplr-bg-secondary);
45
+ border: 1px solid var(--xeplr-border-primary);
46
+ border-radius: 8px;
47
+ padding: 14px 16px;
48
+ overflow-x: auto;
49
+ }
50
+
51
+ /* ── the starter welcome screen (src/pages/Home.jsx) ─────────────────────── */
52
+
53
+ .app-welcome { max-width: 680px; }
54
+
55
+ .app-welcome-logo { width: 52px; height: 52px; display: block; margin-bottom: 20px; }
56
+
57
+ .app-welcome h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.02em; }
58
+
59
+ .app-welcome-lead {
60
+ margin: 0 0 28px;
61
+ font-size: 16px;
62
+ color: var(--xeplr-text-muted);
63
+ }
64
+
65
+ .app-welcome h2 {
66
+ font-size: 15px;
67
+ text-transform: uppercase;
68
+ letter-spacing: 0.08em;
69
+ color: var(--xeplr-text-muted);
70
+ margin: 32px 0 12px;
71
+ }
72
+
73
+ .app-checks { list-style: none; padding: 0; margin: 0; }
74
+
75
+ .app-check {
76
+ display: flex;
77
+ align-items: center;
78
+ gap: 12px;
79
+ padding: 11px 14px;
80
+ margin-bottom: 8px;
81
+ border: 1px solid var(--xeplr-border-primary);
82
+ border-radius: 8px;
83
+ background: var(--xeplr-bg-secondary);
84
+ font-size: 14px;
85
+ }
86
+
87
+ .app-check-dot {
88
+ width: 8px; height: 8px; border-radius: 50%;
89
+ flex-shrink: 0;
90
+ background: var(--xeplr-text-muted);
91
+ }
92
+ .app-check-dot.is-ok { background: #22c55e; }
93
+ .app-check-dot.is-bad { background: #ef4444; }
94
+ /* Pending pulses, so "still checking" never reads as "finished and fine". */
95
+ .app-check-dot.is-pending { background: #eab308; animation: app-pulse 1s ease-in-out infinite; }
96
+
97
+ @keyframes app-pulse { 50% { opacity: 0.25; } }
98
+
99
+ .app-next { margin: 0; padding-left: 20px; font-size: 14px; line-height: 2; }
100
+
101
+ .app-next code {
102
+ background: var(--xeplr-bg-secondary);
103
+ border: 1px solid var(--xeplr-border-primary);
104
+ border-radius: 5px;
105
+ padding: 2px 6px;
106
+ font-size: 13px;
107
+ }
108
+
109
+ .app-welcome-foot {
110
+ margin-top: 32px;
111
+ padding-top: 20px;
112
+ border-top: 1px solid var(--xeplr-border-primary);
113
+ font-size: 13px;
114
+ color: var(--xeplr-text-muted);
115
+ }
116
+
117
+ /* ── pages with a form and a list (src/pages/Tasks.jsx) ──────────────────── */
118
+
119
+ .app-page { max-width: 860px; }
120
+ .app-page h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
121
+ .app-page-lead { margin: 0 0 24px; color: var(--xeplr-text-muted); font-size: 14px; }
122
+
123
+ .app-error {
124
+ padding: 10px 14px;
125
+ margin-bottom: 16px;
126
+ border: 1px solid #ef4444;
127
+ border-radius: 8px;
128
+ background: rgba(239, 68, 68, 0.12);
129
+ font-size: 14px;
130
+ }
131
+
132
+ .app-form {
133
+ border: 1px solid var(--xeplr-border-primary);
134
+ background: var(--xeplr-bg-secondary);
135
+ border-radius: 10px;
136
+ padding: 18px;
137
+ margin-bottom: 28px;
138
+ }
139
+
140
+ .app-field { display: block; margin-bottom: 14px; }
141
+ .app-field > span {
142
+ display: block;
143
+ margin-bottom: 6px;
144
+ font-size: 13px;
145
+ font-weight: 600;
146
+ }
147
+
148
+ .app-field input,
149
+ .app-field textarea,
150
+ .app-field select {
151
+ width: 100%;
152
+ box-sizing: border-box;
153
+ padding: 9px 11px;
154
+ border-radius: 6px;
155
+ border: 1px solid var(--xeplr-border-primary);
156
+ background: var(--xeplr-bg-primary);
157
+ color: var(--xeplr-text-primary);
158
+ font: inherit;
159
+ font-size: 14px;
160
+ }
161
+ .app-field input:focus,
162
+ .app-field textarea:focus,
163
+ .app-field select:focus { outline: 2px solid #6366f1; outline-offset: -1px; }
164
+
165
+ .app-field-row { display: flex; gap: 14px; }
166
+ .app-field-row .app-field { flex: 1; }
167
+
168
+ .app-form-actions { display: flex; gap: 10px; margin-top: 4px; }
169
+
170
+ .app-btn {
171
+ padding: 9px 16px;
172
+ border-radius: 6px;
173
+ border: 1px solid transparent;
174
+ background: #6366f1;
175
+ color: #fff;
176
+ font: inherit;
177
+ font-size: 14px;
178
+ cursor: pointer;
179
+ }
180
+ .app-btn:disabled { opacity: 0.55; cursor: default; }
181
+ .app-btn-quiet {
182
+ background: transparent;
183
+ border-color: var(--xeplr-border-primary);
184
+ color: var(--xeplr-text-primary);
185
+ }
186
+
187
+ .app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
188
+ .app-table th {
189
+ text-align: left;
190
+ padding: 8px 12px;
191
+ font-size: 11px;
192
+ letter-spacing: 0.08em;
193
+ text-transform: uppercase;
194
+ color: var(--xeplr-text-muted);
195
+ border-bottom: 1px solid var(--xeplr-border-primary);
196
+ }
197
+ .app-table td { padding: 12px; border-bottom: 1px solid var(--xeplr-border-primary); vertical-align: top; }
198
+ .app-table tr.is-editing { background: var(--xeplr-bg-secondary); }
199
+ .app-sub { color: var(--xeplr-text-muted); font-size: 13px; margin-top: 3px; }
200
+ .app-empty { color: var(--xeplr-text-muted); text-align: center; padding: 28px; }
201
+ .app-row-actions { text-align: right; white-space: nowrap; }
202
+ .app-row-actions .app-btn { padding: 5px 10px; font-size: 13px; margin-left: 6px; }
203
+
204
+ .app-tag {
205
+ display: inline-block;
206
+ padding: 3px 9px;
207
+ border-radius: 999px;
208
+ font-size: 12px;
209
+ border: 1px solid var(--xeplr-border-primary);
210
+ text-transform: capitalize;
211
+ }
212
+ .app-tag.is-done { border-color: #22c55e; color: #22c55e; }
213
+ .app-tag.is-in_progress { border-color: #eab308; color: #eab308; }
214
+
215
+ /* ── the sample page's instruction panel ─────────────────────────────────── */
216
+
217
+ /* Wider than a normal page, because it carries a column of explanation the
218
+ real pages you write will not have. */
219
+ .app-page-split { display: flex; gap: 32px; align-items: flex-start; max-width: 1180px; }
220
+ .app-page-main { flex: 1; min-width: 0; }
221
+
222
+ .app-help {
223
+ flex: 0 0 330px;
224
+ border: 1px solid var(--xeplr-border-primary);
225
+ border-radius: 10px;
226
+ padding: 20px;
227
+ background: var(--xeplr-bg-secondary);
228
+ font-size: 13px;
229
+ line-height: 1.55;
230
+ position: sticky;
231
+ top: 24px;
232
+ }
233
+
234
+ .app-help-badge {
235
+ display: inline-block;
236
+ padding: 2px 9px;
237
+ border-radius: 999px;
238
+ background: #6366f1;
239
+ color: #fff;
240
+ font-size: 11px;
241
+ font-weight: 700;
242
+ letter-spacing: 0.06em;
243
+ text-transform: uppercase;
244
+ margin-bottom: 12px;
245
+ }
246
+
247
+ .app-help h2 { font-size: 16px; margin: 0 0 8px; }
248
+ .app-help h3 {
249
+ font-size: 11px;
250
+ text-transform: uppercase;
251
+ letter-spacing: 0.08em;
252
+ color: var(--xeplr-text-muted);
253
+ margin: 22px 0 10px;
254
+ }
255
+ .app-help p { margin: 0; color: var(--xeplr-text-muted); }
256
+
257
+ .app-help code {
258
+ display: inline-block;
259
+ background: var(--xeplr-bg-primary);
260
+ border: 1px solid var(--xeplr-border-primary);
261
+ border-radius: 4px;
262
+ padding: 1px 5px;
263
+ font-size: 12px;
264
+ word-break: break-all;
265
+ }
266
+
267
+ .app-help-steps { margin: 0; padding-left: 18px; }
268
+ .app-help-steps li { margin-bottom: 14px; }
269
+ .app-help-steps strong { display: block; margin-bottom: 3px; }
270
+ .app-help-steps > li > code { margin-bottom: 4px; }
271
+ .app-help-steps span { display: block; color: var(--xeplr-text-muted); }
272
+
273
+ .app-help-notes { margin: 0; padding-left: 18px; color: var(--xeplr-text-muted); }
274
+ .app-help-notes li { margin-bottom: 10px; }
275
+
276
+ /* One column when there is not room for two — the explanation drops below the
277
+ form rather than squeezing it. */
278
+ @media (max-width: 1080px) {
279
+ .app-page-split { display: block; }
280
+ .app-help { position: static; margin-top: 28px; width: auto; }
281
+ }
282
+
283
+ /* ── Forms ────────────────────────────────────────────────────────────── */
284
+ /* ── Configure UI ─────────────────────────────────────────────────────── */
285
+ .app-tabs { display: flex; gap: 4px; margin: 4px 0 18px; border-bottom: 1px solid var(--xeplr-border-primary); }
286
+
287
+ .app-tab {
288
+ padding: 8px 14px;
289
+ border: none;
290
+ border-bottom: 2px solid transparent;
291
+ background: none;
292
+ color: var(--xeplr-text-muted);
293
+ font: inherit;
294
+ cursor: pointer;
295
+ }
296
+
297
+ .app-tab.is-active { color: var(--xeplr-text-primary); border-bottom-color: var(--xeplr-accent); }
298
+
299
+ .app-forms-new { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; max-width: 820px; margin: 0 0 18px; }
300
+
301
+ .app-forms-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 220px; font-size: 12px; color: var(--xeplr-text-muted); }
302
+
303
+ .app-menu-label,
304
+ .app-forms-new input {
305
+ flex: 1;
306
+ padding: 9px 11px;
307
+ border-radius: 6px;
308
+ border: 1px solid var(--xeplr-input-border);
309
+ background: var(--xeplr-input-bg);
310
+ color: var(--xeplr-input-text);
311
+ font: inherit;
312
+ }
313
+
314
+ .app-forms-pending { color: var(--xeplr-warning); }
315
+
316
+ .app-notice {
317
+ margin: 0 0 14px;
318
+ padding: 10px 14px;
319
+ border-radius: 6px;
320
+ border: 1px solid var(--xeplr-success-border);
321
+ background: var(--xeplr-success-bg);
322
+ color: var(--xeplr-success);
323
+ }
324
+
325
+ /* ── Designer ─────────────────────────────────────────────────────────── */
326
+ /* The builder fills the space it is given, so it needs a height: the page
327
+ below the top bar, less .main's padding. */
328
+ .app-designer {
329
+ display: flex;
330
+ flex-direction: column;
331
+ height: calc(100vh - 110px);
332
+ min-height: 520px;
333
+ gap: 10px;
334
+ }
335
+
336
+ .app-designer-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
337
+
338
+ .app-designer-title { font-weight: 600; margin-right: 10px; }
339
+
340
+ .app-designer-bar .is-active { background: var(--xeplr-bg-secondary); }
341
+
342
+ .app-designer-canvas {
343
+ flex: 1;
344
+ min-height: 0;
345
+ border: 1px solid var(--xeplr-border-primary);
346
+ border-radius: 8px;
347
+ overflow: hidden;
348
+ }
349
+
350
+ .app-help-prompt {
351
+ white-space: pre-wrap;
352
+ font-size: 12px;
353
+ line-height: 1.5;
354
+ padding: 10px 12px;
355
+ margin: 8px 0;
356
+ border-radius: 6px;
357
+ background: var(--xeplr-bg-tertiary);
358
+ border: 1px solid var(--xeplr-border-primary);
359
+ }
360
+
361
+ .app-menu-hidden td { opacity: 0.5; }
362
+ /* A menu item whose page is hand-written for the browser (ui/pages.json): it
363
+ will not be in a phone app. The reason is its tooltip. */
364
+ .app-web-only {
365
+ display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
366
+ font-size: 11px; font-weight: 600; cursor: help;
367
+ color: var(--xeplr-warning, #a86a00); background: color-mix(in srgb, var(--xeplr-warning, #a86a00) 14%, transparent);
368
+ }
369
+
370
+ .app-menu-shown { display: inline-flex; gap: 6px; align-items: center; }
371
+
372
+ .app-menu-settings .app-table { margin-bottom: 14px; }
373
+
374
+ /* ── Flows, before Workflow is connected (src/pages/Flows.jsx) ─────────────── */
375
+ .app-connect {
376
+ max-width: 720px;
377
+ padding: 22px 24px;
378
+ border: 1px solid var(--xeplr-border-primary);
379
+ border-radius: 10px;
380
+ background: var(--xeplr-bg-tertiary);
381
+ line-height: 1.55;
382
+ }
383
+ .app-connect h2 { margin: 0 0 8px; font-size: 18px; }
384
+ .app-connect p { margin: 0 0 14px; }
385
+ .app-connect-steps { margin: 0 0 14px; padding-left: 20px; }
386
+ .app-connect-steps li { margin-bottom: 14px; }
387
+ .app-connect code { font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: var(--xeplr-bg-secondary); border: 1px solid var(--xeplr-border-primary); }
388
+ .app-connect pre { margin: 6px 0 0; font-size: 12.5px; }
389
+
390
+ /* ── on a phone ──────────────────────────────────────────────────────────
391
+ Forms and lists made in the designer stack themselves (@xeplr/ui-factory),
392
+ and @xeplr/ui-table keeps its own rows reachable. What is left is this
393
+ app's own chrome: room for the top bar instead of the rail, tighter page
394
+ padding, fields one per row, tables that scroll inside their own box
395
+ rather than widening the page, and buttons a thumb can hit. */
396
+ @media (max-width: 640px) {
397
+ .app { padding-left: 0; padding-top: var(--xeplr-nav-bar-height, 52px); }
398
+ .main { padding: 16px 12px; }
399
+ .app-page h1 { font-size: 22px; }
400
+ .app-welcome h1 { font-size: 24px; }
401
+
402
+ .app-field-row { flex-direction: column; gap: 0; }
403
+ .app-field input, .app-field textarea, .app-field select { font-size: 16px; min-height: 44px; }
404
+ .app-forms-field { min-width: 0; flex-basis: 100%; }
405
+ .app-menu-label, .app-forms-new input { font-size: 16px; min-height: 44px; box-sizing: border-box; }
406
+ .app-btn { min-height: 44px; }
407
+ .app-row-actions .app-btn { min-height: 40px; padding: 8px 12px; }
408
+
409
+ .app-table { display: block; overflow-x: auto; }
410
+ .app-tabs { overflow-x: auto; }
411
+ .app-tab { white-space: nowrap; min-height: 44px; }
412
+ .app-help { padding: 16px; }
413
+ .app-connect { padding: 16px; }
414
+ }
@@ -0,0 +1,27 @@
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import { BrowserRouter } from 'react-router-dom'
4
+ import { configure, AccessProvider, ThemeProvider } from '@xeplr/ui-account'
5
+ import App from './App.jsx'
6
+ import './index.css'
7
+ import '@xeplr/ui-account/src/designs/theme.css'
8
+
9
+ // Auth requests are same-origin in dev — vite proxies /auth/api to AUTH_URL
10
+ // (see vite.config.js, which reads it from .env).
11
+ configure('')
12
+
13
+ ReactDOM.createRoot(document.getElementById('root')).render(
14
+ <React.StrictMode>
15
+ <BrowserRouter>
16
+ {/* REQUIRED, not decoration. theme.css defines its colours only inside
17
+ .xeplr-theme-* classes — there is no :root default — so without a
18
+ theme wrapper every var(--xeplr-*) is undefined and the whole UI
19
+ renders unstyled. */}
20
+ <ThemeProvider>
21
+ <AccessProvider>
22
+ <App />
23
+ </AccessProvider>
24
+ </ThemeProvider>
25
+ </BrowserRouter>
26
+ </React.StrictMode>
27
+ )
@@ -0,0 +1,9 @@
1
+ // The logins the backup jobs use — database servers and the S3 bucket —
2
+ // @xeplr/ui-monitor's ConnectionsPage, on this app's API and sign-in.
3
+ // Passwords and keys go in and never come back.
4
+ import { ConnectionsPage } from '@xeplr/ui-monitor'
5
+ import { monitor } from '../api/monitor.js'
6
+
7
+ export default function Connections() {
8
+ return <ConnectionsPage api={monitor} />
9
+ }