diff --git a/tfweb/src/lib/i18n/locales/en.json b/tfweb/src/lib/i18n/locales/en.json index 2d75fbb..55b049c 100644 --- a/tfweb/src/lib/i18n/locales/en.json +++ b/tfweb/src/lib/i18n/locales/en.json @@ -92,7 +92,20 @@ "edit": "Edit", "enroll": "Enroll", "delete": "Delete", - "config": "Configuration" + "config": "Configuration", + "add": "Add", + "create": { + "name": "Host name", + "btn": "Add host", + "cancel": "Cancel", + "role": "Role", + "ip": "IP Address", + "error": { + "needsname": "Host name is required.", + "needsrole": "Role is required.", + "invalidip": "Invalid IP address" + } + } }, "roles": { "delete": { @@ -184,7 +197,8 @@ "hosts": "Hosts", "roles": "Roles", "lighthouses": "Lighthouses", - "relays": "Relays" + "relays": "Relays", + "addhost": "Add Host" }, "logout": "Log out", "loading": "Dashboard is loading" diff --git a/tfweb/src/routes/hosts/+page.svelte b/tfweb/src/routes/hosts/+page.svelte index 0224b22..3e6f43e 100644 --- a/tfweb/src/routes/hosts/+page.svelte +++ b/tfweb/src/routes/hosts/+page.svelte @@ -98,7 +98,8 @@ -

{$t("common.page.hosts")}

+ +

{$t("common.page.hosts")} {$t("hosts.add")}

@@ -114,7 +115,7 @@ {#each hosts as host} {#if !(host.isLighthouse || host.isRelay)} - + diff --git a/tfweb/src/routes/hosts/add/+page.svelte b/tfweb/src/routes/hosts/add/+page.svelte new file mode 100644 index 0000000..400245c --- /dev/null +++ b/tfweb/src/routes/hosts/add/+page.svelte @@ -0,0 +1,196 @@ + + + + {$t("common.title", {values: {title: $t("common.page.hosts")}})} + + + + +

{$t("common.page.addhost")}

+ +
+ + + + + + + + + + {#if loading} + + {:else} + + {/if} + + {#if hasFormErr} +

{formErr}

+ {/if} + +
+
{host.name}{host.name} {host.metadata?.lastSeenAt} {host.ipAddress} {getRoleName(host.roleID)}