Skip to content
Binary file added app/public/swarm/hiverelay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions app/src/HiveRelay.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<script lang="ts">
import { InlineNotification } from "carbon-components-svelte";
import NodeVersionupdater from "./components/NodeVersionupdater.svelte";
export let updateBody = () => {};
import { selectedNode } from "./store";
let success = false;
let notification_message = "";
let show_notification = false;

function handleNodeVersionUpdateSuccess() {
updateBody();

success = true;
notification_message = `${$selectedNode.name} version updated successfully`;
show_notification = true;
}

function handleNodeVersionUpdateError(errMsg: string) {
success = false;
notification_message = errMsg;
show_notification = true;
}
</script>

<main class="hiverelay_container">
{#if show_notification}
<InlineNotification
lowContrast
kind={success ? "success" : "error"}
title={success ? "Success:" : "Error:"}
subtitle={notification_message}
timeout={9000}
on:close={(e) => {
e.preventDefault();
show_notification = false;
}}
/>
{/if}
{#if $selectedNode && $selectedNode.host}
<div class="open-link">
<a href={`https://${$selectedNode.host}`} target="_blank" rel="noreferrer">
Open
</a>
</div>
{/if}
<NodeVersionupdater
handleSuccess={handleNodeVersionUpdateSuccess}
handleError={handleNodeVersionUpdateError}
/>
</main>

<style>
.hiverelay_container {
padding: 1rem;
}
.open-link {
margin-bottom: 1rem;
}
.open-link a {
color: #61dafb;
text-decoration: none;
font-size: 0.9rem;
}
.open-link a:hover {
text-decoration: underline;
}
</style>
3 changes: 3 additions & 0 deletions app/src/controls/Controller.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import Neo4j from "../Neo4j.svelte";
import Stakgraph from "../Stakgraph.svelte";
import Repo2Graph from "../Repo2Graph.svelte";
import HiveRelay from "../HiveRelay.svelte";
import Bot from "../Bot.svelte";

export let updateBody = () => {};
Expand Down Expand Up @@ -113,6 +114,8 @@
<Stakgraph {updateBody} />
{:else if type === "Repo2Graph"}
<Repo2Graph {updateBody} />
{:else if type === "HiveRelay"}
<HiveRelay {updateBody} />
{:else if type === "Bot"}
<Bot />
{:else}
Expand Down
3 changes: 3 additions & 0 deletions app/src/controls/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ const stakgraphControls: Control[] = [];

const repo2graphControls: Control[] = [];

const hiverelayControls: Control[] = [];

const botControls: Control[] = [];

export const controls = {
Expand All @@ -106,5 +108,6 @@ export const controls = {
Neo4j: neo4jControls,
Stakgraph: stakgraphControls,
Repo2Graph: repo2graphControls,
HiveRelay: hiverelayControls,
Bot: botControls,
};
2 changes: 2 additions & 0 deletions app/src/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export type NodeType =
| "Llama"
| "Repo2Graph"
| "Stakgraph"
| "HiveRelay"
| "Bot";

export const allNodeTypes: NodeType[] = [
Expand Down Expand Up @@ -214,6 +215,7 @@ const defpos = {
tribes_1: [1160, 175],
tribes_2: [1160, 425],
tribes_3: [1160, 675],
hive_relay: [1150, 675],
};

export const smalls = ["lss", "neo4j", "elastic", "cache", "lss_1"];
Expand Down
Loading