Skip to content

Commit 7c06604

Browse files
committed
Merge branch 'master' of github.com:grafana/grafana
2 parents 0762c38 + baac780 commit 7c06604

File tree

8 files changed

+40
-9
lines changed

8 files changed

+40
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* **Graph**: Fixed issue with unneeded scrollbar in legend for Firefox, fixes [#4760](https://github.com/grafana/grafana/issues/4760)
1212
* **Table panel**: Fixed issue table panel formating string array properties, fixes [#4791](https://github.com/grafana/grafana/issues/4791)
1313
* **grafana-cli**: Improve error message when failing to install plugins due to corrupt response, fixes [#4651](https://github.com/grafana/grafana/issues/4651)
14+
* **Singlestat**: Fixes prefix an postfix for gauges, fixes [#4812](https://github.com/grafana/grafana/issues/4812)
15+
* **Singlestat**: Fixes auto-refresh on change for some options, fixes [#4809](https://github.com/grafana/grafana/issues/4809)
1416

1517
# 3.0.0-beta5 (2016-04-15)
1618

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
all: deps build
2+
3+
deps:
4+
go run build.go setup
5+
godep restore
6+
npm install
7+
8+
build:
9+
go run build.go build
10+
npm run build
11+
12+
test:
13+
godep go test -v ./pkg/...
14+
npm test
15+
16+
run:
17+
./bin/grafana-server

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ npm (v2.5.0) and grunt (v0.4.5). Run the following:
103103

104104
```bash
105105
npm install
106-
npm install -g grunt-cli
107-
grunt
106+
npm run build
108107
```
109108

110109
### Recompile backend on source change
@@ -145,4 +144,3 @@ please [sign the CLA](http://docs.grafana.org/project/cla/)
145144

146145
Grafana is distributed under Apache 2.0 License.
147146
Work in progress Grafana 2.0 (with included Grafana backend)
148-

build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func ChangeWorkingDir(dir string) {
306306
}
307307

308308
func grunt(params ...string) {
309-
runPrint("./node_modules/grunt-cli/bin/grunt", params...)
309+
runPrint("./node_modules/.bin/grunt", params...)
310310
}
311311

312312
func setup() {

circle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ test:
2525
# Go test
2626
- godep go test -v ./pkg/...
2727
# js tests
28-
- ./node_modules/grunt-cli/bin/grunt test
28+
- npm test
2929
- npm run coveralls
3030

3131
deployment:
3232
master:
3333
branch: master
3434
owner: grafana
35-
commands:
35+
commands:
3636
- ./trigger_grafana_packer.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"npm": "2.14.x"
6363
},
6464
"scripts": {
65+
"build": "grunt",
6566
"test": "grunt test",
6667
"coveralls": "grunt karma:coveralls && rm -rf ./coverage"
6768
},

public/app/plugins/panel/singlestat/module.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ class SingleStatCtrl extends MetricsPanelCtrl {
278278
return body;
279279
}
280280

281+
function getValueText() {
282+
var result = panel.prefix ? panel.prefix : '';
283+
result += data.valueFormated;
284+
result += panel.postfix ? panel.postfix : '';
285+
286+
return result;
287+
}
288+
281289
function addGauge() {
282290
var plotCanvas = $('<div></div>');
283291
var plotCss = {
@@ -332,8 +340,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
332340
},
333341
value: {
334342
color: panel.colorValue ? getColorForValue(data, data.valueRounded) : null,
335-
formatter: function () { return data.valueFormated; },
336-
font: { size: getGaugeFontSize() }
343+
formatter: function() { return getValueText(); },
344+
font: { size: getGaugeFontSize(), family: 'Helvetica Neue", Helvetica, Arial, sans-serif' }
337345
},
338346
show: true
339347
}
@@ -352,7 +360,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
352360
function getGaugeFontSize() {
353361
if (panel.valueFontSize) {
354362
var num = parseInt(panel.valueFontSize.substring(0, panel.valueFontSize.length - 1));
355-
return 30 * (num / 100);
363+
return (30 * (num / 100)) + 15;
356364
} else {
357365
return 30;
358366
}
@@ -419,6 +427,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
419427

420428
function render() {
421429
if (!ctrl.data) { return; }
430+
ctrl.setValues(ctrl.data);
422431
data = ctrl.data;
423432
setElementHeight();
424433

public/sass/components/_panel_singlestat.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@
4848
}
4949
}
5050

51+
#flotGagueValue0 {
52+
font-weight: bold; //please dont hurt me for this!
53+
}
54+
5155

0 commit comments

Comments
 (0)