mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Add redirection to project depending on rad-web cwd
This commit is contained in:
Generated
+5
-5
@@ -88,17 +88,17 @@
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706704813,
|
||||
"narHash": "sha256-o0F1Bm1eUtDyz28hQdyktaW8dDnQl4bLeZhDUbP9dgM=",
|
||||
"lastModified": 1707134016,
|
||||
"narHash": "sha256-Cu8fHlircqH6qY9fN7Q5EWFgOZN1751BTKAKUI0AVQo=",
|
||||
"ref": "master",
|
||||
"rev": "15d17098315469bb180157d1c20344faa10f4f73",
|
||||
"revCount": 1658,
|
||||
"rev": "5abd7bf55a093341231c8b71953777068eade0e2",
|
||||
"revCount": 1667,
|
||||
"type": "git",
|
||||
"url": "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git"
|
||||
},
|
||||
"original": {
|
||||
"ref": "master",
|
||||
"rev": "15d17098315469bb180157d1c20344faa10f4f73",
|
||||
"rev": "5abd7bf55a093341231c8b71953777068eade0e2",
|
||||
"type": "git",
|
||||
"url": "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git"
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
nixpkgs.follows = "heartwood/nixpkgs";
|
||||
flake-utils.follows = "heartwood/flake-utils";
|
||||
heartwood = {
|
||||
url = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?ref=master&rev=15d17098315469bb180157d1c20344faa10f4f73";
|
||||
url = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git?ref=master&rev=5abd7bf55a093341231c8b71953777068eade0e2";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<script>
|
||||
import { api, httpdStore } from "@app/lib/httpd";
|
||||
import Command from "./Command.svelte";
|
||||
|
||||
$: path = window.location.href.replace(window.location.origin, "");
|
||||
$: pathParam = path === "/" ? "" : `--path "${path}"`;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -31,14 +34,14 @@
|
||||
<div class="label">Authenticate with your local node to make changes.</div>
|
||||
<Command
|
||||
fullWidth
|
||||
command={`rad web ${window.origin} --connect ${api.hostname}:${api.port}`} />
|
||||
command={`rad web ${window.origin} --connect ${api.hostname}:${api.port} ${pathParam}`} />
|
||||
{:else}
|
||||
<div class="heading">Connect & Authenticate</div>
|
||||
<div class="label">
|
||||
Connect to your local node to browse projects on your local machine,
|
||||
create issues, and participate in discussions.
|
||||
</div>
|
||||
<Command fullWidth command={`rad web ${window.origin}`} />
|
||||
<Command fullWidth command={`rad web ${window.origin} ${pathParam}`} />
|
||||
|
||||
<div class="divider" />
|
||||
<div class="heading">New to Radicle?</div>
|
||||
|
||||
@@ -221,6 +221,7 @@ export function urlToRoute(url: URL): Route | null {
|
||||
signature: url.searchParams.get("sig") ?? "",
|
||||
publicKey: url.searchParams.get("pk") ?? "",
|
||||
apiAddr: url.searchParams.get("addr") ?? "127.0.0.1:8080",
|
||||
path: url.searchParams.get("path") || undefined,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,7 +20,13 @@ export interface NotFoundRoute {
|
||||
|
||||
interface SessionRoute {
|
||||
resource: "session";
|
||||
params: { id: string; signature: string; publicKey: string; apiAddr: string };
|
||||
params: {
|
||||
id: string;
|
||||
signature: string;
|
||||
publicKey: string;
|
||||
apiAddr: string;
|
||||
path?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface LoadErrorRoute {
|
||||
|
||||
@@ -35,7 +35,14 @@
|
||||
},
|
||||
});
|
||||
}
|
||||
void router.push({ resource: "home" });
|
||||
const route = router.urlToRoute(
|
||||
new URL(activeRoute.params.path || "", window.location.origin),
|
||||
);
|
||||
if (route) {
|
||||
void router.push(route);
|
||||
} else {
|
||||
void router.push({ resource: "home" });
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
15d17098315469bb180157d1c20344faa10f4f73
|
||||
5abd7bf55a093341231c8b71953777068eade0e2
|
||||
Reference in New Issue
Block a user