//now you can refresh each dashboard module you want
This commit is contained in:
+10
-6
@@ -31,14 +31,18 @@ function refreshDashbard(module_name)
|
||||
{
|
||||
if (typeof(module_name) == 'undefined')
|
||||
module_name = 0;
|
||||
datas = {
|
||||
ajax:true,
|
||||
action:'refreshDashboard',
|
||||
module:module_name
|
||||
};
|
||||
else
|
||||
$('#'+module_name+' section').each( function (){
|
||||
$(this).addClass('loading');
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url : dashboard_ajax_url,
|
||||
data : datas,
|
||||
data : {
|
||||
ajax:true,
|
||||
action:'refreshDashboard',
|
||||
module:module_name
|
||||
},
|
||||
dataType: 'json',
|
||||
success : function(widgets){
|
||||
for (var name in widgets)
|
||||
|
||||
@@ -54,7 +54,6 @@ class Dashactivity extends Module
|
||||
|
||||
public function hookDashboardDatas($params)
|
||||
{
|
||||
sleep(2);
|
||||
return array(
|
||||
'data_value' => array(
|
||||
'order_nbr' => 365,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<a class="list-tooolbar-btn" href="#" title="configure">
|
||||
<i class="process-icon-configure"></i>
|
||||
</a>
|
||||
<a class="list-tooolbar-btn" href="#" title="refresh">
|
||||
<a class="list-tooolbar-btn" href="#" onclick="refreshDashbard('dashactivity'); return false;" title="refresh">
|
||||
<i class="process-icon-refresh"></i>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<a class="list-tooolbar-btn" href="javascript:void(0);" title="configure">
|
||||
<i class="process-icon-configure"></i>
|
||||
</a>
|
||||
<a class="list-tooolbar-btn" href="javascript:location.reload();" title="refresh">
|
||||
<a class="list-tooolbar-btn" href="#" onclick="refreshDashbard('dashproducts'); return false;" title="refresh">
|
||||
<i class="process-icon-refresh"></i>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -54,6 +54,23 @@ class Dashtrends extends Module
|
||||
|
||||
public function hookDashboardDatas($params)
|
||||
{
|
||||
return array();
|
||||
return array(
|
||||
'data_value' => array(
|
||||
'sales_score' => Tools::displayPrice(151.365),
|
||||
'orders_score' => 120,
|
||||
'cart_value_score' => Tools::displayPrice(35),
|
||||
'visits_score' => 12,
|
||||
'convertion_rate_score' => 4,
|
||||
'net_profits_score' => Tools::displayPrice(42),
|
||||
),
|
||||
'data_trends' => array(
|
||||
'sales_score_trends' => array('way' => 'up', 'value' => 0.66),
|
||||
'orders_score_trends' => array('way' => 'down', 'value' => 0.66),
|
||||
'cart_value_score_trends' => array('way' => 'up', 'value' => 0.66),
|
||||
'visits_score_trends' => array('way' => 'down', 'value' => 0.66),
|
||||
'convertion_rate_score_trends' => array('way' => 'up', 'value' => 0.66),
|
||||
'net_profits_score_trends' => array('way' => 'up', 'value' => 0.66)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user