update clashmeta core, Imporve UI, merge PR, reset icons, fix CI

This commit is contained in:
wonfen
2023-11-28 07:49:44 +08:00
parent e7b04a89e2
commit ac1fa7209c
57 changed files with 298 additions and 117 deletions

View File

@@ -23,11 +23,13 @@ export const BasePage: React.FC<Props> = (props) => {
{header}
</header>
<section>
<div className="base-content" style={contentStyle} data-windrag>
{children}
</div>
</section>
<div className="base-container">
<section>
<div className="base-content" style={contentStyle} data-windrag>
{children}
</div>
</section>
</div>
</div>
</BaseErrorBoundary>
);

View File

@@ -10,20 +10,24 @@ export const LayoutItem = (props: LinkProps) => {
const navigate = useNavigate();
return (
<ListItem sx={{ py: 0.5, maxWidth: 250, mx: "auto" }}>
<ListItem
sx={{ py: 0.5, maxWidth: 250, mx: "auto", padding: "4px 0px 4px 2px" }}
>
<ListItemButton
selected={!!match}
sx={[
{
borderRadius: 2,
borderTopLeftRadius: 18,
borderBottomLeftRadius: 18,
textAlign: "center",
"& .MuiListItemText-primary": { color: "text.secondary" },
},
({ palette: { mode, primary } }) => {
const bgcolor =
/* const bgcolor =
mode === "light"
? alpha(primary.main, 0.15)
: alpha(primary.main, 0.35);
: alpha(primary.main, 0.35); */
const bgcolor = mode === "light" ? "#ffffff" : "#0E1621";
const color = mode === "light" ? primary.main : primary.light;
return {

View File

@@ -84,7 +84,7 @@ export const useCustomTheme = () => {
}
// css
const backgroundColor = mode === "light" ? "#ffffff" : "#121212";
const backgroundColor = mode === "light" ? "#ffffff" : "#0E1621";
const selectColor = mode === "light" ? "#f5f5f5" : "#d5d5d5";
const scrollColor = mode === "light" ? "#90939980" : "#54545480";

View File

@@ -78,7 +78,7 @@ export const EditorViewer = (props: Props) => {
<DialogTitle>{t("Edit File")}</DialogTitle>
<DialogContent sx={{ width: "95%", pb: 1, userSelect: "text" }}>
<div style={{ width: "100%", height: "420px" }} ref={editorRef} />
<div style={{ width: "100%", height: "500px" }} ref={editorRef} />
</DialogContent>
<DialogActions>

View File

@@ -35,9 +35,9 @@ export const useRenderList = (mode: string) => {
// 自适应
if (col >= 6 || col <= 0) {
if (width > 1450) col = 5;
else if (width > 1024) col = 4;
else if (width > 900) col = 3;
if (width > 1450) col = 4;
else if (width > 1024) col = 3;
else if (width > 900) col = 2;
else if (width >= 600) col = 2;
else col = 1;
}

View File

@@ -18,10 +18,11 @@ import { closeAllConnections } from "@/services/api";
import { grantPermission } from "@/services/cmds";
import getSystem from "@/utils/get-system";
const VALID_CORE = [
/* const VALID_CORE = [
{ name: "Clash", core: "clash" },
{ name: "Clash Meta", core: "clash-meta" },
];
]; */
const VALID_CORE = [{ name: "Clash Meta", core: "clash-meta" }];
const OS = getSystem();
@@ -91,7 +92,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
contentSx={{
pb: 0,
width: 320,
height: 200,
height: 90,
overflowY: "auto",
userSelect: "text",
marginTop: "-8px",
@@ -111,7 +112,7 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
<ListItemText primary={each.name} secondary={`/${each.core}`} />
{(OS === "macos" || OS === "linux") && (
<IconButton
/* <IconButton
color="inherit"
size="small"
edge="end"
@@ -122,7 +123,19 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
}}
>
<Lock fontSize="inherit" />
</IconButton>
</IconButton> */
<Button
variant="outlined"
size="small"
title={t("Tun mode requires")}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
onGrant(each.core);
}}
>
{t("Grant")}
</Button>
)}
</ListItemButton>
))}

View File

@@ -29,8 +29,7 @@ const SettingVerge = ({ onError }: Props) => {
const { t } = useTranslation();
const { verge, patchVerge, mutateVerge } = useVerge();
const { theme_mode, language } = verge ?? {};
const { theme_mode, language, tray_event } = verge ?? {};
const configRef = useRef<DialogRef>(null);
const hotkeyRef = useRef<DialogRef>(null);
const miscRef = useRef<DialogRef>(null);
@@ -91,6 +90,24 @@ const SettingVerge = ({ onError }: Props) => {
</GuardState>
</SettingItem>
{OS !== "linux" && (
<SettingItem label={t("Tray Click Event")}>
<GuardState
value={tray_event ?? "main_window"}
onCatch={onError}
onFormat={(e: any) => e.target.value}
onChange={(e) => onChangeData({ tray_event: e })}
onGuard={(e) => patchVerge({ tray_event: e })}
>
<Select size="small" sx={{ width: 140, "> div": { py: "7.5px" } }}>
<MenuItem value="main_window">{t("Show Main Window")}</MenuItem>
<MenuItem value="system_proxy">{t("System Proxy")}</MenuItem>
<MenuItem value="tun_mode">{t("Tun Mode")}</MenuItem>
</Select>
</GuardState>
</SettingItem>
)}
<SettingItem label={t("Theme Setting")}>
<IconButton
color="inherit"