]> git.joonet.de Git - adminer.git/commitdiff
Display message about missing master status
authorJakub Vrana <jakub@vrana.cz>
Mon, 20 Feb 2017 13:06:19 +0000 (14:06 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 20 Feb 2017 13:06:19 +0000 (14:06 +0100)
adminer/replication.inc.php

index bd25841d3d89efe22c7105b0b5db338106d63497..33a130915d1a17e1dbec5994d169de9673ed73f5 100644 (file)
@@ -1,20 +1,24 @@
 <?php
 page_header(lang('Replication'));
 
-echo "<p><b>" . lang('Master status') . "</b>" . doc_link(array("sql" => "show-master-status.html")) . "\n";
+echo "<h3>" . lang('Master status') . doc_link(array("sql" => "show-master-status.html")) . "</h3>\n";
 $master_replication_status = replication_status("MASTER");
-echo "<table cellspacing='0'>\n";
-foreach ($master_replication_status[0] as $key => $val) {
-       echo "<tr>";
-       echo "<th>" . h($key);
-       echo "<td>" . nbsp($val);
+if (!$master_replication_status) {
+       echo "<p class='message'>" . lang('No rows.') . "\n";
+} else {
+       echo "<table cellspacing='0'>\n";
+       foreach ($master_replication_status[0] as $key => $val) {
+               echo "<tr>";
+               echo "<th>" . h($key);
+               echo "<td>" . nbsp($val);
+       }
+       echo "</table>\n";
 }
-echo "</table>\n";
 
 $slave_replication_status = replication_status("SLAVE");
-if (!empty($slave_replication_status)) {
-       echo "<p><b>" . lang('Slave status') . "</b>" . doc_link(array("sql" => "show-slave-status.html")) . "\n";
-       foreach ($slave_replication_status as $slave) {
+if ($slave_replication_status) {
+       echo "<h3>" . lang('Slave status') . doc_link(array("sql" => "show-slave-status.html")) . "</h3>\n";
+       foreach ($slave_replication_status[0] as $slave) {
                echo "<table cellspacing='0'>\n";
                foreach ($slave as $key => $val) {
                        echo "<tr>";