@reddb-io/ui 0.4.4 → 0.4.6
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/build/404.html +10 -10
- package/build/_app/immutable/chunks/BT_NlJ9b.js +9 -0
- package/build/_app/immutable/chunks/{CRcUHjOC.js → BdKYr7lO.js} +1 -1
- package/build/_app/immutable/chunks/{QTZ_pxoY.js → Br0XzNbS.js} +1 -1
- package/build/_app/immutable/chunks/{C3QbliX6.js → BspwW-rP.js} +1 -1
- package/build/_app/immutable/chunks/{Dblyp_YC.js → DD7_KB97.js} +1 -1
- package/build/_app/immutable/chunks/{RBJGFHIL.js → xVmvYz1F.js} +7 -7
- package/build/_app/immutable/entry/{app.DyPXqkIP.js → app.BwQs72pA.js} +2 -2
- package/build/_app/immutable/entry/start.Dokw79m9.js +1 -0
- package/build/_app/immutable/nodes/{0.jHk_xbql.js → 0.Bn0HCj5G.js} +1 -1
- package/build/_app/immutable/nodes/{1.DG6cNRZC.js → 1.C2fTzfSV.js} +1 -1
- package/build/_app/immutable/nodes/{10.Cf1044jB.js → 10.C6p9_zpN.js} +1 -1
- package/build/_app/immutable/nodes/{15.B_-RXVqx.js → 15.CZkgDcbY.js} +1 -1
- package/build/_app/version.json +1 -1
- package/build/analytics.html +10 -10
- package/build/appearance.html +10 -10
- package/build/ask.html +10 -10
- package/build/cluster.html +10 -10
- package/build/collections.html +10 -10
- package/build/graph.html +11 -11
- package/build/index.html +10 -10
- package/build/query.html +10 -10
- package/build/redwire-ws-spike.html +10 -10
- package/build/security.html +10 -10
- package/build/settings.html +10 -10
- package/build/shadow-dom-spike.html +11 -11
- package/dist/embed/{AnalyticsView-Bc4NYbS5.js → AnalyticsView-Bq4u563e.js} +4 -4
- package/dist/embed/{AnalyticsView-Bc4NYbS5.js.map → AnalyticsView-Bq4u563e.js.map} +1 -1
- package/dist/embed/{RedUiEmbedRoot-BUcz7vnW.js → RedUiEmbedRoot-C29ndra1.js} +8725 -8708
- package/dist/embed/RedUiEmbedRoot-C29ndra1.js.map +1 -0
- package/dist/embed/{index-C3zysLt8.js → index-BAYmeM5z.js} +125 -125
- package/dist/embed/{index-C3zysLt8.js.map → index-BAYmeM5z.js.map} +1 -1
- package/dist/embed/{index-client-esdlRozF.js → index-client-Duv8Z53P.js} +2 -2
- package/dist/embed/{index-client-esdlRozF.js.map → index-client-Duv8Z53P.js.map} +1 -1
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-Ds5a5Bdj.js → sigma.esm-Daj5mOac.js} +2 -2
- package/dist/embed/{sigma.esm-Ds5a5Bdj.js.map → sigma.esm-Daj5mOac.js.map} +1 -1
- package/package.json +3 -3
- package/src/lib/ConnectDropdown.svelte +3 -1
- package/src/lib/reddb/client.ts +4 -1
- package/src/lib/reddb/connection-string.ts +18 -2
- package/build/_app/immutable/chunks/Uan23_-U.js +0 -9
- package/build/_app/immutable/entry/start.BBR6s3gw.js +0 -1
- package/dist/embed/RedUiEmbedRoot-BUcz7vnW.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reddb-io/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "RedDB UI components and standalone web application.",
|
|
6
6
|
"type": "module",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@aflsolutions/graphology-communities-leiden": "^1.1.1",
|
|
50
|
-
"@reddb-io/ui-kit": "0.4.
|
|
51
|
-
"@reddb-io/ui-mcp": "0.4.
|
|
50
|
+
"@reddb-io/ui-kit": "0.4.6",
|
|
51
|
+
"@reddb-io/ui-mcp": "0.4.6",
|
|
52
52
|
"@sigma/edge-curve": "^3.1.0",
|
|
53
53
|
"@sigma/node-border": "^3.0.0",
|
|
54
54
|
"@tauri-apps/api": "^2.5.0",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
let open = $state(false)
|
|
30
|
+
let signInOpen = $state(false)
|
|
30
31
|
let url = $state(pickDefaultUrl())
|
|
31
32
|
let username = $state('')
|
|
32
33
|
let password = $state('')
|
|
@@ -143,6 +144,7 @@
|
|
|
143
144
|
error = connection.probe.error
|
|
144
145
|
status = 'error'
|
|
145
146
|
open = true
|
|
147
|
+
if (error.includes('HTTP 401')) signInOpen = true
|
|
146
148
|
}
|
|
147
149
|
})
|
|
148
150
|
|
|
@@ -225,7 +227,7 @@
|
|
|
225
227
|
|
|
226
228
|
<div class="mb-2 text-[10px] font-mono text-fg-3">URL or Base64-encoded URL · reachable here: {supportedHint}</div>
|
|
227
229
|
|
|
228
|
-
<details class="mb-3">
|
|
230
|
+
<details class="mb-3" bind:open={signInOpen}>
|
|
229
231
|
<summary class="cursor-pointer text-xs text-fg-2">Sign in to the database</summary>
|
|
230
232
|
<div class="grid gap-2 mt-2">
|
|
231
233
|
<label class="text-xs text-fg-2" for="connect-username">Username</label>
|
package/src/lib/reddb/client.ts
CHANGED
|
@@ -430,7 +430,10 @@ export class RedClient {
|
|
|
430
430
|
|
|
431
431
|
if (!res.ok) {
|
|
432
432
|
const body = await res.text().catch(() => "");
|
|
433
|
-
const message =
|
|
433
|
+
const message =
|
|
434
|
+
res.status === 401
|
|
435
|
+
? "Database credentials required (HTTP 401). Sign in with a database username and password."
|
|
436
|
+
: `${verb} ${path} → ${res.status} ${body.slice(0, 200)}`;
|
|
434
437
|
devConsole.record({
|
|
435
438
|
kind: "http",
|
|
436
439
|
verb,
|
|
@@ -59,7 +59,16 @@ export function decodeConnectionString(input: string): string {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
/**
|
|
62
|
+
/** Managed RedDB databases publish HTTPS on 443; their native wire and HTTP
|
|
63
|
+
* container ports are not browser endpoints. Self-hosted aliases keep the
|
|
64
|
+
* existing local HTTP bridge convention. Explicit HTTP(S) URLs stay caller-owned. */
|
|
65
|
+
function managedDatabaseHost(hostname: string): boolean {
|
|
66
|
+
const label = "[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?";
|
|
67
|
+
return new RegExp(
|
|
68
|
+
`^${label}\\.${label}\\.dbs\\.reddb\\.(?:dev|io)$`,
|
|
69
|
+
"i"
|
|
70
|
+
).test(hostname);
|
|
71
|
+
}
|
|
63
72
|
export function parseConnectionString(input: string): ParsedConnectionString {
|
|
64
73
|
let raw = decodeConnectionString(input);
|
|
65
74
|
if (/^(file|unix|red\+unix):\/\//i.test(raw)) return { url: raw };
|
|
@@ -98,7 +107,14 @@ export function parseConnectionString(input: string): ParsedConnectionString {
|
|
|
98
107
|
url.username = "";
|
|
99
108
|
url.password = "";
|
|
100
109
|
}
|
|
101
|
-
if (wire)
|
|
110
|
+
if (wire) {
|
|
111
|
+
if (managedDatabaseHost(url.hostname)) {
|
|
112
|
+
url.protocol = "https:";
|
|
113
|
+
url.port = "";
|
|
114
|
+
} else {
|
|
115
|
+
url.port = "5055";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
102
118
|
const endpoint = url.href.replace(/\/$/, "");
|
|
103
119
|
return { url: endpoint, ...(credentials ? { credentials } : {}) };
|
|
104
120
|
} catch (error) {
|