diff --git a/frontend/src/organisms/addressbar/createhostmodal.svelte b/frontend/src/organisms/addressbar/hostdetail.svelte
similarity index 60%
rename from frontend/src/organisms/addressbar/createhostmodal.svelte
rename to frontend/src/organisms/addressbar/hostdetail.svelte
index 1bfa6c2..33683f5 100644
--- a/frontend/src/organisms/addressbar/createhostmodal.svelte
+++ b/frontend/src/organisms/addressbar/hostdetail.svelte
@@ -1,17 +1,24 @@
-
+
diff --git a/frontend/src/organisms/addressbar/hostmodal.svelte b/frontend/src/organisms/addressbar/hostmodal.svelte
index d7e4ad6..06178f7 100644
--- a/frontend/src/organisms/addressbar/hostmodal.svelte
+++ b/frontend/src/organisms/addressbar/hostmodal.svelte
@@ -4,7 +4,7 @@
import Icon from '../../components/icon.svelte';
import { Hosts, RemoveHost } from '../../../wailsjs/go/app/App';
import Welcome from './welcome.svelte';
- import CreateHostModal from './createhostmodal.svelte';
+ import HostDetail from './hostdetail.svelte';
export let hosts = {};
export let activeHostKey = '';
@@ -12,7 +12,9 @@
const dispatch = createEventDispatcher();
let error = '';
- let createHostModalOpen = false;
+ let hostDetailModalOpen = false;
+ let hostDetailModalHost;
+ let hostDetailModalKey = '';
$: host = hosts?.[activeHostKey];
$: hostCount = Object.keys(hosts).length;
@@ -35,6 +37,18 @@
}
}
+ function createHost() {
+ hostDetailModalHost = undefined;
+ hostDetailModalKey = '';
+ hostDetailModalOpen = true;
+ }
+
+ function editHost(hostKey) {
+ hostDetailModalHost = hosts[hostKey];
+ hostDetailModalKey = hostKey;
+ hostDetailModalOpen = true;
+ }
+
async function removeHost(hostKey) {
try {
await RemoveHost(hostKey);
@@ -57,7 +71,7 @@
{hostCount} host{hostCount === 1 ? '' : 's'}
{/if}
-