feat: Show current proxy for group node

#444
This commit is contained in:
MystiPanda 2024-02-24 13:09:53 +08:00
parent 603c6b826c
commit 8e4d7e989b
No known key found for this signature in database
GPG Key ID: 47D0F0284DC57888
2 changed files with 39 additions and 2 deletions

View File

@ -95,7 +95,32 @@ export const ProxyItemMini = (props: Props) => {
</Typography> </Typography>
{showType && ( {showType && (
<Box sx={{ display: "flex", flexWrap: "nowrap", flex: "none" }}> <Box
sx={{
display: "flex",
flexWrap: "nowrap",
flex: "none",
marginTop: "4px",
}}
>
{proxy.now && (
<Typography
variant="body2"
component="div"
color="text.secondary"
sx={{
display: "block",
textOverflow: "ellipsis",
wordBreak: "break-all",
overflow: "hidden",
whiteSpace: "nowrap",
fontSize: "0.75rem",
marginRight: "8px",
}}
>
{proxy.now}
</Typography>
)}
{!!proxy.provider && ( {!!proxy.provider && (
<TypeBox component="span">{proxy.provider}</TypeBox> <TypeBox component="span">{proxy.provider}</TypeBox>
)} )}
@ -181,6 +206,16 @@ const TypeBox = styled(Box)(({ theme: { palette, typography } }) => ({
fontSize: 10, fontSize: 10,
fontFamily: typography.fontFamily, fontFamily: typography.fontFamily,
marginRight: "4px", marginRight: "4px",
marginTop: "auto",
padding: "0 2px",
lineHeight: 1.25,
}));
const TypeTypo = styled(Box)(({ theme: { palette, typography } }) => ({
display: "inline-block",
fontSize: 10,
fontFamily: typography.fontFamily,
marginRight: "4px",
padding: "0 2px", padding: "0 2px",
lineHeight: 1.25, lineHeight: 1.25,
})); }));

View File

@ -100,7 +100,9 @@ export const ProxyItem = (props: Props) => {
secondary={ secondary={
<> <>
<span style={{ marginRight: 4 }}>{proxy.name}</span> <span style={{ marginRight: 4 }}>{proxy.name}</span>
{showType && proxy.now && (
<TypeBox component="span">{proxy.now}</TypeBox>
)}
{showType && !!proxy.provider && ( {showType && !!proxy.provider && (
<TypeBox component="span">{proxy.provider}</TypeBox> <TypeBox component="span">{proxy.provider}</TypeBox>
)} )}