| <?php |
| #***************************************************************************** |
| # |
| # en_status.inc |
| # |
| # Author: Denis Roy |
| # Date: 2004-09-10 |
| # |
| # Description: Infrastructure status UI |
| # |
| # HISTORY: |
| # |
| #**************************************************************************** |
| |
| include("../html/header.php"); |
| |
| $Menu = new Menu("en"); |
| |
| include("../modules/menu.php"); |
| |
| ?> |
| <br /> |
| <td width="100%" valign="top" class="normal"> |
| <form name="form1" method="post"> |
| <font class="large_title">Project Disk Space and Quota</font><br /><br /> |
| |
| Disk space usage is carefully monitored for the download.eclipse.org server. Although quotas are not strictly enforced, you must keep your disk space usage under your quota, or request a quota increase. |
| Disk space is updated hourly.<br /><br /> |
| |
| Please see the <a href="https://dev.eclipse.org/committers/help/howdoi.php#downloads.put">How Do I? section on Downloads</a> for more information on what you can store in your downloads area.<br /><br /> |
| |
| <?= $ErrorMessage != "" ? "<font class='error'>" . $ErrorMessage . "</font>" : "" ?> |
| |
| <table width="100%" cellpadding="0" cellspacing="0" border="0" class="rect_header"> |
| <tr height="<?= $App->getDefaultRowHeight() ?>"> |
| <td width="5"></td> |
| <td nowrap="true" class="rect_header">Eclipse Projects</td> |
| <td width="100%"></td> |
| <td nowrap="true" id="action_bar"> |
| </td> |
| </tr> |
| <tr> |
| <td height="1"></td> |
| </tr> |
| </table> |
| <table width="100%" cellpadding="0" cellspacing="0" border="0" class="normal"> |
| <tr class="list_column_header" height="<?= $App->getDefaultRowHeight() ?>"> |
| <td width="5"></td> |
| <td><b>Project</b></td> |
| <td align="right"><b>Disk Used (GB)</b></td> |
| <td align="right"><b>Quota (GB)</b></td> |
| <td align="right"><b>Quota %</b></td> |
| <td width="30%"> </td> |
| </tr> |
| <?php |
| $i = 0; |
| |
| while($myrow = mysql_fetch_assoc($rs)) { |
| $i++; |
| $class = ""; |
| $pdu = 0; |
| $cct = 0; |
| |
| //get child project disk summaries |
| $sql = "SELECT SUM(DSK.disk_space) AS GBUsed FROM projects as PRJ LEFT JOIN project_disk_space_usage as DSK ON DSK.project_id = PRJ.project_id |
| WHERE DSK.is_quota <> 0 AND PRJ.is_active=1 AND PRJ.parent_project_id = '" .$myrow['project_id']."' |
| AND DSK.file_path LIKE CONCAT((SELECT file_path from project_disk_space_usage WHERE project_id='".$myrow['project_id']."' AND file_path LIKE '%download%'),'%') "; |
| $ms = mysql_query($sql, $dbh); |
| |
| $crow = mysql_fetch_assoc($ms); |
| if ( mysql_num_rows($ms) > 0 && $crow['GBUsed'] > 0 ) { |
| $cct = $crow['GBUsed']; |
| } |
| //actual disk usage |
| $pdu = $myrow['GBUsed'] - $cct; |
| //limit check |
| if ( $pdu < 0 ){ |
| $pdu = 0; |
| } |
| $pct = 0; |
| if($myrow['disk_quota_gb'] > 0) { |
| //subtract the child project usage |
| $pct = $pdu / $myrow['disk_quota_gb'] * 100; |
| } |
| |
| if($pdu >= $myrow['disk_quota_gb'] && $myrow['disk_quota_gb'] > 0) { |
| $class = "class=\"red\""; |
| } |
| |
| |
| |
| |
| ?> |
| <tr height="<?= $App->getDefaultRowHeight() ?>" class="data<?= $i % 2 ?>"> |
| <td width="5"></td> |
| <td <?= $class ?>><?= $myrow['project_id'] ?></td> |
| <td align="right" <?= $class ?>><?= $pdu ?></td> |
| <td align="right" <?= $class ?>><?= $myrow['disk_quota_gb'] ?></td> |
| <td align="right" <?= $class ?>><?= sprintf("%.1f", $pct) ?></td> |
| <td width="30%"> </td> |
| </tr> |
| <tr height="1" class="menu_border"> |
| <td colspan="7"></td> |
| </tr> |
| |
| <?php |
| } |
| ?> |
| </table> |
| <table width="100%" cellpadding="0" cellspacing="0" border="0" class="normal"> |
| <tr height="1"> |
| <td colspan="2"></td> |
| </tr> |
| <tr class="list_column_header"> |
| <td width="5"></td> |
| <td><b><?= $i ?> project<?= $i != 1 ? "s" : "" ?> found.</td> |
| </tr> |
| </table> |
| </form> |
| </td> |
| <?php |
| include("../html/footer.php"); |
| ?> |