-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
171 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script lang="ts"> | ||
import * as router from "@app/lib/router"; | ||
import * as utils from "@app/lib/utils"; | ||
import NodeSegment from "./Breadcrumbs/NodeSegment.svelte"; | ||
import ProjectSegment from "./Breadcrumbs/ProjectSegment.svelte"; | ||
import Separator from "./Breadcrumbs/Separator.svelte"; | ||
const activeRouteStore = router.activeRouteStore; | ||
</script> | ||
|
||
<style> | ||
.breadcrumbs { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.25rem; | ||
font-weight: var(--font-weight-semibold); | ||
font-size: var(--font-size-small); | ||
} | ||
</style> | ||
|
||
{#if $activeRouteStore.resource === "booting" || $activeRouteStore.resource === "home" || $activeRouteStore.resource === "session" || $activeRouteStore.resource === "loadError" || $activeRouteStore.resource === "notFound"} | ||
<!-- Don't render breadcrumbs for these routes. --> | ||
{:else if $activeRouteStore.resource === "nodes"} | ||
<div class="breadcrumbs"> | ||
<NodeSegment baseUrl={$activeRouteStore.params.baseUrl} /> | ||
</div> | ||
{:else if $activeRouteStore.resource === "project.source" || $activeRouteStore.resource === "project.history" || $activeRouteStore.resource === "project.commit" || $activeRouteStore.resource === "project.issues" || $activeRouteStore.resource === "project.newIssue" || $activeRouteStore.resource === "project.issue" || $activeRouteStore.resource === "project.patches" || $activeRouteStore.resource === "project.patch"} | ||
<div class="breadcrumbs"> | ||
<NodeSegment baseUrl={$activeRouteStore.params.baseUrl} /> | ||
|
||
<Separator /> | ||
|
||
<ProjectSegment activeRoute={$activeRouteStore} /> | ||
</div> | ||
{:else} | ||
{utils.unreachable($activeRouteStore)} | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script lang="ts"> | ||
import type { BaseUrl } from "@httpd-client"; | ||
import { isLocal } from "@app/lib/utils"; | ||
import IconSmall from "@app/components/IconSmall.svelte"; | ||
import Link from "@app/components/Link.svelte"; | ||
export let baseUrl: BaseUrl; | ||
</script> | ||
|
||
<style> | ||
.segment :global(a:hover) { | ||
color: var(--color-fill-primary); | ||
} | ||
</style> | ||
|
||
<span class="segment"> | ||
<Link | ||
style="display: flex; align-items: center; gap: 0.25rem;" | ||
route={{ | ||
resource: "nodes", | ||
params: { | ||
baseUrl, | ||
projectPageIndex: 0, | ||
}, | ||
}}> | ||
{#if isLocal(baseUrl.hostname)} | ||
<IconSmall name="device" /> | ||
Local Node | ||
{:else} | ||
<IconSmall name="globe" /> | ||
{baseUrl.hostname} | ||
{/if} | ||
</Link> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<script lang="ts"> | ||
import type { ProjectLoadedRoute } from "@app/views/projects/router"; | ||
import { capitalize } from "lodash"; | ||
import * as utils from "@app/lib/utils"; | ||
import CopyableId from "@app/components/CopyableId.svelte"; | ||
import Link from "@app/components/Link.svelte"; | ||
import Separator from "./Separator.svelte"; | ||
export let activeRoute: ProjectLoadedRoute; | ||
</script> | ||
|
||
<style> | ||
.segment :global(a:hover) { | ||
color: var(--color-fill-primary); | ||
} | ||
</style> | ||
|
||
<span class="segment"> | ||
<Link | ||
route={{ | ||
resource: "project.source", | ||
project: activeRoute.params.project.id, | ||
node: activeRoute.params.baseUrl, | ||
}}> | ||
{activeRoute.params.project.name} | ||
</Link> | ||
</span> | ||
|
||
<Separator /> | ||
|
||
<span class="segment"> | ||
<Link | ||
route={{ | ||
resource: "project.source", | ||
project: activeRoute.params.project.id, | ||
node: activeRoute.params.baseUrl, | ||
}}> | ||
{#if activeRoute.resource === "project.history" || activeRoute.resource === "project.commit"} | ||
Commits | ||
{:else if activeRoute.resource === "project.newIssue" || activeRoute.resource === "project.issue"} | ||
Issues | ||
{:else if activeRoute.resource === "project.patch"} | ||
Patches | ||
{:else} | ||
{capitalize(activeRoute.resource.split(".")[1])} | ||
{/if} | ||
</Link> | ||
</span> | ||
|
||
{#if activeRoute.resource === "project.commit"} | ||
<Separator /> | ||
<CopyableId id={activeRoute.params.commit.commit.id}> | ||
{utils.formatCommit(activeRoute.params.commit.commit.id)} | ||
</CopyableId> | ||
{:else if activeRoute.resource === "project.issue"} | ||
<Separator /> | ||
<CopyableId id={activeRoute.params.issue.id}> | ||
{utils.formatObjectId(activeRoute.params.issue.id)} | ||
</CopyableId> | ||
{:else if activeRoute.resource === "project.patch"} | ||
<Separator /> | ||
<CopyableId id={activeRoute.params.patch.id}> | ||
{utils.formatObjectId(activeRoute.params.patch.id)} | ||
</CopyableId> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script lang="ts"> | ||
import IconSmall from "@app/components/IconSmall.svelte"; | ||
</script> | ||
|
||
<span style:color="var(--color-foreground-dim)"> | ||
<IconSmall name="chevron-right" /> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters