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
11f66bb9
Commit
11f66bb9
authored
Oct 19, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue with template refresh
parent
dddbe62d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
17 deletions
+19
-17
public/app/features/dashboard/dashboard_ctrl.ts
+7
-0
public/app/features/dashboard/dashboard_model.ts
+4
-0
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
+0
-1
public/app/features/dashboard/time_srv.ts
+2
-2
public/app/features/panel/metrics_panel_ctrl.ts
+0
-1
public/app/features/panel/panel_directive.ts
+0
-1
public/app/features/plugins/plugin_component.ts
+0
-1
public/app/features/templating/variable_srv.ts
+6
-9
public/app/plugins/datasource/testdata/datasource.ts
+0
-1
public/app/plugins/panel/graph/graph.ts
+0
-1
No files found.
public/app/features/dashboard/dashboard_ctrl.ts
View file @
11f66bb9
...
...
@@ -162,10 +162,17 @@ export class DashboardCtrl {
this
.
dashboard
.
removePanel
(
panel
);
}
onDestroy
()
{
if
(
this
.
dashboard
)
{
this
.
dashboard
.
destroy
();
}
}
init
(
dashboard
)
{
this
.
$scope
.
onAppEvent
(
'show-json-editor'
,
this
.
showJsonEditor
.
bind
(
this
));
this
.
$scope
.
onAppEvent
(
'template-variable-value-updated'
,
this
.
templateVariableUpdated
.
bind
(
this
));
this
.
$scope
.
onAppEvent
(
'panel-remove'
,
this
.
onRemovingPanel
.
bind
(
this
));
this
.
$scope
.
$on
(
'$destroy'
,
this
.
onDestroy
.
bind
(
this
));
this
.
setupDashboard
(
dashboard
);
}
}
...
...
public/app/features/dashboard/dashboard_model.ts
View file @
11f66bb9
...
...
@@ -200,6 +200,10 @@ export class DashboardModel {
this
.
events
.
emit
(
'view-mode-changed'
,
panel
);
}
timeRangeUpdated
()
{
this
.
events
.
emit
(
'time-range-updated'
);
}
startRefresh
()
{
this
.
events
.
emit
(
'refresh'
);
...
...
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
View file @
11f66bb9
...
...
@@ -172,7 +172,6 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
renderPanels
()
{
const
panelElements
=
[];
console
.
log
(
'render panels'
);
for
(
const
panel
of
this
.
props
.
dashboard
.
panels
)
{
const
panelClasses
=
classNames
({
panel
:
true
,
'panel--fullscreen'
:
panel
.
fullscreen
});
...
...
public/app/features/dashboard/time_srv.ts
View file @
11f66bb9
...
...
@@ -6,8 +6,8 @@ import _ from 'lodash';
import
kbn
from
'app/core/utils/kbn'
;
import
coreModule
from
'app/core/core_module'
;
import
*
as
dateMath
from
'app/core/utils/datemath'
;
// Types
import
{
TimeRange
}
from
'app/types'
;
export
class
TimeSrv
{
...
...
@@ -147,7 +147,7 @@ export class TimeSrv {
}
refreshDashboard
()
{
this
.
dashboard
.
startRefresh
();
this
.
dashboard
.
timeRangeUpdated
();
}
private
startNextRefreshTimer
(
afterMs
)
{
...
...
public/app/features/panel/metrics_panel_ctrl.ts
View file @
11f66bb9
...
...
@@ -61,7 +61,6 @@ class MetricsPanelCtrl extends PanelCtrl {
}
private
onMetricsPanelRefresh
()
{
console
.
log
(
'metrics_panel_ctrl:onRefresh'
);
// ignore fetching data if another panel is in fullscreen
if
(
this
.
otherPanelInFullscreenMode
())
{
return
;
...
...
public/app/features/panel/panel_directive.ts
View file @
11f66bb9
...
...
@@ -135,7 +135,6 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
ctrl
.
events
.
on
(
'panel-size-changed'
,
()
=>
{
ctrl
.
calculatePanelHeight
();
$timeout
(()
=>
{
console
.
log
(
'panel directive panel size changed, render'
);
resizeScrollableContent
();
ctrl
.
render
();
});
...
...
public/app/features/plugins/plugin_component.ts
View file @
11f66bb9
...
...
@@ -211,7 +211,6 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $
elem
.
append
(
child
);
setTimeout
(()
=>
{
scope
.
$applyAsync
(()
=>
{
console
.
log
(
'post appendAndCompile, broadcast refresh'
,
scope
.
panel
);
scope
.
$broadcast
(
'component-did-mount'
);
});
});
...
...
public/app/features/templating/variable_srv.ts
View file @
11f66bb9
...
...
@@ -13,13 +13,12 @@ export class VariableSrv {
/** @ngInject */
constructor
(
private
$rootScope
,
private
$q
,
private
$location
,
private
$injector
,
private
templateSrv
)
{
// update time variant variables
$rootScope
.
$on
(
'refresh'
,
this
.
onDashboardRefresh
.
bind
(
this
),
$rootScope
);
$rootScope
.
$on
(
'template-variable-value-updated'
,
this
.
updateUrlParamsWithCurrentVariables
.
bind
(
this
),
$rootScope
);
}
init
(
dashboard
)
{
this
.
dashboard
=
dashboard
;
this
.
dashboard
.
on
(
'time-range-updated'
,
this
.
onTimeRangeUpdated
.
bind
(
this
));
// create working class models representing variables
this
.
variables
=
dashboard
.
templating
.
list
=
dashboard
.
templating
.
list
.
map
(
this
.
createVariableFromModel
.
bind
(
this
));
...
...
@@ -42,11 +41,7 @@ export class VariableSrv {
});
}
onDashboardRefresh
(
evt
,
payload
)
{
if
(
payload
&&
payload
.
fromVariableValueUpdated
)
{
return
Promise
.
resolve
({});
}
onTimeRangeUpdated
()
{
const
promises
=
this
.
variables
.
filter
(
variable
=>
variable
.
refresh
===
2
).
map
(
variable
=>
{
const
previousOptions
=
variable
.
options
.
slice
();
...
...
@@ -57,7 +52,9 @@ export class VariableSrv {
});
});
return
this
.
$q
.
all
(
promises
);
return
this
.
$q
.
all
(
promises
).
then
(()
=>
{
this
.
dashboard
.
startRefresh
();
});
}
processVariable
(
variable
,
queryParams
)
{
...
...
@@ -136,7 +133,7 @@ export class VariableSrv {
return
this
.
$q
.
all
(
promises
).
then
(()
=>
{
if
(
emitChangeEvents
)
{
this
.
$rootScope
.
$emit
(
'template-variable-value-updated'
);
this
.
$rootScope
.
$broadcast
(
'refresh'
,
{
fromVariableValueUpdated
:
true
}
);
this
.
dashboard
.
startRefresh
(
);
}
});
}
...
...
public/app/plugins/datasource/testdata/datasource.ts
View file @
11f66bb9
...
...
@@ -62,7 +62,6 @@ class TestDataDatasource {
});
}
console
.
log
(
res
);
return
{
data
:
data
};
});
}
...
...
public/app/plugins/panel/graph/graph.ts
View file @
11f66bb9
...
...
@@ -339,7 +339,6 @@ class GraphElement {
callPlot
(
options
,
incrementRenderCounter
)
{
try
{
console
.
log
(
'plot'
,
this
.
sortedSeries
);
this
.
plot
=
$
.
plot
(
this
.
elem
,
this
.
sortedSeries
,
options
);
if
(
this
.
ctrl
.
renderError
)
{
delete
this
.
ctrl
.
error
;
...
...
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