Skip to content

Commit

Permalink
Update IBM-specific NLB initial values: interval=10, timeout=9, thres…
Browse files Browse the repository at this point in the history
…hold=default
  • Loading branch information
powerkimhub committed Feb 7, 2025
1 parent 72bb46a commit 976dc25
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions api-runtime/rest-runtime/admin-web/AdminWeb-NLB.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ func NLBManagement(c echo.Context) error {
return c.HTML(http.StatusOK, htmlStr)
}

providerName, err := getProviderName(connConfig)
if err != nil {
return c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
}

regionName, err := getRegionName(connConfig)
if err != nil {
return c.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
Expand All @@ -86,12 +91,14 @@ func NLBManagement(c echo.Context) error {

data := struct {
ConnectionConfig string
ProviderName string
RegionName string
Region string
Zone string
NLBs []*cres.NLBInfo
}{
ConnectionConfig: connConfig,
ProviderName: providerName,
RegionName: regionName,
Region: region,
Zone: zone,
Expand Down
14 changes: 11 additions & 3 deletions api-runtime/rest-runtime/admin-web/html/nlb.html
Original file line number Diff line number Diff line change
Expand Up @@ -1326,9 +1326,17 @@ <h2>System ID (Managed by CSP)</h2>
// Reset Health Checker information
document.getElementById('hcProtocol').value = 'TCP';
document.getElementById('hcPort').value = '22';
document.getElementById('interval').value = 'default';
document.getElementById('timeout').value = 'default';
document.getElementById('threshold').value = 'default';

var provider = '{{.ProviderName}}';
if (provider === 'IBM') {
document.getElementById('interval').value = '10';
document.getElementById('timeout').value = '9';
document.getElementById('threshold').value = 'default';
} else {
document.getElementById('interval').value = 'default';
document.getElementById('timeout').value = 'default';
document.getElementById('threshold').value = 'default';
}

// Reset VM list
document.getElementById('vmContainer').innerHTML = '';
Expand Down

0 comments on commit 976dc25

Please sign in to comment.