From 039d304a2aee6058f04ad3802c072bcbf02e0b45 Mon Sep 17 00:00:00 2001 From: rozetko Date: Mon, 28 May 2018 13:55:14 +0300 Subject: [PATCH] Fix typos (#3) --- README.md | 2 +- src/module.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a2d94cc..b2507a7 100644 --- a/README.md +++ b/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 diff --git a/src/module.ts b/src/module.ts index 8160852..4ad545c 100644 --- a/src/module.ts +++ b/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;