Commit 2cdefaa8 authored by SteffTek's avatar SteffTek

Update ramUsageGB.js

parent 74562772
var ctx = document.getElementById("ramgb").getContext('2d');
var ramChart = new Chart(ctx, {
var ctx = document.getElementById("ram").getContext('2d');
var ramChartPT = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ["Used", "Free"],
......@@ -41,14 +41,13 @@ var ramChart = new Chart(ctx, {
});
setInterval(function(){
$.get("./backend/ramUsageGB.php", function( text_var ) {
var use = parseFloat(text_var.split("/")[0]).toFixed(2);
var free = parseFloat(text_var.split("/")[1]) - use;
free = free.toFixed(2);
$.get("./backend/ramUsage.php", function( text_var ) {
var use = parseInt(text_var);
var free = 100 - use;
removeData(ramChart);
removeData(ramChart);
addData(ramChart, "Used", use);
addData(ramChart, "Free", free);
removeData(ramChartPT);
removeData(ramChartPT);
addData(ramChartPT, "Used", use);
addData(ramChartPT, "Free", free);
}, 'text');
}, 500);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment