Skip to content
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
node_modules/
dist/
!backend/dist/
!backend/dist/icon.png
backend/dist/main.js
backend/plugin-bench
*.tgz
Expand Down
7 changes: 7 additions & 0 deletions backend/dist/ICON-LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Speedometer icon

Source: https://icon-icons.com/icon/speedometer/137157

Author: Community (Material Design).

The PNG is distributed under the Apache License 2.0.
Binary file added backend/dist/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import (
//go:embed dist/main.js
var distFS embed.FS

//go:embed dist/icon.png
var iconData []byte

type runSummary struct {
ID string `json:"id"`
Status string `json:"status"`
Expand Down Expand Up @@ -68,9 +71,16 @@ func handleRuns(w http.ResponseWriter, r *http.Request) {
}
}

func handleIcon(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "image/png")
w.Header().Set("Cache-Control", "public, max-age=86400")
_, _ = w.Write(iconData)
}

func main() {
mux := http.NewServeMux()
mux.HandleFunc("GET /main.js", handleBundle)
mux.HandleFunc("GET /icon.png", handleIcon)
mux.HandleFunc("GET /healthz", handleHealth)
mux.HandleFunc("GET /api/status", handleStatus)
mux.HandleFunc("/api/runs", handleRuns)
Expand Down
1 change: 1 addition & 0 deletions charts/plugin-bench/templates/plugin-cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
version: {{ .Chart.AppVersion | quote }}
vendor: {{ .Values.plugin.vendor | quote }}
enabled: {{ .Values.plugin.enabled }}
icon: {{ .Values.plugin.icon | quote }}
backend:
serviceRef:
namespace: {{ .Release.Namespace }}
Expand Down
4 changes: 4 additions & 0 deletions charts/plugin-bench/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ plugin:
vendor: "OpenEverest"
enabled: true
bundlePath: "/main.js"
icon: "/icon.png"
extensionPoints:
- type: route
path: /performance-benchmark
label: Performance Benchmark
- type: sidebarItem
label: Performance Benchmark
icon: "/icon.png"
- type: clusterDetailTab
path: performance-benchmark
label: Performance Benchmark
Expand Down
5 changes: 5 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ const register: PluginRegisterFn = (api: PluginApi) => {
React = api.React;
pluginFetch = api.fetch.bind(api);

api.registerExtension({
type: 'sidebarItem',
label: 'Performance Benchmark',
});

api.registerExtension({
type: 'route',
label: 'Performance Benchmark',
Expand Down
Loading