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:
@@ -49,6 +49,7 @@ enum ServerFuncBtn {
|
|||||||
//pkg,
|
//pkg,
|
||||||
snippet,
|
snippet,
|
||||||
systemd,
|
systemd,
|
||||||
|
portForward,
|
||||||
].map((e) => e.index).toList();
|
].map((e) => e.index).toList();
|
||||||
|
|
||||||
IconData get icon => switch (this) {
|
IconData get icon => switch (this) {
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ class ServerStore extends HiveStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (final spi in ss) {
|
for (final spi in ss) {
|
||||||
|
if (get(spi.id) == null) continue;
|
||||||
if (spi.jumpId != null && idMap.containsKey(spi.jumpId)) {
|
if (spi.jumpId != null && idMap.containsKey(spi.jumpId)) {
|
||||||
final newJumpId = idMap[spi.jumpId]!;
|
final newJumpId = idMap[spi.jumpId]!;
|
||||||
final newSpi = spi.copyWith(jumpId: newJumpId);
|
final newSpi = spi.copyWith(jumpId: newJumpId);
|
||||||
|
|||||||
Reference in New Issue
Block a user