Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(gui): gui structure change to make adding more ledgers easier #3083

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cacti-ledger-browser-react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script type="module" src="/src/main/typescript/main.tsx"></script>
</body>

</html>
266 changes: 0 additions & 266 deletions packages/cacti-ledger-browser-react/src/main.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import StatusPage from "./pages/status-page";

const appConfig = {
name: "Cacti",
url: "cacti",
menuEntries: [
{
title: "Plugin Status",
url: "/",
},
],
routes: [
{
path: "/",
component: StatusPage,
},
],
};

export default appConfig;
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { useEffect, useState } from "react";
import { supabase } from "../../../common/supabase-client";
import CardWrapper from "../../../components/ui/CardWrapper";

function StatusPage() {
const [getPluginStatus, setPluginStatuse] = useState<unknown[]>([]);

const fetchPluginStatus = async () => {
try {
const { data, error } = await supabase.from("plugin_status").select();
if (error) {
throw new Error(
`Could not get plugin statuses from the DB: ${error.message}`,
);
}

if (data) {
setPluginStatuse(
data.map((p) => {
return {
...p,
is_schema_initialized: p.is_schema_initialized
? "Setup complete"
: "No schema",
};
}),
);
}
} catch (error) {
console.error("Error when fetching plugin statuses:", error);
}
};

useEffect(() => {
fetchPluginStatus();
}, []);

return (
<div>
<CardWrapper
columns={
{
schema: [
{ display: "Name", objProp: ["name"] },
{ display: "Instance ID", objProp: ["last_instance_id"] },
{ display: "Status", objProp: ["is_schema_initialized"] },
{ display: "Created at", objProp: ["created_at"] },
{ display: "Connected at", objProp: ["last_connected_at"] },
],
} as any
}
data={getPluginStatus}
title={"Persistence Plugins"}
display={"All"}
trimmed={false}
></CardWrapper>
</div>
);
}

export default StatusPage;
Loading
Loading