Base design
This commit is contained in:
124
watcher_visio/static/css/daisyui-theme.js
Normal file
124
watcher_visio/static/css/daisyui-theme.js
Normal file
File diff suppressed because one or more lines are too long
1057
watcher_visio/static/css/daisyui.js
Normal file
1057
watcher_visio/static/css/daisyui.js
Normal file
File diff suppressed because one or more lines are too long
3
watcher_visio/static/css/input.css
Normal file
3
watcher_visio/static/css/input.css
Normal file
@@ -0,0 +1,3 @@
|
||||
@import "tailwindcss" source(none);
|
||||
@plugin "./daisyui.js";
|
||||
@source "../../templates";
|
||||
9
watcher_visio/static/js/analytics/audit.js
Normal file
9
watcher_visio/static/js/analytics/audit.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// Audit-related JavaScript functions
|
||||
function initializeAuditSelector() {
|
||||
const selector = document.getElementById('auditSelector');
|
||||
if (selector && selector.options.length > 0) {
|
||||
selector.dispatchEvent(new Event('change'));
|
||||
}
|
||||
}
|
||||
|
||||
// Export other audit-related functions...
|
||||
55
watcher_visio/static/js/analytics/charts.js
Normal file
55
watcher_visio/static/js/analytics/charts.js
Normal file
@@ -0,0 +1,55 @@
|
||||
// Chart configuration and initialization
|
||||
const chartConfig = {
|
||||
cutout: "60%",
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
legend: { display: false },
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
label: function(context) {
|
||||
return `${context.label}: ${context.parsed} vCPU`;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
animation: {
|
||||
animateScale: true,
|
||||
animateRotate: true
|
||||
}
|
||||
};
|
||||
|
||||
function initializeUtilizationCharts(cpuMean, ramMean) {
|
||||
const cpuCtx = document.getElementById("cpuChart").getContext('2d');
|
||||
const ramCtx = document.getElementById("ramChart").getContext('2d');
|
||||
|
||||
new Chart(cpuCtx, {
|
||||
type: "doughnut",
|
||||
data: {
|
||||
labels: ["Used", "Free"],
|
||||
datasets: [{
|
||||
data: [{{ cpu_used }}, {{ cpu_free }}],
|
||||
backgroundColor: ["#3b82f6", "#e5e7eb"],
|
||||
borderWidth: 2,
|
||||
borderColor: "#ffffff"
|
||||
}]
|
||||
},
|
||||
options: chartConfig
|
||||
});
|
||||
|
||||
new Chart(ramCtx, {
|
||||
type: "doughnut",
|
||||
data: {
|
||||
labels: ["Used", "Free"],
|
||||
datasets: [{
|
||||
data: [{{ ram_used }}, {{ ram_free }}],
|
||||
backgroundColor: ["#f97316", "#e5e7eb"],
|
||||
borderWidth: 2,
|
||||
borderColor: "#ffffff"
|
||||
}]
|
||||
},
|
||||
options: chartConfig
|
||||
});
|
||||
}
|
||||
|
||||
// Export other chart-related functions...
|
||||
12
watcher_visio/static/js/analytics/utils.js
Normal file
12
watcher_visio/static/js/analytics/utils.js
Normal file
@@ -0,0 +1,12 @@
|
||||
// Utility functions
|
||||
function calculateStats(data) {
|
||||
if (!data || data.length === 0) return { mean: 0, std: 0 };
|
||||
|
||||
const mean = data.reduce((a, b) => a + b, 0) / data.length;
|
||||
const variance = data.reduce((a, b) => a + Math.pow(b - mean, 2), 0) / data.length;
|
||||
const std = Math.sqrt(variance);
|
||||
|
||||
return { mean, std };
|
||||
}
|
||||
|
||||
// Export other utility functions...
|
||||
14
watcher_visio/static/js/chart.js
Normal file
14
watcher_visio/static/js/chart.js
Normal file
File diff suppressed because one or more lines are too long
7
watcher_visio/static/js/chartjs-plugin-annotation.min.js
vendored
Normal file
7
watcher_visio/static/js/chartjs-plugin-annotation.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
0
watcher_visio/static/js/chartjs-plugin-datalabels.min.js
vendored
Normal file
0
watcher_visio/static/js/chartjs-plugin-datalabels.min.js
vendored
Normal file
Reference in New Issue
Block a user