Skip to content

Commit

Permalink
clipboard text (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Feb 5, 2025
1 parent 3261c4c commit 98aae8f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
33 changes: 32 additions & 1 deletion ui/src/AccessPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import {Node} from "@xyflow/react";
import {Button, Grid2, Tooltip, Typography} from "@mui/material";
import AccessIcon from "@mui/icons-material/Lan";
import useApiConsoleStore from "./model/store.ts";
import {useEffect, useState} from "react";
import React, {useEffect, useState} from "react";
import {Frontend} from "./api";
import DeleteIcon from "@mui/icons-material/Delete";
import PropertyTable from "./PropertyTable.tsx";
import ReleaseAccessModal from "./ReleaseAccessModal.tsx";
import {getMetadataApi} from "./model/api.ts";
import ClipboardText from "./ClipboardText.tsx";

interface AccessPanelProps {
access: Node;
Expand Down Expand Up @@ -38,6 +39,36 @@ const AccessPanel = ({ access }: AccessPanelProps) => {
}, [access]);

const customProperties = {
bindAddress: row => <>
<Grid2 container sx={{ flexGrow: 1 }} alignItems="center">
<Grid2 display="flex" justifyContent="left">
<span>{row.value}</span>
</Grid2>
<Grid2 display="flex" justifyContent="right" sx={{ flexGrow: 1 }}>
<ClipboardText text={row.value} />
</Grid2>
</Grid2>
</>,
frontendToken: row => <>
<Grid2 container sx={{ flexGrow: 1 }} alignItems="center">
<Grid2 display="flex" justifyContent="left">
<span>{row.value}</span>
</Grid2>
<Grid2 display="flex" justifyContent="right" sx={{ flexGrow: 1 }}>
<ClipboardText text={row.value} />
</Grid2>
</Grid2>
</>,
shareToken: row => <>
<Grid2 container sx={{ flexGrow: 1 }} alignItems="center">
<Grid2 display="flex" justifyContent="left">
<span>{row.value}</span>
</Grid2>
<Grid2 display="flex" justifyContent="right" sx={{ flexGrow: 1 }}>
<ClipboardText text={row.value} />
</Grid2>
</Grid2>
</>,
createdAt: row => new Date(row.value).toLocaleString(),
updatedAt: row => new Date(row.value).toLocaleString(),
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/SharePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const SharePanel = ({ share }: SharePanelProps) => {
</Grid2>
</>,
reserved: row => row.value ? "reserved" : "ephemeral",
token: row => <>
shareToken: row => <>
<Grid2 container sx={{ flexGrow: 1 }} alignItems="center">
<Grid2 display="flex" justifyContent="left">
<span>{row.value}</span>
Expand Down

0 comments on commit 98aae8f

Please sign in to comment.