Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktaubeneck committed Jul 17, 2024
1 parent 801548f commit 0c48568
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
8 changes: 2 additions & 6 deletions server/app/query/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function Page() {
) => {
setDataByQuery((prev) => {
let _prev = prev;
if (!prev.hasOwnProperty(query.uuid)) {
if (!Object.hasOwn(prev, query.uuid)) {
// if queryID not in dataByQuery yet,
// add initial status before updating value
_prev = {
Expand Down Expand Up @@ -132,9 +132,6 @@ export default function Page() {
if (statusEvent === null) {
return <></>;
}
const status = statusEvent.status;
const startTime = statusEvent.startTime;
const endTime = statusEvent.endTime;

return (
<div
Expand Down Expand Up @@ -164,7 +161,6 @@ export default function Page() {
if (statusEvent === null) {
return <></>;
}
const status = statusEvent.status;

return (
<div
Expand All @@ -175,7 +171,7 @@ export default function Page() {
{remoteServer.remoteServerNameStr} Status
</dt>
<dd>
<StatusPill status={status} />
<StatusPill status={statusEvent.status} />
</dd>
</div>
);
Expand Down
7 changes: 0 additions & 7 deletions server/app/query/view/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,15 @@ import {
LogViewer,
} from "@/app/query/view/[id]/components";
import {
Status,
StatusEvent,
ServerLog,
RemoteServer,
RemoteServerNames,
RemoteServersType,
IPARemoteServers, //hack until the queryId is stored in a DB
StatusByRemoteServer,
StatsByRemoteServer,
StartTimeByRemoteServer,
EndTimeByRemoteServer,
StatusEventByRemoteServer,
initialStatusByRemoteServer,
initialStatsByRemoteServer,
initialStartTimeByRemoteServer,
initialEndTimeByRemoteServer,
initialStatusEventByRemoteServer,
} from "@/app/query/servers";
import { StatsComponent } from "@/app/query/view/[id]/charts";
Expand Down
6 changes: 6 additions & 0 deletions server/data/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export async function getQuery(displayId: string): Promise<Query> {

if (error) {
console.error(error);
throw new Error(
`Error fetching query with displayId= ${displayId}: ${error.message}`,
);
} else if (status === 200) {
if (data) {
return processQueryData(data);
Expand All @@ -67,6 +70,9 @@ export async function getQueryByUUID(uuid: string): Promise<Query> {

if (error) {
console.error(error);
throw new Error(
`Error fetching query with UUID= ${uuid}: ${error.message}`,
);
} else if (status === 200) {
if (data) {
return processQueryData(data);
Expand Down

0 comments on commit 0c48568

Please sign in to comment.