add ceawl in queue notification

This commit is contained in:
ghost 2023-04-02 01:30:50 +03:00
parent 23ca2ca481
commit d5f33ad643
2 changed files with 23 additions and 0 deletions

View File

@ -59,6 +59,23 @@ class SQLite {
'); ');
} }
public function getTotalPagesByHttpCode(mixed $httpCode) {
if (is_null($httpCode)) {
$query = $this->_db->query('SELECT COUNT(*) AS `total` FROM `page` WHERE `httpCode` IS NULL');
} else {
$query = $this->_db->prepare('SELECT COUNT(*) AS `total` FROM `page` WHERE `httpCode` = ?');
$query->execute([$httpCode]);
}
return $query->fetch()->total;
}
public function getTotalPages() { public function getTotalPages() {
$query = $this->_db->prepare('SELECT COUNT(*) AS `total` FROM `page`'); $query = $this->_db->prepare('SELECT COUNT(*) AS `total` FROM `page`');

View File

@ -177,6 +177,9 @@ if (!empty($q)) {
<?php if ($results) { ?> <?php if ($results) { ?>
<div> <div>
<?php echo sprintf(_('Total found: %s'), $resultsTotal) ?> <?php echo sprintf(_('Total found: %s'), $resultsTotal) ?>
<?php if ($queueTotal = $db->getTotalPagesByHttpCode(null)) { ?>
<?php echo sprintf(_('* Please wait for all pages crawl to complete (%s in queue).'), $queueTotal) ?>
<?php } ?>
</div> </div>
<?php foreach ($results as $result) { ?> <?php foreach ($results as $result) { ?>
<div> <div>
@ -190,6 +193,9 @@ if (!empty($q)) {
<?php } else { ?> <?php } else { ?>
<div style="text-align:center"> <div style="text-align:center">
<?php echo sprintf(_('Total found: %s'), $resultsTotal) ?> <?php echo sprintf(_('Total found: %s'), $resultsTotal) ?>
<?php if ($q && $queueTotal = $db->getTotalPagesByHttpCode(null)) { ?>
<?php echo sprintf(_('* Please wait for all pages crawl to complete (%s in queue).'), $queueTotal) ?>
<?php } ?>
</div> </div>
<?php } ?> <?php } ?>
</main> </main>