チェンジセット 32: trunk/install
- コミット日時:
- 2007/01/02 12:37:12 (18 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/install/php/foltialib.php
r21 r32 408 408 409 409 function printdiskusage(){//戻り値 なし 410 list (, $all, $use , $free, $usepercent) = getdiskusage(); 411 412 print " 413 <div style=\"width:100%;border:1px solid black;text-align:left;\"><span style=\"float:right;\">$free</span> 414 <div style=\"width:$usepercent;border:1px solid black;background:white;\">$use/$all($usepercent)</div> 415 </div> 416 "; 417 //exec('ps ax | grep ffmpeg |grep MP4 ' ,$ffmpegprocesses); 418 }//end sub 419 420 421 function getdiskusage(){//戻り値 配列 [,全体容量, 使用容量 , 空き容量, 利用割合] 410 422 411 423 global $recfolderpath,$recfolderpath; … … 414 426 $freearea = preg_split ("/[\s,]+/", $hdfreearea[0]); 415 427 416 // exec ( "ps ax | grep ffmpeg", $encoding); 417 // exec ( "ps ax | grep faac", $processlock); 418 419 print " 420 <div style=\"width:100%;border:1px solid black;text-align:left;\"><span style=\"float:right;\">$freearea[3]</span> 421 <div style=\"width:$freearea[4];border:1px solid black;background:white;\">$freearea[2]/$freearea[1]($freearea[4])</div> 422 </div> 423 "; 424 425 //exec('ps ax | grep ffmpeg |grep MP4 ' ,$ffmpegprocesses); 428 return $freearea; 429 430 }//endsub 431 432 433 function printtrcnprocesses(){ 434 426 435 $ffmpegprocesses = `ps ax | grep ffmpeg | grep -v grep | wc -l `; 427 428 436 $uptime = exec('uptime'); 429 437 … … 433 441 print "</div>"; 434 442 435 }//end sub 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 443 }//endsub 444 445 446 function warndiskfreearea(){ 447 448 if ($demomode){ 449 print "<!-- demo mode -->"; 450 }else{ 451 452 global $recfolderpath,$recfolderpath; 453 454 exec ( "df $recfolderpath | grep $recfolderpath", $hdfreearea); 455 $freearea = preg_split ("/[\s,]+/", $hdfreearea[0]); 456 $freebytes = $freearea[3]; 457 if ($freebytes == "" ){ 458 // 459 print "<!-- err:\$freebytes is null -->"; 460 }elseif($freebytes > 1024*1024*100 ){// 100GB以上あいてれば 461 //なにもしない 462 print "<style type=\"text/css\"><!-- --></style>"; 463 }elseif($freebytes > 1024*1024*50 ){// 100GB以下 464 print "<style type=\"text/css\"><!-- 465 body { 466 background-color: #CCCC99; 467 } 468 --> 469 </style> 470 "; 471 }elseif($freebytes > 1024*1024*30 ){// 50GB以下 472 print "<style type=\"text/css\"><!-- 473 body { 474 background-color:#CC6666; 475 } 476 --> 477 </style> 478 "; 479 }elseif($freebytes > 0 ){// 30GB以下 480 print "<style type=\"text/css\"><!-- 481 body { 482 background-color:#FF0000; 483 } 484 --> 485 </style> 486 "; 487 }else{ 488 print "<!-- no much : $freebytes -->"; 489 490 491 }//endif freebytess 492 493 }//endif demomode 494 495 }//endsub 459 496 460 497 trunk/install/php/index.php
r1 r32 33 33 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=EUC-JP\"> 34 34 <meta http-equiv=\"Content-Style-Type\" content=\"text/css\"> 35 <link rel=\"stylesheet\" type=\"text/css\" href=\"graytable.css\"> 36 <title>foltia:放映予定</title> 35 <link rel=\"stylesheet\" type=\"text/css\" href=\"graytable.css\"> "; 36 //ディスク空き容量によって背景色表示変更 37 warndiskfreearea(); 38 print "<title>foltia:放映予定</title> 37 39 </head>"; 38 40 trunk/install/php/showplaylist.php
r17 r32 27 27 <link rel="stylesheet" type="text/css" href="graytable.css"> 28 28 <?php 29 include("./foltialib.php"); 30 31 //ディスク空き容量によって背景色表示変更 32 warndiskfreearea(); 33 29 34 print "<title>foltia:recorded file list</title> 30 35 </head>"; 31 36 32 include("./foltialib.php");33 37 $con = m_connect(); 34 38 $now = date("YmdHi"); 35 36 39 ?> 37 40 <body BGCOLOR="#ffffff" TEXT="#494949" LINK="#0047ff" VLINK="#000000" ALINK="#c6edff" > … … 47 50 }else{ 48 51 printdiskusage(); 52 printtrcnprocesses(); 49 53 } 50 54 ?>