-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
217 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ pnpm-debug.log* | |
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Package dist includes the static web pages for the monitoring tool. | ||
package dist | ||
|
||
import ( | ||
"embed" | ||
"fmt" | ||
"net/http" | ||
"os" | ||
"path" | ||
"runtime" | ||
"strings" | ||
) | ||
|
||
//go:embed index.html assets/* | ||
var staticAssets embed.FS | ||
|
||
// GetAssets returns the static assets | ||
func GetAssets() http.FileSystem { | ||
if isDevelopmentMode() { | ||
_, assetPath, _, ok := runtime.Caller(1) | ||
if !ok { | ||
panic("error getting path") | ||
} | ||
|
||
assetPath = path.Join(path.Dir(assetPath), "/web") | ||
|
||
// path := path.Join(path.Dir(filename), "../config/settings.toml") | ||
|
||
fmt.Printf("In monitoring tool development mode, serving assets from %s\n", assetPath) | ||
|
||
return http.Dir(assetPath) | ||
} | ||
|
||
return http.FS(staticAssets) | ||
} | ||
|
||
// isDevelopmentMode returns true if environment variable AKITA_MONITOR_DEV is | ||
// set. | ||
func isDevelopmentMode() bool { | ||
evName := "AKITA_MONITOR_DEV" | ||
evValue, exist := os.LookupEnv(evName) | ||
|
||
if !exist { | ||
return false | ||
} | ||
|
||
if strings.ToLower(evValue) == "true" || evValue == "1" { | ||
return true | ||
} | ||
|
||
return false | ||
} |
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,75 @@ | ||
<!DOCTYPE html> | ||
<header> | ||
<meta charset="UTF-8"> | ||
<title>Akita Monitoring Tool</title> | ||
</header> | ||
|
||
<script type="module" crossorigin src="/assets/index-702f2fca.js"></script> | ||
<link rel="stylesheet" href="/assets/index-d610f457.css"> | ||
|
||
<body> | ||
|
||
<nav id="navbar" class="navbar navbar-dark bg-dark"> | ||
<a class="navbar-brand" href="/">AkitaRTM</a> | ||
|
||
<div class="btn-toolbar my-2 my-lg-0"> | ||
<div class="btn-group me-3 ms-3" role="group"> | ||
<button class="btn btn-primary" type="button"> | ||
<span class="resource-type">CPU</span> | ||
<span id="cpu-usage"></span> | ||
</button> | ||
<button class="btn btn-primary" type="button"> | ||
<span class="resource-type">Mem</span> | ||
<span id="mem-usage"></span> | ||
</button> | ||
<button id="profile-button" class="btn btn-primary" | ||
type="button"> | ||
<i class="fa-solid fa-clock"></i> | ||
</button> | ||
</div> | ||
|
||
<button class="btn btn-success" id="hang-analyzer-btn"> | ||
<i class="fa-solid fa-sign-hanging"></i> | ||
</button> | ||
|
||
<div class="input-group ms-3 me-2"> | ||
<button id="run-button" class="btn btn-success" type="submit"> | ||
<i class="fas fa-repeat"></i> | ||
</button> | ||
<button id="continue-button" class="btn btn-success" | ||
type="submit"> | ||
<i class="fas fa-play"></i> | ||
</button> | ||
<button id="pause-button" class="btn btn-danger"> | ||
<i class="fas fa-pause"></i> | ||
</button> | ||
<label id="now-label" class="input-group-text"> | ||
</label> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<div id="debug-tool-container" class="main-container"> | ||
<div id="left-pane" class="horizontal-block horizontal-container"> | ||
</div> | ||
<div id="vertical-divider-left" | ||
class="horizontal-block vertical-divider"> | ||
</div> | ||
<div id="central-pane" class="horizontal-block horizontal-container "> | ||
</div> | ||
<div id="vertical-divider-right" | ||
class="horizontal-block vertical-divider"> | ||
</div> | ||
<div id="right-pane" class="horizontal-block horizontal-container"> | ||
</div> | ||
</div> | ||
|
||
<div id="monitor-group" class="monitor-group"> | ||
<div id="monitor-group-divider" class="horizontal-divider"></div> | ||
<div id="monitor-group-container" class="monitor-group-container"> | ||
</div> | ||
</div> | ||
|
||
<div id="progress-bar-group" class="progress-bar-group"></div> | ||
|
||
</body> |