diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..690c56b Binary files /dev/null and b/bun.lockb differ diff --git a/src/components/CreateCruisePage.tsx b/src/components/CreateCruisePage.tsx index f754958..450ee00 100644 --- a/src/components/CreateCruisePage.tsx +++ b/src/components/CreateCruisePage.tsx @@ -7,7 +7,7 @@ import './CreateCruisePage.css'; export default function CreateCruisePage() { const [page, setPage] = useState('info'); - const [strat, setStrat] = useState<'raw-html' | 'react-js'>('raw-html'); + const [strat, setStrat] = useState<'raw-html' | 'react-js' | 'raw-html-anthracite' | 'docker' | 'default'>('default'); const [owner, setOwner] = useState(''); const [repo, setRepo] = useState(''); const [name, setName] = useState(''); @@ -32,8 +32,8 @@ export default function CreateCruisePage() { "serviceName": name, "containerUrl": `ghcr.io/${owner}/${repo}`, "namespaceId": search.get("namespaceId"), - "serviceUrl": hostUriInput, - "hostnammes": [] + "serviceUrl": "https://"+hostUriInput, + "hostnames": [] }) }).then((response)=> { if(response.status === 200) { @@ -84,10 +84,13 @@ export default function CreateCruisePage() { {setName(e.currentTarget.value)}}/> -
How did you create your website?
+
Choose a Dockerfile template

Don't see your technology/framework? Email me: nws-support@nickorlow.com

- + + + + @@ -113,7 +116,7 @@ export default function CreateCruisePage() { setRepo(git_url.pathname.split('/')[2]) } } catch (e) { - alert('invalid github url') + alert('Invalid GitHub URL. Should be of format https://github.com/owner/repo') return; } @@ -121,7 +124,7 @@ export default function CreateCruisePage() { try { let url = new URL("https://"+hostUriInput); } catch (e) { - alert('invalid host url') + alert('Invalid domain! Should be format subdomain.domain.tld. Don\'t include protocols in front (i.e https://)') return; } @@ -138,10 +141,11 @@ export default function CreateCruisePage() { page === 'scriptgen' &&

Copy & Paste the below into your terminal to add NWS deployment scripts to your webapp

- + curl -s https://raw.githubusercontent.com/nickorlow/nws-ghactions-templates/main/add-nws.sh | bash -s {strat} {owner} {repo}
Ensure the script finishes running before continuing +
For your security, you may view the source code of the script here
@@ -152,7 +156,7 @@ export default function CreateCruisePage() {
} { - page === 'dns' && + page === 'dns' &&

Add the following DNS entry to {new URI("https://"+hostUriInput).hostname()}

{ @@ -173,7 +177,7 @@ export default function CreateCruisePage() { new URI("https://"+hostUriInput).subdomain().length > 0 &&

Type: CNAME

-

Name: {new URI(hostUriInput).subdomain()} ({new URI(hostUriInput).hostname()})

+

Name: {new URI("https://"+hostUriInput).subdomain()} ({new URI("https://"+hostUriInput).hostname()})

Value: entry.nws.nickorlow.com

} @@ -182,11 +186,24 @@ export default function CreateCruisePage() {
} { - page === 'done' && + page === 'done' &&
-

Welcome to NWS


+

Welcome to NWS!


+

Your site should be avaliable on NWS momentairly


+

It would be great if you could add the following to your website:


+ + <p>Hosting provided by <a href="https://nws.nickorlow.com">NWS</a></p> +

+ { strat === "raw-html-anthracite" && +
+

It would be great if you could add the following to your website as well:


+ + <p>Powered by <a href="https://github.com/nickorlow/anthracite">Anthracite Web Server</a></p> +

+
+ + }
-
} diff --git a/src/components/DashboardPage.tsx b/src/components/DashboardPage.tsx index ced4050..3ff16df 100644 --- a/src/components/DashboardPage.tsx +++ b/src/components/DashboardPage.tsx @@ -4,9 +4,13 @@ import { useGetAccountServices, useGetServicesInNamespace, useLoggedInRedirect, - useNWSAccount + useNWSAccount, + useNWSAuthKey } from "../nws-api/hooks"; -import {useState} from "react"; +import { + createNamespace +} from "../nws-api/calls" +import {useState, useEffect} from "react"; import {enableSSL} from "../nws-api/calls"; @@ -16,25 +20,60 @@ export default function DashboardPage() { let {setNs, services, ns} = useGetServicesInNamespace(); let namespaces: Namespace[] = useGetAccountNamespaces(); + const urlParams = new URLSearchParams(window.location.search); + return(
+

I don't really know what I was on when I wrote this but a lot of things in the web ui are goofy, sorry about that.. :/ A new one is on its way.

Welcome to NWS, {account?.name}!

- +
+

Namespace

+ +
+ +
+

Container Deployment Services

- +
@@ -47,16 +86,19 @@ export default function DashboardPage() {

{e.serviceId}

{e.hostnames.map((host)=>{ return ( -
- {host.hostname} - {!host.isSslEnabled ? { +
+ {host.hostname} + {!host.isSslEnabled ?
:

SSL is enabled!

}
) diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index ac67d77..b8dc681 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -3,7 +3,7 @@ import React from "react"; export default function Footer() { return ( ); diff --git a/src/components/HomePage.tsx b/src/components/HomePage.tsx index 88d2cc6..f13ddc1 100644 --- a/src/components/HomePage.tsx +++ b/src/components/HomePage.tsx @@ -37,18 +37,15 @@ export default function HomePage() { nws-logo
-

Nick Web Services

-

- Nick Web Services is a hosting service based out of - Austin, Texas. It is committed - to achieving maximum uptime with better performance and a lower cost than any of the major cloud - services. +

Sharpe Mountain Compute

+

+ Sharpe Mountain Compute (fka Nick Web Services) is a reliable cloud compute provider. SMC is dedicated to achieving maximum uptime at a lower cost than traditional cloud compute providers.

100% Uptime from 1/1/2023 - 11/8/2023

-

Watch the NWS Deployment Demo

+

Watch the SMC Deployment Demo


diff --git a/src/components/RegisterPage.tsx b/src/components/RegisterPage.tsx index 971bb47..c04b07f 100644 --- a/src/components/RegisterPage.tsx +++ b/src/components/RegisterPage.tsx @@ -96,10 +96,10 @@ export default function RegisterPage() {
-

Verify your E-Mail address.

+

Successfully Registered!

-

Please verify your E-Mail by clicking the link we sent to you at: {email}

+

Proceed to login

); -} \ No newline at end of file +} diff --git a/src/components/UptimeComparisonCard.tsx b/src/components/UptimeComparisonCard.tsx index 3383e4e..16f3a39 100644 --- a/src/components/UptimeComparisonCard.tsx +++ b/src/components/UptimeComparisonCard.tsx @@ -38,22 +38,22 @@ export default function UptimeComparisonCard(props: {uptime: UptimeRecord, isSer

Uptime (Last Month)

-
+

{props.uptime.uptimeMonth}%


Uptime ({new Date().getFullYear()} YTD)

-
+

{props.uptime.uptimeYtd}%


Avg Response Time (24hr)

-
+

{props.uptime.averageResponseTime}ms


Current Status

-
+

- +
diff --git a/src/nws-api/calls.ts b/src/nws-api/calls.ts index aacf0d4..2c7151f 100644 --- a/src/nws-api/calls.ts +++ b/src/nws-api/calls.ts @@ -50,6 +50,22 @@ export async function getNamespaces(accountId: string, skey: SessionKey): Promis return namespaces; } +export async function createNamespace(name: string, accountId: string, session: SessionKey): Promise { + let response: Response = await fetch('https://api-nws.nickorlow.com/namespaces', { + headers: { + 'Content-Type': 'application/json', + Authorization: btoa(session.accountId + ":" + session.id) + }, + method: 'POST', + body: JSON.stringify({ + 'name': name, + 'ownerId': accountId + }) + }); + let namespace: Namespace = await response.json(); + return namespace; +} + export async function enableSSL(accountId: string, serviceId: string, hostname: string, session: SessionKey) { await fetch('https://api-nws.nickorlow.com/'+accountId+'/service/'+serviceId+"/hosts/"+hostname+"/ssl", { headers: {