ui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

README

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

yarn eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Serving UI assets from the filesystem

By default, the built web assets are compressed (via the main Makefile) and statically compiled into the Promlens binary using Go's embed package.

During development it can be convenient to tell the Promlens server to always serve its web assets from the local filesystem (in the web/ui/static build output directory) without having to recompile the Go binary. To make this work, remove the builtinassets build tag in the flags entry in .promu.yml, and then run make build (or build Promlens using go build ./cmd/promlens).

Note that in most cases, it is even more convenient to just use the development web server via npm start as mentioned above, since serving web assets like this from the filesystem still requires rebuilding those assets via make ui-build (or npm run build) before they can be served.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Assets = func() http.FileSystem {
	wd, err := os.Getwd()
	if err != nil {
		panic(err)
	}
	var assetsPrefix string
	switch filepath.Base(wd) {
	case "promlens":

		assetsPrefix = "./app"
	case "app":

		assetsPrefix = "./"
	}

	static := filter.Keep(
		http.Dir(path.Join(assetsPrefix, "build")),
		func(path string, fi os.FileInfo) bool {
			return fi.IsDir() ||
				(!strings.HasSuffix(path, "map.js") &&
					!strings.HasSuffix(path, "/bootstrap.js") &&
					!strings.HasSuffix(path, "/bootstrap-theme.css") &&
					!strings.HasSuffix(path, "/bootstrap.css"))
		},
	)

	return union.New(map[string]http.FileSystem{
		"/static": static,
	})
}()

Assets contains the project's assets.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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