Skip to content

Commit

Permalink
fix: latency not showing up for db status and minor ui improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
AshutoshDash1999 committed Dec 15, 2024
1 parent 3f72c94 commit c02ee8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions apps/status/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ const Page = () => {
};

useEffect(() => {
const BASE_API =
process.env.NODE_ENV === "production"
? "https://api.plura.pro"
: "http://localhost:3001";
const BASE_API = "https://api.plura.pro";
// const BASE_API =
// process.env.NODE_ENV === "production"
// ? "https://api.plura.pro"
// : "http://localhost:3001";

// fetch web server status
const fetchStatusData = async () => {
Expand Down Expand Up @@ -126,25 +127,25 @@ const Page = () => {
const createdData = todayStatus?.map((status: StatusT) => ({
status: getServiceStatus(status?.latencies?.MASS_CREATED),
timestamp: status?.timestamp,
latency: status?.latencies?.MASS_CREATED,
latency: status?.totalLatency,
}));

const readData = todayStatus?.map((status: StatusT) => ({
status: getServiceStatus(status?.latencies?.MASS_READ),
timestamp: status?.timestamp,
latency: status?.latencies?.MASS_READ,
latency: status?.totalLatency,
}));

const updatedData = todayStatus?.map((status: StatusT) => ({
status: getServiceStatus(status?.latencies?.MASS_UPDATE),
timestamp: status?.timestamp,
latency: status?.latencies?.MASS_UPDATE,
latency: status?.totalLatency,
}));

const deletedData = todayStatus?.map((status: StatusT) => ({
status: getServiceStatus(status?.latencies?.MASS_DELETE),
timestamp: status?.timestamp,
latency: status?.latencies?.MASS_DELETE,
latency: status?.totalLatency,
}));

setCreatedData(createdData);
Expand Down
2 changes: 1 addition & 1 deletion apps/status/components/custom/status.card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function StatusCard({
if (percentage < 10) {
return (
<>
<IconWifi className="size-5 mr-2 text-red-500" /> Down
<IconWifi className="size-5 mr-2 text-neutral-500" /> Fetching ...
</>
);
} else if (percentage < 20) {
Expand Down

0 comments on commit c02ee8f

Please sign in to comment.