diff --git a/main.go b/main.go index 1fcb83c..365a9d0 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,7 @@ import ( "net" "net/http" "os" + "os/exec" "os/user" "runtime" "sort" @@ -31,6 +32,7 @@ type NetInterface struct { MAC string `json:"mac"` Addresses []string `json:"addresses"` IsLoopback bool `json:"is_loopback"` + Profile string `json:"profile"` } type DiskInfo struct { @@ -206,6 +208,10 @@ func getInterfaces() []NetInterface { if err != nil { return nil } + + // Profile holen (best effort) + profilesByIndex, _ := getWinNetProfiles() + var out []NetInterface for _, ifc := range ifaces { if (ifc.Flags & net.FlagUp) == 0 { @@ -222,10 +228,7 @@ func getInterfaces() []NetInterface { case *net.IPAddr: ip = v.IP } - if ip == nil { - continue - } - if ip.IsLoopback() { + if ip == nil || ip.IsLoopback() { continue } ips = append(ips, ip.String()) @@ -233,11 +236,15 @@ func getInterfaces() []NetInterface { if isLoop { continue } + + profile := profilesByIndex[ifc.Index] // 👈 jetzt sicher über Index + out = append(out, NetInterface{ Name: ifc.Name, MAC: ifc.HardwareAddr.String(), Addresses: ips, IsLoopback: isLoop, + Profile: profile, }) } return out @@ -358,25 +365,28 @@ var page = template.Must(template.New("index").Parse(` h1{font-size:22px;margin:0 0 16px 0} .grid{display:flex;flex-direction:column;gap:12px} .card{width:100%} - .k{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em} + .k{font-size:16px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em} .v{font-weight:600} .row{display:flex;justify-content:space-between;gap:8px;align-items:center;margin:6px 0} .mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace} - .pill{display:inline-block;background:#0b2547;color:#b8d4ff;border-radius:999px;padding:2px 8px;margin:2px 6px 0 0;font-size:12px} + .stereo{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;color: #ffd500ff} + .pill{display:inline-block;background: #0b2547;color: #00ff2aff;border-radius:999px;padding:2px 8px;margin:2px 6px 0 0;font-size:14px} + .pill2{display:inline-block;background: #ffe100ff;color: #282828ff;border-radius:999px;padding:2px 8px;margin:2px 6px 0 0;font-size:14px} .bar{height:10px;background:#091428;border-radius:999px;overflow:hidden} .fill{height:100%;background:var(--accent);width:0%} footer{margin-top:18px;color:var(--muted);font-size:12px} .disks table{width:100%;border-collapse:collapse} .disks th,.disks td{padding:8px;border-bottom:1px solid #1b2a4a;text-align:left;font-size:14px} +