@nodestackapp/server 2.0.0 → 2.1.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 +4 -3
- package/dist/NodeStack.d.ts +9 -0
- package/dist/NodeStack.d.ts.map +1 -1
- package/dist/NodeStack.js +24 -3
- package/dist/NodeStack.js.map +1 -1
- package/dist/admin/AdminUIBundler.d.ts.map +1 -1
- package/dist/admin/AdminUIBundler.js +9 -5
- package/dist/admin/AdminUIBundler.js.map +1 -1
- package/dist/admin/ui/css/codemirror.css +98 -0
- package/dist/admin/ui/css/main.css +2309 -2189
- package/dist/admin/ui/index.html +8331 -5295
- package/dist/admin/ui/js/api.js +44 -14
- package/dist/admin/ui/js/app.js +480 -254
- package/dist/admin/ui/js/apps.js +29 -14
- package/dist/admin/ui/js/codemirror.js +15 -0
- package/dist/admin/ui/js/collections.js +38 -9
- package/dist/admin/ui/js/command-palette.js +12 -1
- package/dist/admin/ui/js/functions-tester.js +432 -0
- package/dist/admin/ui/js/functions-workbench.js +1038 -0
- package/dist/admin/ui/js/functions.js +765 -0
- package/dist/admin/ui/js/modals.js +6 -2
- package/dist/admin/ui/js/plugin-tester.js +562 -559
- package/dist/admin/ui/js/plugins.js +198 -77
- package/dist/admin/ui/js/records.js +89 -54
- package/dist/admin/ui/js/schema.js +23 -9
- package/dist/admin/ui/js/views.js +82 -34
- package/dist/admin/ui/js/webhooks.js +1111 -1104
- package/dist/apps/AppScope.d.ts +4 -0
- package/dist/apps/AppScope.d.ts.map +1 -1
- package/dist/apps/AppScope.js +33 -1
- package/dist/apps/AppScope.js.map +1 -1
- package/dist/auth/ApiKeyService.d.ts +91 -0
- package/dist/auth/ApiKeyService.d.ts.map +1 -0
- package/dist/auth/ApiKeyService.js +414 -0
- package/dist/auth/ApiKeyService.js.map +1 -0
- package/dist/auth/AuthService.d.ts +33 -1
- package/dist/auth/AuthService.d.ts.map +1 -1
- package/dist/auth/AuthService.js +219 -1
- package/dist/auth/AuthService.js.map +1 -1
- package/dist/auth/oauth/AppleProvider.d.ts +23 -0
- package/dist/auth/oauth/AppleProvider.d.ts.map +1 -0
- package/dist/auth/oauth/AppleProvider.js +161 -0
- package/dist/auth/oauth/AppleProvider.js.map +1 -0
- package/dist/auth/oauth/BaseOAuthProvider.d.ts +18 -0
- package/dist/auth/oauth/BaseOAuthProvider.d.ts.map +1 -0
- package/dist/auth/oauth/BaseOAuthProvider.js +79 -0
- package/dist/auth/oauth/BaseOAuthProvider.js.map +1 -0
- package/dist/auth/oauth/DiscordProvider.d.ts +11 -0
- package/dist/auth/oauth/DiscordProvider.d.ts.map +1 -0
- package/dist/auth/oauth/DiscordProvider.js +47 -0
- package/dist/auth/oauth/DiscordProvider.js.map +1 -0
- package/dist/auth/oauth/GitHubProvider.d.ts +13 -0
- package/dist/auth/oauth/GitHubProvider.d.ts.map +1 -0
- package/dist/auth/oauth/GitHubProvider.js +90 -0
- package/dist/auth/oauth/GitHubProvider.js.map +1 -0
- package/dist/auth/oauth/GoogleProvider.d.ts +11 -0
- package/dist/auth/oauth/GoogleProvider.d.ts.map +1 -0
- package/dist/auth/oauth/GoogleProvider.js +43 -0
- package/dist/auth/oauth/GoogleProvider.js.map +1 -0
- package/dist/auth/oauth/MicrosoftProvider.d.ts +11 -0
- package/dist/auth/oauth/MicrosoftProvider.d.ts.map +1 -0
- package/dist/auth/oauth/MicrosoftProvider.js +83 -0
- package/dist/auth/oauth/MicrosoftProvider.js.map +1 -0
- package/dist/auth/oauth/OAuthProviderRegistry.d.ts +32 -0
- package/dist/auth/oauth/OAuthProviderRegistry.d.ts.map +1 -0
- package/dist/auth/oauth/OAuthProviderRegistry.js +232 -0
- package/dist/auth/oauth/OAuthProviderRegistry.js.map +1 -0
- package/dist/auth/oauth/types.d.ts +63 -0
- package/dist/auth/oauth/types.d.ts.map +1 -0
- package/dist/auth/oauth/types.js +3 -0
- package/dist/auth/oauth/types.js.map +1 -0
- package/dist/cli/cli.js +10 -10
- package/dist/cli/cli.js.map +1 -1
- package/dist/core/container/Tokens.d.ts +2 -0
- package/dist/core/container/Tokens.d.ts.map +1 -1
- package/dist/core/container/Tokens.js +2 -0
- package/dist/core/container/Tokens.js.map +1 -1
- package/dist/core/plugins/PluginManager.d.ts.map +1 -1
- package/dist/core/plugins/PluginManager.js +73 -19
- package/dist/core/plugins/PluginManager.js.map +1 -1
- package/dist/database/migrations/SystemMigrations.d.ts.map +1 -1
- package/dist/database/migrations/SystemMigrations.js +40 -0
- package/dist/database/migrations/SystemMigrations.js.map +1 -1
- package/dist/functions/FunctionService.d.ts +80 -0
- package/dist/functions/FunctionService.d.ts.map +1 -0
- package/dist/functions/FunctionService.js +610 -0
- package/dist/functions/FunctionService.js.map +1 -0
- package/dist/functions/runtime/IFunctionRuntime.d.ts +23 -0
- package/dist/functions/runtime/IFunctionRuntime.d.ts.map +1 -0
- package/dist/functions/runtime/IFunctionRuntime.js +3 -0
- package/dist/functions/runtime/IFunctionRuntime.js.map +1 -0
- package/dist/functions/runtime/QuickJsWasmRuntime.d.ts +21 -0
- package/dist/functions/runtime/QuickJsWasmRuntime.d.ts.map +1 -0
- package/dist/functions/runtime/QuickJsWasmRuntime.js +418 -0
- package/dist/functions/runtime/QuickJsWasmRuntime.js.map +1 -0
- package/dist/functions/runtime/SandboxedRunner.d.ts +31 -0
- package/dist/functions/runtime/SandboxedRunner.d.ts.map +1 -0
- package/dist/functions/runtime/SandboxedRunner.js +61 -0
- package/dist/functions/runtime/SandboxedRunner.js.map +1 -0
- package/dist/functions/security/SsrfGuard.d.ts +41 -0
- package/dist/functions/security/SsrfGuard.d.ts.map +1 -0
- package/dist/functions/security/SsrfGuard.js +470 -0
- package/dist/functions/security/SsrfGuard.js.map +1 -0
- package/dist/functions/types.d.ts +109 -0
- package/dist/functions/types.d.ts.map +1 -0
- package/dist/functions/types.js +3 -0
- package/dist/functions/types.js.map +1 -0
- package/dist/http/HttpServer.d.ts +7 -1
- package/dist/http/HttpServer.d.ts.map +1 -1
- package/dist/http/HttpServer.js +66 -1
- package/dist/http/HttpServer.js.map +1 -1
- package/dist/http/controllers/ApiKeyController.d.ts +31 -0
- package/dist/http/controllers/ApiKeyController.d.ts.map +1 -0
- package/dist/http/controllers/ApiKeyController.js +52 -0
- package/dist/http/controllers/ApiKeyController.js.map +1 -0
- package/dist/http/controllers/AuthController.d.ts +29 -1
- package/dist/http/controllers/AuthController.d.ts.map +1 -1
- package/dist/http/controllers/AuthController.js +42 -1
- package/dist/http/controllers/AuthController.js.map +1 -1
- package/dist/http/controllers/FunctionController.d.ts +64 -0
- package/dist/http/controllers/FunctionController.d.ts.map +1 -0
- package/dist/http/controllers/FunctionController.js +202 -0
- package/dist/http/controllers/FunctionController.js.map +1 -0
- package/dist/http/controllers/RecordController.d.ts.map +1 -1
- package/dist/http/controllers/RecordController.js +4 -0
- package/dist/http/controllers/RecordController.js.map +1 -1
- package/dist/http/middleware/AuthMiddleware.d.ts +6 -1
- package/dist/http/middleware/AuthMiddleware.d.ts.map +1 -1
- package/dist/http/middleware/AuthMiddleware.js +79 -8
- package/dist/http/middleware/AuthMiddleware.js.map +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/chat-notifications.d.ts +51 -0
- package/dist/plugins/chat-notifications.d.ts.map +1 -0
- package/dist/plugins/chat-notifications.js +545 -0
- package/dist/plugins/chat-notifications.js.map +1 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/webhooks.d.ts +5 -34
- package/dist/plugins/webhooks.d.ts.map +1 -1
- package/dist/plugins/webhooks.js +11 -412
- package/dist/plugins/webhooks.js.map +1 -1
- package/dist/records/MockDataService.d.ts.map +1 -1
- package/dist/records/MockDataService.js +3 -0
- package/dist/records/MockDataService.js.map +1 -1
- package/dist/records/RecordService.d.ts.map +1 -1
- package/dist/records/RecordService.js +39 -30
- package/dist/records/RecordService.js.map +1 -1
- package/dist/records/RecordValidator.d.ts +6 -0
- package/dist/records/RecordValidator.d.ts.map +1 -0
- package/dist/records/RecordValidator.js +100 -0
- package/dist/records/RecordValidator.js.map +1 -0
- package/package.json +89 -88
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
? state.pluginNavItems.length
|
|
17
17
|
: '--';
|
|
18
18
|
|
|
19
|
+
// Functions initial count
|
|
20
|
+
const functionsInitial = (typeof functionsState !== 'undefined' && functionsState.stats?.totalFunctions !== undefined)
|
|
21
|
+
? functionsState.stats.totalFunctions
|
|
22
|
+
: (typeof functionsState !== 'undefined' && Array.isArray(functionsState.functions))
|
|
23
|
+
? functionsState.functions.length
|
|
24
|
+
: '--';
|
|
25
|
+
|
|
19
26
|
main.innerHTML = `
|
|
20
27
|
<div style="width: 100%; display: flex; flex-direction: column; gap: 1.25rem;">
|
|
21
28
|
|
|
@@ -49,18 +56,18 @@
|
|
|
49
56
|
</div>
|
|
50
57
|
</div>
|
|
51
58
|
|
|
52
|
-
<!-- Zone 1 (Vitals Strip): High-Density
|
|
59
|
+
<!-- Zone 1 (Vitals Strip): High-Density 7-KPI Row + Integrated Telemetry Bar -->
|
|
53
60
|
<div style="background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; overflow: hidden;">
|
|
54
|
-
<!-- Top:
|
|
61
|
+
<!-- Top: 7 Horizontal KPI Metrics (Responsive auto-fitting row) -->
|
|
55
62
|
<div class="home-kpi-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0.75rem; padding: 0.85rem 1.15rem;">
|
|
56
63
|
<!-- KPI 1: Collections -->
|
|
57
64
|
<div style="background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.75rem 1rem; cursor: pointer; transition: border-color 0.15s ease;" onclick="selectNav('collections')" title="Click to view all collections directory">
|
|
58
65
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem;">
|
|
59
66
|
<div style="display: flex; align-items: center; gap: 6px;">
|
|
60
|
-
<
|
|
67
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg>
|
|
61
68
|
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Collections</span>
|
|
62
69
|
</div>
|
|
63
|
-
<span style="font-size: 11px; color:
|
|
70
|
+
<span style="font-size: 11px; color: var(--accent-primary); font-weight: 600;">View ➔</span>
|
|
64
71
|
</div>
|
|
65
72
|
<div style="font-size: 22px; font-weight: 800; color: var(--text-heading);" id="home-stat-collections">${collectionsCount}</div>
|
|
66
73
|
<div style="font-size: 11px; color: var(--text-muted); margin-top: 2px;">Registered tables</div>
|
|
@@ -69,30 +76,30 @@
|
|
|
69
76
|
<!-- KPI 2: Active Records -->
|
|
70
77
|
<div style="background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.75rem 1rem;">
|
|
71
78
|
<div style="display: flex; align-items: center; gap: 6px; margin-bottom: 0.35rem;">
|
|
72
|
-
<
|
|
79
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"></path><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"></path></svg>
|
|
73
80
|
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Total Records</span>
|
|
74
81
|
</div>
|
|
75
|
-
<div style="font-size: 22px; font-weight: 800; color: var(--
|
|
82
|
+
<div style="font-size: 22px; font-weight: 800; color: var(--text-heading);" id="home-stat-records">--</div>
|
|
76
83
|
<div style="font-size: 11px; color: var(--text-muted); margin-top: 2px;">Active database rows</div>
|
|
77
84
|
</div>
|
|
78
85
|
|
|
79
86
|
<!-- KPI 3: Storage Size -->
|
|
80
87
|
<div style="background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.75rem 1rem;">
|
|
81
88
|
<div style="display: flex; align-items: center; gap: 6px; margin-bottom: 0.35rem;">
|
|
82
|
-
<
|
|
89
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><line x1="22" y1="12" x2="2" y2="12"></line><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path><line x1="6" y1="16" x2="6.01" y2="16"></line><line x1="10" y1="16" x2="10.01" y2="16"></line></svg>
|
|
83
90
|
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Storage Size</span>
|
|
84
91
|
</div>
|
|
85
|
-
<div style="font-size: 22px; font-weight: 800; color: var(--
|
|
92
|
+
<div style="font-size: 22px; font-weight: 800; color: var(--text-heading);" id="home-stat-size">--</div>
|
|
86
93
|
<div style="font-size: 11px; color: var(--text-muted); margin-top: 2px;">data.db + WAL journal</div>
|
|
87
94
|
</div>
|
|
88
95
|
|
|
89
96
|
<!-- KPI 4: Realtime Streams -->
|
|
90
97
|
<div style="background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.75rem 1rem;">
|
|
91
98
|
<div style="display: flex; align-items: center; gap: 6px; margin-bottom: 0.35rem;">
|
|
92
|
-
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color
|
|
99
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><path d="M4.93 4.93a10 10 0 0 0 0 14.14M8.46 8.46a5 5 0 0 0 0 7.08M12 12h.01"/></svg>
|
|
93
100
|
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Realtime Streams</span>
|
|
94
101
|
</div>
|
|
95
|
-
<div style="font-size: 22px; font-weight: 800; color: var(--
|
|
102
|
+
<div style="font-size: 22px; font-weight: 800; color: var(--text-heading);" id="home-stat-realtime">--</div>
|
|
96
103
|
<div style="font-size: 11px; color: var(--text-muted); margin-top: 2px;">Connected SSE clients</div>
|
|
97
104
|
</div>
|
|
98
105
|
|
|
@@ -100,12 +107,12 @@
|
|
|
100
107
|
<div style="background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.75rem 1rem; cursor: pointer; transition: border-color 0.15s ease;" onclick="selectNav('webhooks')" title="Click to view webhooks and delivery logs">
|
|
101
108
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem;">
|
|
102
109
|
<div style="display: flex; align-items: center; gap: 6px;">
|
|
103
|
-
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color
|
|
110
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><path d="M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c0-2.21 1.79-4 4-4h5.99c1.1 0 1.95-.94 2.48-1.9A4 4 0 0 1 22 13c0 2.21-1.79 4-4 4z"/><circle cx="6" cy="17" r="1"/><circle cx="18" cy="13" r="1"/></svg>
|
|
104
111
|
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Webhooks</span>
|
|
105
112
|
</div>
|
|
106
|
-
<span style="font-size: 11px; color:
|
|
113
|
+
<span style="font-size: 11px; color: var(--accent-primary); font-weight: 600;">View ➔</span>
|
|
107
114
|
</div>
|
|
108
|
-
<div style="font-size: 22px; font-weight: 800; color: var(--
|
|
115
|
+
<div style="font-size: 22px; font-weight: 800; color: var(--text-heading);" id="home-stat-webhooks">${webhooksInitial}</div>
|
|
109
116
|
<div style="font-size: 11px; color: var(--text-muted); margin-top: 2px;" id="home-stat-webhooks-sub">Endpoints & deliveries</div>
|
|
110
117
|
</div>
|
|
111
118
|
|
|
@@ -113,29 +120,42 @@
|
|
|
113
120
|
<div style="background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.75rem 1rem; cursor: pointer; transition: border-color 0.15s ease;" onclick="selectNav('plugins')" title="Click to browse plugins and extensions">
|
|
114
121
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem;">
|
|
115
122
|
<div style="display: flex; align-items: center; gap: 6px;">
|
|
116
|
-
<
|
|
123
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>
|
|
117
124
|
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Plugins</span>
|
|
118
125
|
</div>
|
|
119
|
-
<span style="font-size: 11px; color:
|
|
126
|
+
<span style="font-size: 11px; color: var(--accent-primary); font-weight: 600;">View ➔</span>
|
|
120
127
|
</div>
|
|
121
|
-
<div style="font-size: 22px; font-weight: 800; color: var(--
|
|
128
|
+
<div style="font-size: 22px; font-weight: 800; color: var(--text-heading);" id="home-stat-plugins">${pluginsInitial}</div>
|
|
122
129
|
<div style="font-size: 11px; color: var(--text-muted); margin-top: 2px;" id="home-stat-plugins-sub">Active extensions</div>
|
|
123
130
|
</div>
|
|
131
|
+
|
|
132
|
+
<!-- KPI 7: Functions -->
|
|
133
|
+
<div style="background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.75rem 1rem; cursor: pointer; transition: border-color 0.15s ease;" onclick="selectNav('functions')" title="Click to view serverless functions and execution logs">
|
|
134
|
+
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem;">
|
|
135
|
+
<div style="display: flex; align-items: center; gap: 6px;">
|
|
136
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>
|
|
137
|
+
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Functions</span>
|
|
138
|
+
</div>
|
|
139
|
+
<span style="font-size: 11px; color: var(--accent-primary); font-weight: 600;">View ➔</span>
|
|
140
|
+
</div>
|
|
141
|
+
<div style="font-size: 22px; font-weight: 800; color: var(--text-heading);" id="home-stat-functions">${functionsInitial}</div>
|
|
142
|
+
<div style="font-size: 11px; color: var(--text-muted); margin-top: 2px;" id="home-stat-functions-sub">Serverless lambda logic</div>
|
|
143
|
+
</div>
|
|
124
144
|
</div>
|
|
125
145
|
|
|
126
146
|
<!-- Bottom: Integrated 24h Telemetry Strip -->
|
|
127
147
|
<div style="background: var(--bg-hover-subtle); border-top: 1px solid var(--border-subtle); padding: 0.65rem 1.15rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;">
|
|
128
148
|
<div style="display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;">
|
|
129
149
|
<div style="display: flex; align-items: center; gap: 6px;">
|
|
130
|
-
<
|
|
150
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line></svg>
|
|
131
151
|
<span style="font-size: 11px; font-weight: 700; color: var(--text-heading); text-transform: uppercase; letter-spacing: 0.04em;">24h Telemetry</span>
|
|
132
152
|
<span class="badge badge-status-200" style="font-size: 9.5px; padding: 1px 5px;">Live</span>
|
|
133
153
|
</div>
|
|
134
154
|
<div style="display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; font-size: 12px; color: var(--text-muted);">
|
|
135
155
|
<span>Requests: <strong id="home-snap-requests" style="color: var(--text-heading); font-family: var(--font-mono); font-weight: 700;">--</strong></span>
|
|
136
|
-
<span>Latency: <strong id="home-snap-latency" style="color: var(--
|
|
137
|
-
<span>Error Rate: <strong id="home-snap-errors" style="color: var(--
|
|
138
|
-
<span>Peak: <strong id="home-snap-peak" style="color: var(--
|
|
156
|
+
<span>Latency: <strong id="home-snap-latency" style="color: var(--text-heading); font-family: var(--font-mono); font-weight: 700;">--</strong></span>
|
|
157
|
+
<span>Error Rate: <strong id="home-snap-errors" style="color: var(--text-heading); font-family: var(--font-mono); font-weight: 700;">--</strong></span>
|
|
158
|
+
<span>Peak: <strong id="home-snap-peak" style="color: var(--text-heading); font-family: var(--font-mono); font-weight: 700;">--</strong></span>
|
|
139
159
|
</div>
|
|
140
160
|
</div>
|
|
141
161
|
<button class="btn btn-secondary btn-sm" onclick="selectNav('analytics')" style="padding: 2px 8px; font-size: 11px; display: inline-flex; align-items: center; gap: 4px;" title="Open in-depth analytics">
|
|
@@ -151,7 +171,7 @@
|
|
|
151
171
|
<div>
|
|
152
172
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem;">
|
|
153
173
|
<div style="display: flex; align-items: center; gap: 7px;">
|
|
154
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color
|
|
174
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/></svg>
|
|
155
175
|
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Starter Accelerators</span>
|
|
156
176
|
</div>
|
|
157
177
|
<button class="btn btn-secondary btn-sm" onclick="openTemplatesModal()" style="font-size: 11px; padding: 2px 8px;" title="Browse all template recipes">
|
|
@@ -168,17 +188,17 @@
|
|
|
168
188
|
<button class="btn btn-primary btn-sm" onclick="openNewCollectionModal()" style="font-size: 12px; padding: 7px 12px; display: flex; align-items: center; justify-content: center; gap: 6px;" title="Create new blank collection">
|
|
169
189
|
<span>+</span><span>New Collection</span>
|
|
170
190
|
</button>
|
|
171
|
-
<button class="btn btn-secondary btn-sm" onclick="openApplyTemplateConfirmModal('ecommerce')" style="
|
|
172
|
-
<
|
|
191
|
+
<button class="btn btn-secondary btn-sm" onclick="openApplyTemplateConfirmModal('ecommerce')" style="font-size: 12px; padding: 7px 12px; display: flex; align-items: center; justify-content: center; gap: 6px;" title="Preview & install E-Commerce recipe">
|
|
192
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--text-muted);"><circle cx="8" cy="21" r="1"/><circle cx="19" cy="21" r="1"/><path d="M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"/></svg><span>E-Commerce</span>
|
|
173
193
|
</button>
|
|
174
|
-
<button class="btn btn-secondary btn-sm" onclick="openApplyTemplateConfirmModal('blog')" style="
|
|
175
|
-
<
|
|
194
|
+
<button class="btn btn-secondary btn-sm" onclick="openApplyTemplateConfirmModal('blog')" style="font-size: 12px; padding: 7px 12px; display: flex; align-items: center; justify-content: center; gap: 6px;" title="Preview & install Blog recipe">
|
|
195
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--text-muted);"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg><span>Blog / CMS</span>
|
|
176
196
|
</button>
|
|
177
|
-
<button class="btn btn-secondary btn-sm" onclick="openApplyTemplateConfirmModal('crm')" style="
|
|
178
|
-
<
|
|
197
|
+
<button class="btn btn-secondary btn-sm" onclick="openApplyTemplateConfirmModal('crm')" style="font-size: 12px; padding: 7px 12px; display: flex; align-items: center; justify-content: center; gap: 6px;" title="Preview & install CRM recipe">
|
|
198
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--text-muted);"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg><span>SaaS / CRM</span>
|
|
179
199
|
</button>
|
|
180
|
-
<button class="btn btn-secondary btn-sm" onclick="openImportJsonModal()" style="
|
|
181
|
-
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg><span>Import JSON</span>
|
|
200
|
+
<button class="btn btn-secondary btn-sm" onclick="openImportJsonModal()" style="font-size: 12px; padding: 7px 12px; display: flex; align-items: center; justify-content: center; gap: 6px;" title="Paste JSON → Auto-infer schema">
|
|
201
|
+
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--text-muted);"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg><span>Import JSON</span>
|
|
182
202
|
</button>
|
|
183
203
|
</div>
|
|
184
204
|
</div>
|
|
@@ -188,7 +208,7 @@
|
|
|
188
208
|
<div>
|
|
189
209
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem;">
|
|
190
210
|
<div style="display: flex; align-items: center; gap: 7px;">
|
|
191
|
-
<
|
|
211
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--accent-primary);"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>
|
|
192
212
|
<span style="font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em;">Developer Quick Tools</span>
|
|
193
213
|
</div>
|
|
194
214
|
<span class="badge badge-get" style="font-size: 10px;">SDK & API</span>
|
|
@@ -270,7 +290,7 @@
|
|
|
270
290
|
if (errEl && metrics.traffic24h?.overallErrorRate !== undefined) {
|
|
271
291
|
const errRate = metrics.traffic24h.overallErrorRate;
|
|
272
292
|
errEl.textContent = `${errRate.toFixed(1)} %`;
|
|
273
|
-
errEl.style.color = errRate > 5 ? '#f87171' : '
|
|
293
|
+
errEl.style.color = errRate > 5 ? '#f87171' : 'var(--text-heading)';
|
|
274
294
|
}
|
|
275
295
|
|
|
276
296
|
const peakEl = document.getElementById('home-snap-peak');
|
|
@@ -308,6 +328,26 @@
|
|
|
308
328
|
plugSubEl.textContent = `${navItems.length} active / ${catalog.length || 5} available`;
|
|
309
329
|
}
|
|
310
330
|
}).catch(() => {});
|
|
331
|
+
|
|
332
|
+
// Asynchronously load function vitals
|
|
333
|
+
const fnSlug = typeof getActiveAppSlug === 'function' ? getActiveAppSlug() : 'default';
|
|
334
|
+
const fnEndpoint = fnSlug && fnSlug !== 'default' ? `/api/apps/${fnSlug}/functions/stats` : '/api/functions/stats';
|
|
335
|
+
api(fnEndpoint).then((stats) => {
|
|
336
|
+
if (!stats) return;
|
|
337
|
+
if (typeof functionsState !== 'undefined') {
|
|
338
|
+
functionsState.stats = stats;
|
|
339
|
+
}
|
|
340
|
+
const fnEl = document.getElementById('home-stat-functions');
|
|
341
|
+
const fnSubEl = document.getElementById('home-stat-functions-sub');
|
|
342
|
+
if (fnEl) {
|
|
343
|
+
fnEl.textContent = (stats.totalFunctions !== undefined ? stats.totalFunctions : (stats.activeFunctions || 0)).toString();
|
|
344
|
+
}
|
|
345
|
+
if (fnSubEl) {
|
|
346
|
+
const active = stats.activeFunctions || 0;
|
|
347
|
+
const execs = stats.totalExecutions || 0;
|
|
348
|
+
fnSubEl.textContent = `${active} active${execs > 0 ? ` • ${execs} runs` : ' • 0 runs'}`;
|
|
349
|
+
}
|
|
350
|
+
}).catch(() => {});
|
|
311
351
|
}
|
|
312
352
|
|
|
313
353
|
let auditState = {
|
|
@@ -333,10 +373,18 @@
|
|
|
333
373
|
}
|
|
334
374
|
if (typeof window !== 'undefined') {
|
|
335
375
|
window.loadLogsSubTab = loadLogsSubTab;
|
|
376
|
+
window.switchLogsSubTab = switchLogsSubTab;
|
|
336
377
|
}
|
|
337
378
|
|
|
338
|
-
function switchLogsSubTab(subTab) {
|
|
379
|
+
function switchLogsSubTab(subTab, pushState = true) {
|
|
339
380
|
auditState.subTab = subTab;
|
|
381
|
+
if (pushState && typeof updateUrl === 'function') {
|
|
382
|
+
const path = (subTab === 'audit') ? '/_/logs/audit' : '/_/logs';
|
|
383
|
+
updateUrl(path);
|
|
384
|
+
}
|
|
385
|
+
if (typeof updateBreadcrumbs === 'function') {
|
|
386
|
+
updateBreadcrumbs();
|
|
387
|
+
}
|
|
340
388
|
renderLogsView();
|
|
341
389
|
loadLogsSubTab();
|
|
342
390
|
}
|
|
@@ -365,11 +413,11 @@
|
|
|
365
413
|
<div class="audit-subtabs-bar">
|
|
366
414
|
<button class="audit-subtab-btn ${!isAudit ? 'active' : ''}" onclick="switchLogsSubTab('traffic')">
|
|
367
415
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20h9M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>
|
|
368
|
-
<span
|
|
416
|
+
<span>HTTP Traffic Logs</span>
|
|
369
417
|
</button>
|
|
370
418
|
<button class="audit-subtab-btn ${isAudit ? 'active' : ''}" onclick="switchLogsSubTab('audit')">
|
|
371
419
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
|
|
372
|
-
<span
|
|
420
|
+
<span>Data Audit Trail</span>
|
|
373
421
|
</button>
|
|
374
422
|
</div>
|
|
375
423
|
|