ui

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

UI

Our goal is to provide the upstream Prometheus UI with the only change that it queries data from Google Cloud Prometheus Engine and with support for pages other than /graph removed.

Since the UI is not a public NPM package, importing the specific React components for a custom apps is very difficult. Thus we use a simpler approach where we load the upstream UI at a given version and apply a minimal set of overrides files.

How it works

Development

The hack/update-ui.sh <PROMETHEUS_TAG> script syncs the upstream UI into third_party/prometheus_ui/base at a fixed git tag. All files and directories provided in thid_party/prometheus_ui/override/ are copied over the web/ui/react-app path of the upstream checkout. After updating the upstream tag, the override files may need adjustment.

Building

The final app is statically compiled into the Go binary for release. To build the UI, run:

./build.sh

This creates the final gziped files in ./build and generated ./embed.go to instruct the Go compiler to include them into the final Go binary.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Assets = http.Dir("static/")

Serve assets from a static directory if they have not been compiled into the binary.

It always attempts to serve anything "static/" in the current working directory as this is for development purposes only.

Functions

func Handler

func Handler(externalURL *url.URL) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL