Add netquality 1.1.2 client and node behavior.
Show the address actually probed, keep address-selection misses out of formal loss, and add session metrics, a stop summary, pinned chart points, and in-app metric and release-history screens. Client version is 1.1.2+5. Attribution remains 言灸 under AGPL-3.0-only. Co-authored-by: yanjiu0721 <yanjiu0721@users.noreply.github.com>
This commit is contained in:
1 parent
8ca2185c01
commit
aeb08ec049
40 files changed
+3827
-545
No files matched your search
@@ -0,0 +1,45 @@
|
||||
// Copyright (C) 2026 言灸
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import '../storage/token_vault.dart';
|
||||
import 'session_config.dart';
|
||||
|
||||
/// Blank means "keep the token already stored". A non-blank value replaces it.
|
||||
/// The saved token is never returned here.
|
||||
String? replacementNodeToken(String entered) {
|
||||
final trimmed = entered.trim();
|
||||
if (trimmed.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
/// Writes a replacement token. Returns false when the existing secret is kept.
|
||||
Future<bool> saveEditedNodeToken(
|
||||
TokenVault vault,
|
||||
String id,
|
||||
String entered,
|
||||
) async {
|
||||
final next = replacementNodeToken(entered);
|
||||
if (next == null) {
|
||||
return false;
|
||||
}
|
||||
await vault.write(nodeTokenKey(id), next);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Keeps [RemoteNode.id]. Changing the control URL clears a cached visibility
|
||||
/// check because it may now be a different server. The token is not part of
|
||||
/// this object.
|
||||
RemoteNode applyNodeEdit(
|
||||
RemoteNode node, {
|
||||
required String name,
|
||||
required String baseUrl,
|
||||
}) {
|
||||
final urlChanged = node.baseUrl != baseUrl;
|
||||
return node.copyWith(
|
||||
name: name,
|
||||
baseUrl: baseUrl,
|
||||
visibility: urlChanged ? '' : node.visibility,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2026 言灸
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import 'probe_profile.dart';
|
||||
|
||||
/// Keeps a port the user typed. An empty field or a value that is still the
|
||||
/// previous profile's default follows the newly selected profile.
|
||||
String portAfterProfileChange({
|
||||
required String current,
|
||||
required int previousDefault,
|
||||
required int nextDefault,
|
||||
}) {
|
||||
final trimmed = current.trim();
|
||||
if (trimmed.isEmpty || int.tryParse(trimmed) == previousDefault) {
|
||||
return '$nextDefault';
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
String portHint(ProbeProfile profile) {
|
||||
switch (profile.id) {
|
||||
case 'nq-tcp':
|
||||
return '合作反射 TCP 默认 19090';
|
||||
case 'nq-udp':
|
||||
return '合作反射 UDP 默认 19091';
|
||||
default:
|
||||
return '${profile.label} 默认 ${profile.port}';
|
||||
}
|
||||
}
|
||||
|
||||
const portHelperText =
|
||||
'合作反射 TCP 默认 19090,UDP 默认 19091。只有当前端口仍是上一种类型的默认值或为空时,切换类型才会自动更换。';
|
||||
Reference in new issue
Block a user