mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-26 13:49:21 +00:00
Updated SCSI table list to show all SCSI IDs
This commit is contained in:
parent
4c135d7791
commit
9d94cdeec6
@ -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");
|
||||
@ -121,32 +117,55 @@ function current_rascsi_config() {
|
||||
echo ' <td><b>Actions</b></td>';
|
||||
echo ' </tr>';
|
||||
|
||||
foreach ($rasctl_lines as $current_line)
|
||||
{
|
||||
if(strlen($current_line) === 0){
|
||||
continue;
|
||||
}
|
||||
if(strpos($current_line, '+----') === 0){
|
||||
continue;
|
||||
$scsi_ids = array();
|
||||
|
||||
}
|
||||
if(strpos($current_line, '| ID | UN') === 0){
|
||||
continue;
|
||||
}
|
||||
$segments = explode("|", $current_line);
|
||||
foreach ($rasctl_lines as $current_line)
|
||||
{
|
||||
if(strlen($current_line) === 0){
|
||||
continue;
|
||||
}
|
||||
if(strpos($current_line, '+----') === 0){
|
||||
continue;
|
||||
|
||||
echo ' <tr>';
|
||||
echo ' <form>';
|
||||
echo ' <td>'.trim($segments[1]).'</td>';
|
||||
echo ' <td>'.trim($segments[3]).'</td>';
|
||||
echo ' <td>'.trim($segments[4]).'</td>';
|
||||
echo ' <td>';
|
||||
echo ' <input type="button" value="Eject" onClick="eject_image(\''.trim($segments[1]).'\',\''.trim($segments[4]).'\')"/>';
|
||||
echo ' <input type="button" value="Disconnect" onClick="remove_device('.trim($segments[1]).')"/>';
|
||||
echo ' </td>';
|
||||
echo ' </form>';
|
||||
echo ' </tr>';
|
||||
}
|
||||
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 ' <tr>';
|
||||
echo ' <form>';
|
||||
echo ' <td style="text-align:center">'.$id.'</td>';
|
||||
if(isset($scsi_ids[$id]))
|
||||
{
|
||||
echo ' <td style="text-align:center">'.$scsi_ids[$id]['type'].'</td>';
|
||||
echo ' <td>'.$scsi_ids[$id]['file'].'</td>';
|
||||
echo ' <td>';
|
||||
echo ' <input type="button" value="Eject" onClick="eject_image(\''.$id.'\',\''.$scsi_ids[$id]['file'].'\')"/>';
|
||||
echo ' <input type="button" value="Disconnect" onClick="remove_device('.$id.')"/>';
|
||||
echo ' </td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ' <td style="text-align:center">-</td>';
|
||||
echo ' <td>-</td>';
|
||||
echo ' <td>';
|
||||
echo ' <input type="button" value="Connect New Device" onClick="attach_device('.$id.')"/>';
|
||||
echo ' </td>';
|
||||
|
||||
}
|
||||
echo ' </form>';
|
||||
echo ' </tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user