Skip to content

Commit

Permalink
Declutter input panel labels
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Sim <[email protected]>
  • Loading branch information
ihcsim committed Dec 7, 2024
1 parent 23ecc1e commit 0819b79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
9 changes: 4 additions & 5 deletions pkg/console/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,16 @@ const (
askVipMethodLabel = "VIP Mode"

clusterNetworkTitle = "Configure cluster network"
clusterPodCIDRLabel = "Pod CIDR (optional) "
clusterServiceCIDRLabel = "Service CIDR (optional) "
clusterDNSLabel = "Cluster DNS IP (optional) "
clusterPodCIDRLabel = "Pod CIDR"
clusterServiceCIDRLabel = "Service CIDR"
clusterDNSLabel = "Cluster DNS IP"
clusterPodCIDRPanel = "podCIDRPanel"
clusterServiceCIDRPanel = "serviceCIDRPanel"
clusterDNSPanel = "clusterDNSPanel"
clusterNetworkNotePanel = "clusterNetworkNotePanel"
clusterNetworkDNSNotePanel = "clusterNetworkDNSNotePanel"
clusterNetworkValidatorPanel = "clusterNetworkValidatorPanel"
clusterNetworkNote = "Note: Leave blank to use the default pod CIDR 10.52.0.0/16, service CIDR 10.53.0.0/16 and cluster DNS 10.53.0.10."
clusterNetworkDNSNote = "If the service CIDR is changed, the DNS IP must be updated to be within the service CIDR."
clusterNetworkNote = "Note: Leave blank to use the default pod CIDR 10.52.0.0/16, service CIDR 10.53.0.0/16 and cluster DNS 10.53.0.10. If the service CIDR is changed, the DNS IP must be updated to be within the service CIDR."

clusterTokenCreateNote = "Note: The token is used for adding nodes to the cluster"
clusterTokenJoinNote = "Note: Input the token of the existing cluster"
Expand Down
16 changes: 2 additions & 14 deletions pkg/console/install_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,6 @@ func showClusterNetworkPage(c *Console) error {
clusterServiceCIDRPanel,
clusterDNSPanel,
clusterNetworkNotePanel,
clusterNetworkDNSNotePanel,
clusterNetworkValidatorPanel,
clusterPodCIDRPanel)
}
Expand All @@ -1771,7 +1770,6 @@ func addClusterNetworkPanel(c *Console) error {
clusterServiceCIDRPanel,
clusterDNSPanel,
clusterNetworkNotePanel,
clusterNetworkDNSNotePanel,
clusterNetworkValidatorPanel)
}

Expand Down Expand Up @@ -1812,12 +1810,6 @@ func addClusterNetworkPanel(c *Console) error {
return err
}

if err := c.setContentByName(
clusterNetworkDNSNotePanel,
clusterNetworkDNSNote); err != nil {
return err
}

// reset any previous error in the validator panel before
// showing the rest of the page
return c.setContentByName(clusterNetworkValidatorPanel, "")
Expand Down Expand Up @@ -1987,14 +1979,10 @@ func addClusterNetworkPanel(c *Console) error {
// set up notes panels
notePanel := widgets.NewPanel(c.Gui, clusterNetworkNotePanel)
notePanel.Focus = false
setLocation(notePanel, 3)
notePanel.Wrap = true
setLocation(notePanel, 4)
c.AddElement(clusterNetworkNotePanel, notePanel)

dnsNotePanel := widgets.NewPanel(c.Gui, clusterNetworkDNSNotePanel)
dnsNotePanel.Focus = false
setLocation(dnsNotePanel, 3)
c.AddElement(clusterNetworkDNSNotePanel, dnsNotePanel)

// set up validator panel for warning and error messages
validatorPanel := widgets.NewPanel(c.Gui, clusterNetworkValidatorPanel)
validatorPanel.FgColor = gocui.ColorRed
Expand Down

0 comments on commit 0819b79

Please sign in to comment.