chore(i18n): components.connection

This commit is contained in:
Slinetrac
2025-11-01 23:34:32 +08:00
Unverified
parent f307c193f5
commit 092e637044
2 changed files with 9 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import {
} from "@mui/material";
import { useLockFn } from "ahooks";
import dayjs from "dayjs";
import { useTranslation } from "react-i18next";
import { closeConnections } from "tauri-plugin-mihomo-api";
import parseTraffic from "@/utils/parse-traffic";
@@ -33,6 +34,7 @@ export const ConnectionItem = (props: Props) => {
const { value, onShowDetail } = props;
const { id, metadata, chains, start, curUpload, curDownload } = value;
const { t } = useTranslation();
const onDelete = useLockFn(async () => closeConnections(id));
const showTraffic = curUpload! >= 100 || curDownload! >= 100;
@@ -42,7 +44,13 @@ export const ConnectionItem = (props: Props) => {
dense
sx={{ borderBottom: "1px solid var(--divider-color)" }}
secondaryAction={
<IconButton edge="end" color="inherit" onClick={onDelete}>
<IconButton
edge="end"
color="inherit"
onClick={onDelete}
title={t("components.connection.actions.closeConnection")}
aria-label={t("components.connection.actions.closeConnection")}
>
<CloseRounded />
</IconButton>
}

View File

@@ -250,7 +250,6 @@ export const ConnectionTable = (props: Props) => {
const handleColumnResize = (params: GridColumnResizeParams) => {
const { colDef, width } = params;
console.log("Column resize:", colDef.field, width);
setColumnWidths((prev) => ({
...prev,
[colDef.field]: width,