mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
feat: Support proxy group icon
This commit is contained in:
parent
73a597e3e5
commit
4fa19006ad
@ -37,6 +37,18 @@ export const ProxyRender = (props: RenderProps) => {
|
|||||||
dense
|
dense
|
||||||
onClick={() => onHeadState(group.name, { open: !headState?.open })}
|
onClick={() => onHeadState(group.name, { open: !headState?.open })}
|
||||||
>
|
>
|
||||||
|
{group.icon && group.icon.trim().startsWith("http") && (
|
||||||
|
<img src={group.icon} height="40px" style={{ marginRight: "8px" }} />
|
||||||
|
)}
|
||||||
|
{group.icon && group.icon.trim().startsWith("data") && (
|
||||||
|
<img src={group.icon} height="40px" style={{ marginRight: "8px" }} />
|
||||||
|
)}
|
||||||
|
{group.icon && group.icon.trim().startsWith("<svg") && (
|
||||||
|
<img
|
||||||
|
src={`data:image/svg+xml;base64,${btoa(group.icon)}`}
|
||||||
|
height="40px"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={group.name}
|
primary={group.name}
|
||||||
secondary={
|
secondary={
|
||||||
|
@ -102,11 +102,15 @@ export const TestItem = (props: Props) => {
|
|||||||
{...attributes}
|
{...attributes}
|
||||||
{...listeners}
|
{...listeners}
|
||||||
>
|
>
|
||||||
{icon ? (
|
{icon && icon.trim() !== "" ? (
|
||||||
<Box sx={{ display: "flex", justifyContent: "center" }}>
|
<Box sx={{ display: "flex", justifyContent: "center" }}>
|
||||||
{icon?.trim().startsWith("http") ? (
|
{icon.trim().startsWith("http") && (
|
||||||
<img src={icon} height="40px" />
|
<img src={icon} height="40px" style={{ marginRight: "8px" }} />
|
||||||
) : (
|
)}
|
||||||
|
{icon.trim().startsWith("data") && (
|
||||||
|
<img src={icon} height="40px" style={{ marginRight: "8px" }} />
|
||||||
|
)}
|
||||||
|
{icon.trim().startsWith("<svg") && (
|
||||||
<img
|
<img
|
||||||
src={`data:image/svg+xml;base64,${btoa(icon)}`}
|
src={`data:image/svg+xml;base64,${btoa(icon)}`}
|
||||||
height="40px"
|
height="40px"
|
||||||
|
1
src/services/types.d.ts
vendored
1
src/services/types.d.ts
vendored
@ -53,6 +53,7 @@ interface IProxyItem {
|
|||||||
all?: string[];
|
all?: string[];
|
||||||
now?: string;
|
now?: string;
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
|
icon?: string;
|
||||||
provider?: string; // 记录是否来自provider
|
provider?: string; // 记录是否来自provider
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user