Browse Source

show keys only in records list

main
ghost 9 months ago
parent
commit
617a91735e
  1. 43
      src/server.php

43
src/server.php

@ -273,10 +273,14 @@ $server->setHandler(
// Append latest records // Append latest records
foreach ($records as $record) foreach ($records as $record)
{ {
// Key // Link
$result[] = null;
$result[] = sprintf( $result[] = sprintf(
'### %s', '=> /%s %s %s',
$record['transaction'],
date(
'Y-m-d',
$record['time']
),
trim( trim(
preg_replace( // single-line preg_replace( // single-line
'/[\s]+/', '/[\s]+/',
@ -285,43 +289,10 @@ $server->setHandler(
) )
) )
); );
// Value
$result[] = null;
$result[] = trim(
preg_replace(
[
'/(^|\s+)(#|\*|```|=>)/', // escape gemini text
'/[\n\r]{3,}/', // remove extra breaks
],
[
'$1 $2',
PHP_EOL . PHP_EOL,
],
$record['value']
)
);
// Link
$result[] = null;
$result[] = sprintf(
'=> /%s %s in %d',
$record['transaction'],
date(
'Y-m-d',
$record['time']
),
$record['block']
);
} }
// Append navigation // Append navigation
$result[] = null; $result[] = null;
$result[] = sprintf(
'## %s',
$config->geminiapp->string->navigation
);
$result[] = null;
// Pagination // Pagination
$older = []; $older = [];

Loading…
Cancel
Save