UI changes for problems
This commit is contained in:
parent
332788dd20
commit
09241e73a5
18 changed files with 125 additions and 40 deletions
19
problem.go
19
problem.go
|
|
@ -26,7 +26,7 @@ type Problem struct { // {{{
|
|||
SectionName string `json:"section_name"`
|
||||
} // }}}
|
||||
|
||||
func ProblemsRetrieve(archived bool, from, to time.Time) (problems []Problem, err error) { // {{{
|
||||
func ProblemsRetrieve(showCurrent bool, from, to time.Time) (problems []Problem, err error) { // {{{
|
||||
problems = []Problem{}
|
||||
row := service.Db.Conn.QueryRow(`
|
||||
SELECT
|
||||
|
|
@ -48,11 +48,14 @@ func ProblemsRetrieve(archived bool, from, to time.Time) (problems []Problem, er
|
|||
INNER JOIN area a ON s.area_id = a.id
|
||||
WHERE
|
||||
CASE
|
||||
WHEN $1 THEN true
|
||||
WHEN NOT $1 THEN p.end IS NULL
|
||||
END AND
|
||||
p.start >= $2 AND
|
||||
p.end <= $3
|
||||
WHEN NOT $1 THEN p.end IS NULL
|
||||
WHEN $1 THEN
|
||||
p.start >= $2 AND
|
||||
(
|
||||
p.end IS NULL OR
|
||||
p.end <= $3
|
||||
)
|
||||
END
|
||||
|
||||
ORDER BY
|
||||
p.start DESC)
|
||||
|
|
@ -61,7 +64,7 @@ func ProblemsRetrieve(archived bool, from, to time.Time) (problems []Problem, er
|
|||
|
||||
(SELECT
|
||||
-1 AS id,
|
||||
null,
|
||||
dp.last_value,
|
||||
null,
|
||||
false,
|
||||
'{}',
|
||||
|
|
@ -78,7 +81,7 @@ func ProblemsRetrieve(archived bool, from, to time.Time) (problems []Problem, er
|
|||
ORDER BY
|
||||
dp.name ASC)
|
||||
) AS problems`,
|
||||
archived,
|
||||
showCurrent,
|
||||
from,
|
||||
to,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue