Commit 7c06604f by Torkel Ödegaard

Merge branch 'master' of github.com:grafana/grafana

parents 0762c38d baac7809
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* **Graph**: Fixed issue with unneeded scrollbar in legend for Firefox, fixes [#4760](https://github.com/grafana/grafana/issues/4760) * **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) * **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) * **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) # 3.0.0-beta5 (2016-04-15)
......
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
...@@ -103,8 +103,7 @@ npm (v2.5.0) and grunt (v0.4.5). Run the following: ...@@ -103,8 +103,7 @@ npm (v2.5.0) and grunt (v0.4.5). Run the following:
```bash ```bash
npm install npm install
npm install -g grunt-cli npm run build
grunt
``` ```
### Recompile backend on source change ### Recompile backend on source change
...@@ -145,4 +144,3 @@ please [sign the CLA](http://docs.grafana.org/project/cla/) ...@@ -145,4 +144,3 @@ please [sign the CLA](http://docs.grafana.org/project/cla/)
Grafana is distributed under Apache 2.0 License. Grafana is distributed under Apache 2.0 License.
Work in progress Grafana 2.0 (with included Grafana backend) Work in progress Grafana 2.0 (with included Grafana backend)
...@@ -306,7 +306,7 @@ func ChangeWorkingDir(dir string) { ...@@ -306,7 +306,7 @@ func ChangeWorkingDir(dir string) {
} }
func grunt(params ...string) { func grunt(params ...string) {
runPrint("./node_modules/grunt-cli/bin/grunt", params...) runPrint("./node_modules/.bin/grunt", params...)
} }
func setup() { func setup() {
......
...@@ -25,7 +25,7 @@ test: ...@@ -25,7 +25,7 @@ test:
# Go test # Go test
- godep go test -v ./pkg/... - godep go test -v ./pkg/...
# js tests # js tests
- ./node_modules/grunt-cli/bin/grunt test - npm test
- npm run coveralls - npm run coveralls
deployment: deployment:
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
"npm": "2.14.x" "npm": "2.14.x"
}, },
"scripts": { "scripts": {
"build": "grunt",
"test": "grunt test", "test": "grunt test",
"coveralls": "grunt karma:coveralls && rm -rf ./coverage" "coveralls": "grunt karma:coveralls && rm -rf ./coverage"
}, },
......
...@@ -278,6 +278,14 @@ class SingleStatCtrl extends MetricsPanelCtrl { ...@@ -278,6 +278,14 @@ class SingleStatCtrl extends MetricsPanelCtrl {
return body; return body;
} }
function getValueText() {
var result = panel.prefix ? panel.prefix : '';
result += data.valueFormated;
result += panel.postfix ? panel.postfix : '';
return result;
}
function addGauge() { function addGauge() {
var plotCanvas = $('<div></div>'); var plotCanvas = $('<div></div>');
var plotCss = { var plotCss = {
...@@ -332,8 +340,8 @@ class SingleStatCtrl extends MetricsPanelCtrl { ...@@ -332,8 +340,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
}, },
value: { value: {
color: panel.colorValue ? getColorForValue(data, data.valueRounded) : null, color: panel.colorValue ? getColorForValue(data, data.valueRounded) : null,
formatter: function () { return data.valueFormated; }, formatter: function() { return getValueText(); },
font: { size: getGaugeFontSize() } font: { size: getGaugeFontSize(), family: 'Helvetica Neue", Helvetica, Arial, sans-serif' }
}, },
show: true show: true
} }
...@@ -352,7 +360,7 @@ class SingleStatCtrl extends MetricsPanelCtrl { ...@@ -352,7 +360,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
function getGaugeFontSize() { function getGaugeFontSize() {
if (panel.valueFontSize) { if (panel.valueFontSize) {
var num = parseInt(panel.valueFontSize.substring(0, panel.valueFontSize.length - 1)); var num = parseInt(panel.valueFontSize.substring(0, panel.valueFontSize.length - 1));
return 30 * (num / 100); return (30 * (num / 100)) + 15;
} else { } else {
return 30; return 30;
} }
...@@ -419,6 +427,7 @@ class SingleStatCtrl extends MetricsPanelCtrl { ...@@ -419,6 +427,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
function render() { function render() {
if (!ctrl.data) { return; } if (!ctrl.data) { return; }
ctrl.setValues(ctrl.data);
data = ctrl.data; data = ctrl.data;
setElementHeight(); setElementHeight();
......
...@@ -48,4 +48,8 @@ ...@@ -48,4 +48,8 @@
} }
} }
#flotGagueValue0 {
font-weight: bold; //please dont hurt me for this!
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment