Al-HUWAITI Shell
Al-huwaiti


Server : LiteSpeed
System : Linux server335.web-hosting.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : cardxfeb ( 2452)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /home/cardxfeb/www/resources/assets/js/storage/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/cardxfeb/www/resources/assets/js/storage/storage.js
document.addEventListener("turbo:load", function () {
    loadDashboardData();
});

function loadDashboardData() {
var chartDataElement = document.getElementById("storagePieChart");
if (!chartDataElement) return;
var storageChartData = JSON.parse(chartDataElement.getAttribute("data-chart-data"));
var storageChartLabels = JSON.parse(chartDataElement.getAttribute("data-chart-labels"));
storageChart(storageChartData, storageChartLabels);
}

window.statisticsColors = ["#6571FF", "#C1C6FF"];

function storageChart(data, labels) {
// Check if the element exists before accessing it
let pieChartElement = document.getElementById("storagePieChart");
if (!pieChartElement) return; // Exit if the element doesn't exist
let ctx = pieChartElement.getContext("2d");
new Chart(ctx, {
  type: "pie",
  options: {
      responsive: true,
      maintainAspectRatio: false,
      responsiveAnimationDuration: 500,
      plugins: {
          tooltip: {
              callbacks: {
                  label: function (context) {
                     let label = labels[context.dataIndex] || '';
                     let value = Math.round(context.parsed) + "%";
                     return label + " " + value;
                  },
              },
          },
      },
  },
  data: {
      datasets: [
          {
              data: data,
              backgroundColor: window.statisticsColors, // corrected variable name
          },
      ],
  },
});
}

Al-HUWAITI Shell