Skip to content

Commit

Permalink
Includes checks for storage
Browse files Browse the repository at this point in the history
  • Loading branch information
CGoodwin90 committed Aug 21, 2024
1 parent 7495130 commit 304aaa7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion landingTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ <h1>Internal Services Test</h1>
<h2>Available Services:</h2>
<ul>
{{range .Services}}
<li><a href="/{{.Type}}?service={{.Name}}">{{.Name}}</a></li>
{{if (eq .Type "storage")}}
<li><a href="/{{.Type}}?path={{.Name}}">storage:{{.Name}}</a></li>
{{else}}
<li><a href="/{{.Type}}?service={{.Name}}">{{.Name}}</a></li>
{{end}}
{{end}}
</ul>
</body>
Expand Down
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package main
import (
"bytes"
"fmt"
"github.com/gorilla/mux"
machinery "github.com/uselagoon/machinery/utils/variables"
"gopkg.in/yaml.v3"
"html/template"
"log"
Expand All @@ -11,8 +13,6 @@ import (
"regexp"
"strings"
"time"

"github.com/gorilla/mux"
)

type LandingPageData struct {
Expand Down Expand Up @@ -79,6 +79,11 @@ func getServices() []Service {
serviceList = append(serviceList, Service{Type: serviceType, Name: service})
}
}
storage := machinery.GetEnv("STORAGE_LOCATION", "")
if storage != "" {
serviceList = append(serviceList, Service{Type: "storage", Name: storage})
}

return serviceList
}

Expand Down

0 comments on commit 304aaa7

Please sign in to comment.