Skip to content

Commit

Permalink
panel improvements (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Jan 22, 2025
1 parent 3751d0b commit 8da300b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ui100/src/ApiConsole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const ApiConsole = ({ logout }: ApiConsoleProps) => {
<Grid2 size="grow">
{mainPanel}
</Grid2>
{sidePanel ? <Grid2 size={4}>{sidePanel}</Grid2> : null}
{sidePanel ? <Grid2 size={5}>{sidePanel}</Grid2> : null}
</Grid2>
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion ui100/src/EnvironmentPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ const EnvironmentPanel = ({environment}: EnvironmentPanelProps) => {
}

const labels = {
zId: "OpenZiti Service"
createdAt: "Created",
updatedAt: "Updated"
}

useEffect(() => {
Expand All @@ -98,6 +99,7 @@ const EnvironmentPanel = ({environment}: EnvironmentPanelProps) => {
let env = d.environment!;
delete env.activity;
delete env.limited;
delete env.zId;
setDetail(env);
})
.catch(e => {
Expand Down
20 changes: 15 additions & 5 deletions ui100/src/SharePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ShareIcon from "@mui/icons-material/Share";
import {Configuration, MetadataApi, Share} from "./api";
import {useEffect, useState} from "react";
import PropertyTable from "./PropertyTable.tsx";
import SecretToggle from "./SecretToggle.tsx";
import useStore from "./model/store.ts";
import DeleteIcon from "@mui/icons-material/Delete";

Expand All @@ -17,10 +16,17 @@ const SharePanel = ({ share }: SharePanelProps) => {
const [detail, setDetail] = useState<Share>(null);

const customProperties = {
zId: row => <SecretToggle secret={row.value} />,
createdAt: row => new Date(row.value).toLocaleString(),
updatedAt: row => new Date(row.value).toLocaleString(),
frontendEndpoint: row => <a href={row.value} target="_">{row.value}</a>
frontendEndpoint: row => <a href={row.value} target="_">{row.value}</a>,
reserved: row => row.value ? "reserved" : "ephemeral"
}

const labels = {
backendProxyEndpoint: "Target",
createdAt: "Created",
reserved: "Reservation",
updatedAt: "Updated"
}

useEffect(() => {
Expand All @@ -34,7 +40,11 @@ const SharePanel = ({ share }: SharePanelProps) => {
.then(d => {
delete d.activity;
delete d.limited;
delete d.reserved;
delete d.zId;
if(d.shareMode === "private") {
delete d.frontendEndpoint;
delete d.frontendSelection;
}
setDetail(d);
})
.catch(e => {
Expand All @@ -55,7 +65,7 @@ const SharePanel = ({ share }: SharePanelProps) => {
</Grid2>
<Grid2 container sx={{ flexGrow: 1 }}>
<Grid2 display="flex">
<PropertyTable object={detail} custom={customProperties}/>
<PropertyTable object={detail} custom={customProperties} labels={labels} />
</Grid2>
</Grid2>
</Typography>
Expand Down

0 comments on commit 8da300b

Please sign in to comment.