diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d4ee020dce..a61e0d66c65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ * **Graph**: Fixed issue with unneeded scrollbar in legend for Firefox, fixes [#4760](https://github.com/grafana/grafana/issues/4760) * **Table panel**: Fixed issue table panel formating string array properties, fixes [#4791](https://github.com/grafana/grafana/issues/4791) * **grafana-cli**: Improve error message when failing to install plugins due to corrupt response, fixes [#4651](https://github.com/grafana/grafana/issues/4651) +* **Singlestat**: Fixes prefix an postfix for gauges, fixes [#4812](https://github.com/grafana/grafana/issues/4812) +* **Singlestat**: Fixes auto-refresh on change for some options, fixes [#4809](https://github.com/grafana/grafana/issues/4809) # 3.0.0-beta5 (2016-04-15) diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..6cccaa7f64b --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +all: deps build + +deps: + go run build.go setup + godep restore + npm install + +build: + go run build.go build + npm run build + +test: + godep go test -v ./pkg/... + npm test + +run: + ./bin/grafana-server diff --git a/README.md b/README.md index 931055349cf..d538ba78e1e 100644 --- a/README.md +++ b/README.md @@ -103,8 +103,7 @@ npm (v2.5.0) and grunt (v0.4.5). Run the following: ```bash npm install -npm install -g grunt-cli -grunt +npm run build ``` ### Recompile backend on source change @@ -145,4 +144,3 @@ please [sign the CLA](http://docs.grafana.org/project/cla/) Grafana is distributed under Apache 2.0 License. Work in progress Grafana 2.0 (with included Grafana backend) - diff --git a/build.go b/build.go index 93b9e6db087..0965a405e70 100644 --- a/build.go +++ b/build.go @@ -306,7 +306,7 @@ func ChangeWorkingDir(dir string) { } func grunt(params ...string) { - runPrint("./node_modules/grunt-cli/bin/grunt", params...) + runPrint("./node_modules/.bin/grunt", params...) } func setup() { diff --git a/circle.yml b/circle.yml index 22dab8ab893..02f9f91e103 100644 --- a/circle.yml +++ b/circle.yml @@ -25,12 +25,12 @@ test: # Go test - godep go test -v ./pkg/... # js tests - - ./node_modules/grunt-cli/bin/grunt test + - npm test - npm run coveralls deployment: master: branch: master owner: grafana - commands: + commands: - ./trigger_grafana_packer.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN} diff --git a/package.json b/package.json index e71a9049dde..e314476f999 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "npm": "2.14.x" }, "scripts": { + "build": "grunt", "test": "grunt test", "coveralls": "grunt karma:coveralls && rm -rf ./coverage" }, diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index 0e28aa8baba..8033e73468d 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -278,6 +278,14 @@ class SingleStatCtrl extends MetricsPanelCtrl { return body; } + function getValueText() { + var result = panel.prefix ? panel.prefix : ''; + result += data.valueFormated; + result += panel.postfix ? panel.postfix : ''; + + return result; + } + function addGauge() { var plotCanvas = $('
'); var plotCss = { @@ -332,8 +340,8 @@ class SingleStatCtrl extends MetricsPanelCtrl { }, value: { color: panel.colorValue ? getColorForValue(data, data.valueRounded) : null, - formatter: function () { return data.valueFormated; }, - font: { size: getGaugeFontSize() } + formatter: function() { return getValueText(); }, + font: { size: getGaugeFontSize(), family: 'Helvetica Neue", Helvetica, Arial, sans-serif' } }, show: true } @@ -352,7 +360,7 @@ class SingleStatCtrl extends MetricsPanelCtrl { function getGaugeFontSize() { if (panel.valueFontSize) { var num = parseInt(panel.valueFontSize.substring(0, panel.valueFontSize.length - 1)); - return 30 * (num / 100); + return (30 * (num / 100)) + 15; } else { return 30; } @@ -419,6 +427,7 @@ class SingleStatCtrl extends MetricsPanelCtrl { function render() { if (!ctrl.data) { return; } + ctrl.setValues(ctrl.data); data = ctrl.data; setElementHeight(); diff --git a/public/sass/components/_panel_singlestat.scss b/public/sass/components/_panel_singlestat.scss index 84de79c387e..fac2f716674 100644 --- a/public/sass/components/_panel_singlestat.scss +++ b/public/sass/components/_panel_singlestat.scss @@ -48,4 +48,8 @@ } } +#flotGagueValue0 { + font-weight: bold; //please dont hurt me for this! +} +