-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: moved chart and introduced dev mode
- Loading branch information
Showing
7 changed files
with
49 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
// +build !dev | ||
|
||
// Package ui generates binary data from the files inside the dist/ folder | ||
// to be included into the final binary, or to be served during development. | ||
package ui // import "gbbr.io/ev/ui" | ||
|
||
import assetfs "github.com/elazarl/go-bindata-assetfs" | ||
|
||
//go:generate webpack --display=errors-only | ||
//go:generate go-bindata -o bindata.go -prefix=dist/ -pkg ui dist/ | ||
|
||
import ( | ||
"log" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
// rootDir will hold the full path of the dist/ file server. It is used by | ||
// go-bindata in -dev mode. | ||
var rootDir string | ||
|
||
func init() { | ||
wd, err := os.Getwd() | ||
if err != nil { | ||
log.Fatalf("getwd: %v", err) | ||
} | ||
rootDir = filepath.Join(wd, "ui", "dist") | ||
// FS serves the binary embedded http.Filesystem. | ||
var FS = &assetfs.AssetFS{ | ||
Asset: Asset, | ||
AssetDir: AssetDir, | ||
AssetInfo: AssetInfo, | ||
Prefix: "", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// +build dev | ||
|
||
package ui | ||
|
||
import "net/http" | ||
|
||
// FS serves the actual files from the local folder in dev mode. | ||
var FS = http.Dir("ui/dist/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters