working deploys

This commit is contained in:
Nicholas Orlowsky 2023-01-18 14:18:31 -06:00
parent 847d11c841
commit 67dcd4e139
3 changed files with 12 additions and 25 deletions

View file

@ -2,6 +2,7 @@ import {useState} from "react";
import URI from "urijs";
import {Namespace} from "../nws-api/types";
import {useNWSAccount, useNWSAuthKey} from "../nws-api/hooks";
import {useSearchParams} from "react-router-dom";
export default function CreateCruisePage() {
const [page, setPage] = useState('info');
@ -16,18 +17,20 @@ export default function CreateCruisePage() {
const authKey = useNWSAuthKey();
const acct = useNWSAccount();
const [search, useSearch] = useSearchParams();
function deploy() {
fetch("https://api-nws.nickorlow.com/Services/" + acct!.id + "/service",
fetch("https://api-nws.nickorlow.com/" + acct!.id + "/service",
{
method: 'POST',
headers: {
"Authorization": authKey
"Authorization": authKey,
"Content-Type": "application/json"
},
body: JSON.stringify({
"serviceName": name,
"containerUrl": `ghcr.io/${owner}/${repo}`,
"namespaceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"namespaceId": search.get("namespaceId"),
"serviceUrl": hostUriInput,
})
}).then((response)=> {

View file

@ -8,7 +8,7 @@ export default function UptimeCard(props: {uptime: UptimeRecord, isService: bool
const [isModalOpen, setModalOpen] = useState(false);
return(
<div className={"nws-card row mb-2 m-0"} style={{maxWidth: '100%'}}>
<h3 className={"col-md-9 col-12 uptime-lnk"} onClick={()=>setModalOpen(true)}>{props.uptime.name}</h3>
<h4 className={"col-md-9 col-12 uptime-lnk"} onClick={()=>setModalOpen(true)}>{props.uptime.name}</h4>
<div className={`col-md-3 col-12 d-flex d-md-none justify-content-start`}>
<p className={`fw-bold severity-label w-100