Changeset 25027 for branches/pap/DataStoreServer/web/cgi/dsgetindex
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
DataStoreServer/web/cgi/dsgetindex (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/DataStoreServer/web/cgi/dsgetindex
r17755 r25027 62 62 # used by the pretty printer 63 63 @path = split(/\//, $directories); 64 # shift off the empty bit 65 shift @path; 64 66 65 67 } else { … … 167 169 # XXX: 168 170 # quick hacky pretty printer 169 # Stolen from Eric's Data Store mock up 170 # 171 171 # Adapted from Eric's Data Store mock up 172 # 173 174 sub print_free_space { 175 use Filesys::Df; 176 # get free space 177 my $ref = df($DS_ROOT); 178 printf '<p>Free space: %.2f G (%.1f%%)</p>', 179 $ref->{bfree}/(1024*1024), 180 100.0*$ref->{bfree}/$ref->{blocks}; 181 print "\n"; 182 } 172 183 sub pprint_pre { 173 #use Filesys::Df;174 184 175 185 print header('text/html', '200 OK'); 176 186 print start_html('Data Store'); 177 187 178 # get free space179 # my $ref = df($DS_ROOT);180 # printf '<p>Free space: %.2fG (%.1f%%)</p>',181 # $ref->{bfree}/(1024*1024),182 # 100.0*$ref->{bfree}/$ref->{blocks};183 # print "\n";184 188 185 189 # return link 186 190 print a({-href=>"./index.txt"}, "Text Version"); 187 191 188 if ($#path > 1) {192 if ($#path >= 1) { 189 193 print "    \n"; 190 194 191 my $up = join('/', @path[0..$#path-1]);192 print a({-href=>" $up"}, "Up to $up");195 my $up = join('/', @path[0..$#path-1]); 196 print a({-href=>".."}, "Up to $up"); 193 197 194 198 } … … 204 208 print p(); 205 209 210 print_free_space(); 206 211 print end_html(); 207 212 } … … 232 237 else { 233 238 # assumes id is always first field 234 my $wpath = join('/',@path)."/$toks[0]";235 236 # if this is a file request, use a download cgi237 if ($wpath =~ /\.fits\s*$/) {238 $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/'239 }239 my $wpath = "./$toks[0]"; 240 241 # if this is a file request, use a download cgi 242 if ($wpath =~ /\.fits\s*$/) { 243 $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/' 244 } 240 245 241 246 print a({-href=>$wpath}, $toks[0]);
Note:
See TracChangeset
for help on using the changeset viewer.
