add host list

This commit is contained in:
Nicholas Orlowsky 2023-07-09 22:14:37 -04:00
parent e491b99b53
commit d1f552e8a5
3 changed files with 27 additions and 10 deletions

View file

@ -3,7 +3,8 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="03fafda4-e2c1-4602-a731-a2f96e84badd" name="Default Changelist" comment=""> <list default="true" id="03fafda4-e2c1-4602-a731-a2f96e84badd" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/nws-api/calls.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/nws-api/calls.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/components/DashboardPage.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/DashboardPage.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/nws-api/types.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/nws-api/types.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -68,7 +69,7 @@
<workItem from="1673378530233" duration="327000" /> <workItem from="1673378530233" duration="327000" />
<workItem from="1673538703809" duration="6147000" /> <workItem from="1673538703809" duration="6147000" />
<workItem from="1674698447115" duration="249000" /> <workItem from="1674698447115" duration="249000" />
<workItem from="1688939993548" duration="2065000" /> <workItem from="1688939993548" duration="2649000" />
</task> </task>
<servers /> <servers />
</component> </component>

View file

@ -45,14 +45,23 @@ export default function DashboardPage() {
<h3>{e.serviceName}</h3> <h3>{e.serviceName}</h3>
<p><b>Application Id</b></p> <p><b>Application Id</b></p>
<p>{e.serviceId}</p> <p>{e.serviceId}</p>
<a onClick={async ()=> { {e.hostnames.map((host)=>{
return (
<div className={"mb-2 p-2"}>
<a href={host.hostname}>{host.hostname}</a>
{host.isSslEnabled ? <a onClick={async () => {
let rawSession: string | null = localStorage.getItem("session_key"); let rawSession: string | null = localStorage.getItem("session_key");
if(rawSession != null) { if (rawSession != null) {
let session: SessionKey = JSON.parse(rawSession); let session: SessionKey = JSON.parse(rawSession);
await enableSSL(account!.id!, e.serviceId, session); await enableSSL(account!.id!, e.serviceId, session);
} }
}}>Enable SSL</a> }}>Enable SSL</a> : <p>SSL is enabled!</p>
}
</div>
)
})}
</div> </div>
</div>); </div>);
})} })}

View file

@ -48,12 +48,19 @@ export type Account = {
status?: string status?: string
}; };
export type Host = {
serviceId: string,
isSslEnabled: boolean,
hostname: string
};
export type Service = { export type Service = {
serviceId: string, serviceId: string,
serviceName: string, serviceName: string,
namespace: string, namespace: string,
containerUrl: string, containerUrl: string,
ownerId: string ownerId: string,
hostnames: Host[]
} }
export type ApiError = { export type ApiError = {