mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[hotfix] periodic refresh dashboard feature had broken caching
This commit is contained in:
parent
37be01bc12
commit
7b1075990c
@ -18,6 +18,7 @@ var Dashboard = function (dashboardData) {
|
||||
filters: {},
|
||||
init: function () {
|
||||
this.initDashboardView();
|
||||
this.firstLoad = true;
|
||||
px.initFavStars();
|
||||
var sliceObjects = [],
|
||||
dash = this;
|
||||
@ -67,15 +68,17 @@ var Dashboard = function (dashboardData) {
|
||||
startPeriodicRender: function (interval) {
|
||||
this.stopPeriodicRender();
|
||||
var dash = this;
|
||||
var maxRandomDelay = Math.min(interval * 0.1, 5000);
|
||||
var maxRandomDelay = Math.min(interval * 0.2, 5000);
|
||||
var refreshAll = function () {
|
||||
dash.slices.forEach(function (slice) {
|
||||
var force = !dash.firstLoad;
|
||||
setTimeout(function () {
|
||||
slice.render(true);
|
||||
},
|
||||
//Randomize to prevent all widgets refreshing at the same time
|
||||
maxRandomDelay * Math.random());
|
||||
slice.render(force);
|
||||
},
|
||||
//Randomize to prevent all widgets refreshing at the same time
|
||||
maxRandomDelay * Math.random());
|
||||
});
|
||||
dash.firstLoad = false;
|
||||
};
|
||||
|
||||
var fetchAndRender = function () {
|
||||
|
@ -120,13 +120,16 @@ class BaseViz(object):
|
||||
del d['action']
|
||||
d.update(kwargs)
|
||||
# Remove unchecked checkboxes because HTML is weird like that
|
||||
for key in d.keys():
|
||||
od = OrderedDict()
|
||||
for key in sorted(d.keys()):
|
||||
if d[key] is False:
|
||||
del d[key]
|
||||
else:
|
||||
od[key] = d[key]
|
||||
href = Href(
|
||||
'/caravel/explore/{self.datasource.type}/'
|
||||
'{self.datasource.id}/'.format(**locals()))
|
||||
return href(d)
|
||||
return href(od)
|
||||
|
||||
def get_df(self, query_obj=None):
|
||||
"""Returns a pandas dataframe based on the query object"""
|
||||
|
Loading…
Reference in New Issue
Block a user