Added nodata_problem_seconds to datapoint view
This commit is contained in:
parent
aa9376ac13
commit
a94559ab6c
13
datapoint.go
13
datapoint.go
@ -161,6 +161,7 @@ func DatapointsRetrieve() (dps []Datapoint, err error) { // {{{
|
||||
dp.datatype,
|
||||
dp.last_value,
|
||||
dp.group,
|
||||
dp.nodata_problem_seconds,
|
||||
|
||||
dpv.id AS v_id,
|
||||
dpv.ts,
|
||||
@ -185,11 +186,12 @@ func DatapointsRetrieve() (dps []Datapoint, err error) { // {{{
|
||||
defer rows.Close()
|
||||
|
||||
type DbRes struct {
|
||||
ID int
|
||||
Group string
|
||||
Name string
|
||||
Datatype DatapointType
|
||||
LastValue time.Time `db:"last_value"`
|
||||
ID int
|
||||
Group string
|
||||
Name string
|
||||
Datatype DatapointType
|
||||
LastValue time.Time `db:"last_value"`
|
||||
NodataProblemSeconds int `db:"nodata_problem_seconds"`
|
||||
|
||||
VID sql.NullInt64 `db:"v_id"`
|
||||
Ts sql.NullTime
|
||||
@ -214,6 +216,7 @@ func DatapointsRetrieve() (dps []Datapoint, err error) { // {{{
|
||||
dp.Datatype = res.Datatype
|
||||
dp.LastValue = res.LastValue
|
||||
dp.Found = true
|
||||
dp.NodataProblemSeconds = res.NodataProblemSeconds
|
||||
|
||||
if res.VID.Valid {
|
||||
dpv.ID = int(res.VID.Int64)
|
||||
|
@ -104,7 +104,7 @@ label {
|
||||
}
|
||||
#datapoints {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, min-content);
|
||||
grid-template-columns: repeat(6, min-content);
|
||||
grid-gap: 8px 16px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#datapoints {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, min-content);
|
||||
grid-template-columns: repeat(6, min-content);
|
||||
grid-gap: 8px 16px;
|
||||
margin-top: 16px;
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
<h2 class="line">{{ .Group }}</h2>
|
||||
<div class="header">Name</div>
|
||||
<div class="header">Datatype</div>
|
||||
<div class="header">No data</div>
|
||||
<div class="header">Last value</div>
|
||||
<div class="header">Value</div>
|
||||
<div class="header"></div>
|
||||
@ -22,6 +23,7 @@
|
||||
{{ end }}
|
||||
<div class="name"><a href="/datapoint/edit/{{ .ID }}">{{ .Name }}</a></div>
|
||||
<div class="datatype">{{ .Datatype }}</div>
|
||||
<div class="datatype">{{ .NodataProblemSeconds }}</div>
|
||||
<div class="last-value">{{ format_time .LastValue }}</div>
|
||||
{{ if eq .Datatype "DATETIME" }}
|
||||
<div class="value">{{ if .LastDatapointValue.ValueDateTime.Valid }}{{ format_time .LastDatapointValue.Value }}{{ end }}</div>
|
||||
|
Loading…
Reference in New Issue
Block a user