-
Notifications
You must be signed in to change notification settings - Fork 7
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
X-Admin app improvements #761
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
78f055a
adopt hash router and react query
Velua 36bb7a1
remove usePollJson
Velua 2c3d9b6
remove stale logic
Velua 42c6da0
add conect page and logic
Velua d61ef13
a
Velua e96466d
update floating words
Velua 88b5110
working
Velua d5fb92b
add alert and accordion
Velua 65645a4
add multi-steps loading
Velua 3e2048e
prevent default
Velua f96ef92
Merge remote-tracking branch 'origin/main' into x-admin-wizard
Velua dbdee91
add toast and installation progression
Velua 0fb4c2a
move chain interactions to single file
Velua 816b460
prevent default
Velua 116cb7d
adopt tabs list
Velua 7c21135
pinning on logs page
Velua 2ec24c3
add changes
Velua 48c1452
clear up files and create psi packages
Velua cf25ef1
fix bug in additional dependencies and adopt dev/prod defaults
Velua 53af758
fix connection bug
Velua 7f5ef95
cosmetic changes
Velua 6f8b89c
fix bad link
Velua 13633bf
render disconnect only on transient connections
Velua 39ac4c6
fix accordion formatting
Velua b3cf3e8
Merge remote-tracking branch 'origin/main' into x-admin-wizard
Velua f317dcc
fix double entry bug
Velua bb17a34
adopt DevDefault in boot
Velua 14d5a7b
Merge remote-tracking branch 'origin/main' into x-admin-wizard
Velua File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,17 @@ | ||
import { useEffect, useState } from "react"; | ||
|
||
import { PsinodeConfig } from "./configuration/interfaces"; | ||
import { NavHeader } from "./components/nav-header"; | ||
import { StatusBanner } from "./components/status-banner"; | ||
import { BootPage } from "./boot-wizard/boot-page"; | ||
import { ConfigurationPage } from "./configuration/configuration-page"; | ||
import { usePollJson } from "./hooks"; | ||
import { LogsPage } from "./log/logs-page"; | ||
import { DashboardPage } from "./dashboard/dashboard-page"; | ||
import { PeersPage } from "./peers/peers-page"; | ||
import { Peer } from "./peers/interfaces"; | ||
|
||
const MENU_ITEMS = ["Dashboard", "Peers", "Logs", "Configuration", "Boot"]; | ||
import { Outlet } from "react-router-dom"; | ||
|
||
function App() { | ||
const [activeItem, setActiveItem] = useState(""); | ||
|
||
useEffect(() => { | ||
if (!activeItem) { | ||
setActiveItem(getPageTab()); | ||
} | ||
window.addEventListener("hashchange", () => { | ||
setActiveItem(getPageTab()); | ||
}); | ||
return () => window.removeEventListener("hashchange", () => {}); | ||
}, []); | ||
|
||
const [peers, peersError, refetchPeers] = usePollJson<Peer[]>( | ||
"/native/admin/peers" | ||
); | ||
|
||
const [config, configError, refetchConfig] = usePollJson<PsinodeConfig>( | ||
"/native/admin/config" | ||
); | ||
const [status, statusError] = usePollJson<string[]>("/native/admin/status"); | ||
|
||
let activeMenuItems = ["Dashboard", "Peers", "Logs", "Configuration"]; | ||
if (status && status.includes("needgenesis")) { | ||
activeMenuItems.push("Boot"); | ||
} | ||
|
||
return ( | ||
<div className="mx-auto max-w-screen-xl"> | ||
<NavHeader menuItems={activeMenuItems} activeItem={activeItem} /> | ||
|
||
<StatusBanner | ||
status={status} | ||
statusError={statusError} | ||
peersError={peersError} | ||
configError={configError} | ||
/> | ||
{activeItem === "Dashboard" ? ( | ||
<DashboardPage /> | ||
) : activeItem === "Logs" ? ( | ||
<LogsPage /> | ||
) : activeItem === "Peers" ? ( | ||
<PeersPage | ||
config={config} | ||
peers={peers || []} | ||
refetchConfig={refetchConfig} | ||
refetchPeers={refetchPeers} | ||
/> | ||
) : activeItem === "Configuration" ? ( | ||
<ConfigurationPage | ||
config={config} | ||
refetchConfig={refetchConfig} | ||
/> | ||
) : activeItem === "Boot" ? ( | ||
<BootPage config={config} refetchConfig={refetchConfig} /> | ||
) : null} | ||
<NavHeader /> | ||
<div className="py-2"> | ||
<StatusBanner /> | ||
</div> | ||
<Outlet /> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; | ||
|
||
const getPageTab = () => { | ||
const tab = window.location.hash.substring(1) || "Unknown"; | ||
return MENU_ITEMS.includes(tab) ? tab : "Dashboard"; | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
psibase boot
needs to be updatedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tester as well, yeah?
psibase/rust/psibase/src/main.rs
Line 646 in 98f3198
and
psibase/rust/psibase/src/tester.rs
Line 62 in 98f3198