diff --git a/src/webui/explore.php b/src/webui/explore.php new file mode 100644 index 0000000..e0be239 --- /dev/null +++ b/src/webui/explore.php @@ -0,0 +1,319 @@ + $config->manticore->server->host, + 'port' => $config->manticore->server->port, + ] +); + +// Init index +$index = $client->index( + $config->manticore->index->document->name +); + +// Get totals +$total = $index->search('') + ->option('cutoff', 0) + ->limit(0) + ->get() + ->getTotal(); + +$placeholder = sprintf( + _('Search in %s documents %s'), + number_format( + $total + ), + $config->webui->search->index->request->url->enabled ? _('or enter new address to crawl...') : false +); + +// Get document data +$document = $index->getDocumentById( + isset($_GET['i']) ? $_GET['i'] : 0 +); + +// Get icon +$hostname = parse_url( + $document->url, + PHP_URL_HOST +); + +$identicon = new \Jdenticon\Identicon(); + +$identicon->setValue( + $hostname +); + +$identicon->setSize(36); + +$identicon->setStyle( + [ + 'backgroundColor' => 'rgba(255, 255, 255, 0)', + 'padding' => 0 + ] +); + +$icon = $identicon->getImageDataUri('webp'); + +// Get snaps info +$snaps = []; + +?> + + + + + <?php echo _('Yo! explore') ?> + + + + +
+
+

+ + +
+
+
+ +
+ title) && empty($document->description) && empty($document->keywords)) { ?> + + + title)) { ?> +

title) ?>

+ + description)) { ?> + description) ?> + + keywords)) { ?> + keywords) ?> + + + + url)) ?> + +
+
+

+ identicon +

+ code)) { ?> +

+ code == 200) { ?> +

code ?>

+ +

+ code ?> +

+ + + mime)) { ?> +

+

mime ?>

+ + size)) { ?> +

+

size ?>

+ + time)) { ?> +

+

time) ?> / time ?>

+ + +

+ $snap) { ?> +

+ + time) ?> / time ?> + +

+ + +
+ +
+ +
+ +
+ + \ No newline at end of file