diff --git a/dist/adastra-vtl-installer-1.0.0.tar.gz b/dist/adastra-vtl-installer-1.0.0.tar.gz index cea81f2..93ccbe8 100644 Binary files a/dist/adastra-vtl-installer-1.0.0.tar.gz and b/dist/adastra-vtl-installer-1.0.0.tar.gz differ diff --git a/dist/adastra-vtl-installer/VERSION b/dist/adastra-vtl-installer/VERSION index f086f9a..3ce113b 100644 --- a/dist/adastra-vtl-installer/VERSION +++ b/dist/adastra-vtl-installer/VERSION @@ -1,4 +1,4 @@ Adastra VTL Installer Version: 1.0.0 -Build Date: 2025-12-10 12:25:11 +Build Date: 2025-12-10 14:36:24 Build Host: vtl-dev diff --git a/dist/adastra-vtl-installer/web-ui/api.php b/dist/adastra-vtl-installer/web-ui/api.php index 70908cb..5a6a2cb 100644 --- a/dist/adastra-vtl-installer/web-ui/api.php +++ b/dist/adastra-vtl-installer/web-ui/api.php @@ -148,10 +148,16 @@ switch ($action) { getDeviceMapping(); break; + case 'library_status': + getLibraryStatus(); + break; + case 'system_health': getSystemHealth(); break; + + case 'restart_appliance': restartAppliance(); break; @@ -938,4 +944,59 @@ function getDeviceMapping() { 'raw_output' => $output ]); } + +function getLibraryStatus() { + // Find library contents file + $files = glob('/etc/mhvtl/library_contents.*'); + if (empty($files)) { + echo json_encode(['success' => false, 'error' => 'No library config found']); + return; + } + + // Use the first one found, typically library_contents.10 + $file = $files[0]; + $libId = substr(strrchr($file, '.'), 1); + + $lines = file($file); + $status = [ + 'library_id' => $libId, + 'drives' => [], + 'slots' => [], + 'maps' => [], + 'pickers' => [] + ]; + + foreach ($lines as $line) { + $line = trim($line); + if (empty($line) || $line[0] == '#') continue; + + if (preg_match('/^Drive\s+(\d+):\s*(.*)$/i', $line, $matches)) { + $status['drives'][] = [ + 'id' => intval($matches[1]), + 'barcode' => trim($matches[2]), + 'full' => !empty(trim($matches[2])) + ]; + } elseif (preg_match('/^Slot\s+(\d+):\s*(.*)$/i', $line, $matches)) { + $status['slots'][] = [ + 'id' => intval($matches[1]), + 'barcode' => trim($matches[2]), + 'full' => !empty(trim($matches[2])) + ]; + } elseif (preg_match('/^MAP\s+(\d+):\s*(.*)$/i', $line, $matches)) { + $status['maps'][] = [ + 'id' => intval($matches[1]), + 'barcode' => trim($matches[2]), + 'full' => !empty(trim($matches[2])) + ]; + } elseif (preg_match('/^Picker\s+(\d+):\s*(.*)$/i', $line, $matches)) { + $status['pickers'][] = [ + 'id' => intval($matches[1]), + 'barcode' => trim($matches[2]), + 'full' => !empty(trim($matches[2])) + ]; + } + } + + echo json_encode(['success' => true, 'data' => $status]); +} ?> diff --git a/dist/adastra-vtl-installer/web-ui/index.html b/dist/adastra-vtl-installer/web-ui/index.html index 2dc4cc8..81ea183 100644 --- a/dist/adastra-vtl-installer/web-ui/index.html +++ b/dist/adastra-vtl-installer/web-ui/index.html @@ -208,6 +208,35 @@
Complete CRUD management for virtual tape files
+Complete CRUD management for virtual tape files