#!/usr/local/bin/perl # index.cgi # Display a list of known disks and partitions require './format-lib.pl'; &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("format", "man")); $extwidth = 250; print "\n"; print " ", "\n"; @dlist = &list_disks(); $mountcan = &foreign_available("mount"); for($i=0; $i<@dlist; $i++) { $dl = $dlist[$i]; next if (!&can_edit_disk($dl->{'device'})); print "\n"; } print "
$text{'index_disk'}$text{'index_parts'}
\n"; print " "; print "\n"; print "\n"; print "\n"; print " "; print "\n"; print "
$text{'index_location'}$dl->{'desc'}
$text{'index_cyl'}$dl->{'cyl'}
$text{'index_model'}",$dl->{'type'} ? $dl->{'type'} : $text{'index_unknown'}, "
\n"; if (!$dl->{'device'}) { # Drive type unknown.. print "$text{'index_unknown2'}\n"; } elsif (@parts = &list_partitions($dl->{'device'})) { # Known and formatted.. print "\n"; print " ", " ", " ", " ", " ", " ", "\n"; for($j=0; $j<@parts; $j++) { $p = $parts[$j]; print " ", "\n"; } else { print "\n"; } } print "
$text{'index_no'}$text{'index_type'}$text{'index_extent'}$text{'index_start'}$text{'index_end'}$text{'index_use'}$text{'index_free'}
\n"; if ($access{'view'}) { print $j; } else { print "$j"; } print " $p->{'tag'} \n"; if ($p->{'end'} != 0) { printf "", $extwidth*$p->{'start'}/$dl->{'cyl'}; printf "", $extwidth*($p->{'end'}-$p->{'start'})/ $dl->{'cyl'}; printf "", $extwidth*($dl->{'cyl'}-$p->{'end'})/ $dl->{'cyl'}; print " $p->{'start'}$p->{'end'} \n"; @stat = &device_status($p->{'device'}); if ($stat[1] =~ /^meta/) { print "MetaDisk\n"; } elsif (!$mountcan) { print "$stat[0]\n"; } elsif ($stat[0] && $stat[3] == -1) { print "$stat[0]\n"; } elsif ($stat[0]) { print "$stat[0]\n"; } print " \n"; if ($stat[0] ne 'swap' && (@space = &disk_space($p->{'device'})) && $space[0]) { printf "%d %%\n", 100 * $space[1] / $space[0]; } print "
\n"; } else { # Disk is not formatted.. print "$text{'index_format'}\n"; } print "

\n"; &ui_print_footer("/", $text{'index'});