diff --git a/src-tauri/src/ipc.rs b/src-tauri/src/ipc.rs index 8f456b06b..334ef1ccb 100644 --- a/src-tauri/src/ipc.rs +++ b/src-tauri/src/ipc.rs @@ -130,11 +130,8 @@ impl From for WebDavFile { #[derive(serde::Serialize, specta::Type)] pub struct NetworkInterfaceView { pub name: String, - #[specta(type = Vec)] - pub addr: Vec, + pub addr: Vec, pub mac_addr: Option, - pub index: u32, - pub internal: bool, } #[derive(serde::Serialize, serde::Deserialize, specta::Type)] @@ -146,18 +143,25 @@ pub enum InterfaceAddress { #[derive(serde::Serialize, serde::Deserialize, specta::Type)] pub struct IpAddress { pub ip: String, - pub broadcast: Option, - pub netmask: Option, } impl From for NetworkInterfaceView { fn from(interface: network_interface::NetworkInterface) -> Self { Self { name: interface.name, - addr: interface.addr, + addr: interface + .addr + .into_iter() + .map(|address| match address { + network_interface::Addr::V4(address) => InterfaceAddress::V4(IpAddress { + ip: address.ip.to_string(), + }), + network_interface::Addr::V6(address) => InterfaceAddress::V6(IpAddress { + ip: address.ip.to_string(), + }), + }) + .collect(), mac_addr: interface.mac_addr, - index: interface.index, - internal: interface.internal, } } } diff --git a/src/services/bindings.ts b/src/services/bindings.ts index 25dd62d35..a3e9a6676 100644 --- a/src/services/bindings.ts +++ b/src/services/bindings.ts @@ -544,8 +544,6 @@ export type InterfaceAddress = export type IpAddress = { ip: string - broadcast: string | null - netmask: string | null } export type JsonValue = @@ -581,8 +579,6 @@ export type NetworkInterfaceView = { name: string addr: InterfaceAddress[] mac_addr: string | null - index: number - internal: boolean } export type NoticeStatus =