Skip to content

Commit d8587d9

Browse files
committed
default user, default dashboard
1 parent 20d4c41 commit d8587d9

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

pkg/plugin/datasource.go

-6
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,6 @@ func (d *Datasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRe
208208
res.Message = "'Host' cannot be empty"
209209
return res, nil
210210
}
211-
if len(config.Username) == 0 {
212-
res.Status = backend.HealthStatusError
213-
res.Message = "'Username' cannot be empty"
214-
return res, nil
215-
}
216-
217211
engine := timeplus.NewEngine(logger, config.Host, config.TCPPort, config.HTTPPort, config.Username, config.Secrets.Password)
218212

219213
if err := engine.Ping(ctx); err != nil {

pkg/timeplus/engine.go

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ func NewEngine(logger log.Logger, host string, tcpPort, httpPort int, username,
4343
if httpPort == 0 {
4444
httpPort = 3218
4545
}
46+
if len(username) == 0 {
47+
username = "default"
48+
}
49+
4650
connection := protonDriver.OpenDB(&protonDriver.Options{
4751
Addr: []string{fmt.Sprintf("%s:%d", host, tcpPort)},
4852
Auth: protonDriver.Auth{

provisioning/dashboards/carsharing.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -399,24 +399,24 @@
399399
{
400400
"current": {
401401
"selected": true,
402-
"text": "c00013",
403-
"value": "c00013"
402+
"text": "c00000",
403+
"value": "c00000"
404404
},
405405
"datasource": {
406406
"type": "timeplus-proton-datasource",
407407
"uid": "proton-ds"
408408
},
409-
"definition": "select cid from table(car_live_data)",
409+
"definition": "select cid from table(car_live_data) where _tp_time < to_datetime($__to/1000) and _tp_time > to_datetime($__from/1000)",
410410
"hide": 0,
411411
"includeAll": false,
412412
"label": "Car ID",
413413
"multi": false,
414414
"name": "cid",
415415
"options": [],
416416
"query": {
417-
"query": "select cid from table(car_live_data)"
417+
"query": "select cid from table(car_live_data) where _tp_time < to_datetime($__to/1000) and _tp_time > to_datetime($__from/1000)"
418418
},
419-
"refresh": 1,
419+
"refresh": 2,
420420
"regex": "",
421421
"skipUrlSync": false,
422422
"sort": 0,
@@ -432,6 +432,6 @@
432432
"timezone": "",
433433
"title": "Carsharing Demo Dashboard",
434434
"uid": "dd9e271d-7225-47d4-9e57-62133db0df62",
435-
"version": 13,
435+
"version": 1,
436436
"weekStart": ""
437437
}

src/components/ConfigEditor.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,12 @@ export function ConfigEditor(props: Props) {
106106
width={40}
107107
/>
108108
</InlineField>
109-
<InlineField required={true} label="Username" labelWidth={14} interactive tooltip={'Username'}>
109+
<InlineField label="Username" labelWidth={14} interactive tooltip={'Username'}>
110110
<Input
111-
required={true}
112111
id="config-editor-username"
113112
onChange={onUsernameChange}
114113
value={jsonData.username}
115-
placeholder="Enter the username, e.g. admin"
114+
placeholder="default"
116115
width={40}
117116
/>
118117
</InlineField>

0 commit comments

Comments
 (0)