feat (Menu Features): Added a port forwarding button and optimized server storage logic (#1092)

* feat (Menu Features): Added a port forwarding button and optimized server storage logic

Added the `portForward` option to the `ServerFuncBtn` enumeration to support port forwarding

Added duplicate ID checks to `ServerStore` to prevent data conflicts

* fix(server): Fixed the update logic for redirect IDs in server storage

Prevents updates from being skipped when the ID remains unchanged, ensuring that redirect IDs are mapped correctly

* fix(server): Fixed an issue where existing records were not skipped correctly when updating the redirect ID
This commit is contained in:
GT610
2026-03-27 18:03:27 +08:00
committed by GitHub
parent c0f98e41c8
commit 44f4051d46
2 changed files with 2 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ enum ServerFuncBtn {
//pkg,
snippet,
systemd,
portForward,
].map((e) => e.index).toList();
IconData get icon => switch (this) {

View File

@@ -175,6 +175,7 @@ class ServerStore extends HiveStore {
}
for (final spi in ss) {
if (get(spi.id) == null) continue;
if (spi.jumpId != null && idMap.containsKey(spi.jumpId)) {
final newJumpId = idMap[spi.jumpId]!;
final newSpi = spi.copyWith(jumpId: newJumpId);