Fix commented out sections manifesting
parent
5484b2292e
commit
26bbdf0012
|
|
@ -6,18 +6,18 @@
|
||||||
<script src="../../core/lib/customize.js"></script>
|
<script src="../../core/lib/customize.js"></script>
|
||||||
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
||||||
|
|
||||||
//buttons
|
<!-- Toggle Buttons -->
|
||||||
<div class="btn-group" style="margin: 1em; display: flex; justify-content: center;">
|
<div class="btn-group" style="margin: 1em; display: flex; justify-content: center;">
|
||||||
<button id="tableButton" class="btn btn-primary">View Table</button>
|
<button id="tableButton" class="btn btn-primary">View Table</button>
|
||||||
<button id="pieChartButton" class="btn">View Pie Chart</button>
|
<button id="pieChartButton" class="btn">View Pie Chart</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
//table
|
<!-- Table View -->
|
||||||
<div id="storageTable"></div>
|
<div id="storageTable"></div>
|
||||||
|
|
||||||
//chart
|
<!-- Chart View -->
|
||||||
<div id="appPieChart" style="display: none; justify-content: center;">
|
<div id="storagePieChart" style="display: none; justify-content: center;">
|
||||||
<div id="AppChart" style="width: 100%; max-width: 600px; height: 400px;"></div>
|
<div id="piechart" style="width: 100%; max-width: 600px; height: 400px;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
|
|
||||||
const chartData = [
|
const chartData = [
|
||||||
['App', 'Total Size']
|
['App', 'Total Size']
|
||||||
].concat(globalApps.map(app => [app[0], (app[1] + app[2])/1000+" kb"]));
|
].concat(globalApps.map(app => [app[0], app[1] + app[2]]));
|
||||||
|
|
||||||
const data = google.visualization.arrayToDataTable(chartData);
|
const data = google.visualization.arrayToDataTable(chartData);
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const chart = new google.visualization.PieChart(document.getElementById('AppChart'));
|
const chart = new google.visualization.PieChart(document.getElementById('piechart'));
|
||||||
chart.draw(data, options);
|
chart.draw(data, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
// Toggle view buttons
|
// Toggle view buttons
|
||||||
document.getElementById("pieChartButton").addEventListener("click", function () {
|
document.getElementById("pieChartButton").addEventListener("click", function () {
|
||||||
document.getElementById("storageTable").style.display = "none";
|
document.getElementById("storageTable").style.display = "none";
|
||||||
document.getElementById("appPieChart").style.display = "flex";
|
document.getElementById("storagePieChart").style.display = "flex";
|
||||||
drawChart();
|
drawChart();
|
||||||
|
|
||||||
this.classList.add("btn-primary");
|
this.classList.add("btn-primary");
|
||||||
|
|
@ -124,14 +124,15 @@
|
||||||
|
|
||||||
document.getElementById("tableButton").addEventListener("click", function () {
|
document.getElementById("tableButton").addEventListener("click", function () {
|
||||||
document.getElementById("storageTable").style.display = "block";
|
document.getElementById("storageTable").style.display = "block";
|
||||||
document.getElementById("appPieChart").style.display = "none";
|
document.getElementById("storagePieChart").style.display = "none";
|
||||||
drawTable();
|
drawTable();
|
||||||
|
|
||||||
this.classList.add("btn-primary");
|
this.classList.add("btn-primary");
|
||||||
document.getElementById("pieChartButton").classList.remove("btn-primary");
|
document.getElementById("pieChartButton").classList.remove("btn-primary");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Register as app loader's entry point
|
||||||
|
window.onInit = onInit;
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue