From eada2a371fac9d6f1ab018b9fa578993190a0fe3 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Fri, 16 Feb 2024 01:50:35 +0000 Subject: [PATCH] css --- package.json | 1 + src/App.tsx | 6 ++++-- src/index.css | 4 ++++ src/utils/data-utils.ts | 9 +++++---- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 42426c0..024e739 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "webapp-deployment-status-ui", "version": "0.1.0", "private": true, + "homepage": "https://gibbon.vdb.to/deployer", "dependencies": { "@tanstack/react-query": "^5.17.15", "@testing-library/jest-dom": "^5.14.1", diff --git a/src/App.tsx b/src/App.tsx index 33a55c5..7bac3a5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -19,8 +19,10 @@ function StatusTable() { const [logId, setLogId] = useState(""); // Queries - const query = useQuery({queryKey: ['allStatus'], queryFn: fetchAllStatuses}) + const query = useQuery({queryKey: ['allStatus'], queryFn: fetchAllStatuses, refetchInterval: 10000}); const queryLog = useQuery({queryKey: ['log', logId], queryFn: () => fetchLogs(logId)}); + + const linkFmt = "https://console.laconic.com/console?query=%0A%20%20fragment%20ValueParts%20on%20Value%20%7B%0A%20%20%20%20...%20on%20BooleanValue%20%7B%0A%20%20%20%20%20%20bool%3A%20value%0A%20%20%20%20%7D%0A%20%20%20%20...%20on%20IntValue%20%7B%0A%20%20%20%20%20%20int%3A%20value%0A%20%20%20%20%7D%0A%20%20%20%20...%20on%20FloatValue%20%7B%0A%20%20%20%20%20%20float%3A%20value%0A%20%20%20%20%7D%0A%20%20%20%20...%20on%20StringValue%20%7B%0A%20%20%20%20%20%20string%3A%20value%0A%20%20%20%20%7D%0A%20%20%20%20...%20on%20BytesValue%20%7B%0A%20%20%20%20%20%20bytes%3A%20value%0A%20%20%20%20%7D%0A%20%20%20%20...%20on%20LinkValue%20%7B%0A%20%20%20%20%20%20link%3A%20value%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20fragment%20AttrParts%20on%20Attribute%20%7B%0A%20%20%20%20key%0A%20%20%20%20value%20%7B%0A%20%20%20%20%20%20...ValueParts%0A%20%20%20%20%20%20...%20on%20ArrayValue%20%7B%0A%20%20%20%20%20%20%20%20value%20%7B%0A%20%20%20%20%20%20%20%20%20%20...ValueParts%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20%7B%0A%20%20%20%20getRecordsByIds(ids%3A%20%5B%22$RQID$%22%5D)%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20names%0A%20%20%20%20%20%20bondId%0A%20%20%20%20%20%20createTime%0A%20%20%20%20%20%20expiryTime%0A%20%20%20%20%20%20owners%0A%20%20%20%20%20%20attributes%20%7B%0A%20%20%20%20%20%20%20%20...AttrParts%0A%20%20%20%20%20%20%20%20value%20%7B%0A%20%20%20%20%20%20%20%20%20%20...%20on%20MapValue%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20map%3A%20value%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20...AttrParts%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A"; return (
{logId && ( @@ -33,7 +35,7 @@ function StatusTable() { {query.data?.map((status: any) =>
Request ID: - {status.id} + {status.id}
Application: diff --git a/src/index.css b/src/index.css index 7eb2663..be0ac97 100644 --- a/src/index.css +++ b/src/index.css @@ -17,6 +17,10 @@ button { cursor: pointer; } +a { + color: #444; +} + #all-status { margin: auto; min-width: 50%; diff --git a/src/utils/data-utils.ts b/src/utils/data-utils.ts index 4808b66..aaa8cd8 100644 --- a/src/utils/data-utils.ts +++ b/src/utils/data-utils.ts @@ -1,6 +1,7 @@ +const baseUrl = "https://webapp-deployer-api.apps.snowballtools.com"; + export const fetchAllStatuses = async () => { - let url = "http://localhost:9555" - const res = await fetch(url); + const res = await fetch(baseUrl); if (!res.ok) { throw new Error('Network response was not ok') } @@ -12,10 +13,10 @@ export const fetchLogs = async (id: string) => { if (!id) { return ""; } - let url = `http://localhost:9555/log/${id}` + let url = `${baseUrl}/log/${id}` const res = await fetch(url); if (!res.ok) { throw new Error('Network response was not ok') } return await res.text(); -} \ No newline at end of file +}