Move admin UI assets to the admin service directory

pull/5710/head
gunnaraasen 2016-02-16 17:08:15 -08:00
parent 316e44c324
commit 426bc0aa3e
22 changed files with 43 additions and 28 deletions

23
services/admin/README.md Normal file
View File

@ -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
services/admin/admin.go Normal file
View File

@ -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

View File

@ -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.

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -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"
)

View File

@ -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.

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
# InfluxDB Admin Interface
This is the built-in admin interface that ships with InfluxDB. An emphasis has been placed on making it minimalistic and able to be bundled with the server without adding lots of overhead or preprocessing steps.
## Building
The only step required to bundle this with InfluxDB is to create a compressed file system using `statik` as follows:
```
go get github.com/rakyll/statik
$GOPATH/bin/statik -src=./shared/admin
go fmt statik/statik.go
```
That should update the file located at `statik/statik.go`, which will get automatically build into the InfluxDB binary when it is compiled. This step should also be completed in any pull requests that make modifications to the admin interface, as it won't be run as a separate step in the release process.

File diff suppressed because one or more lines are too long