mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-12 05:32:09 +08:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e3be5a27f | ||
|
|
4adac9e4b6 | ||
|
|
2c60f55f45 | ||
|
|
b8c13c0370 |
@@ -4,7 +4,7 @@
|
||||
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/node:2": {
|
||||
"version": "26.13.0",
|
||||
"version": "26.13.1",
|
||||
"pnpmVersion": "12.18.0"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/rust:1": {
|
||||
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Pnpm install and check
|
||||
@@ -262,7 +262,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Pnpm install and check
|
||||
@@ -395,7 +395,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Pnpm install and check
|
||||
@@ -479,7 +479,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6.1.1
|
||||
name: Install pnpm
|
||||
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
- name: Install gh-aw extension
|
||||
uses: github/gh-aw-actions/setup-cli@53d0749e19424a918acd82b4d140264ce48f2f14 # v1.2.2
|
||||
with:
|
||||
version: v1.0.1
|
||||
version: v1.2.2
|
||||
- name: Install Rust Stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
- name: Install frontend dependencies
|
||||
env:
|
||||
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
name: Install pnpm
|
||||
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
if: github.event.inputs[matrix.input] == 'true'
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Pnpm install and check
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
if: github.event.action != 'closed'
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
- name: Validate source and publish the approved snapshot
|
||||
id: source
|
||||
env:
|
||||
@@ -231,7 +231,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Pnpm install and check
|
||||
@@ -330,7 +330,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Pnpm install and check
|
||||
@@ -461,7 +461,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Pnpm install and check
|
||||
@@ -542,7 +542,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
- uses: pnpm/action-setup@v6
|
||||
with:
|
||||
run_install: false
|
||||
@@ -565,7 +565,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
name: Install pnpm
|
||||
@@ -593,7 +593,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
name: Install pnpm
|
||||
@@ -661,7 +661,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
name: Install pnpm
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v6
|
||||
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
name: Install pnpm
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
name: Install pnpm
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '26.13.0'
|
||||
node-version: '26.13.1'
|
||||
|
||||
- uses: pnpm/action-setup@v6
|
||||
name: Install pnpm
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
nodejs 26.13.0
|
||||
nodejs 26.13.1
|
||||
pnpm 12.18.0
|
||||
rust 1.99.1
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<details>
|
||||
<summary><strong> 🐞 修复问题 </strong></summary>
|
||||
|
||||
- 修复应用退出时无条件重写 `clash.yaml`、`verge.yaml` 和 `profiles.yaml` 导致文件创建时间丢失的问题
|
||||
|
||||
- 修复检测更新后又发布新版时,应用内更新失败
|
||||
- 修复订阅响应过大导致内存占用过高,限制单次下载为 4 MiB
|
||||
- 修复全局模式默认停在 `DIRECT` 或 `REJECT` 导致流量未经代理,现自动切换到第一个策略组
|
||||
@@ -40,6 +42,7 @@
|
||||
<details>
|
||||
<summary><strong> ✨ 新增功能 </strong></summary>
|
||||
|
||||
- 新增连接页面按网络协议(TCP/UDP)筛选连接
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
@@ -74,12 +74,16 @@ impl<T: Clone> Draft<T> {
|
||||
result
|
||||
}
|
||||
|
||||
/// Commits and clears the draft.
|
||||
/// Commits and clears the draft, reporting whether one was staged.
|
||||
#[inline]
|
||||
pub fn apply(&self) {
|
||||
pub fn apply(&self) -> bool {
|
||||
let mut guard = self.inner.data.lock();
|
||||
if let Some(d) = guard.1.take() {
|
||||
guard.0 = d;
|
||||
match guard.1.take() {
|
||||
Some(d) => {
|
||||
guard.0 = d;
|
||||
true
|
||||
}
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -280,25 +280,29 @@ impl Config {
|
||||
}
|
||||
|
||||
/// Commits drafts during exit/restart/shutdown so user changes are not lost.
|
||||
/// A config with nothing staged keeps its file, so its timestamps stay put.
|
||||
pub async fn apply_all_and_save_file() {
|
||||
logging!(debug, Type::Config, "save all draft data");
|
||||
let save_clash_task = AsyncHandler::spawn(|| async {
|
||||
let clash = Self::clash().await;
|
||||
clash.apply();
|
||||
logging_error!(Type::Config, clash.data_arc().save_config().await);
|
||||
if clash.apply() {
|
||||
logging_error!(Type::Config, clash.data_arc().save_config().await);
|
||||
}
|
||||
});
|
||||
|
||||
let save_verge_task = AsyncHandler::spawn(|| async {
|
||||
let verge = Self::verge().await;
|
||||
verge.apply();
|
||||
logging_error!(Type::Config, verge.data_arc().save_file().await);
|
||||
if verge.apply() {
|
||||
logging_error!(Type::Config, verge.data_arc().save_file().await);
|
||||
}
|
||||
});
|
||||
|
||||
let save_profiles_task = AsyncHandler::spawn(|| async {
|
||||
let _profile_write = super::profiles::PROFILE_WRITE_LOCK.lock().await;
|
||||
let profiles = Self::profiles().await;
|
||||
profiles.apply();
|
||||
logging_error!(Type::Config, profiles.data_arc().save_file().await);
|
||||
if profiles.apply() {
|
||||
logging_error!(Type::Config, profiles.data_arc().save_file().await);
|
||||
}
|
||||
});
|
||||
|
||||
let _ = tokio::join!(save_clash_task, save_verge_task, save_profiles_task);
|
||||
|
||||
@@ -71,6 +71,10 @@ const ORDER_OPTIONS = [
|
||||
|
||||
type OrderKey = (typeof ORDER_OPTIONS)[number]['id']
|
||||
|
||||
type NetworkFilter = 'all' | 'tcp' | 'udp'
|
||||
|
||||
let savedNetworkFilter: NetworkFilter = 'all'
|
||||
|
||||
const orderFunctionMap = ORDER_OPTIONS.reduce<Record<OrderKey, OrderFunc>>(
|
||||
(acc, option) => {
|
||||
acc[option.id] = option.fn
|
||||
@@ -86,6 +90,9 @@ const ConnectionsPage = () => {
|
||||
const { searchState, match, onSearch } = usePageSearch('connections')
|
||||
const hasSearch = searchState.text.length > 0
|
||||
const [curOrderOpt, setCurOrderOpt] = useState<OrderKey>('default')
|
||||
const [networkFilter, setNetworkFilter] =
|
||||
useState<NetworkFilter>(savedNetworkFilter)
|
||||
const hasFilter = networkFilter !== 'all'
|
||||
const [connectionsType, setConnectionsType] = useState<'active' | 'closed'>(
|
||||
'active',
|
||||
)
|
||||
@@ -112,18 +119,30 @@ const ConnectionsPage = () => {
|
||||
const filterConn = useMemo(() => {
|
||||
const orderFunc = orderFunctionMap[curOrderOpt]
|
||||
|
||||
if (isTableLayout && !hasSearch) return selectedConnections
|
||||
if (!hasSearch) return orderFunc([...selectedConnections])
|
||||
if (isTableLayout && !hasSearch && !hasFilter) return selectedConnections
|
||||
if (!hasSearch && !hasFilter) return orderFunc([...selectedConnections])
|
||||
|
||||
const matchConns = selectedConnections.filter((conn) => {
|
||||
const { host, destinationIP, process } = conn.metadata
|
||||
const { host, destinationIP, process, network } = conn.metadata
|
||||
if (networkFilter !== 'all' && network !== networkFilter) return false
|
||||
return (
|
||||
match(host || '') || match(destinationIP || '') || match(process || '')
|
||||
!hasSearch ||
|
||||
match(host || '') ||
|
||||
match(destinationIP || '') ||
|
||||
match(process || '')
|
||||
)
|
||||
})
|
||||
|
||||
return orderFunc ? orderFunc(matchConns) : matchConns
|
||||
}, [selectedConnections, isTableLayout, hasSearch, match, curOrderOpt])
|
||||
}, [
|
||||
selectedConnections,
|
||||
isTableLayout,
|
||||
hasSearch,
|
||||
hasFilter,
|
||||
networkFilter,
|
||||
match,
|
||||
curOrderOpt,
|
||||
])
|
||||
|
||||
const displayRows = useConnectionRowViews(
|
||||
isTableLayout ? EMPTY_CONNECTIONS : filterConn,
|
||||
@@ -255,6 +274,24 @@ const ConnectionsPage = () => {
|
||||
))}
|
||||
</BaseStyledSelect>
|
||||
)}
|
||||
<BaseStyledSelect
|
||||
style={{ width: 80 }}
|
||||
value={networkFilter}
|
||||
onChange={(e) => {
|
||||
savedNetworkFilter = e.target.value as NetworkFilter
|
||||
setNetworkFilter(savedNetworkFilter)
|
||||
}}
|
||||
>
|
||||
<MenuItem value="all">
|
||||
<span style={{ fontSize: 14 }}>All</span>
|
||||
</MenuItem>
|
||||
<MenuItem value="tcp">
|
||||
<span style={{ fontSize: 14 }}>TCP</span>
|
||||
</MenuItem>
|
||||
<MenuItem value="udp">
|
||||
<span style={{ fontSize: 14 }}>UDP</span>
|
||||
</MenuItem>
|
||||
</BaseStyledSelect>
|
||||
<Box
|
||||
sx={{
|
||||
flex: 1,
|
||||
|
||||
Reference in New Issue
Block a user