Browse Source

Fix typos (#3)

master
rozetko 6 years ago committed by GitHub
parent
commit
039d304a2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      README.md
  2. 8
      src/module.ts

2
README.md

@ -21,7 +21,7 @@ You should have [hastic-server](https://github.com/hastic/hastic-server) running
- open new dasboard where you want to see Hastic panel
- open Dashboard `Settings` (top right corner) and then `Varables`
- Add new `Constant` [variable](http://docs.grafana.org/reference/templating/#variable-types) with `name` equals to `$HASTIC_SERVER_URL` and `value` with URL of your hastic-server instance (e.g. `http://localhost:8000`) in your dashboard
- Add new `Constant` [variable](http://docs.grafana.org/reference/templating/#variable-types) with `name` equals to `HASTIC_SERVER_URL` and `value` with URL of your hastic-server instance (e.g. `http://localhost:8000`) in your dashboard
- Save settings and close Settings window
- set one metrics in `Metrics` tab. Only one metric suported
- go to `Analytics tab` and create new anomaly

8
src/module.ts

@ -21,7 +21,7 @@ import config from 'grafana/app/core/config';
import _ from 'lodash';
const BACKEND_VARIABLE_NAME = "HASTIC_SERVER_URL";
const BACKEND_VARIABLE_NAME = 'HASTIC_SERVER_URL';
class GraphCtrl extends MetricsPanelCtrl {
@ -195,17 +195,17 @@ class GraphCtrl extends MetricsPanelCtrl {
}
get backendURL(): string {
if(this.templateSrv.index['HASTIC_SERVER_URL'] === undefined) {
if(this.templateSrv.index[BACKEND_VARIABLE_NAME] === undefined) {
return undefined;
}
return this.templateSrv.index['HASTIC_SERVER_URL'].current.value;
return this.templateSrv.index[BACKEND_VARIABLE_NAME].current.value;
}
async runBackendConnectivityCheck() {
if(this.backendURL === '' || this.backendURL === undefined) {
this.alertSrv.set(
`Dashboard variable $${BACKEND_VARIABLE_NAME} is missing`,
'Please set $${BACKEND_VARIABLE_NAME} ',
`Please set $${BACKEND_VARIABLE_NAME}`,
'warning', 4000
);
return;

Loading…
Cancel
Save