From 5b761439248ae09b7ec6c921417c69c0f3a693c3 Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Sun, 28 Jan 2024 13:40:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/push.yml | 5 +---- src/components/ConnectionTable.module.scss | 13 ++++++++----- src/components/ConnectionTable.scss | 5 ++++- src/components/Connections.tsx | 13 +++---------- src/components/proxies/ProxyLatency.module.scss | 2 +- src/components/proxies/ProxyProvider.tsx | 2 +- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 73a02df4f..41b2b1f39 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -17,14 +17,11 @@ jobs: node-version: '18.x' cache: pnpm - name: Install package and build - run: | - pnpm install --no-frozen-lockfile - pnpm build + run: npm install -g pnpm && pnpm i && pnpm build - name: Deploy uses: crazy-max/ghaction-github-pages@v2 with: target_branch: gh-pages build_dir: public - fqdn: yacd.metacubex.one env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/components/ConnectionTable.module.scss b/src/components/ConnectionTable.module.scss index 1f1a48caa..cb81dff01 100644 --- a/src/components/ConnectionTable.module.scss +++ b/src/components/ConnectionTable.module.scss @@ -26,21 +26,24 @@ } .break { + /* 上边下边 | 左边右边 */ + max-width: 13em; + min-width: 9em; word-wrap: break-word; - word-break: break-all; - align-items: center; - text-align: left; + overflow-wrap: break-word; } .td { /* 上边下边 | 左边右边 */ padding: 10px 5px; font-size: 0.9em; - // max-width: 14em; - min-width: 9em; + max-width: 18em; + min-width: 10em; cursor: default; text-align: left; vertical-align: middle; + overflow: hidden; + text-overflow: ellipsis; white-space: nowrap; &:hover { diff --git a/src/components/ConnectionTable.scss b/src/components/ConnectionTable.scss index 22324dbe2..efb90feb2 100644 --- a/src/components/ConnectionTable.scss +++ b/src/components/ConnectionTable.scss @@ -2,7 +2,6 @@ td.ctrl { min-width: 4em; text-align: center; - display: flex; justify-content: center; align-items: center; @@ -20,4 +19,8 @@ min-width: 7em; text-align: center; } + + td.process { + text-align: center; + } } diff --git a/src/components/Connections.tsx b/src/components/Connections.tsx index cff9a26ed..5613cf004 100644 --- a/src/components/Connections.tsx +++ b/src/components/Connections.tsx @@ -174,16 +174,9 @@ function modifyChains(chains: string[]): string { if (chains.length === 1) { return chains[0]; + } else { + return `${chains.pop()} :: ${chains[0]}`; } - - //倒序 - if (chains.length === 2) { - return `${chains[1]} -> ${chains[0]}`; - } - - const first = chains.pop(); - const last = chains.shift(); - return `${first} -> ${last}`; } function renderTableOrPlaceholder(columns, hiddenColumns, conns: FormattedConn[]) { @@ -203,6 +196,7 @@ function ConnQty({ qty }) { const sortDescFirst = true; const hiddenColumnsOrigin = ['id']; const columnsOrigin = [ + { Header: 'c_ctrl', accessor: 'ctrl' }, { accessor: 'id', show: false }, { Header: 'c_type', accessor: 'type' }, { Header: 'c_process', accessor: 'process' }, @@ -217,7 +211,6 @@ const columnsOrigin = [ { Header: 'c_source', accessor: 'source' }, { Header: 'c_destination_ip', accessor: 'destinationIP' }, { Header: 'c_sni', accessor: 'sniffHost' }, - { Header: 'c_ctrl', accessor: 'ctrl' }, ]; const savedHiddenColumns = localStorage.getItem('hiddenColumns'); diff --git a/src/components/proxies/ProxyLatency.module.scss b/src/components/proxies/ProxyLatency.module.scss index 37502a89f..165a1f946 100644 --- a/src/components/proxies/ProxyLatency.module.scss +++ b/src/components/proxies/ProxyLatency.module.scss @@ -5,6 +5,6 @@ color: #eee; font-size: 0.75em; @media (--breakpoint-not-small) { - font-size: 0.8em; + font-size: 1em; } } diff --git a/src/components/proxies/ProxyProvider.tsx b/src/components/proxies/ProxyProvider.tsx index 99d3b3a4a..32ed91b7b 100644 --- a/src/components/proxies/ProxyProvider.tsx +++ b/src/components/proxies/ProxyProvider.tsx @@ -101,7 +101,7 @@ function ProxyProviderImpl({ display: 'flex', alignItems: 'center', flexWrap: 'wrap', - justifyContent: 'space-between', + justifyContent: 'start', }} >