Skip to content

Commit

Permalink
Merge pull request #43 from deggja/feat_38
Browse files Browse the repository at this point in the history
fix: cleanup dirty git state
  • Loading branch information
deggja committed Dec 11, 2023
2 parents b6883a4 + 467b72f commit ec2ade9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
46 changes: 23 additions & 23 deletions backend/cmd/dash.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,33 @@ func startDashboardServer() {
}
}

func dashboardHandler(w http.ResponseWriter, r *http.Request) {
// Check if we are in development mode
isDevelopment := true // You can use an environment variable or a config flag to set this
if isDevelopment {
// Redirect to the Vue dev server
vueDevServer := "http://localhost:8081"
http.Redirect(w, r, vueDevServer+r.RequestURI, http.StatusTemporaryRedirect)
} else {
// Serve the embedded frontend using statik
statikFS, err := fs.New()
if err != nil {
log.Fatal(err)
}
http.FileServer(statikFS).ServeHTTP(w, r)
}
}

// func dashboardHandler(w http.ResponseWriter, r *http.Request) {
// statikFS, err := fs.New()
// if err != nil {
// log.Fatal(err)
// // Check if we are in development mode
// isDevelopment := true // You can use an environment variable or a config flag to set this
// if isDevelopment {
// // Redirect to the Vue dev server
// vueDevServer := "http://localhost:8081"
// http.Redirect(w, r, vueDevServer+r.RequestURI, http.StatusTemporaryRedirect)
// } else {
// // Serve the embedded frontend using statik
// statikFS, err := fs.New()
// if err != nil {
// log.Fatal(err)
// }
// http.FileServer(statikFS).ServeHTTP(w, r)
// }

// // Serve the embedded frontend
// http.FileServer(statikFS).ServeHTTP(w, r)
// }

func dashboardHandler(w http.ResponseWriter, r *http.Request) {
statikFS, err := fs.New()
if err != nil {
log.Fatal(err)
}

// Serve the embedded frontend
http.FileServer(statikFS).ServeHTTP(w, r)
}

// handleNamespacesWithPoliciesRequest handles the HTTP request for serving a list of namespaces with network policies.
func handleNamespacesWithPoliciesRequest(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
Expand Down
2 changes: 1 addition & 1 deletion backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
Expand Down
Binary file modified backend/netfetch
Binary file not shown.
2 changes: 1 addition & 1 deletion backend/statik/statik.go

Large diffs are not rendered by default.

0 comments on commit ec2ade9

Please sign in to comment.