Skip to content

Commit

Permalink
dont craft the vlan menu because of upstream bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fbuetler committed Mar 29, 2024
1 parent 6db2c2b commit 3cd0283
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions pkg/controller/DiscordController.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,27 +237,30 @@ func (dc *DiscordController) GetDiscordUserCard(searchString string, buttonsEnab
vlansMissing = true
} else {
log.Debug("crafting vlan menu")
var vlanMenu []discordgo.SelectMenuOption
for _, vlan := range switchRef.Vlans {
isDefault := switchRef.PrimaryVlan == vlan
vlanMenu = append(vlanMenu, discordgo.SelectMenuOption{
Description: vlan.Description,
Value: fmt.Sprint(vlan.VlanID),
Label: fmt.Sprintf("VLAN %d (%s) - %s", vlan.VlanID, vlan.Name, vlan.IpRange.String()),
Default: isDefault,
})
}
vlanRow = discordgo.ActionsRow{
Components: []discordgo.MessageComponent{
discordgo.SelectMenu{
MaxValues: 1,
CustomID: "findVlanSelect",
Placeholder: "Default VLAN",
Options: vlanMenu,
Disabled: !buttonsEnabled,
/*
skip vlan menu because of https://github.com/bwmarrin/discordgo/pull/1476
var vlanMenu []discordgo.SelectMenuOption
for _, vlan := range switchRef.Vlans {
isDefault := switchRef.PrimaryVlan == vlan
vlanMenu = append(vlanMenu, discordgo.SelectMenuOption{
Description: vlan.Description,
Value: fmt.Sprint(vlan.VlanID),
Label: fmt.Sprintf("VLAN %d (%s) - %s", vlan.VlanID, vlan.Name, vlan.IpRange.String()),
Default: isDefault,
})
}
vlanRow = discordgo.ActionsRow{
Components: []discordgo.MessageComponent{
discordgo.SelectMenu{
MaxValues: 1,
CustomID: "findVlanSelect",
Placeholder: "Default VLAN",
Options: vlanMenu,
Disabled: !buttonsEnabled,
},
},
},
}
}
*/
}
} else {
vlansMissing = true
Expand Down

0 comments on commit 3cd0283

Please sign in to comment.