|
|
@ -60,6 +60,10 @@ $(function() {
|
|
|
|
contentType: "application/json",
|
|
|
|
contentType: "application/json",
|
|
|
|
async: false,
|
|
|
|
async: false,
|
|
|
|
success: function(data) {
|
|
|
|
success: function(data) {
|
|
|
|
|
|
|
|
if(typeof data[0].duration == 'undefined'){
|
|
|
|
|
|
|
|
console.log("Currently data can't be retrieved...");
|
|
|
|
|
|
|
|
console.log(JSON.stringify(data));
|
|
|
|
|
|
|
|
}else{
|
|
|
|
var duration = data[0].duration / 60000; // Convert to minutes
|
|
|
|
var duration = data[0].duration / 60000; // Convert to minutes
|
|
|
|
var newData = [{
|
|
|
|
var newData = [{
|
|
|
|
"duration": duration,
|
|
|
|
"duration": duration,
|
|
|
@ -69,10 +73,7 @@ $(function() {
|
|
|
|
"owner": "NO"
|
|
|
|
"owner": "NO"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
];
|
|
|
|
// data.forEach(function(entry) {
|
|
|
|
}
|
|
|
|
// entry.duration = entry.duration / 60000 % 100; // Convert to minutes
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// providerData = data;
|
|
|
|
|
|
|
|
providerData = newData;
|
|
|
|
providerData = newData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -81,18 +82,15 @@ $(function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var drawGadget = function() {
|
|
|
|
var drawGadget = function() {
|
|
|
|
|
|
|
|
|
|
|
|
draw('#canvas', conf[CHART_CONF], schema, providerData);
|
|
|
|
draw('#canvas', conf[CHART_CONF], schema, providerData);
|
|
|
|
setInterval(function() {
|
|
|
|
setInterval(function() {
|
|
|
|
draw('#canvas', conf[CHART_CONF], schema, getProviderData());
|
|
|
|
draw('#canvas', conf[CHART_CONF], schema, getProviderData());
|
|
|
|
}, pref.getInt(REFRESH_INTERVAL));
|
|
|
|
}, pref.getInt(REFRESH_INTERVAL));
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
getGadgetLocation(function(gadget_Location) {
|
|
|
|
getGadgetLocation(function(gadget_Location) {
|
|
|
|
gadgetLocation = gadget_Location;
|
|
|
|
gadgetLocation = gadget_Location;
|
|
|
|
init();
|
|
|
|
init();
|
|
|
|
drawGadget();
|
|
|
|
drawGadget();
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|