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
a8abaaf5
Commit
a8abaaf5
authored
Aug 30, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if alert exists already. Closes #442
parent
43f13746
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
js/services.js
+14
-15
No files found.
js/services.js
View file @
a8abaaf5
...
@@ -17,21 +17,20 @@ angular.module('kibana.services', [])
...
@@ -17,21 +17,20 @@ angular.module('kibana.services', [])
text
:
text
||
''
,
text
:
text
||
''
,
severity
:
severity
||
'info'
,
severity
:
severity
||
'info'
,
},
},
_ca
=
angular
.
copy
(
_a
),
_ca
=
angular
.
toJson
(
_a
),
_clist
=
angular
.
copy
(
self
.
list
);
_clist
=
_
.
map
(
self
.
list
,
function
(
alert
){
return
angular
.
toJson
(
alert
);});
console
.
log
(
_
.
contains
(
_clist
,
_ca
))
// If we already have this alert, remove it and add a new one
// Why do this instead of skipping the add because it resets the timer
// If there isn't already a message with the same text
if
(
_
.
contains
(
_clist
,
_ca
))
{
if
(
!
_
.
contains
(
_clist
,
_ca
))
{
_
.
remove
(
self
.
list
,
_
.
indexOf
(
_clist
,
_ca
));
console
.
log
(
_clist
);
}
console
.
log
([
_ca
]);
self
.
list
.
push
(
_a
);
self
.
list
.
push
(
_a
);
if
(
timeout
>
0
)
{
if
(
timeout
>
0
)
{
$timeout
(
function
()
{
$timeout
(
function
()
{
self
.
list
=
_
.
without
(
self
.
list
,
_a
);
self
.
list
=
_
.
without
(
self
.
list
,
_a
);
},
timeout
);
},
timeout
);
}
}
}
};
};
...
...
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