Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add redirection to project depending on rad-web cwd
Sebastian Martinez committed 2 years ago
commit 2b3b8bc0dee6d4c8bc9ab225317c0cf8ee2954b7
parent 414c6cafda1913716002d64fd21b7f5eec40dade
7 files changed +28 -11
modified flake.lock
@@ -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"
      }
modified flake.nix
@@ -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";
    };
  };

modified src/components/ConnectInstructions.svelte
@@ -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>
modified src/lib/router.ts
@@ -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,
          },
        };
      }
modified src/lib/router/definitions.ts
@@ -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 {
modified src/views/session/Index.svelte
@@ -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>

modified tests/support/heartwood-version
@@ -1 +1 @@
-
15d17098315469bb180157d1c20344faa10f4f73
+
5abd7bf55a093341231c8b71953777068eade0e2

\ No newline at end of file