import {Account, Namespace, Service, SessionKey} from "../nws-api/types"; import { useGetAccountNamespaces, useGetAccountServices, useGetServicesInNamespace, useLoggedInRedirect, useNWSAccount } from "../nws-api/hooks"; import {useState} from "react"; import {enableSSL} from "../nws-api/calls"; export default function DashboardPage() { useLoggedInRedirect(); let account: Account | undefined = useNWSAccount(); let {setNs, services, ns} = useGetServicesInNamespace(); let namespaces: Namespace[] = useGetAccountNamespaces(); return(

Welcome to NWS, {account?.name}!


Container Deployment Services

{services.map((e)=>{ return (

{e.serviceName}

Application Id

{e.serviceId}

{e.hostnames.map((host)=>{ return (
{host.hostname} {!host.isSslEnabled ? { let rawSession: string | null = localStorage.getItem("session_key"); if (rawSession != null) { let session: SessionKey = JSON.parse(rawSession); await enableSSL(account!.id!, e.serviceId, session); } }}>Enable SSL :

SSL is enabled!

}
) })}
); })}
); }