mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
f72dac0c95
commit
d51e61f6d0
1 changed files with 2 additions and 4 deletions
|
@ -21,7 +21,6 @@ var (
|
||||||
|
|
||||||
func (mod *BLERecon) getRow(dev *network.BLEDevice) []string {
|
func (mod *BLERecon) getRow(dev *network.BLEDevice) []string {
|
||||||
rssi := network.ColorRSSI(dev.RSSI)
|
rssi := network.ColorRSSI(dev.RSSI)
|
||||||
name := ops.Ternary(dev.Device.Name() == "", dev.Advertisement.LocalName, dev.Device.Name()).(string)
|
|
||||||
address := network.NormalizeMac(dev.Device.ID())
|
address := network.NormalizeMac(dev.Device.ID())
|
||||||
vendor := tui.Dim(ops.Ternary(dev.Vendor == "", dev.Advertisement.Company, dev.Vendor).(string))
|
vendor := tui.Dim(ops.Ternary(dev.Vendor == "", dev.Advertisement.Company, dev.Vendor).(string))
|
||||||
isConnectable := ops.Ternary(dev.Advertisement.Connectable, tui.Green("✔"), tui.Red("✖")).(string)
|
isConnectable := ops.Ternary(dev.Advertisement.Connectable, tui.Green("✔"), tui.Red("✖")).(string)
|
||||||
|
@ -38,7 +37,6 @@ func (mod *BLERecon) getRow(dev *network.BLEDevice) []string {
|
||||||
return []string{
|
return []string{
|
||||||
rssi,
|
rssi,
|
||||||
address,
|
address,
|
||||||
name,
|
|
||||||
vendor,
|
vendor,
|
||||||
dev.Advertisement.Flags.String(),
|
dev.Advertisement.Flags.String(),
|
||||||
isConnectable,
|
isConnectable,
|
||||||
|
@ -100,14 +98,14 @@ func (mod *BLERecon) doSelection() (err error, devices []*network.BLEDevice) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mod *BLERecon) colNames() []string {
|
func (mod *BLERecon) colNames() []string {
|
||||||
colNames := []string{"RSSI", "MAC", "Name", "Vendor", "Flags", "Connect", "Seen"}
|
colNames := []string{"RSSI", "MAC", "Vendor", "Flags", "Connect", "Seen"}
|
||||||
switch mod.selector.SortField {
|
switch mod.selector.SortField {
|
||||||
case "rssi":
|
case "rssi":
|
||||||
colNames[0] += " " + mod.selector.SortSymbol
|
colNames[0] += " " + mod.selector.SortSymbol
|
||||||
case "mac":
|
case "mac":
|
||||||
colNames[1] += " " + mod.selector.SortSymbol
|
colNames[1] += " " + mod.selector.SortSymbol
|
||||||
case "seen":
|
case "seen":
|
||||||
colNames[6] += " " + mod.selector.SortSymbol
|
colNames[5] += " " + mod.selector.SortSymbol
|
||||||
}
|
}
|
||||||
return colNames
|
return colNames
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue