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

Move admin UI assets to the admin service directory #5710

Merged
merged 1 commit into from
Feb 19, 2016
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
23 changes: 23 additions & 0 deletions services/admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# InfluxDB Admin Interface

This is the built-in admin interface that ships with InfluxDB. The service is intended to have little overhead and minimal preprocessing steps.

## How it works

Static assets, located in the `assets` directory, are embedded in the `influxd` binary and served from memory using a simple fileserver.

The admin UI itself uses [React](https://github.com/facebook/react) for the user interface to interact directly with the InfluxDB API, usually running on port `8086`.

## Building

The only step required to bundle the admin UI with InfluxDB is to create a compressed file system using `statik` as follows:

```
go get github.com/rakyll/statik # make sure $GOPATH/bin is listed in your PATH
cd $GOPATH/src/github.com/influxdata/influxdb
go generate github.com/influxdata/influxdb/services/admin
```

The `go generate ./...` command will run `statik` to generate the `statik/statik.go` file. The generated `go` file will embed the admin interface assets into the InfluxDB binary.

This step should be run before submitting any pull requests which include modifications to admin interface assets.
4 changes: 4 additions & 0 deletions services/admin/admin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package admin // import "github.com/influxdata/influxdb/services/admin"

//go:generate statik -src=assets
//go:generate go fmt statik/statik.go
4 changes: 4 additions & 0 deletions services/admin/assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Please note that these files are embedded into the `influxd` binary using the
[statik](https://github.com/rakyll/statik) tool. `go generate` needs to be run
whenever there are changes made to files in this directory. See the admin
interface readme for more information.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion services/admin/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"

// Register static assets via statik.
_ "github.com/influxdata/influxdb/statik"
_ "github.com/influxdata/influxdb/services/admin/statik"
"github.com/rakyll/statik/fs"
)

Expand Down
3 changes: 1 addition & 2 deletions statik/README.md → services/admin/statik/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Please note that this file is automatically generated by the
[statik](https://github.com/rakyll/statik) tool, and should not be
updated directly. For more information, please see the Admin UI readme
available at `/shared/admin/README.md`.
updated directly. See the Admin UI readme for more information.
10 changes: 10 additions & 0 deletions services/admin/statik/statik.go

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions shared/admin/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions statik/statik.go

This file was deleted.