Skip to content

Commit 65b4945

Browse files
committed
Merge branch 'master' into query-editor-style
2 parents bca0894 + aa98ada commit 65b4945

File tree

19 files changed

+115
-52
lines changed

19 files changed

+115
-52
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
},

pkg/api/dtos/plugins.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ func (slice PluginList) Swap(i, j int) {
4848
type ImportDashboardCommand struct {
4949
PluginId string `json:"pluginId"`
5050
Path string `json:"path"`
51-
Reinstall bool `json:"reinstall"`
51+
Overwrite bool `json:"overwrite"`
5252
Inputs []plugins.ImportDashboardInput `json:"inputs"`
5353
}

pkg/api/plugins.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,12 @@ func GetPluginReadme(c *middleware.Context) Response {
156156
func ImportDashboard(c *middleware.Context, apiCmd dtos.ImportDashboardCommand) Response {
157157

158158
cmd := plugins.ImportDashboardCommand{
159-
OrgId: c.OrgId,
160-
UserId: c.UserId,
161-
PluginId: apiCmd.PluginId,
162-
Path: apiCmd.Path,
163-
Inputs: apiCmd.Inputs,
159+
OrgId: c.OrgId,
160+
UserId: c.UserId,
161+
PluginId: apiCmd.PluginId,
162+
Path: apiCmd.Path,
163+
Inputs: apiCmd.Inputs,
164+
Overwrite: apiCmd.Overwrite,
164165
}
165166

166167
if err := bus.Dispatch(&cmd); err != nil {

pkg/plugins/dashboard_importer.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ import (
1111
)
1212

1313
type ImportDashboardCommand struct {
14-
Path string `json:"string"`
15-
Inputs []ImportDashboardInput `json:"inputs"`
14+
Path string
15+
Inputs []ImportDashboardInput
16+
Overwrite bool
1617

17-
OrgId int64 `json:"-"`
18-
UserId int64 `json:"-"`
19-
PluginId string `json:"-"`
18+
OrgId int64
19+
UserId int64
20+
PluginId string
2021
Result *PluginDashboardInfoDTO
2122
}
2223

@@ -67,6 +68,7 @@ func ImportDashboard(cmd *ImportDashboardCommand) error {
6768
Dashboard: generatedDash,
6869
OrgId: cmd.OrgId,
6970
UserId: cmd.UserId,
71+
Overwrite: cmd.Overwrite,
7072
}
7173

7274
if err := bus.Dispatch(&saveCmd); err != nil {

public/app/core/directives/plugin_component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $
211211
// let a binding digest cycle complete before adding to dom
212212
setTimeout(function() {
213213
elem.append(child);
214+
scope.$apply(function() {
215+
scope.$broadcast('refresh');
216+
});
214217
});
215218
}
216219

public/app/core/utils/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class Emitter {
2323
this.emitter.on(name, handler);
2424

2525
if (scope) {
26-
scope.$on('$destroy', function() {
26+
scope.$on('$destroy', () => {
2727
this.emitter.off(name, handler);
2828
});
2929
}

public/app/features/panel/panel_ctrl.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,15 @@ export class PanelCtrl {
4444
this.pluginName = plugin.name;
4545
}
4646

47-
$scope.$on("refresh", () => this.refresh());
48-
$scope.$on("render", () => this.render());
47+
$scope.$on("refresh", this.refresh.bind(this));
48+
$scope.$on("render", this.render.bind(this));
4949
$scope.$on("$destroy", () => this.events.emit('panel-teardown'));
5050
}
5151

5252
init() {
5353
this.calculatePanelHeight();
54-
5554
this.publishAppEvent('panel-initialized', {scope: this.$scope});
5655
this.events.emit('panel-initialized');
57-
58-
this.refresh();
5956
}
6057

6158
renderingCompleted() {

public/app/features/plugins/ds_edit_ctrl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ export class DataSourceEditCtrl {
9898

9999
this.datasourceSrv.get(this.current.name).then(datasource => {
100100
if (!datasource.testDatasource) {
101-
this.testing.message = 'Data source does not support test connection feature.';
102-
this.testing.status = 'warning';
103-
this.testing.title = 'Unknown';
101+
delete this.testing;
104102
return;
105103
}
106104

@@ -118,7 +116,9 @@ export class DataSourceEditCtrl {
118116
}
119117
});
120118
}).finally(() => {
121-
this.testing.done = true;
119+
if (this.testing) {
120+
this.testing.done = true;
121+
}
122122
});
123123
}
124124

public/app/features/plugins/import_list/import_list.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
</td>
1616
<td>
1717
v{{dash.revision}}
18-
</td>
19-
<td ng-if="dash.installed">
20-
Imported v{{dash.installedRevision}}
18+
<span ng-if="dash.installed">
19+
&nbsp;(Imported v{{dash.installedRevision}})
20+
<span>
2121
</td>
2222
<td style="text-align: right">
2323
<button class="btn btn-secondary" ng-click="ctrl.import(dash, false)" ng-show="!dash.installed">
2424
Import
2525
</button>
2626
<button class="btn btn-secondary" ng-click="ctrl.import(dash, true)" ng-show="dash.installed">
27-
Re-Import
27+
Update
2828
</button>
2929
<button class="btn btn-danger" ng-click="ctrl.remove(dash)" ng-show="dash.installed">
3030
Delete

public/app/features/plugins/import_list/import_list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ export class DashImportListCtrl {
4343
});
4444
}
4545

46-
import(dash, reinstall) {
46+
import(dash, overwrite) {
4747
var installCmd = {
4848
pluginId: this.plugin.id,
4949
path: dash.path,
50-
reinstall: reinstall,
50+
overwrite: overwrite,
5151
inputs: []
5252
};
5353

public/app/features/plugins/partials/ds_edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h1 ng-hide="ctrl.isNew">Edit data source</h1>
5353
</plugin-component>
5454
</rebuild-on-change>
5555

56-
<div ng-if="ctrl.testing" style="margin-top: 25px">
56+
<div ng-if="ctrl.testing" class="gf-form-group">
5757
<h5 ng-show="!ctrl.testing.done">Testing.... <i class="fa fa-spiner fa-spin"></i></h5>
5858
<div class="alert-{{ctrl.testing.status}} alert">
5959
<div class="alert-title">{{ctrl.testing.title}}</div>

public/app/plugins/panel/singlestat/editor.html

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158

159159
<div class="editor-row">
160160
<div class="section" style="margin-bottom: 20px">
161-
<div class="tight-form last">
161+
<div class="tight-form">
162162
<ul class="tight-form-list">
163163
<li class="tight-form-item" style="width: 80px">
164164
<strong>Gauge</strong>
@@ -169,27 +169,39 @@
169169
ng-model="ctrl.panel.gauge.show" ng-checked="ctrl.panel.gauge.show" ng-change="ctrl.render()">
170170
<label for="panel.gauge.show" class="cr1"></label>
171171
</li>
172-
<li class="tight-form-item">
173-
Threshold labels&nbsp;
174-
<input class="cr1" id="panel.gauge.thresholdLabels" type="checkbox"
175-
ng-model="ctrl.panel.gauge.thresholdLabels" ng-checked="ctrl.panel.gauge.thresholdLabels" ng-change="ctrl.render()">
176-
<label for="panel.gauge.thresholdLabels" class="cr1"></label>
177-
</li>
178172
<li class="tight-form-item">
179173
Min
180174
</li>
181175
<li>
182-
<input type="text" class="input-small tight-form-input" ng-model="ctrl.panel.gauge.minValue" ng-blur="ctrl.render()" placeholder="0"></input>
176+
<input type="number" class="input-small tight-form-input" ng-model="ctrl.panel.gauge.minValue" ng-blur="ctrl.render()" placeholder="0"></input>
183177
</li>
184178
<li class="tight-form-item last">
185179
Max
186180
</li>
187181
<li>
188-
<input type="text" class="input-small tight-form-input last" ng-model="ctrl.panel.gauge.maxValue" ng-blur="ctrl.render()" placeholder="100"></input>
182+
<input type="number" class="input-small tight-form-input last" ng-model="ctrl.panel.gauge.maxValue" ng-blur="ctrl.render()" placeholder="100"></input>
183+
<span class="alert-state-critical" ng-show="ctrl.invalidGaugeRange">
184+
&nbsp;
185+
<i class="fa fa-warning"></i>
186+
Min value is bigger than max.
187+
</span>
189188
</li>
190189
</ul>
191190
<div class="clearfix"></div>
192191
</div>
192+
<div class="tight-form last">
193+
<li class="tight-form-item">
194+
Threshold labels&nbsp;
195+
<input class="cr1" id="panel.gauge.thresholdLabels" type="checkbox" ng-model="ctrl.panel.gauge.thresholdLabels" ng-checked="ctrl.panel.gauge.thresholdLabels" ng-change="ctrl.render()">
196+
<label for="panel.gauge.thresholdLabels" class="cr1"></label>
197+
</li>
198+
<li class="tight-form-item">
199+
Threshold markers&nbsp;
200+
<input class="cr1" id="panel.gauge.thresholdMarkers" type="checkbox" ng-model="ctrl.panel.gauge.thresholdMarkers" ng-checked="ctrl.panel.gauge.thresholdMarkers" ng-change="ctrl.render()">
201+
<label for="panel.gauge.thresholdMarkers" class="cr1"></label>
202+
</li>
203+
<div class="clearfix"></div>
204+
</div>
193205
</div>
194206
</div>
195207

0 commit comments

Comments
 (0)