Explorar el Código

feat: Show current proxy for group node

#444
MystiPanda hace 1 año
padre
commit
8e4d7e989b
Se han modificado 2 ficheros con 39 adiciones y 2 borrados
  1. 36 1
      src/components/proxy/proxy-item-mini.tsx
  2. 3 1
      src/components/proxy/proxy-item.tsx

+ 36 - 1
src/components/proxy/proxy-item-mini.tsx

@@ -95,7 +95,32 @@ export const ProxyItemMini = (props: Props) => {
         </Typography>
 
         {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 && (
               <TypeBox component="span">{proxy.provider}</TypeBox>
             )}
@@ -181,6 +206,16 @@ const TypeBox = styled(Box)(({ theme: { palette, typography } }) => ({
   fontSize: 10,
   fontFamily: typography.fontFamily,
   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",
   lineHeight: 1.25,
 }));

+ 3 - 1
src/components/proxy/proxy-item.tsx

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