Commit 3a951ded by Bence Dányi

webui: whitespace fix

parent 638ec148
{% load l10n %} {% load l10n %}
<html> <html>
<head> <head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript"> <script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']}); google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart); google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() { function drawChart() {
// Create the data table.
var data_cpu = new google.visualization.DataTable(); var data_cpu = new google.visualization.DataTable();
data_cpu.addColumn('string', 'Topping'); data_cpu.addColumn('string', 'Topping');
data_cpu.addColumn('number', 'Slices'); data_cpu.addColumn('number', 'Free');
data_cpu.addColumn('number', 'Allocated');
data_cpu.addColumn('number', 'Used');
data_cpu.addRows([ data_cpu.addRows([
['Free CPU', {{STAT.CPU.FREE_CPU}}], ['CPU %', {{STAT.CPU.FREE_CPU}},{{STAT.CPU.ALLOC_CPU}},{{STAT.CPU.USED_CPU}}],
['Allocated CPU', {{STAT.CPU.ALLOC_CPU}}],
['Used CPU', {{STAT.CPU.USED_CPU}}],
]); ]);
var cpu_options = {
// Set chart options 'title':'Cloud CPU usage percent (100/CPU)',
var cpu_options = {'title':'Cloud CPU usage percent (100/CPU)', 'width':900,
'width':400, 'height':50,
'height':300, isStacked: true
slices: {0: {color: 'blue'}, 1:{color: 'orange'},
2:{color: 'red'}}
}; };
var data_mem = new google.visualization.DataTable(); var data_mem = new google.visualization.DataTable();
data_mem.addColumn('string', 'Topping'); data_mem.addColumn('string', 'Topping');
data_mem.addColumn('number', 'Slices'); data_mem.addColumn('number', 'Slices');
...@@ -42,27 +28,24 @@ ...@@ -42,27 +28,24 @@
['Allocated Memory', {{STAT.MEM.ALLOC_MEM|unlocalize}}], ['Allocated Memory', {{STAT.MEM.ALLOC_MEM|unlocalize}}],
['Used Memory', {{STAT.MEM.USED_MEM|unlocalize}}], ['Used Memory', {{STAT.MEM.USED_MEM|unlocalize}}],
]); ]);
var mem_options = {
// Set chart options 'title':'Cloud Memory usage in {{STAT.DIMENSION}}',
var mem_options = {'title':'Cloud Memory usage in {{STAT.DIMENSION}}',
'width':400, 'width':400,
'height':300, 'height':300,
slices: {0: {color: 'blue'}, 1:{color: 'orange'}, slices: {
2:{color: 'red'}} 0: {color: 'blue'},
1:{color: 'orange'},
2:{color: 'red'}
},
}; };
// Instantiate and draw our chart, passing in some options. var chart = new google.visualization.BarChart(document.getElementById('chart_cpu_div'));
var chart = new
google.visualization.PieChart(document.getElementById('chart_cpu_div'));
chart.draw(data_cpu, cpu_options); chart.draw(data_cpu, cpu_options);
var chart = new var chart = new google.visualization.PieChart(document.getElementById('chart_mem_div'));
google.visualization.PieChart(document.getElementById('chart_mem_div'));
chart.draw(data_mem, mem_options); chart.draw(data_mem, mem_options);
} }
</script> </script>
</head> </head>
<body> <body>
<!--Div that will hold the pie chart-->
<div>Running VMs: {{STAT.VMS}}</div> <div>Running VMs: {{STAT.VMS}}</div>
<div id="chart_cpu_div"></div> <div id="chart_cpu_div"></div>
<div id="chart_mem_div"></div> <div id="chart_mem_div"></div>
......
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 sign in to comment