This commit is contained in:
hufangzhou
2024-05-27 15:41:45 +08:00
committed by caoyanyi
parent e5634840de
commit 6b2ed5bfc0
5 changed files with 21 additions and 9 deletions
+1
View File
@@ -64,6 +64,7 @@ $lang->misc->checkTable = "Prüfe Datentabellen";
$lang->misc->needRepair = "Repariere Datentabellen";
$lang->misc->repairTable = "Datenbank íst beschädigt. Bitte brüfen und reparieren!";
$lang->misc->repairFail = "Reparatur fehlgeschlagen. Bitte wechseln Sie in das Verzeichnis der Datenbank, und versuchen Sie folgenden Befehl <code>myisamchk -r -f %s.MYI</code> zum reparieren der DB.";
$lang->misc->withoutCmd = 'Reparatur fehlgeschlagen.';
$lang->misc->connectFail = "Failed to connect to the database. Error: %s,<br/> Please check the MySQL error log and troubleshoot.";
$lang->misc->tableName = "Tabellenname";
$lang->misc->tableStatus = "Status";
+1
View File
@@ -64,6 +64,7 @@ $lang->misc->checkTable = "Check Data Table";
$lang->misc->needRepair = "Repair Table";
$lang->misc->repairTable = "Database table might be damaged due to power outage. Please check and repair!";
$lang->misc->repairFail = "Failed to repair. Please go to the data directory of your database, and try to execute <code>myisamchk -r -f %s.MYI</code> repair.";
$lang->misc->withoutCmd = 'Failed to repair.';
$lang->misc->connectFail = "Failed to connect to the database. Error: %s,<br/> Please check the MySQL error log and troubleshoot.";
$lang->misc->tableName = "Table Name";
$lang->misc->tableStatus = "Status";
+1
View File
@@ -64,6 +64,7 @@ $lang->misc->checkTable = "Vérifiez les Données de la Table";
$lang->misc->needRepair = "Réparer la Table";
$lang->misc->repairTable = "La Base de Données est peut-être endommagée. Elle a besoin d'être vérifiée et éventuellement réparée !";
$lang->misc->repairFail = "La réparation a échoué. Allez dans le répertoire de données de votre table et essayez d'exécuter <code>myisamchk -r -f %s.MYI</code> pour la réparer. Mais on ne promet rien :-(";
$lang->misc->withoutCmd = 'La réparation a échoué.';
$lang->misc->connectFail = "Echec de connexion à la Base de données. Erreur: %s,<br/>Vérifiez la log des erreurs MySQL et des dysfonctionnements.";
$lang->misc->tableName = "Nom de la Table";
$lang->misc->tableStatus = "Statut";
+1
View File
@@ -64,6 +64,7 @@ $lang->misc->checkTable = "检查修复数据表";
$lang->misc->needRepair = "修复表";
$lang->misc->repairTable = "数据库表可能因为断电原因损坏,需要检查修复!!";
$lang->misc->repairFail = "修复失败,请到该数据库的数据目录下,尝试执行<code>myisamchk -r -f %s.MYI</code>进行修复。";
$lang->misc->withoutCmd = '修复失败。';
$lang->misc->connectFail = "连接数据库失败,错误:%s,<br/> 请检查mysql错误日志,排查错误。";
$lang->misc->tableName = "表名";
$lang->misc->tableStatus = "状态";
+17 -9
View File
@@ -63,7 +63,7 @@ $lang = new stdclass();
$lang->misc = new stdclass();
$lang->storyCommon = '';
$lang->productCommon = '';
$lang->executionCommon = '';
$lang->executionCommon = '';
$lang->URCommon = '';
$lang->SRCommon = '';
$lang->productURCommon = '';
@@ -90,15 +90,15 @@ else
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$tables = array();
$stmt = $dbh->query("show full tables");
$stmt = $dbh->query("select * from information_schema.tables where table_schema = '{$config->db->name}'");
while($table = $stmt->fetch(PDO::FETCH_ASSOC))
{
$tableName = $table["Tables_in_{$config->db->name}"];
$tableType = strtolower($table['Table_type']);
$tableName = $table["TABLE_NAME"];
$tableType = strtolower($table['TABLE_TYPE']);
if($tableType == 'base table')
{
$tableStatus = $dbh->query("$type table $tableName")->fetch();
$tables[$tableName] = strtolower($tableStatus->Msg_text);
$tables[$tableName] = array('status' => strtolower($tableStatus->Msg_text), 'engine' => strtolower($table['ENGINE']));
}
}
$status = 'check';
@@ -143,12 +143,20 @@ else
</thead>
<tbody>
<?php $needRepair = false;?>
<?php foreach($tables as $tableName => $tableStatus):?>
<?php if($tableStatus != 'ok') $needRepair = true;?>
<?php foreach($tables as $tableName => $tableInfo):?>
<?php if($tableInfo['status'] != 'ok') $needRepair = true;?>
<tr>
<td><?php echo $tableName;?></td>
<td><span style='color:<?php echo $tableStatus == 'ok' ? 'green' : 'red'?>'><?php echo $tableStatus;?></span></td>
<td><?php if($type == 'repair' and $tableStatus != 'ok') printf($lang->misc->repairFail, $tableName)?></td>
<td><span style='color:<?php echo $tableInfo['status'] == 'ok' ? 'green' : 'red'?>'><?php echo $tableInfo['status'];?></span></td>
<td>
<?php
if($type == 'repair' && $tableInfo['status'] != 'ok')
{
if($tableInfo['engine'] == 'myisam') printf($lang->misc->repairFail, $tableName);
if($tableInfo['engine'] == 'innodb') echo $lang->misc->withoutCmd;
}
?>
</td>
</tr>
</tbody>
<?php endforeach;?>