Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cleanup dirty git state #43

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.