Skip to content

Commit

Permalink
Redesign node view and use it as the landing-page
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfs committed Jul 26, 2024
1 parent 266afb1 commit c0049f8
Show file tree
Hide file tree
Showing 50 changed files with 1,037 additions and 1,007 deletions.
8 changes: 1 addition & 7 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
"fallbackPublicExplorer": "FALLBACK_PUBLIC_EXPLORER",
"apiVersion": "API_VERSION",
"defaultHttpdPort": "DEFAULT_HTTPD_PORT",
"defaultHttpdHostname": "DEFAULT_HTTPD_HOSTNAME",
"defaultHttpdScheme": "DEFAULT_HTTPD_SCHEME",
"defaultNodePort": "DEFAULT_NODE_PORT",
"pinned": {
"__name": "PINNED_NODES",
"__format": "json"
}
"defaultHttpdScheme": "DEFAULT_HTTPD_SCHEME"
},
"source": {
"commitsPerPage": "COMMITS_PER_PAGE"
Expand Down
13 changes: 1 addition & 12 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@
"fallbackPublicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path",
"apiVersion": "4.0.0",
"defaultHttpdPort": 443,
"defaultHttpdHostname": "seed.radicle.garden",
"defaultHttpdScheme": "https",
"defaultNodePort": 8776,
"pinned": [
{
"baseUrl": {
"hostname": "seed.radicle.xyz",
"port": 443,
"scheme": "https"
}
}
]
"defaultHttpdScheme": "https"
},
"source": {
"commitsPerPage": 30
Expand Down
17 changes: 6 additions & 11 deletions config/test.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
"nodes": {
"defaultHttpdPort": 8081,
"defaultHttpdHostname": "127.0.0.1",
"defaultHttpdScheme": "http",
"pinned": [
{
"baseUrl": {
"hostname": "127.0.0.1",
"port": 8081,
"scheme": "http"
}
}
]
"defaultHttpdScheme": "http"
},
"fallbackPreferredSeed": {
"hostname": "127.0.0.1",
"port": 8081,
"scheme": "http"
}
}
3 changes: 0 additions & 3 deletions module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ declare module "virtual:*" {
apiVersion: string;
fallbackPublicExplorer: string;
defaultHttpdPort: number;
defaultHttpdHostname: string;
defaultLocalHttpdPort: number;
defaultNodePort: number;
defaultHttpdScheme: string;
pinned: { baseUrl: BaseUrl }[];
};
source: {
commitsPerPage: number;
Expand Down
Binary file added public/images/default-seed-avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/default-seed-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions radicle-httpd/src/api/v1/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use radicle::Node;

use crate::api::error::Error;
use crate::api::Context;
use crate::axum_extra::Path;
use crate::axum_extra::{cached_response, Path};

pub fn router(ctx: Context) -> Router {
Router::new()
Expand Down Expand Up @@ -84,13 +84,15 @@ async fn node_handler(State(ctx): State<Context>) -> impl IntoResponse {
}
};

Ok::<_, Error>(Json(Response::new(
let response = Response::new(
node_id,
agent,
config,
node_state.to_string(),
ctx.profile.config.web.clone(),
)))
);

Ok::<_, Error>(cached_response(response, 600))
}

/// Return stored information about other nodes.
Expand Down
3 changes: 0 additions & 3 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import Commit from "@app/views/projects/Commit.svelte";
import History from "@app/views/projects/History.svelte";
import Home from "@app/views/home/Index.svelte";
import Issue from "@app/views/projects/Issue.svelte";
import Issues from "@app/views/projects/Issues.svelte";
import Nodes from "@app/views/nodes/View.svelte";
Expand Down Expand Up @@ -59,8 +58,6 @@
<div class="loading">
<Loading />
</div>
{:else if $activeRouteStore.resource === "home"}
<Home />
{:else if $activeRouteStore.resource === "nodes"}
<Nodes {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "project.source"}
Expand Down
34 changes: 0 additions & 34 deletions src/App/Header.svelte

This file was deleted.

41 changes: 0 additions & 41 deletions src/App/Header/Breadcrumbs.svelte

This file was deleted.

29 changes: 0 additions & 29 deletions src/App/Header/Breadcrumbs/NodeSegment.svelte

This file was deleted.

127 changes: 0 additions & 127 deletions src/App/Header/Breadcrumbs/ProjectSegment.svelte

This file was deleted.

25 changes: 23 additions & 2 deletions src/App/AppLayout.svelte → src/App/Layout.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import Footer from "@app/App/Footer.svelte";
import Header from "@app/App/Header.svelte";
import MobileFooter from "@app/App/MobileFooter.svelte";
import Link from "@app/components/Link.svelte";
</script>

<style>
Expand All @@ -12,11 +12,23 @@
}
.header {
border-bottom: 1px solid var(--color-fill-separator);
display: flex;
align-items: center;
gap: 0.5rem;
margin: 0;
padding: 0.5rem 0.5rem 0.5rem 1rem;
height: 3.5rem;
justify-content: flex-end;
}
.content {
height: 100%;
overflow-y: scroll;
}
.logo {
height: var(--button-regular-height);
margin: 0 0.5rem;
}
@media (max-width: 719.98px) {
.app {
display: grid;
Expand All @@ -31,7 +43,16 @@

<div class="app">
<div class="global-hide-on-mobile-down header">
<Header />
<Link
style="display: flex; align-items: center;"
route={{ resource: "nodes", params: undefined }}>
<img
width="24"
height="24"
class="logo"
alt="Radicle logo"
src="/radicle.svg" />
</Link>
</div>
<div class="content">
<slot />
Expand Down
Loading

0 comments on commit c0049f8

Please sign in to comment.