forked from kairos-io/kairos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌱 Webui enhancements (kairos-io#620)
* 🌱 Make sure webui starts on alpine Also drop to shell when there are no providers Signed-off-by: mudler <mudler@c3os.io> * 🌱 Suppress verbose logging on tty Signed-off-by: mudler <mudler@c3os.io> * 🌱 Print WebUI address Signed-off-by: mudler <mudler@c3os.io> * 🎨 Update banner Signed-off-by: mudler <mudler@c3os.io> * 🌱 Refactor, display also interfaces Signed-off-by: mudler <mudler@c3os.io> * 🌱 Address feedback from review Signed-off-by: mudler <mudler@c3os.io> Signed-off-by: mudler <mudler@c3os.io>
- Loading branch information
Showing
9 changed files
with
1,183 additions
and
750 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package machine | ||
|
||
import ( | ||
"net" | ||
) | ||
|
||
func Interfaces() (in []string) { | ||
ifaces, err := net.Interfaces() | ||
if err != nil { | ||
return | ||
} | ||
for _, i := range ifaces { | ||
if i.Flags == net.FlagLoopback { | ||
continue | ||
} | ||
in = append(in, i.Name) | ||
} | ||
return | ||
} | ||
|
||
func LocalIPs() (ips []string) { | ||
ifaces, err := net.Interfaces() | ||
if err != nil { | ||
return | ||
} | ||
for _, i := range ifaces { | ||
if i.Flags == net.FlagLoopback { | ||
continue | ||
} | ||
addrs, err := i.Addrs() | ||
if err != nil { | ||
continue | ||
} | ||
for _, a := range addrs { | ||
ip, _, err := net.ParseCIDR(a.String()) | ||
if err != nil { | ||
continue | ||
} | ||
|
||
ips = append(ips, ip.String()) | ||
} | ||
} | ||
return | ||
} |