From 275a73d1c760fc3fcd163901e628fdafe351830d Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 28 May 2024 10:18:19 +0200 Subject: [PATCH] Add delegates and node scope policies to Sidebar --- src/components/IconSmall.svelte | 38 ++++++ src/components/ScopePolicyExplainer.svelte | 44 ++++-- src/views/nodes/View.svelte | 37 +++-- src/views/projects/Commit.svelte | 5 +- src/views/projects/History.svelte | 4 +- src/views/projects/Issue.svelte | 4 +- src/views/projects/Issue/New.svelte | 5 +- src/views/projects/Issues.svelte | 11 +- src/views/projects/Layout.svelte | 7 +- src/views/projects/Patch.svelte | 4 +- src/views/projects/Patches.svelte | 11 +- src/views/projects/Sidebar.svelte | 54 +++++++- src/views/projects/Sidebar/ContextRepo.svelte | 129 ++++++++++++++++++ src/views/projects/Source.svelte | 5 +- src/views/projects/router.ts | 45 +++++- 15 files changed, 356 insertions(+), 47 deletions(-) create mode 100644 src/views/projects/Sidebar/ContextRepo.svelte diff --git a/src/components/IconSmall.svelte b/src/components/IconSmall.svelte index a9238c0e6e..c8ac1299da 100644 --- a/src/components/IconSmall.svelte +++ b/src/components/IconSmall.svelte @@ -53,6 +53,7 @@ | "online" | "patch" | "plus" + | "quorum" | "repo" | "seedling" | "settings" @@ -499,6 +500,43 @@ fill-rule="evenodd" clip-rule="evenodd" d="M13.1667 8C13.1667 8.27614 12.9428 8.5 12.6667 8.5L3.33334 8.5C3.0572 8.5 2.83334 8.27614 2.83334 8C2.83334 7.72386 3.0572 7.5 3.33334 7.5L12.6667 7.5C12.9428 7.5 13.1667 7.72386 13.1667 8Z" /> + {:else if name === "quorum"} + + + + + + + + + {:else if name === "repo"} import type { Scope, Policy } from "@httpd-client"; + import { capitalize } from "lodash"; + export let scope: Scope; export let policy: Policy; -{#if policy === "allow"} - All discovered repositories will get seeded, -{:else if policy === "block"} - Only repositories marked as such will get seeded, -{/if} -{#if scope === "all"} - and all changes in those repositories, made by any peer, will be synced. -{:else if scope === "followed"} - and only changes made by explicitly followed peers will be synced. -{/if} + + +
+ Scope: + {capitalize(scope)} +
+
+ {#if scope === "all"} + All changes in seeded repositories, made by any peer, will be synced. + {:else if scope === "followed"} + Only changes made by explicitly followed peers will be synced. + {/if} +
+ +
+ Policy: + {capitalize(policy)} +
+
+ {#if policy === "allow"} + All discovered repositories will get seeded. + {:else if policy === "block"} + Only repositories marked as such will get seeded. + {/if} +
diff --git a/src/views/nodes/View.svelte b/src/views/nodes/View.svelte index 0a60ca6d27..1092587153 100644 --- a/src/views/nodes/View.svelte +++ b/src/views/nodes/View.svelte @@ -1,6 +1,8 @@ + + + +
+
+
+ + Delegates + {project.delegates.length} +
+
+ + + {project.threshold}/{project.delegates.length} + + {#if !disablePopovers} + + + + + +
+ {project.threshold} out of {project.delegates.length} delegates have + to accept changes to be included in the canonical branch. +
+
+ {/if} +
+
+
+ {#each project.delegates as { id: nodeId, alias }} +
+ +
+ {/each} +
+
+
+
+ {#if isLocal(baseUrl.hostname)} + Local Node + {:else} + {baseUrl.hostname} + {/if} +
+ +
+
+
+ (expandedNode = !expandedNode)}> + + + Seeding Policy +
+
+ {capitalize(shortSeedingPolicy)} +
+
+ {#if expandedNode && node.config} +
+ +
+ {/if} +
+ Radicle version + + {node.version} + +
+
+
diff --git a/src/views/projects/Source.svelte b/src/views/projects/Source.svelte index 548f306eb5..75102443fc 100644 --- a/src/views/projects/Source.svelte +++ b/src/views/projects/Source.svelte @@ -1,5 +1,5 @@