mirror of
https://github.com/khairul169/garage-webui.git
synced 2025-04-28 14:59:31 +07:00
Compare commits
3 Commits
ccfa2cde25
...
b53859ae23
Author | SHA1 | Date | |
---|---|---|---|
b53859ae23 | |||
8728108d18 | |||
0d844c7ac6 |
10
README.md
10
README.md
@ -39,10 +39,10 @@ services:
|
|||||||
- ./data:/var/lib/garage/data
|
- ./data:/var/lib/garage/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 3900:3900
|
- 3900:3900
|
||||||
- 3901:3901
|
- 3901:3901
|
||||||
- 3902:3903
|
- 3902:3903
|
||||||
- 3903:3903
|
- 3903:3903
|
||||||
|
|
||||||
webui:
|
webui:
|
||||||
image: khairul169/garage-webui:latest
|
image: khairul169/garage-webui:latest
|
||||||
@ -62,7 +62,7 @@ services:
|
|||||||
Get the latest binary from the [release page](https://github.com/khairul169/garage-webui/releases/latest) according to your OS architecture. For example:
|
Get the latest binary from the [release page](https://github.com/khairul169/garage-webui/releases/latest) according to your OS architecture. For example:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ wget -O garage-webui https://github.com/khairul169/garage-webui/releases/download/1.0.5/garage-webui-v1.0.5-linux-amd64
|
$ wget -O garage-webui https://github.com/khairul169/garage-webui/releases/download/1.0.6/garage-webui-v1.0.6-linux-amd64
|
||||||
$ chmod +x garage-webui
|
$ chmod +x garage-webui
|
||||||
$ sudo cp garage-webui /usr/local/bin
|
$ sudo cp garage-webui /usr/local/bin
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "garage-webui",
|
"name": "garage-webui",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:client": "vite",
|
"dev:client": "vite",
|
||||||
@ -48,4 +48,4 @@
|
|||||||
"typescript-eslint": "^8.0.0",
|
"typescript-eslint": "^8.0.0",
|
||||||
"vite": "^5.4.0"
|
"vite": "^5.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,8 @@ const AssignNodeDialog = () => {
|
|||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
const zoneList = useMemo(() => {
|
const zoneList = useMemo(() => {
|
||||||
const list = cluster?.nodes
|
const nodes = cluster?.nodes || cluster?.knownNodes || [];
|
||||||
|
const list = nodes
|
||||||
.flatMap((i) => {
|
.flatMap((i) => {
|
||||||
const role = layout?.roles.find((role) => role.id === i.id);
|
const role = layout?.roles.find((role) => role.id === i.id);
|
||||||
const staged = layout?.stagedRoleChanges.find(
|
const staged = layout?.stagedRoleChanges.find(
|
||||||
@ -83,7 +84,8 @@ const AssignNodeDialog = () => {
|
|||||||
}, [cluster, layout]);
|
}, [cluster, layout]);
|
||||||
|
|
||||||
const tagsList = useMemo(() => {
|
const tagsList = useMemo(() => {
|
||||||
const list = cluster?.nodes
|
const nodes = cluster?.nodes || cluster?.knownNodes || [];
|
||||||
|
const list = nodes
|
||||||
.flatMap((i) => {
|
.flatMap((i) => {
|
||||||
const role = layout?.roles.find((role) => role.id === i.id);
|
const role = layout?.roles.find((role) => role.id === i.id);
|
||||||
const staged = layout?.stagedRoleChanges.find(
|
const staged = layout?.stagedRoleChanges.find(
|
||||||
|
@ -268,7 +268,9 @@ const NodesList = ({ nodes }: NodeListProps) => {
|
|||||||
|
|
||||||
<Dropdown
|
<Dropdown
|
||||||
end
|
end
|
||||||
vertical={idx >= items.length - 2 ? "top" : "bottom"}
|
vertical={
|
||||||
|
idx > 2 && idx >= items.length - 2 ? "top" : "bottom"
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Dropdown.Toggle button={false}>
|
<Dropdown.Toggle button={false}>
|
||||||
<Button shape="circle" color="ghost">
|
<Button shape="circle" color="ghost">
|
||||||
|
@ -2,9 +2,22 @@ import Page from "@/context/page-context";
|
|||||||
import { useClusterStatus } from "./hooks";
|
import { useClusterStatus } from "./hooks";
|
||||||
import { Card } from "react-daisyui";
|
import { Card } from "react-daisyui";
|
||||||
import NodesList from "./components/nodes-list";
|
import NodesList from "./components/nodes-list";
|
||||||
|
import { useMemo } from "react";
|
||||||
|
|
||||||
const ClusterPage = () => {
|
const ClusterPage = () => {
|
||||||
const { data } = useClusterStatus();
|
const { data } = useClusterStatus();
|
||||||
|
const nodes = useMemo(() => {
|
||||||
|
if (!data) return [];
|
||||||
|
|
||||||
|
if (Array.isArray(data.knownNodes)) {
|
||||||
|
return data.knownNodes.map((node) => ({
|
||||||
|
...node,
|
||||||
|
role: data.layout?.roles.find((role) => role.id === node.id),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
return data.nodes || [];
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
@ -18,7 +31,10 @@ const ClusterPage = () => {
|
|||||||
<DetailItem title="Version" value={data?.garageVersion} />
|
<DetailItem title="Version" value={data?.garageVersion} />
|
||||||
{/* <DetailItem title="Rust version" value={data?.rustVersion} /> */}
|
{/* <DetailItem title="Rust version" value={data?.rustVersion} /> */}
|
||||||
<DetailItem title="DB engine" value={data?.dbEngine} />
|
<DetailItem title="DB engine" value={data?.dbEngine} />
|
||||||
<DetailItem title="Layout version" value={data?.layoutVersion} />
|
<DetailItem
|
||||||
|
title="Layout version"
|
||||||
|
value={data?.layoutVersion || data?.layout?.version}
|
||||||
|
/>
|
||||||
</Card.Body>
|
</Card.Body>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@ -26,7 +42,7 @@ const ClusterPage = () => {
|
|||||||
<Card.Body>
|
<Card.Body>
|
||||||
<Card.Title>Nodes</Card.Title>
|
<Card.Title>Nodes</Card.Title>
|
||||||
|
|
||||||
<NodesList nodes={data?.nodes || []} />
|
<NodesList nodes={nodes} />
|
||||||
</Card.Body>
|
</Card.Body>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,7 +7,9 @@ export type GetStatusResult = {
|
|||||||
rustVersion: string;
|
rustVersion: string;
|
||||||
dbEngine: string;
|
dbEngine: string;
|
||||||
layoutVersion: number;
|
layoutVersion: number;
|
||||||
nodes: Node[];
|
nodes?: Node[];
|
||||||
|
knownNodes?: Node[];
|
||||||
|
layout?: GetClusterLayoutResult;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Node = {
|
export type Node = {
|
||||||
@ -17,9 +19,9 @@ export type Node = {
|
|||||||
hostname: string;
|
hostname: string;
|
||||||
isUp: boolean;
|
isUp: boolean;
|
||||||
lastSeenSecsAgo: number | null;
|
lastSeenSecsAgo: number | null;
|
||||||
draining: boolean;
|
draining?: boolean;
|
||||||
dataPartition: DataPartition;
|
dataPartition?: DataPartition;
|
||||||
metadataPartition: DataPartition;
|
metadataPartition?: DataPartition;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DataPartition = {
|
export type DataPartition = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user