@bananacool467/authtics-host 0.0.2-beta.2 → 0.0.2-beta.4
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 -2
- package/dist/cli.js +0 -42
- package/dist/devPanel.js +47 -25
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# Authtics Host
|
|
2
2
|
|
|
3
|
-
Version 0.0.2-beta.
|
|
3
|
+
Version 0.0.2-beta.4
|
|
4
4
|
License: MIT
|
|
5
5
|
|
|
6
6
|
**(NOTE: This version is in BETA, bugs are expected)**
|
|
7
7
|
|
|
8
8
|
Authtics Host is a framework inspired by Next.js. Authtics Host supports SSR (Server-Side Rendering) and uses esbuild.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**(NOTE: The short name for Authtics Host is HostJS)**
|
|
11
|
+
|
|
12
|
+
## Setting Up
|
|
11
13
|
|
|
12
14
|
To get **Authtics Host** use:
|
|
13
15
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -134,8 +134,6 @@ export default class App {
|
|
|
134
134
|
let datMatched = false;
|
|
135
135
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
136
136
|
datMatched = true;
|
|
137
|
-
if (config_.dat == undefined)
|
|
138
|
-
datMatched = true;
|
|
139
137
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
140
138
|
datMatched = true;
|
|
141
139
|
if (datMatched) {
|
|
@@ -153,8 +151,6 @@ export default class App {
|
|
|
153
151
|
let datMatched = false;
|
|
154
152
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
155
153
|
datMatched = true;
|
|
156
|
-
if (config_.dat == undefined)
|
|
157
|
-
datMatched = true;
|
|
158
154
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
159
155
|
datMatched = true;
|
|
160
156
|
if (datMatched) {
|
|
@@ -169,8 +165,6 @@ export default class App {
|
|
|
169
165
|
let datMatched = false;
|
|
170
166
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
171
167
|
datMatched = true;
|
|
172
|
-
if (config_.dat == undefined)
|
|
173
|
-
datMatched = true;
|
|
174
168
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
175
169
|
datMatched = true;
|
|
176
170
|
if (datMatched) {
|
|
@@ -219,8 +213,6 @@ export default class App {
|
|
|
219
213
|
let datMatched = false;
|
|
220
214
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
221
215
|
datMatched = true;
|
|
222
|
-
if (config_.dat == undefined)
|
|
223
|
-
datMatched = true;
|
|
224
216
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
225
217
|
datMatched = true;
|
|
226
218
|
if (datMatched) {
|
|
@@ -235,8 +227,6 @@ export default class App {
|
|
|
235
227
|
let datMatched = false;
|
|
236
228
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
237
229
|
datMatched = true;
|
|
238
|
-
if (config_.dat == undefined)
|
|
239
|
-
datMatched = true;
|
|
240
230
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
241
231
|
datMatched = true;
|
|
242
232
|
if (datMatched) {
|
|
@@ -251,8 +241,6 @@ export default class App {
|
|
|
251
241
|
let datMatched = false;
|
|
252
242
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
253
243
|
datMatched = true;
|
|
254
|
-
if (config_.dat == undefined)
|
|
255
|
-
datMatched = true;
|
|
256
244
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
257
245
|
datMatched = true;
|
|
258
246
|
if (datMatched) {
|
|
@@ -272,8 +260,6 @@ export default class App {
|
|
|
272
260
|
let datMatched = false;
|
|
273
261
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
274
262
|
datMatched = true;
|
|
275
|
-
if (config_.dat == undefined)
|
|
276
|
-
datMatched = true;
|
|
277
263
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
278
264
|
datMatched = true;
|
|
279
265
|
if (datMatched) {
|
|
@@ -294,8 +280,6 @@ export default class App {
|
|
|
294
280
|
let datMatched = false;
|
|
295
281
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
296
282
|
datMatched = true;
|
|
297
|
-
if (config_.dat == undefined)
|
|
298
|
-
datMatched = true;
|
|
299
283
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
300
284
|
datMatched = true;
|
|
301
285
|
if (datMatched) {
|
|
@@ -308,8 +292,6 @@ export default class App {
|
|
|
308
292
|
let datMatched = false;
|
|
309
293
|
if (config_.dat && config_.dat == reqBody.dat)
|
|
310
294
|
datMatched = true;
|
|
311
|
-
if (config_.dat == undefined)
|
|
312
|
-
datMatched = true;
|
|
313
295
|
if (config_.dat && Array.isArray(config_.dat) && config_.dat.includes(reqBody.dat))
|
|
314
296
|
datMatched = true;
|
|
315
297
|
if (datMatched) {
|
|
@@ -318,30 +300,6 @@ export default class App {
|
|
|
318
300
|
httpVersion: req.httpVersion
|
|
319
301
|
}));
|
|
320
302
|
}
|
|
321
|
-
else {
|
|
322
|
-
const { url = "/", method } = req;
|
|
323
|
-
const showPanel = config_.devMode !== false;
|
|
324
|
-
const compiler = config_.compilerType === 'babel' ? 'babel' : 'esbuild';
|
|
325
|
-
const hotReload = config_.hotReload === true;
|
|
326
|
-
const notFoundPath = path.join(__dirname, '404.js');
|
|
327
|
-
if (fs.existsSync(notFoundPath)) {
|
|
328
|
-
try {
|
|
329
|
-
let html = await renderPage(notFoundPath, url, showPanel, compiler, hotReload, (config_.autoPage != false));
|
|
330
|
-
res.setHeader("Content-Type", "text/html");
|
|
331
|
-
res.writeHead(404);
|
|
332
|
-
html = html.replace("<script>", "<script>\nwindow.__status_code__ = 404;");
|
|
333
|
-
res.end(html);
|
|
334
|
-
}
|
|
335
|
-
catch (e) {
|
|
336
|
-
res.writeHead(404);
|
|
337
|
-
res.end(`<html><head></head><body><center><b>404</b> | Not found: ${url}</center></body></html>`);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
res.writeHead(404);
|
|
342
|
-
res.end(`<html><head></head><body><center><b>404</b> | Not found: ${url}</center></body></html>`);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
303
|
});
|
|
346
304
|
}
|
|
347
305
|
get(routePath, handler) {
|
package/dist/devPanel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useState, useEffect, useRef } from 'react';
|
|
3
|
-
import { ShieldCheck, CircleX, ChevronDown, ChevronUp, Bug, AlertTriangle, Info, ArrowLeft, Wifi, Terminal, Route, Globe, ChevronRight, ChevronLeft, Server } from 'lucide-react';
|
|
3
|
+
import { ShieldCheck, CircleX, ChevronDown, ChevronUp, Bug, AlertTriangle, Info, ArrowLeft, Wifi, Terminal, Route, Globe, ChevronRight, ChevronLeft, Server, TriangleAlert, Eye } from 'lucide-react';
|
|
4
4
|
import Prism from 'prismjs';
|
|
5
5
|
import 'prismjs/components/prism-javascript';
|
|
6
6
|
Prism.languages.javascript['builtin'] = /\b(window|document|console|navigator|localStorage|sessionStorage|fetch|Promise|setTimeout|setInterval|clearTimeout|clearInterval|requestAnimationFrame|Math|JSON|Object|Array|String|Number|Boolean|Date|RegExp|Error|Map|Set|Symbol|Proxy|Reflect|performance|history|location|screen|crypto|indexedDB|alert|confirm|prompt)\b/;
|
|
@@ -121,6 +121,9 @@ function installConsoleInterceptor() {
|
|
|
121
121
|
};
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
+
function SecuredTab() {
|
|
125
|
+
return (_jsxs("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column', padding: '8px 10px', textAlign: 'center', gap: '8px' }, children: [_jsx(CircleX, { size: 32, color: 'red' }), _jsx("span", { style: { color: 'red', fontSize: 24 }, children: "Tab Isn't Accessible" }), _jsx("span", { style: { color: 'red', fontSize: 12 }, children: "To access this tab, you need to set \"dat\" in the Authtics Host config to set restriction and then restart." })] }));
|
|
126
|
+
}
|
|
124
127
|
function PanelButton({ onClick, onClick2, children, style, fullWidth, disabled }) {
|
|
125
128
|
const [hovered, setHovered] = useState(false);
|
|
126
129
|
const [pressed, setPressed] = useState(false);
|
|
@@ -188,6 +191,7 @@ export default function DevPanel() {
|
|
|
188
191
|
const [users, setUsers] = useState(0);
|
|
189
192
|
const [token, setToken] = useState(null);
|
|
190
193
|
const [tokenLength, setTokenLength] = useState(0);
|
|
194
|
+
const [tokenHidden, setTokenHidden] = useState(true);
|
|
191
195
|
const [consoleInputFocused, setConsoleInputFocused] = useState(false);
|
|
192
196
|
const consoleInputRef = useRef(null);
|
|
193
197
|
const overlayRef = useRef(null);
|
|
@@ -349,20 +353,22 @@ export default function DevPanel() {
|
|
|
349
353
|
setUsers(data.users);
|
|
350
354
|
}
|
|
351
355
|
};
|
|
352
|
-
setTimeout(() => {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
356
|
+
setTimeout(async () => {
|
|
357
|
+
await getDatMatching();
|
|
358
|
+
if (datRestrictionMissing === false) {
|
|
359
|
+
getPath();
|
|
360
|
+
getCompilerType();
|
|
361
|
+
getHttpVersion();
|
|
362
|
+
isSSR();
|
|
363
|
+
userSettings();
|
|
364
|
+
getHostVersion();
|
|
365
|
+
setInterval(() => {
|
|
366
|
+
getUsage();
|
|
367
|
+
}, 250);
|
|
368
|
+
setInterval(() => {
|
|
369
|
+
update();
|
|
370
|
+
}, 500);
|
|
371
|
+
}
|
|
366
372
|
}, 250);
|
|
367
373
|
}, []);
|
|
368
374
|
const restart = async () => {
|
|
@@ -707,7 +713,7 @@ export default function DevPanel() {
|
|
|
707
713
|
border: '1px solid #eee',
|
|
708
714
|
fontSize: '12px',
|
|
709
715
|
color: '#333',
|
|
710
|
-
}, children: [_jsx("span", { children: "Ping" }), _jsx("span", { style: { color: ping__ < 100 ? '#16a34a' : ping__ < 300 ? '#d97706' : '#e53e3e', fontFamily: 'monospace' }, children: ping__ > 0 ? `${ping__}ms` : '??ms' })] }), _jsx(Sparkline, { data: receivedHistory, color: "#3b82f6", label: "Received", unit: " bytes" }), _jsx(Sparkline, { data: sentHistory, color: "#16a34a", label: "Sent", unit: " bytes" }), networkFetches.length === 0
|
|
716
|
+
}, children: [_jsx("span", { children: "Ping" }), _jsx("span", { style: { color: ping__ < 100 ? '#16a34a' : ping__ < 300 ? '#d97706' : '#e53e3e', fontFamily: 'monospace' }, children: ping__ > 0 ? `${ping__}ms` : '??ms' })] }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '4px' }, children: [_jsx(Info, { size: 10 }), "this analytic is unavaliable. Set \"dat\" in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {})), _jsx(Sparkline, { data: receivedHistory, color: "#3b82f6", label: "Received", unit: " bytes" }), _jsx(Sparkline, { data: sentHistory, color: "#16a34a", label: "Sent", unit: " bytes" }), networkFetches.length === 0
|
|
711
717
|
? _jsx("div", { style: { color: '#aaa', fontSize: '12px', padding: '4px 2px' }, children: "No network requests yet." })
|
|
712
718
|
: [...networkFetches].reverse().map((f, i) => (_jsxs("div", { style: {
|
|
713
719
|
background: '#fff',
|
|
@@ -734,7 +740,7 @@ export default function DevPanel() {
|
|
|
734
740
|
display: 'flex',
|
|
735
741
|
alignItems: 'center',
|
|
736
742
|
gap: '6px',
|
|
737
|
-
}, children: [_jsxs(PanelButton, { onClick: () => setRouteOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(Route, { size: 12, color: "#3b82f6" }), " Route"] }), _jsx("span", { style: { fontSize: '10px', color: '#aaa', marginLeft: '2px' }, children: pathName })] }), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: 'flex', flexDirection: 'column', gap: '8px' }, children: [_jsx("span", { style: { fontSize: '24px', color: '#333', fontWeight: 'bold' }, children: pathName }), _jsxs("div", { style: {
|
|
743
|
+
}, children: [_jsxs(PanelButton, { onClick: () => setRouteOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(Route, { size: 12, color: "#3b82f6" }), " Route"] }), _jsx("span", { style: { fontSize: '10px', color: '#aaa', marginLeft: '2px' }, children: pathName })] }), datRestrictionMissing ? (_jsx(SecuredTab, {})) : (_jsx(_Fragment, {})), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: (datRestrictionMissing ? 'none' : 'flex'), flexDirection: 'column', gap: '8px' }, children: [_jsx("span", { style: { fontSize: '24px', color: '#333', fontWeight: 'bold' }, children: pathName }), _jsxs("div", { style: {
|
|
738
744
|
display: 'flex',
|
|
739
745
|
justifyContent: 'space-between',
|
|
740
746
|
padding: '6px 10px',
|
|
@@ -768,7 +774,7 @@ export default function DevPanel() {
|
|
|
768
774
|
display: 'flex',
|
|
769
775
|
alignItems: 'center',
|
|
770
776
|
gap: '6px',
|
|
771
|
-
}, children: [_jsxs(PanelButton, { onClick: () => setWebpageInfoOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(Globe, { size: 12, color: "#3b82f6" }), " Webpage Info"] })] }), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: 'flex', flexDirection: 'column', gap: '8px' }, children: [_jsxs("span", { style: { fontSize: '12px', color: '#333' }, children: [_jsx("span", { style: { fontSize: '24px', color: '#333', fontWeight: 'bold' }, children: pathName }), " on ", _jsx("span", { style: { fontSize: '12px', color: '#333', fontWeight: 'bold' }, children: hostName })] }), _jsxs("div", { style: {
|
|
777
|
+
}, children: [_jsxs(PanelButton, { onClick: () => setWebpageInfoOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(Globe, { size: 12, color: "#3b82f6" }), " Webpage Info"] })] }), datRestrictionMissing ? (_jsx(SecuredTab, {})) : (_jsx(_Fragment, {})), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: (datRestrictionMissing ? 'none' : 'flex'), flexDirection: 'column', gap: '8px' }, children: [_jsxs("span", { style: { fontSize: '12px', color: '#333' }, children: [_jsx("span", { style: { fontSize: '24px', color: '#333', fontWeight: 'bold' }, children: pathName }), " on ", _jsx("span", { style: { fontSize: '12px', color: '#333', fontWeight: 'bold' }, children: hostName })] }), _jsxs("div", { style: {
|
|
772
778
|
display: 'flex',
|
|
773
779
|
justifyContent: 'space-between',
|
|
774
780
|
padding: '6px 10px',
|
|
@@ -811,7 +817,7 @@ export default function DevPanel() {
|
|
|
811
817
|
display: 'flex',
|
|
812
818
|
alignItems: 'center',
|
|
813
819
|
gap: '6px',
|
|
814
|
-
}, children: [_jsxs(PanelButton, { onClick: () => setClientInfoOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(Info, { size: 12, color: "#3b82f6" }), " Client Info"] })] }), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: 'flex', flexDirection: 'column', gap: '8px' }, children: [_jsxs("div", { style: {
|
|
820
|
+
}, children: [_jsxs(PanelButton, { onClick: () => setClientInfoOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(Info, { size: 12, color: "#3b82f6" }), " Client Info"] })] }), datRestrictionMissing ? (_jsx(SecuredTab, {})) : (_jsx(_Fragment, {})), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: (datRestrictionMissing ? 'none' : 'flex'), flexDirection: 'column', gap: '8px' }, children: [_jsxs("div", { style: {
|
|
815
821
|
display: 'flex',
|
|
816
822
|
justifyContent: 'space-between',
|
|
817
823
|
padding: '6px 10px',
|
|
@@ -854,7 +860,7 @@ export default function DevPanel() {
|
|
|
854
860
|
display: 'flex',
|
|
855
861
|
alignItems: 'center',
|
|
856
862
|
gap: '6px',
|
|
857
|
-
}, children: [_jsxs(PanelButton, { onClick: () => setAboutHostOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(ShieldCheck, { size: 12, color: "#f472b6" }), " About Host"] })] }), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: 'flex', flexDirection: 'column', gap: '8px' }, children: [_jsxs("span", { style: { fontSize: '24px', color: '#333', fontWeight: 'bold', textAlign: 'center', display: 'flex', alignItems: 'center', flexDirection: 'column', gap: '6px' }, children: [_jsx(ShieldCheck, { size: 36, color: "#f472b6" }), "Authtics Host"] }), _jsx("span", { style: { fontSize: '12px', color: '#333', textAlign: 'center' }, children: "A lightweight, fast, and secure web server for modern web applications." }), _jsxs("div", { style: {
|
|
863
|
+
}, children: [_jsxs(PanelButton, { onClick: () => setAboutHostOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(ShieldCheck, { size: 12, color: "#f472b6" }), " About Host"] })] }), datRestrictionMissing ? (_jsx(SecuredTab, {})) : (_jsx(_Fragment, {})), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: (datRestrictionMissing ? 'none' : 'flex'), flexDirection: 'column', gap: '8px' }, children: [_jsxs("span", { style: { fontSize: '24px', color: '#333', fontWeight: 'bold', textAlign: 'center', display: 'flex', alignItems: 'center', flexDirection: 'column', gap: '6px' }, children: [_jsx(ShieldCheck, { size: 36, color: "#f472b6" }), "Authtics Host"] }), _jsx("span", { style: { fontSize: '12px', color: '#333', textAlign: 'center' }, children: "A lightweight, fast, and secure web server for modern web applications." }), _jsxs("div", { style: {
|
|
858
864
|
display: 'flex',
|
|
859
865
|
justifyContent: 'space-between',
|
|
860
866
|
padding: '6px 10px',
|
|
@@ -890,7 +896,7 @@ export default function DevPanel() {
|
|
|
890
896
|
display: 'flex',
|
|
891
897
|
alignItems: 'center',
|
|
892
898
|
gap: '6px',
|
|
893
|
-
}, children: [_jsxs(PanelButton, { onClick: () => setServerInfoOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(Server, { size: 12, color: "#f472b6" }), " Server Info"] })] }), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: 'flex', flexDirection: 'column', gap: '8px' }, children: [_jsxs("div", { style: {
|
|
899
|
+
}, children: [_jsxs(PanelButton, { onClick: () => setServerInfoOpen(false), style: { color: '#555' }, children: [_jsx(ArrowLeft, { size: 12 }), " Back"] }), _jsxs("span", { style: { fontSize: '12px', display: 'flex', alignItems: 'center', gap: '4px', color: '#333' }, children: [_jsx(Server, { size: 12, color: "#f472b6" }), " Server Info"] })] }), datRestrictionMissing ? (_jsx(SecuredTab, {})) : (_jsx(_Fragment, {})), _jsxs("div", { style: { overflowY: 'auto', maxHeight: '260px', padding: '10px', display: (datRestrictionMissing ? 'none' : 'flex'), flexDirection: 'column', gap: '8px' }, children: [_jsxs("div", { style: {
|
|
894
900
|
display: 'flex',
|
|
895
901
|
justifyContent: 'space-between',
|
|
896
902
|
padding: '6px 10px',
|
|
@@ -917,7 +923,7 @@ export default function DevPanel() {
|
|
|
917
923
|
border: '1px solid #eee',
|
|
918
924
|
fontSize: '12px',
|
|
919
925
|
color: '#333',
|
|
920
|
-
}, children: [_jsx("span", { style: { fontSize: '12px', color: '#333' }, children: "Total current users" }), _jsx("span", { style: { fontSize: '12px', color: 'blue' }, children: users })] }), _jsx(Sparkline, { data: cpuUsageHistory, color: "#3b82f6", label: "CPU Usage", unit: "" }), _jsx(Sparkline, { data: heapUsageHistory, color: "#3b82f6", label: "Heap Used", unit: "" })] })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { padding: '8px', gap: '4px', display: 'flex', flexDirection: 'column' }, children: [_jsxs(PanelButton, { onClick: () => setConsoleOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(Terminal, { size: 12, color: "#16a34a" }), " Console"] }), logs.length > 0 && (_jsx("span", { style: { color: '#111', borderRadius: '100px', padding: '1px 6px', fontSize: '10px' }, children: logs.length }))] }), _jsxs(PanelButton, { onClick: () => setRouteOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(Route, { size: 12, color: "#3b82f6" }), " Route"] }),
|
|
926
|
+
}, children: [_jsx("span", { style: { fontSize: '12px', color: '#333' }, children: "Total current users" }), _jsx("span", { style: { fontSize: '12px', color: 'blue' }, children: users })] }), _jsx(Sparkline, { data: cpuUsageHistory, color: "#3b82f6", label: "CPU Usage", unit: "" }), _jsx(Sparkline, { data: heapUsageHistory, color: "#3b82f6", label: "Heap Used", unit: "" })] })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { padding: '8px', gap: '4px', display: 'flex', flexDirection: 'column' }, children: [_jsxs(PanelButton, { onClick: () => setConsoleOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(Terminal, { size: 12, color: "#16a34a" }), " Console"] }), logs.length > 0 && (_jsx("span", { style: { color: '#111', borderRadius: '100px', padding: '1px 6px', fontSize: '10px' }, children: logs.length }))] }), _jsxs(PanelButton, { onClick: () => setRouteOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(Route, { size: 12, color: "#3b82f6" }), " Route"] }), _jsxs("span", { style: { color: '#111', borderRadius: '100px', padding: '1px 6px', fontSize: '10px', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '4px' }, children: [datRestrictionMissing && _jsx(TriangleAlert, { size: 12, color: "orange" }), pathName] })] }), _jsxs(PanelButton, { onClick: () => setWebpageInfoOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(Globe, { size: 12, color: "#3b82f6" }), " Webpage Info"] }), datRestrictionMissing && _jsx(TriangleAlert, { size: 12, color: "orange" })] }), _jsx(PanelButton, { onClick: () => setNetworkOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: _jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(Wifi, { size: 12, color: "#3b82f6" }), " Network"] }) }), _jsxs(PanelButton, { onClick: () => setClientInfoOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(Info, { size: 12, color: "#3b82f6" }), " Client Info"] }), datRestrictionMissing && _jsx(TriangleAlert, { size: 12, color: "orange" })] }), _jsxs(PanelButton, { onClick: () => setAboutHostOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(ShieldCheck, { size: 12, color: "#f472b6" }), " About Host"] }), datRestrictionMissing && _jsx(TriangleAlert, { size: 12, color: "orange" })] }), _jsxs(PanelButton, { onClick: () => setServerInfoOpen(true), fullWidth: true, style: { color: '#333', justifyContent: 'space-between', height: '32px' }, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center', gap: '6px' }, children: [_jsx(Server, { size: 12, color: "#f472b6" }), " Server Info"] }), datRestrictionMissing && _jsx(TriangleAlert, { size: 12, color: "orange" })] })] }), _jsxs("div", { style: {
|
|
921
927
|
padding: '6px 8px',
|
|
922
928
|
borderTop: '1px solid #ddd',
|
|
923
929
|
background: '#fff',
|
|
@@ -927,7 +933,6 @@ export default function DevPanel() {
|
|
|
927
933
|
maxHeight: '260px',
|
|
928
934
|
flexDirection: 'column',
|
|
929
935
|
}, children: [_jsxs("div", { style: {
|
|
930
|
-
display: 'flex',
|
|
931
936
|
justifyContent: 'space-between',
|
|
932
937
|
padding: '6px 10px',
|
|
933
938
|
background: '#fff',
|
|
@@ -935,7 +940,24 @@ export default function DevPanel() {
|
|
|
935
940
|
border: '1px solid #eee',
|
|
936
941
|
fontSize: '12px',
|
|
937
942
|
color: '#333',
|
|
938
|
-
|
|
943
|
+
display: 'flex'
|
|
944
|
+
}, children: [_jsx("span", { style: { fontSize: '12px', color: '#333', position: 'relative' }, children: "DAT (Developer Access Token)" }), _jsxs("div", { style: { position: 'relative',
|
|
945
|
+
display: 'inline-flex' }, children: [_jsx("span", { style: { fontSize: '12px', color: 'blue' }, children: token }), tokenHidden && (_jsxs("div", { style: {
|
|
946
|
+
position: 'absolute',
|
|
947
|
+
top: 0, left: 0,
|
|
948
|
+
marginTop: '-2.5px',
|
|
949
|
+
width: '100%', height: '100%',
|
|
950
|
+
backdropFilter: 'blur(10px)',
|
|
951
|
+
backgroundColor: 'rgba(255,255,255,0.3)',
|
|
952
|
+
cursor: 'pointer',
|
|
953
|
+
padding: '2.5px 2.5px',
|
|
954
|
+
borderRadius: '8px',
|
|
955
|
+
textAlign: 'center',
|
|
956
|
+
display: 'flex',
|
|
957
|
+
justifyContent: 'center',
|
|
958
|
+
alignItems: 'center',
|
|
959
|
+
gap: '4px'
|
|
960
|
+
}, onClick: () => setTokenHidden(false), children: [_jsx(Eye, { size: 12 }), "Click to reveal"] }))] })] }), tokenLength !== 16 ? (_jsx(_Fragment, { children: _jsxs("div", { style: {
|
|
939
961
|
display: 'flex',
|
|
940
962
|
background: '#ba4e4e',
|
|
941
963
|
borderRadius: '10px',
|
|
@@ -955,7 +977,7 @@ export default function DevPanel() {
|
|
|
955
977
|
gap: '6px',
|
|
956
978
|
color: '#fff',
|
|
957
979
|
flexDirection: 'row',
|
|
958
|
-
}, children: "Updates to security. Apps with version 0.0.1-beta.9 and over will now require DAT restriction to access remote features like restarting and shutting down the app." }) })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { restart(); }, fullWidth: true, style: { color: '#fff', justifyContent: 'center', height: '32px', background: '#ba4e4e' }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: "Restart App" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '4px' }, children: [_jsx(Info, { size: 10 }), "Restarting the app is unavaliable. Set \"dat\" in the Authtics Host config to set restriction."] })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { shutDown(); }, fullWidth: true, style: { color: '#fff', justifyContent: 'center', height: '32px', background: '#ba4e4e' }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: "Shut Down App" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '4px' }, children: [_jsx(Info, { size: 10 }), "Shutting down the app is unavaliable. Set \"dat\" in the Authtics Host config to set restriction."] })) : (_jsx(_Fragment, {}))] })] })) }) }), datMatch ? (_jsxs("div", { onClick: () => setOpen(o => !o), style: {
|
|
980
|
+
}, children: "Updates to security. Apps with version 0.0.1-beta.9 and over will now require DAT restriction to access remote features like restarting and shutting down the app." }) })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { restart(); }, fullWidth: true, style: { color: '#fff', justifyContent: 'center', height: '32px', background: '#ba4e4e' }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: "Restart App" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '4px' }, children: [_jsx(Info, { size: 10 }), "Restarting the app is unavaliable. Set \"dat\" in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {})), _jsx(PanelButton, { onClick: () => { shutDown(); }, fullWidth: true, style: { color: '#fff', justifyContent: 'center', height: '32px', background: '#ba4e4e' }, disabled: datRestrictionMissing, children: _jsx("span", { style: { display: 'flex', alignItems: 'center', gap: '6px', textAlign: 'center' }, children: "Shut Down App" }) }), datRestrictionMissing ? (_jsxs("span", { style: { display: 'flex', opacity: 0.5, fontSize: 10, justifyContent: 'center', alignItems: 'center', gap: '4px' }, children: [_jsx(Info, { size: 10 }), "Shutting down the app is unavaliable. Set \"dat\" in the Authtics Host config to set restriction and then restart."] })) : (_jsx(_Fragment, {}))] })] })) }) }), datMatch ? (_jsxs("div", { onClick: () => setOpen(o => !o), style: {
|
|
959
981
|
display: 'flex',
|
|
960
982
|
flexDirection: 'row',
|
|
961
983
|
alignItems: 'center',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bananacool467/authtics-host",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.4",
|
|
4
4
|
"description": "A Next.js-inspired SSR framework for Node.js with TypeScript and JSX support.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"lightweight",
|
|
36
36
|
"hot-reload",
|
|
37
37
|
"dev",
|
|
38
|
-
"developer"
|
|
38
|
+
"developer",
|
|
39
|
+
"HostJS"
|
|
39
40
|
],
|
|
40
41
|
"author": "bananacool467",
|
|
41
42
|
"license": "MIT",
|