Skip to content

Commit

Permalink
Version bump, dash UX and internal config
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-uk committed Dec 29, 2023
1 parent e269dc3 commit 13a9b4a
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 14 deletions.
12 changes: 6 additions & 6 deletions deploy/helm/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ apiVersion: v1
entries:
nanomon:
- apiVersion: v2
appVersion: 0.0.8
created: "2023-10-28T11:03:16.084451395+01:00"
appVersion: 0.0.9
created: "2023-12-29T15:58:59.969596475Z"
dependencies:
- condition: mongodb.enabled
name: mongodb
repository: https://charts.bitnami.com/bitnami
version: 13.x.x
description: Deploy NanoMon, a HTTP and network monitoring tool
digest: 6269c725121a3601e1fbb757d4c23ab2fb7eeb0d70ab1d09161bc416cd534f3a
digest: 033846643a063be31075313f66a476d7af9b06bca0492a4f075eefd3b0db6f85
name: nanomon
type: application
urls:
- nanomon-0.0.6.tgz
version: 0.0.6
- apiVersion: v2
appVersion: 0.0.4
created: "2023-10-28T11:03:16.077647567+01:00"
created: "2023-12-29T15:58:59.963805497Z"
dependencies:
- condition: mongodb.enabled
name: mongodb
Expand All @@ -33,7 +33,7 @@ entries:
version: 0.0.5
- apiVersion: v2
appVersion: 0.0.3
created: "2023-10-28T11:03:16.071528116+01:00"
created: "2023-12-29T15:58:59.958862518Z"
dependencies:
- condition: mongodb.enabled
name: mongodb
Expand All @@ -46,4 +46,4 @@ entries:
urls:
- nanomon-0.0.4.tgz
version: 0.0.4
generated: "2023-10-28T11:03:16.066312772+01:00"
generated: "2023-12-29T15:58:59.952014861Z"
Binary file modified deploy/helm/nanomon-0.0.6.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion deploy/helm/nanomon/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: nanomon
description: Deploy NanoMon, a HTTP and network monitoring tool
type: application
version: "0.0.6"
appVersion: "0.0.8"
appVersion: "0.0.9"
dependencies:
- name: mongodb
repository: https://charts.bitnami.com/bitnami
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/nanomon/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nanomon

![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.8](https://img.shields.io/badge/AppVersion-0.0.8-informational?style=flat-square)
![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.9](https://img.shields.io/badge/AppVersion-0.0.9-informational?style=flat-square)

Deploy NanoMon, a HTTP and network monitoring tool

Expand Down
5 changes: 5 additions & 0 deletions frontend/app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ async function startApp() {
BUILD_INFO: '__DEFAULT__',
}
}

// These are sort of hard coded as I'm lazy
config.apiDebug = false // Enable API debug logging
config.refreshTime = 15 // Seconds between refreshes

console.log(`### Config: ${JSON.stringify(config)}`)

Alpine.start()
Expand Down
9 changes: 9 additions & 0 deletions frontend/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,12 @@ a {
font-size: 1rem;
}
}

.dash-name {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
min-height: 2.4rem;
line-height: 1.2rem;
}
6 changes: 5 additions & 1 deletion frontend/lib/api-client.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// NanoMon Frontend - API client for calling the backend NanoMon API
// ----------------------------------------------------------------------------

import { config } from '../app.mjs'

export class APIClient {
endpoint = 'http://localhost:8000'
scopes = []
Expand Down Expand Up @@ -55,7 +57,9 @@ export class APIClient {

// All requests go through this method, it handles auth if required
async _baseRequest(path, method = 'GET', body, authRequest = false) {
// Removed console.log(`### API request: ${method} ${this.endpoint}/${path}`)
if (config.apiDebug) {
console.log(`### API request: ${method} ${this.endpoint}/${path}`)
}

// This block handles authentication if enabled and the request requires it
let tokenRes = null
Expand Down
4 changes: 2 additions & 2 deletions frontend/views/dash.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
@click="window.location.hash = '#monitor/'+m.id"
>
<div x-html="m.icon" class="fs-1"></div>
<!-- <hr /> -->
<div x-text="m.name"></div>
<div x-text="m.name" class="dash-name"></div>
</div>
</template>
</div>
Expand All @@ -19,6 +18,7 @@
<div class="spinner-border spinner-border-sm text-info" role="status" x-show="loading">
<span class="visually-hidden">Loading...</span>
</div>

<span x-text="updateText"></span>

&mdash; <span x-text="paused ? 'Auto update paused': 'Auto update every '+autoUpdate+' seconds '"> </span> &mdash;
Expand Down
3 changes: 2 additions & 1 deletion frontend/views/dash.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// NanoMon Frontend
// ----------------------------------------------------------------------------

import { config } from '../app.mjs'
import { getStatusFields, monitorIcon } from '../lib/utils.mjs'

export const dashComponent = (api) => ({
monitors: [],
error: '',
autoUpdate: 5,
autoUpdate: config.refreshTime,
updated: new Date(),
intervalToken: null,
loading: true,
Expand Down
3 changes: 2 additions & 1 deletion frontend/views/home.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// NanoMon Frontend
// ----------------------------------------------------------------------------

import { config } from '../app.mjs'
import { getStatusFields, monitorIcon } from '../lib/utils.mjs'

const charts = {}
Expand All @@ -11,7 +12,7 @@ const CHART_SIZE = 20
export const homeComponent = (api) => ({
monitors: [],
error: '',
autoUpdate: 5,
autoUpdate: config.refreshTime,
updated: new Date(),
intervalToken: null,
loading: true,
Expand Down
3 changes: 2 additions & 1 deletion frontend/views/results.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// NanoMon Frontend
// ----------------------------------------------------------------------------

import { config } from '../app.mjs'
import { getStatusFields } from '../lib/utils.mjs'

export const resultsComponent = (api) => ({
results: [],
error: '',
autoUpdate: 5,
autoUpdate: config.refreshTime,
updated: new Date(),
intervalToken: null,
loading: true,
Expand Down

0 comments on commit 13a9b4a

Please sign in to comment.