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
aa4b3ef0
Commit
aa4b3ef0
authored
Aug 22, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More error handling, changed es loading to use get instead of search
parent
f4f8577d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
js/services.js
+14
-12
No files found.
js/services.js
View file @
aa4b3ef0
...
@@ -53,6 +53,7 @@ angular.module('kibana.services', [])
...
@@ -53,6 +53,7 @@ angular.module('kibana.services', [])
self
.
map
(
indices
).
then
(
function
(
result
)
{
self
.
map
(
indices
).
then
(
function
(
result
)
{
self
.
mapping
=
_
.
extend
(
self
.
mapping
,
result
);
self
.
mapping
=
_
.
extend
(
self
.
mapping
,
result
);
self
.
list
=
mapFields
(
self
.
mapping
);
self
.
list
=
mapFields
(
self
.
mapping
);
console
.
log
(
self
.
mapping
);
});
});
// Otherwise just use the cached mapping
// Otherwise just use the cached mapping
}
else
{
}
else
{
...
@@ -749,20 +750,22 @@ angular.module('kibana.services', [])
...
@@ -749,20 +750,22 @@ angular.module('kibana.services', [])
});
});
};
};
this
.
elasticsearch_load
=
function
(
type
,
id
)
{
this
.
elasticsearch_load
=
function
(
type
,
id
)
{
var
request
=
ejs
.
Request
().
indices
(
config
.
kibana_index
).
types
(
type
);
return
$http
({
return
request
.
query
(
url
:
config
.
elasticsearch
+
"/"
+
config
.
kibana_index
+
"/"
+
type
+
"/"
+
id
,
ejs
.
IdsQuery
(
id
)
method
:
"GET"
).
doSearch
(
function
(
results
)
{
}).
error
(
function
(
data
,
status
,
headers
,
conf
)
{
if
(
_
.
isUndefined
(
results
))
{
if
(
status
===
0
)
{
return
false
;
alertSrv
.
set
(
'Error'
,
"Could not contact Elasticsearch at "
+
config
.
elasticsearch
+
". Please ensure that Elasticsearch is reachable from your system."
,
'error'
);
}
else
{
}
else
{
self
.
dash_load
(
angular
.
fromJson
(
results
.
hits
.
hits
[
0
][
'_source'
][
'dashboard'
]));
alertSrv
.
set
(
'Error'
,
"Could not find "
+
id
+
". If you"
+
return
true
;
" are using a proxy, ensure it is configured correctly"
,
'error'
)
;
}
}
},
return
false
;
function
(
data
,
statu
s
)
{
}).
success
(
function
(
data
,
status
,
header
s
)
{
alertSrv
.
set
(
'Error'
,
'Could not load '
+
config
.
elasticsearch
+
"/"
+
config
.
kibana_index
+
"/"
+
type
+
"/"
+
id
,
'error'
);
self
.
dash_load
(
angular
.
fromJson
(
data
[
'_source'
][
'dashboard'
])
);
});
});
};
};
...
@@ -786,7 +789,6 @@ angular.module('kibana.services', [])
...
@@ -786,7 +789,6 @@ angular.module('kibana.services', [])
request
=
type
===
'temp'
&&
ttl
?
request
.
ttl
(
ttl
)
:
request
;
request
=
type
===
'temp'
&&
ttl
?
request
.
ttl
(
ttl
)
:
request
;
// TOFIX: Implement error handling here
return
request
.
doIndex
(
return
request
.
doIndex
(
// Success
// Success
function
(
result
)
{
function
(
result
)
{
...
...
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