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
1f959272
Commit
1f959272
authored
Sep 16, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(migration): added back support to import old dashboard from from Elasticsearch
parent
f9cd9423
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
public/app/plugins/datasource/elasticsearch/datasource.js
+36
-0
No files found.
public/app/plugins/datasource/elasticsearch/datasource.js
View file @
1f959272
...
@@ -215,6 +215,42 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
...
@@ -215,6 +215,42 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
});
});
};
};
ElasticDatasource
.
prototype
.
getDashboard
=
function
(
id
)
{
return
this
.
_get
(
'/dashboard/'
+
id
)
.
then
(
function
(
result
)
{
return
angular
.
fromJson
(
result
.
_source
.
dashboard
);
});
};
ElasticDatasource
.
prototype
.
searchDashboards
=
function
()
{
var
query
=
{
query
:
{
query_string
:
{
query
:
'*'
}
},
size
:
10000
,
sort
:
[
"_uid"
],
};
return
this
.
_post
(
this
.
index
+
'/dashboard/_search'
,
query
)
.
then
(
function
(
results
)
{
if
(
_
.
isUndefined
(
results
.
hits
))
{
return
{
dashboards
:
[],
tags
:
[]
};
}
var
resultsHits
=
results
.
hits
.
hits
;
var
displayHits
=
{
dashboards
:
[]
};
for
(
var
i
=
0
,
len
=
resultsHits
.
length
;
i
<
len
;
i
++
)
{
var
hit
=
resultsHits
[
i
];
displayHits
.
dashboards
.
push
({
id
:
hit
.
_id
,
title
:
hit
.
_source
.
title
,
tags
:
hit
.
_source
.
tags
});
}
return
displayHits
;
});
};
return
ElasticDatasource
;
return
ElasticDatasource
;
});
});
});
});
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