diff --git a/src/php/rascsi.php b/src/php/rascsi.php index d0960a17..a762232e 100644 --- a/src/php/rascsi.php +++ b/src/php/rascsi.php @@ -34,10 +34,6 @@ function remove_device(id){ alert("OK"); } - - - - function delete_file(f){ if(confirm("Are you sure you want to delete "+f+"?")) alert("OK"); @@ -120,33 +116,56 @@ function current_rascsi_config() { echo ' Image File'; echo ' Actions'; echo ' '; - - foreach ($rasctl_lines as $current_line) - { - if(strlen($current_line) === 0){ - continue; - } - if(strpos($current_line, '+----') === 0){ - continue; - } - if(strpos($current_line, '| ID | UN') === 0){ - continue; - } - $segments = explode("|", $current_line); + $scsi_ids = array(); - echo ' '; - echo '
'; - echo ' '.trim($segments[1]).''; - echo ' '.trim($segments[3]).''; - echo ' '.trim($segments[4]).''; - echo ' '; - echo ' '; - echo ' '; - echo ' '; - echo '
'; - echo ' '; + foreach ($rasctl_lines as $current_line) + { + if(strlen($current_line) === 0){ + continue; + } + if(strpos($current_line, '+----') === 0){ + continue; + } + if(strpos($current_line, '| ID | UN') === 0){ + continue; + } + $segments = explode("|", $current_line); + + $id_config = array(); + $id_config['id'] = trim($segments[1]); + $id_config['type'] = trim($segments[3]); + $id_config['file'] = trim($segments[4]); + + $scsi_ids[$id_config['id']] = $id_config; + } + + + foreach (range(0,7) as $id){ + echo ' '; + echo '
'; + echo ' '.$id.''; + if(isset($scsi_ids[$id])) + { + echo ' '.$scsi_ids[$id]['type'].''; + echo ' '.$scsi_ids[$id]['file'].''; + echo ' '; + echo ' '; + echo ' '; + echo ' '; + } + else + { + echo ' -'; + echo ' -'; + echo ' '; + echo ' '; + echo ' '; + + } + echo '
'; + echo ' '; } echo ''; }