mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-04 09:06:38 +08:00
feat: auto-fallback to default bind IP when invalid bind address detected
When a forward service is updated with a bind IP that doesn't exist on the host network interfaces, the system now automatically falls back to the default bind address (listening on all interfaces) instead of failing. - Added syncForwardServicesWithWarnings to collect fallback warnings - Implemented fallbackForwardPortToDefaultBind for graceful degradation - Added UpdateForwardPortBindIP repository method to persist fallback - Enhanced error detection for 'cannot assign requested address' errors - Frontend displays warning toasts when fallback occurs - Added comprehensive unit tests for new error detection functions
This commit is contained in:
@@ -1419,6 +1419,18 @@ export default function ForwardPage() {
|
||||
}
|
||||
|
||||
if (res.code === 0) {
|
||||
const warningItems = Array.isArray((res as any).data?.warnings)
|
||||
? (res as any).data.warnings
|
||||
.map((item: unknown) => (typeof item === "string" ? item.trim() : ""))
|
||||
.filter((item: string) => item)
|
||||
: [];
|
||||
|
||||
warningItems.forEach((warning: string) => {
|
||||
toast(warning, {
|
||||
icon: "⚠️",
|
||||
duration: 5000,
|
||||
});
|
||||
});
|
||||
toast.success(isEdit ? "修改成功" : "创建成功");
|
||||
setModalOpen(false);
|
||||
loadData();
|
||||
|
||||
Reference in New Issue
Block a user