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
41820ccb
Commit
41820ccb
authored
Mar 23, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dashboard Snapshot sharing: singlestat panel now works, #1623
parent
4d13a5bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
10 deletions
+25
-10
src/app/features/panel/panelHelper.js
+7
-1
src/app/features/panel/panelSrv.js
+7
-0
src/app/panels/graph/module.js
+6
-9
src/app/panels/singlestat/module.js
+5
-0
No files found.
src/app/features/panel/panelHelper.js
View file @
41820ccb
...
...
@@ -70,7 +70,13 @@ function (angular, _, kbn, $) {
cacheTimeout
:
scope
.
panel
.
cacheTimeout
};
return
datasource
.
query
(
metricsQuery
);
return
datasource
.
query
(
metricsQuery
).
then
(
function
(
results
)
{
if
(
scope
.
dashboard
.
snapshot
)
{
scope
.
panel
.
snapshotData
=
results
;
}
return
results
;
});
};
});
...
...
src/app/features/panel/panelSrv.js
View file @
41820ccb
...
...
@@ -93,6 +93,13 @@ function (angular, _, config) {
$scope
.
get_data
=
function
()
{
if
(
$scope
.
otherPanelInFullscreenMode
())
{
return
;
}
if
(
$scope
.
panel
.
snapshotData
)
{
if
(
$scope
.
loadSnapshot
)
{
$scope
.
loadSnapshot
(
$scope
.
panel
.
snapshotData
);
}
return
;
}
delete
$scope
.
panelMeta
.
error
;
$scope
.
panelMeta
.
loading
=
true
;
...
...
src/app/panels/graph/module.js
View file @
41820ccb
...
...
@@ -130,12 +130,6 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) {
$scope
.
refreshData
=
function
(
datasource
)
{
panelHelper
.
updateTimeRange
(
$scope
);
if
(
$scope
.
panel
.
snapshotData
)
{
$scope
.
annotationsPromise
=
$q
.
when
([]);
$scope
.
dataHandler
(
$scope
.
panel
.
snapshotData
);
return
;
}
$scope
.
annotationsPromise
=
annotationsSrv
.
getAnnotations
(
$scope
.
rangeUnparsed
,
$scope
.
dashboard
);
return
panelHelper
.
issueMetricQuery
(
$scope
,
datasource
)
...
...
@@ -146,10 +140,13 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) {
});
};
$scope
.
loadSnapshot
=
function
(
snapshotData
)
{
panelHelper
.
updateTimeRange
(
$scope
);
$scope
.
annotationsPromise
=
$q
.
when
([]);
$scope
.
dataHandler
(
snapshotData
);
};
$scope
.
dataHandler
=
function
(
results
)
{
if
(
$scope
.
dashboard
.
snapshot
)
{
$scope
.
panel
.
snapshotData
=
results
;
}
// png renderer returns just a url
if
(
_
.
isString
(
results
))
{
$scope
.
render
(
results
);
...
...
src/app/panels/singlestat/module.js
View file @
41820ccb
...
...
@@ -87,6 +87,11 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) {
});
};
$scope
.
loadSnapshot
=
function
(
snapshotData
)
{
panelHelper
.
updateTimeRange
(
$scope
);
$scope
.
dataHandler
(
snapshotData
);
};
$scope
.
dataHandler
=
function
(
results
)
{
$scope
.
series
=
_
.
map
(
results
.
data
,
$scope
.
seriesHandler
);
$scope
.
render
();
...
...
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