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