Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Show seed in project view
Alexis Sellier committed 4 years ago
commit 17f048c87a6c8ff63508dc267324aa91530bb418
parent 7fc675f728264db44fe900eccf31b4da3c45ee55
2 files changed +13 -0
modified src/base/projects/Browser.svelte
@@ -187,6 +187,11 @@
      <div class="stat">
        <strong>{tree.stats.contributors}</strong> contributor(s)
      </div>
+
      {#if config.seed.api}
+
        <div class="stat" title="Project data is fetched from this seed">
+
          <span>{utils.formatSeedApi(config.seed.api)}</span>
+
        </div>
+
      {/if}
      <div class="anchor">
        {#if org}
          {#await getAnchor}
modified src/utils.ts
@@ -58,6 +58,14 @@ export function formatHash(hash: string): string {
    + hash.substring(hash.length - 4, hash.length);
}

+
export function formatSeedApi(input: string): string {
+
  const match = input.match(/^https?:\/\/([^:]+)/);
+
  if (match) {
+
    return match[1];
+
  }
+
  return input;
+
}
+

export function capitalize(s: string): string {
  if (s === "") return s;
  return s[0].toUpperCase() + s.substr(1);