chore: UI adjustment, add translation, fix CI

This commit is contained in:
wonfen 2023-11-22 14:52:14 +08:00
parent 408a4420c9
commit ec50b1d67a
17 changed files with 71 additions and 115 deletions

View File

@ -45,7 +45,7 @@ jobs:
if: startsWith(matrix.os, 'ubuntu-') if: startsWith(matrix.os, 'ubuntu-')
uses: mknejp/delete-release-assets@v1 uses: mknejp/delete-release-assets@v1
with: with:
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
tag: dev tag: dev
fail-if-no-assets: false fail-if-no-assets: false
fail-if-no-release: false fail-if-no-release: false
@ -74,7 +74,7 @@ jobs:
- name: Tauri build - name: Tauri build
uses: tauri-apps/tauri-action@v0 uses: tauri-apps/tauri-action@v0
env: env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with: with:
@ -92,7 +92,7 @@ jobs:
pnpm portable pnpm portable
env: env:
TAG_NAME: dev TAG_NAME: dev
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_WIN_PORTABLE: 1 VITE_WIN_PORTABLE: 1

View File

@ -67,7 +67,7 @@ jobs:
# continue-on-error: true # continue-on-error: true
if: matrix.portable == false if: matrix.portable == false
env: env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with: with:
@ -84,7 +84,7 @@ jobs:
run: | run: |
pnpm portable pnpm portable
env: env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_WIN_PORTABLE: 1 VITE_WIN_PORTABLE: 1
@ -116,4 +116,4 @@ jobs:
- name: Release updater file - name: Release updater file
run: pnpm updater run: pnpm updater
env: env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -28,4 +28,4 @@ jobs:
- name: Release updater file - name: Release updater file
run: pnpm updater run: pnpm updater
env: env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -41,6 +41,7 @@ async function resolveUpdater() {
win64: { signature: "", url: "" }, // compatible with older formats win64: { signature: "", url: "" }, // compatible with older formats
linux: { signature: "", url: "" }, // compatible with older formats linux: { signature: "", url: "" }, // compatible with older formats
darwin: { signature: "", url: "" }, // compatible with older formats darwin: { signature: "", url: "" }, // compatible with older formats
"darwin-aarch64": { signature: "", url: "" },
"darwin-intel": { signature: "", url: "" }, "darwin-intel": { signature: "", url: "" },
"darwin-x86_64": { signature: "", url: "" }, "darwin-x86_64": { signature: "", url: "" },
"linux-x86_64": { signature: "", url: "" }, "linux-x86_64": { signature: "", url: "" },
@ -77,6 +78,16 @@ async function resolveUpdater() {
updateData.platforms["darwin-x86_64"].signature = sig; updateData.platforms["darwin-x86_64"].signature = sig;
} }
// darwin url (aarch)
if (name.endsWith("aarch64.app.tar.gz")) {
updateData.platforms["darwin-aarch64"].url = browser_download_url;
}
// darwin signature (aarch)
if (name.endsWith("aarch64.app.tar.gz.sig")) {
const sig = await getSignature(browser_download_url);
updateData.platforms["darwin-aarch64"].signature = sig;
}
// linux url // linux url
if (name.endsWith(".AppImage.tar.gz")) { if (name.endsWith(".AppImage.tar.gz")) {
updateData.platforms.linux.url = browser_download_url; updateData.platforms.linux.url = browser_download_url;

View File

@ -46,7 +46,7 @@ impl IClashTemp {
map.insert("unified-delay".into(), true.into()); map.insert("unified-delay".into(), true.into());
#[cfg(feature = "default-meta")] #[cfg(feature = "default-meta")]
map.insert("tcp-concurrent".into(), true.into()); map.insert("tcp-concurrent".into(), true.into());
map.insert("ipv6".into(), false.into()); // map.insert("ipv6".into(), false.into());
Self(map) Self(map)
} }

View File

@ -10,7 +10,7 @@
height: 100%; height: 100%;
max-width: 225px; max-width: 225px;
min-width: 125px; min-width: 125px;
padding: 36px 0 28px; padding: 16px 0 8px;
position: relative; position: relative;
flex-direction: column; flex-direction: column;
box-sizing: border-box; box-sizing: border-box;
@ -90,8 +90,8 @@
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
right: 28px; right: 2px;
bottom: 28px; bottom: 10px;
} }
} }
} }

View File

@ -6,7 +6,7 @@
> header { > header {
flex: 0 0 58px; flex: 0 0 58px;
width: 100%; width: 95%;
// max-width: 850px; // max-width: 850px;
margin: 0 auto; margin: 0 auto;
padding-right: 4px; padding-right: 4px;
@ -16,24 +16,19 @@
justify-content: space-between; justify-content: space-between;
} }
.base-container {
height: 100%;
overflow: hidden;
border-radius: var(--border-radius);
> section { > section {
position: relative; position: relative;
flex: 1 1 100%; flex: 1 1 100%;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
padding: 28px 0; padding: 8px 0;
box-sizing: border-box; box-sizing: border-box;
scrollbar-gutter: stable; scrollbar-gutter: stable;
background-color: var(--background-color); // background-color: var(--background-color);
.base-content { .base-content {
width: 90%; width: 95%;
// max-width: 850px; // max-width: 850px;
margin: 0 auto; margin: 0 auto;
animation: baseContentIn 0.3s normal 1 forwards; animation: baseContentIn 0.3s normal 1 forwards;
@ -52,4 +47,3 @@
} }
} }
} }
}

View File

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

View File

@ -15,7 +15,7 @@ export const LayoutItem = (props: LinkProps) => {
selected={!!match} selected={!!match}
sx={[ sx={[
{ {
borderRadius: 8, borderRadius: 2,
textAlign: "center", textAlign: "center",
"& .MuiListItemText-primary": { color: "text.secondary" }, "& .MuiListItemText-primary": { color: "text.secondary" },
}, },

View File

@ -142,19 +142,19 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
</Typography> </Typography>
<FlexBox> <FlexBox>
<Typography className="label">Enable:</Typography> <Typography className="label">{t("Enable status")}</Typography>
<Typography className="value"> <Typography className="value">
{(!!sysproxy?.enable).toString()} {(!!sysproxy?.enable).toString()}
</Typography> </Typography>
</FlexBox> </FlexBox>
<FlexBox> <FlexBox>
<Typography className="label">Server:</Typography> <Typography className="label">{t("Server Addr")}</Typography>
<Typography className="value">{sysproxy?.server || "-"}</Typography> <Typography className="value">{sysproxy?.server || "-"}</Typography>
</FlexBox> </FlexBox>
<FlexBox> <FlexBox>
<Typography className="label">Bypass:</Typography> <Typography className="label">{t("Bypass")}</Typography>
<Typography className="value">{sysproxy?.bypass || "-"}</Typography> <Typography className="value">{sysproxy?.bypass || "-"}</Typography>
</FlexBox> </FlexBox>
</Box> </Box>

View File

@ -7,9 +7,6 @@
"Label-Settings": "Settings", "Label-Settings": "Settings",
"Connections": "Connections", "Connections": "Connections",
"Upload Total": "Upload Total",
"Download Total": "Download Total",
"Active Connections": "Active Connections",
"Logs": "Logs", "Logs": "Logs",
"Clear": "Clear", "Clear": "Clear",
"Proxies": "Proxies", "Proxies": "Proxies",
@ -52,6 +49,7 @@
"Filter": "Filter", "Filter": "Filter",
"Filter conditions": "Filter conditions", "Filter conditions": "Filter conditions",
"Refresh profiles": "Refresh profiles", "Refresh profiles": "Refresh profiles",
"Rules": "Rules",
"Type": "Type", "Type": "Type",
"Name": "Name", "Name": "Name",
@ -80,6 +78,9 @@
"Proxy Guard": "Proxy Guard", "Proxy Guard": "Proxy Guard",
"Guard Duration": "Guard Duration", "Guard Duration": "Guard Duration",
"Proxy Bypass": "Proxy Bypass", "Proxy Bypass": "Proxy Bypass",
"Enable status": "Enable status",
"Server Addr": "Server Addr",
"Bypass": "Bypass",
"Current System Proxy": "Current System Proxy", "Current System Proxy": "Current System Proxy",
"Theme Mode": "Theme Mode", "Theme Mode": "Theme Mode",
"Theme Blur": "Theme Blur", "Theme Blur": "Theme Blur",

View File

@ -7,9 +7,6 @@
"Label-Settings": "设 置", "Label-Settings": "设 置",
"Connections": "连接", "Connections": "连接",
"Upload Total": "上传总量",
"Download Total": "下载总量",
"Active Connections": "活动连接",
"Logs": "日志", "Logs": "日志",
"Clear": "清除", "Clear": "清除",
"Proxies": "代理", "Proxies": "代理",
@ -52,6 +49,7 @@
"Filter": "过滤节点", "Filter": "过滤节点",
"Filter conditions": "过滤条件", "Filter conditions": "过滤条件",
"Refresh profiles": "刷新订阅", "Refresh profiles": "刷新订阅",
"Rules": "规则",
"Type": "类型", "Type": "类型",
"Name": "名称", "Name": "名称",
@ -79,8 +77,11 @@
"System Proxy Setting": "系统代理设置", "System Proxy Setting": "系统代理设置",
"Proxy Guard": "系统代理守卫", "Proxy Guard": "系统代理守卫",
"Guard Duration": "代理守卫间隔", "Guard Duration": "代理守卫间隔",
"Proxy Bypass": "Proxy Bypass", "Proxy Bypass": "代理绕过",
"Current System Proxy": "当前系统代理", "Current System Proxy": "当前系统代理",
"Enable status": "开启状态:",
"Server Addr": "服务地址:",
"Bypass": "当前绕过:",
"Theme Mode": "主题模式", "Theme Mode": "主题模式",
"Theme Blur": "背景模糊", "Theme Blur": "背景模糊",
"Theme Setting": "主题设置", "Theme Setting": "主题设置",

View File

@ -3,24 +3,16 @@ import { useLockFn } from "ahooks";
import { import {
Box, Box,
Button, Button,
Grid,
IconButton, IconButton,
MenuItem, MenuItem,
Paper, Paper,
Select, Select,
TextField, TextField,
Typography,
} from "@mui/material"; } from "@mui/material";
import { useRecoilState } from "recoil"; import { useRecoilState } from "recoil";
import { Virtuoso } from "react-virtuoso"; import { Virtuoso } from "react-virtuoso";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { import { TableChartRounded, TableRowsRounded } from "@mui/icons-material";
ArrowDownward,
ArrowUpward,
Link,
TableChartRounded,
TableRowsRounded,
} from "@mui/icons-material";
import { closeAllConnections } from "@/services/api"; import { closeAllConnections } from "@/services/api";
import { atomConnectionSetting } from "@/services/states"; import { atomConnectionSetting } from "@/services/states";
import { useClashInfo } from "@/hooks/use-clash"; import { useClashInfo } from "@/hooks/use-clash";
@ -32,7 +24,6 @@ import {
ConnectionDetail, ConnectionDetail,
ConnectionDetailRef, ConnectionDetailRef,
} from "@/components/connection/connection-detail"; } from "@/components/connection/connection-detail";
import parseTraffic from "@/utils/parse-traffic";
const initConn = { uploadTotal: 0, downloadTotal: 0, connections: [] }; const initConn = { uploadTotal: 0, downloadTotal: 0, connections: [] };
@ -57,10 +48,6 @@ const ConnectionsPage = () => {
list.sort((a, b) => b.curDownload! - a.curDownload!), list.sort((a, b) => b.curDownload! - a.curDownload!),
}; };
const uploadTotal = connData.uploadTotal;
const downloadTotal = connData.downloadTotal;
const filterConn = useMemo(() => { const filterConn = useMemo(() => {
const orderFunc = orderOpts[curOrderOpt]; const orderFunc = orderOpts[curOrderOpt];
const connections = connData.connections.filter((conn) => const connections = connData.connections.filter((conn) =>
@ -125,24 +112,6 @@ const ConnectionsPage = () => {
const detailRef = useRef<ConnectionDetailRef>(null!); const detailRef = useRef<ConnectionDetailRef>(null!);
const connectionItems = [
{
icon: <ArrowUpward />,
label: t("Upload Total"),
value: parseTraffic(uploadTotal).join(" "),
},
{
icon: <ArrowDownward />,
label: t("Download Total"),
value: parseTraffic(downloadTotal).join(" "),
},
{
icon: <Link />,
label: t("Active Connections"),
value: filterConn.length,
},
];
return ( return (
<BasePage <BasePage
title={t("Connections")} title={t("Connections")}
@ -173,21 +142,7 @@ const ConnectionsPage = () => {
</Box> </Box>
} }
> >
<Paper sx={{ padding: 2, mb: 2 }}> <Paper sx={{ boxShadow: 0, height: "100%" }}>
<Grid container>
{connectionItems.map((item, index) => (
<Grid item xs={4} key={index}>
<Box display="flex" alignItems="center" whiteSpace="nowrap">
{item.icon}
<Typography sx={{ ml: 1, mr: 1 }}>{item.label}</Typography>
<Typography>{item.value}</Typography>
</Box>
</Grid>
))}
</Grid>
</Paper>
<Paper sx={{ boxShadow: 2, height: "calc(100% - 56px - 16px)" }}>
<Box <Box
sx={{ sx={{
pt: 1, pt: 1,

View File

@ -67,7 +67,7 @@ const LogPage = () => {
<Paper <Paper
sx={{ sx={{
boxSizing: "border-box", boxSizing: "border-box",
boxShadow: 2, boxShadow: 0,
height: "100%", height: "100%",
userSelect: "text", userSelect: "text",
}} }}

View File

@ -75,7 +75,7 @@ const ProxyPage = () => {
<Paper <Paper
sx={{ sx={{
borderRadius: 1, borderRadius: 1,
boxShadow: 2, boxShadow: 0,
height: "100%", height: "100%",
boxSizing: "border-box", boxSizing: "border-box",
py: 1, py: 1,

View File

@ -19,7 +19,7 @@ const RulesPage = () => {
return ( return (
<BasePage title={t("Rules")} contentStyle={{ height: "100%" }}> <BasePage title={t("Rules")} contentStyle={{ height: "100%" }}>
<Paper sx={{ boxSizing: "border-box", boxShadow: 2, height: "100%" }}> <Paper sx={{ boxSizing: "border-box", boxShadow: 0, height: "100%" }}>
<Box <Box
sx={{ sx={{
pt: 1, pt: 1,

View File

@ -35,17 +35,13 @@ const SettingPage = () => {
> >
<Grid container spacing={{ xs: 2, lg: 3 }}> <Grid container spacing={{ xs: 2, lg: 3 }}>
<Grid item xs={12} md={6}> <Grid item xs={12} md={6}>
<Paper sx={{ borderRadius: 1, boxShadow: 2, marginBottom: 2 }}>
<SettingSystem onError={onError} />
</Paper>
<Paper sx={{ borderRadius: 1, boxShadow: 2 }}> <Paper sx={{ borderRadius: 1, boxShadow: 2 }}>
<SettingClash onError={onError} /> <SettingClash onError={onError} />
</Paper> </Paper>
</Grid> </Grid>
<Grid item xs={12} md={6}>
<Paper sx={{ borderRadius: 1, boxShadow: 2 }}>
<SettingSystem onError={onError} />
</Paper>
</Grid>
<Grid item xs={12} md={6}> <Grid item xs={12} md={6}>
<Paper sx={{ borderRadius: 1, boxShadow: 2 }}> <Paper sx={{ borderRadius: 1, boxShadow: 2 }}>
<SettingVerge onError={onError} /> <SettingVerge onError={onError} />