Changeset 362


Ignore:
Timestamp:
May 21, 2008, 7:56:49 AM (16 years ago)
Author:
george
Message:

Přidáno: Stránkování výpisu restartů. Zaznamenávání mangosd.conf. Rychlé odkazy na vlákna v výpisu backtrace.

Location:
administrace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • administrace/debug_list.php

    r348 r362  
    88}
    99
    10 echo('<table width="100%"><tr><td width="150px" valign="top">');
    11 echo('<strong>Restart list</strong><br>');
     10echo('<table width="100%"><tr><td width="10%" valign="top" style="">');
     11echo('<strong>Restart history:</strong><br>');
    1212
    1313if(array_key_exists('Id', $_GET)) $Id = addslashes($_GET['Id']);
    1414  else $Id = 0;
     15if(array_key_exists('Page', $_GET)) $Page = addslashes($_GET['Page']);
     16  else $Page = 0;
    1517
    16 $DbResult = $Database->query('SELECT Id, Time FROM debug WHERE 1 ORDER BY Time DESC');
     18$DbResult = $Database->query('SELECT COUNT(*) FROM debug');
     19$DbRow = $DbResult->fetch_array();
     20$Total = $DbRow[0];
     21
     22$DbResult = $Database->query('SELECT Id, Time FROM debug WHERE 1 ORDER BY Time DESC LIMIT '.($Page * $ItemPerPage).','.$ItemPerPage);
    1723while($DbRow = $DbResult->fetch_array())
    1824{
    1925  if($DbRow['Id'] == $Id) echo('<strong>');
    20   echo('<a href="?Id='.$DbRow['Id'].'&amp;Show=Backtrace">'.str_replace(" ", "&nbsp;", $DbRow['Time']).'</a>');
     26  echo('<a href="?Id='.$DbRow['Id'].'&amp;Page='.$Page.'&amp;Show=Backtrace">'.str_replace(" ", "&nbsp;", $DbRow['Time']).'</a>');
    2127  if($DbRow['Id'] == $Id) echo('</strong>');
    2228  echo('<br>');
    2329}
     30echo(PagesList('?Page=', $Page, $Total, $ItemPerPage, 2));
    2431
    25 echo('</td><td valign="top">');
     32echo('</td><td valign="top" width="90%">');
    2633
    2734if($Id > 0)
     
    3946      '  <a href="?Id='.$Id.'&amp;Show=Log">Mangos log</a>'.
    4047      '  <a href="?Id='.$Id.'&amp;Show=Error">Console error log</a>'.
    41       '  <a href="?Id='.$Id.'&amp;Show=DbErrors">Database error log</a><hr>');
     48      '  <a href="?Id='.$Id.'&amp;Show=DbErrors">Database error log</a>'.
     49      '  <a href="?Id='.$Id.'&amp;Show=Configuration">Mangos configuration</a>'.
     50      '<hr>');
    4251    if(array_key_exists('Show', $_GET))
    4352    {
     
    4554      switch($Show)
    4655      {
    47         case 'Backtrace':
    48           echo('<strong>Backtrace:</strong> <br><pre>'.htmlspecialchars($DbRow['Backtrace']).'</pre>');
     56        case 'Backtrace':
     57          $Content = htmlspecialchars($DbRow['Backtrace']);
     58          for($I = 1; $I < 8; $I++)
     59          {
     60            $Content = str_replace('Thread '.$I, '<hr><strong id="'.$I.'">Thread '.$I.'</strong>', $Content);
     61            $Content = str_replace($I.' Thread', '<a href="#'.$I.'"">'.$I.' Thread</a>', $Content);
     62          }
     63          echo('<strong>Backtrace:</strong> <br><pre>'.$Content.'</pre>');
    4964          break;
    5065        case 'Log':
     
    5772          echo('<strong>Database error log:</strong> <br><pre>'.htmlspecialchars($DbRow['DbErrors']).'</pre>');
    5873          break;
     74        case 'Configuration':
     75          echo('<strong>Mangos configuration:</strong> <br><pre>'.htmlspecialchars($DbRow['Configuration']).'</pre>');
     76          break;
    5977      }
    6078    }
  • administrace/global.php

    r329 r362  
    44
    55// Configuration
     6$MangosConfFile = '/a/mangos/etc/mangosd.conf';
    67$StdOutLogFile = '/a/log/mangos/mangos-worldd.log';
    78$ErrOutLogFile = '/a/log/mangos/mangos-worldd.err';
    89$MangosLogFile = '/a/log/mangos/Server.log';
    910$MangosDbErrorsLogFile = '/a/log/mangos/DBErrors.log';
     11$ItemPerPage = 35;
    1012
    1113//$DatabaseHost = $Config['Database']['Host'];
  • administrace/process_log.php

    r329 r362  
    5353//echo($Database->error);
    5454
     55$Log = addslashes(file_get_contents($MangosConfFile));
     56$Database->query('UPDATE `debug` SET Configuration="'.$Log.'" WHERE Id='.$InsertId);
     57
    5558// Clear log files
    5659unlink($MangosLogFile);
Note: See TracChangeset for help on using the changeset viewer.