From 917242cfbe69b36ed2de8b1548947229e0794a6a Mon Sep 17 00:00:00 2001 From: Oluwatobi Bamidele Date: Fri, 4 Oct 2024 20:52:01 +0100 Subject: [PATCH] feat: render swarm number --- src/bin/super/superapp/src/Remotes.svelte | 9 +++++++-- src/bin/super/superapp/src/types/types.ts | 1 + src/bin/super/superapp/src/utils/index.ts | 11 +++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/bin/super/superapp/src/Remotes.svelte b/src/bin/super/superapp/src/Remotes.svelte index fbe86747..f9649096 100644 --- a/src/bin/super/superapp/src/Remotes.svelte +++ b/src/bin/super/superapp/src/Remotes.svelte @@ -23,7 +23,7 @@ import { remotes, tribes } from "./store"; import { onMount } from "svelte"; import type { Remote } from "./types/types"; - import { splitHost } from "./utils/index"; + import { getSwarmNumber, splitHost } from "./utils/index"; import { selectedNode } from "./store"; import { create_new_swarm_ec2, @@ -188,7 +188,11 @@ } function remoterow(r: Remote) { - return { ...r, id: r.host }; + let swarmNumber = ""; + if (r.default_host) { + swarmNumber = getSwarmNumber(r.default_host); + } + return { ...r, id: r.host, number: swarmNumber }; } async function handleSubmitAddSwarm() { @@ -532,6 +536,7 @@