Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5a1cf2c7
Commit
5a1cf2c7
authored
Jan 23, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: minor code style changes
parent
dd707106
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
pkg/services/sqlstore/alert.go
+4
-4
pkg/services/sqlstore/playlist.go
+3
-6
No files found.
pkg/services/sqlstore/alert.go
View file @
5a1cf2c7
...
...
@@ -24,7 +24,7 @@ func init() {
func
GetAlertById
(
query
*
m
.
GetAlertByIdQuery
)
error
{
alert
:=
m
.
Alert
{}
has
,
err
:=
x
.
I
d
(
query
.
Id
)
.
Get
(
&
alert
)
has
,
err
:=
x
.
I
D
(
query
.
Id
)
.
Get
(
&
alert
)
if
!
has
{
return
fmt
.
Errorf
(
"could not find alert"
)
}
...
...
@@ -113,7 +113,7 @@ func HandleAlertsQuery(query *m.GetAlertsQuery) error {
}
alerts
:=
make
([]
*
m
.
Alert
,
0
)
if
err
:=
x
.
S
ql
(
sql
.
String
(),
params
...
)
.
Find
(
&
alerts
);
err
!=
nil
{
if
err
:=
x
.
S
QL
(
sql
.
String
(),
params
...
)
.
Find
(
&
alerts
);
err
!=
nil
{
return
err
}
...
...
@@ -260,7 +260,7 @@ func SetAlertState(cmd *m.SetAlertStateCommand) error {
alert
.
ExecutionError
=
cmd
.
Error
}
sess
.
I
d
(
alert
.
Id
)
.
Update
(
&
alert
)
sess
.
I
D
(
alert
.
Id
)
.
Update
(
&
alert
)
return
nil
})
}
...
...
@@ -324,7 +324,7 @@ func GetAlertStatesForDashboard(query *m.GetAlertStatesForDashboardQuery) error
WHERE org_id = ? AND dashboard_id = ?`
query
.
Result
=
make
([]
*
m
.
AlertStateInfoDTO
,
0
)
err
:=
x
.
S
ql
(
rawSql
,
query
.
OrgId
,
query
.
DashboardId
)
.
Find
(
&
query
.
Result
)
err
:=
x
.
S
QL
(
rawSql
,
query
.
OrgId
,
query
.
DashboardId
)
.
Find
(
&
query
.
Result
)
return
err
}
pkg/services/sqlstore/playlist.go
View file @
5a1cf2c7
...
...
@@ -17,15 +17,13 @@ func init() {
}
func
CreatePlaylist
(
cmd
*
m
.
CreatePlaylistCommand
)
error
{
var
err
error
playlist
:=
m
.
Playlist
{
Name
:
cmd
.
Name
,
Interval
:
cmd
.
Interval
,
OrgId
:
cmd
.
OrgId
,
}
_
,
err
=
x
.
Insert
(
&
playlist
)
_
,
err
:
=
x
.
Insert
(
&
playlist
)
fmt
.
Printf
(
"%v"
,
playlist
.
Id
)
...
...
@@ -47,7 +45,6 @@ func CreatePlaylist(cmd *m.CreatePlaylistCommand) error {
}
func
UpdatePlaylist
(
cmd
*
m
.
UpdatePlaylistCommand
)
error
{
var
err
error
playlist
:=
m
.
Playlist
{
Id
:
cmd
.
Id
,
OrgId
:
cmd
.
OrgId
,
...
...
@@ -68,7 +65,7 @@ func UpdatePlaylist(cmd *m.UpdatePlaylistCommand) error {
Interval
:
playlist
.
Interval
,
}
_
,
err
=
x
.
Id
(
cmd
.
Id
)
.
Cols
(
"id"
,
"name"
,
"interval"
)
.
Update
(
&
playlist
)
_
,
err
:=
x
.
ID
(
cmd
.
Id
)
.
Cols
(
"id"
,
"name"
,
"interval"
)
.
Update
(
&
playlist
)
if
err
!=
nil
{
return
err
...
...
@@ -104,7 +101,7 @@ func GetPlaylist(query *m.GetPlaylistByIdQuery) error {
}
playlist
:=
m
.
Playlist
{}
_
,
err
:=
x
.
I
d
(
query
.
Id
)
.
Get
(
&
playlist
)
_
,
err
:=
x
.
I
D
(
query
.
Id
)
.
Get
(
&
playlist
)
query
.
Result
=
&
playlist
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment