Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Add seeding count to bottom of Node page
Merged did:key:z6MkkfM3...sVz5 opened 2 years ago
1 file changed +8 -29 cddf8b40 fe7cd1b4
modified src/views/nodes/View.svelte
@@ -1,11 +1,5 @@
<script lang="ts">
-
  import type {
-
    BaseUrl,
-
    NodeStats,
-
    Policy,
-
    ProjectListQuery,
-
    Scope,
-
  } from "@httpd-client";
+
  import type { BaseUrl, NodeStats, Policy, Scope } from "@httpd-client";
  import type { ComponentProps } from "svelte";
  import type { ProjectInfo } from "@app/components/ProjectCard";

@@ -38,20 +32,10 @@
    | undefined;

  onMount(async () => {
-
    const query: ProjectListQuery = { show: "all" };
-
    await api
-
      .getStats()
-
      .then(({ repos: { total } }) => (query.perPage = total))
-
      .catch(e => {
-
        console.error(
-
          "Not able to query to total repo count for your local node.",
-
          e,
-
        );
-
      });
-

-
    localProjects = await fetchProjectInfos(api.baseUrl, query).catch(
-
      error => error,
-
    );
+
    localProjects = await fetchProjectInfos(api.baseUrl, {
+
      show: "all",
+
      perPage: stats.repos.total,
+
    }).catch(error => error);
  });

  function isSeeding(projectId: string) {
@@ -99,10 +83,6 @@
    gap: 0.5rem;
    width: 100%;
  }
-
  .pinned {
-
    display: flex;
-
    align-items: center;
-
  }
  .info {
    display: flex;
    justify-content: space-between;
@@ -165,10 +145,9 @@
      </div>

      <div class="subtitle">
-
        <div class="pinned txt-semibold">
-
          {stats.repos.total} repositories hosted
+
        <div class="txt-semibold">
+
          {isLocal(baseUrl.hostname) ? "Seeded" : "Pinned"} projects
        </div>
-

        <div class="global-hide-on-mobile" style:margin-left="auto">
          {#if policy && scope}
            <ScopePolicyPopover
@@ -188,7 +167,7 @@
      </div>

      <div style:margin-top="1rem">
-
        {#await fetchProjectInfos( baseUrl, { show: isLocal(baseUrl.hostname) ? "all" : "pinned" }, )}
+
        {#await fetchProjectInfos( baseUrl, { show: isLocal(baseUrl.hostname) ? "all" : "pinned", perPage: stats.repos.total }, )}
          <Loading small center />
        {:then projectInfos}
          <div class="project-grid">