$v) { $query[$k] = $v; } $query['token'] = user_generate_auth_token(get_user_id($_SESSION['username'])); $query['locale'] = isset($_SESSION['language']) ? $_SESSION['language'] : 'en_US'; $query['records'] = 100000; $query['mode'] = 'getreport'; $query['hideoptions'] = 1; $query['export'] = 1; $base_url = get_localhost_url(); $path = (substr($base_url, -1) === '/') ? 'includes/components/saturationreport/index.php' : '/includes/components/saturationreport/index.php'; $url = $base_url . $path . '?' . http_build_query($query); $url = str_replace(["\r", "\n"], '', trim($url)); $filename = 'index-' . uniqid() . '.' . $type; $args = array( 'filename' => $filename, 'url' => $url, 'type' => $type, 'orientation' => 0, ); $command_id = submit_command(COMMAND_DOWNLOAD_REPORT, serialize($args)); header('Content-Type: application/json'); echo json_encode(array('command_id' => $command_id)); exit; } // Normal display display_saturationreport(); /** * Output report HTML only (no full page wrapper). * Used by: (1) AJAX load into #report, (2) Chromium for PDF/JPG export. */ function get_saturationreport_report() { define('SATURATIONREPORT_DATA_ONLY', 1); require_once(dirname(__FILE__) . '/saturationreport.api.php'); $services = get_saturationreport_services_data(); if (isset($services['error'])) { echo '
' . _('Summary of Tracked Storage: Volumes') . '
'; echo '' . _('Report Date:') . ' ' . date('n/j/y, g:i A') . '
'; echo '| ' . _('DISPLAY NAME') . ' | '; echo '' . _('CAPTION') . ' | '; echo '' . _('DISK SPACE USED') . ' | '; echo '' . _('DISK SPACE AVAILABLE') . ' | '; echo '' . _('PERCENT USED') . ' | '; echo '
|---|---|---|---|---|
| ' . _('No services with trackvolume custom variable found') . ' | ||||
| ' . encode_form_val($host_name) . ' | '; echo '' . encode_form_val($caption) . ' | '; echo '' . encode_form_val($disk_used) . ' | '; echo '' . encode_form_val($disk_available) . ' | '; echo '';
if ($percent > 0) {
echo ' ';
} else {
echo 'N/A';
}
echo ' | ';
echo '