Skip to content

Commit 2e669a0

Browse files
committed
feat(server-detail): add toggle for server detail summary display
1 parent edea609 commit 2e669a0

File tree

6 files changed

+56
-42
lines changed

6 files changed

+56
-42
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ NEXT_PUBLIC_Links='[{"link":"https://github.com/hamster1963/nezha-dash","name":"
1616
NEXT_PUBLIC_DisableIndex=false
1717
NEXT_PUBLIC_ShowTagCount=false
1818
NEXT_PUBLIC_ShowIpInfo=false
19+
NEXT_PUBLIC_ShowServerDetailSummary=true
1920

2021
# Komari Panel Compatibility
2122
# Enable Komari panel support instead of Nezha monitoring

app/(main)/server/[id]/page.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export default function Page({ params }: PageProps) {
3030
const disabledTabs: TabType[] = disableNetworkTab ? ["Network"] : []
3131
const [currentTab, setCurrentTab] = useState<TabType>(tabs[0])
3232

33+
const showServerDetailSummary = getEnv("NEXT_PUBLIC_ShowServerDetailSummary") === "true"
34+
3335
// Handle tab switching - prevent switching to disabled tabs
3436
const handleTabSwitch = (tab: string) => {
3537
if (!disabledTabs.includes(tab as TabType)) {
@@ -75,9 +77,11 @@ export default function Page({ params }: PageProps) {
7577
</nav>
7678

7779
{/* detail lists */}
78-
<section>
79-
<ServerDetailSummary server_id={serverId} />
80-
</section>
80+
{showServerDetailSummary && (
81+
<section>
82+
<ServerDetailSummary server_id={serverId} />
83+
</section>
84+
)}
8185

8286
{tabContent[currentTab]}
8387
</main>

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
33
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
44
"files": {
55
"ignoreUnknown": false,

0 commit comments

Comments
 (0)