|
6 | 6 | gtag('js', new Date()); gtag('config', 'UA-7722718-13');</script> |
7 | 7 |
|
8 | 8 | <meta charset="utf-8"/> |
9 | | - <meta name='date' content='2025-12-04T04:43:32.9876236Z'> |
| 9 | + <meta name='date' content='2025-12-04T15:16:58.1589715Z'> |
10 | 10 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
11 | 11 | <link rel="icon" type="image/svg" href="/img/logo.svg"> |
12 | 12 | <title>Admin UI Analytics for SQLite</title> |
@@ -1455,20 +1455,30 @@ <h3 id="benefits-of-api-analytics">Benefits of API Analytics<a class="header-anc |
1455 | 1455 | <h3 id="getting-started">Getting Started<a class="header-anchor" href="javascript:;" onclick="location.hash='#getting-started'" aria-label="Permalink">​</a></h3> |
1456 | 1456 | <p>As they offer significant and valuable insights they're now built into all new ASP.NET Core IdentityAuth templates, |
1457 | 1457 | existing .NET 8 IdentityAuth templates can enable it with:</p> |
1458 | | -<div class="not-prose sh-copy cp flex cursor-pointer mb-3" onclick="copy(this)"> |
1459 | | - <div class="flex-grow bg-gray-800"> |
1460 | | - <div class="pl-4 py-1 pb-1.5 align-middle whitespace-pre text-base text-gray-100"><p>npx add-in sqlitelogs</p> |
1461 | | -</div> |
1462 | | - </div> |
1463 | | - <div class="flex"> |
1464 | | - <div class="bg-green-600 text-white p-1.5 pb-0"> |
1465 | | - <svg class="copied w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg> |
1466 | | - <svg class="nocopy w-6 h-6" title="copy" fill='none' stroke='white' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'> |
1467 | | - <path stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2'></path> |
1468 | | - </svg> |
| 1458 | +<div class="sh mb-4"><div class="not-prose group relative overflow-hidden rounded-lg border border-slate-200 dark:border-slate-700 bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 shadow-sm hover:shadow-md transition-all duration-200 cursor-pointer" onclick="shellCopy(this)"> |
| 1459 | + <!-- Background pattern --> |
| 1460 | + <div class="absolute inset-0 bg-grid-slate-100 dark:bg-grid-slate-800 opacity-50" style="background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px); background-size: 16px 16px;"></div> |
| 1461 | + |
| 1462 | + <div class="relative flex items-center justify-between px-4 py-3"> |
| 1463 | + <!-- Left side - Terminal icon and command --> |
| 1464 | + <div class="flex items-center gap-3 flex-1 min-w-0"> |
| 1465 | + <svg class="w-4 h-4 text-slate-500 dark:text-slate-400 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19h8"/><path d="m4 17 6-6-6-6"/></svg> |
| 1466 | + <div class="flex items-center gap-2 min-w-0 flex-1"> |
| 1467 | + <code class="text-sm font-mono text-slate-900 dark:text-slate-100 truncate"><p>npx add-in sqlitelogs</p> |
| 1468 | +</code> |
| 1469 | + </div> |
| 1470 | + </div> |
| 1471 | + |
| 1472 | + <!-- Right side - Copy button --> |
| 1473 | + <div class="flex items-center gap-2 ml-4"> |
| 1474 | + <button class="shell-copy-btn flex items-center justify-center p-2 rounded-md transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-300 border border-slate-300 dark:border-slate-600 hover:bg-slate-50 dark:hover:bg-slate-700 hover:border-slate-400 dark:hover:border-slate-500" aria-label="Copy command"> |
| 1475 | + <svg class="copied w-4 h-4" style="display:none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg> |
| 1476 | + <svg class="nocopy w-4 h-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg> |
| 1477 | + </button> |
| 1478 | + </div> |
1469 | 1479 | </div> |
1470 | 1480 | </div> |
1471 | | - </div> |
| 1481 | +</div> |
1472 | 1482 | <p>.NET 8 Templates that are not configured to use <a href="/endpoint-routing">Endpoint Routing</a> |
1473 | 1483 | and <a href="/net-ioc">ASP.NET Core IOC</a> will need to explicitly register <code>SqliteRequestLogger</code> |
1474 | 1484 | as a singleton dependency in addition to configuring it on the <code>RequestLogsFeature</code> plugin:</p> |
@@ -1633,20 +1643,30 @@ <h3 id="disallowing-bots-in-robots.txt">Disallowing Bots in robots.txt<a class=" |
1633 | 1643 | <h3 id="disallowing-bot-requests">Disallowing Bot Requests<a class="header-anchor" href="javascript:;" onclick="location.hash='#disallowing-bot-requests'" aria-label="Permalink">​</a></h3> |
1634 | 1644 | <p>As this was not having an immediate effect we took a more forceful approach to implement a middleware to reject all |
1635 | 1645 | requests from disallowed bots from accessing our App which you can add to your own App with:</p> |
1636 | | -<div class="not-prose sh-copy cp flex cursor-pointer mb-3" onclick="copy(this)"> |
1637 | | - <div class="flex-grow bg-gray-800"> |
1638 | | - <div class="pl-4 py-1 pb-1.5 align-middle whitespace-pre text-base text-gray-100"><p>npx add-in useragent-blocking</p> |
1639 | | -</div> |
1640 | | - </div> |
1641 | | - <div class="flex"> |
1642 | | - <div class="bg-green-600 text-white p-1.5 pb-0"> |
1643 | | - <svg class="copied w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg> |
1644 | | - <svg class="nocopy w-6 h-6" title="copy" fill='none' stroke='white' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'> |
1645 | | - <path stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2'></path> |
1646 | | - </svg> |
| 1646 | +<div class="sh mb-4"><div class="not-prose group relative overflow-hidden rounded-lg border border-slate-200 dark:border-slate-700 bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 shadow-sm hover:shadow-md transition-all duration-200 cursor-pointer" onclick="shellCopy(this)"> |
| 1647 | + <!-- Background pattern --> |
| 1648 | + <div class="absolute inset-0 bg-grid-slate-100 dark:bg-grid-slate-800 opacity-50" style="background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px); background-size: 16px 16px;"></div> |
| 1649 | + |
| 1650 | + <div class="relative flex items-center justify-between px-4 py-3"> |
| 1651 | + <!-- Left side - Terminal icon and command --> |
| 1652 | + <div class="flex items-center gap-3 flex-1 min-w-0"> |
| 1653 | + <svg class="w-4 h-4 text-slate-500 dark:text-slate-400 flex-shrink-0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19h8"/><path d="m4 17 6-6-6-6"/></svg> |
| 1654 | + <div class="flex items-center gap-2 min-w-0 flex-1"> |
| 1655 | + <code class="text-sm font-mono text-slate-900 dark:text-slate-100 truncate"><p>npx add-in useragent-blocking</p> |
| 1656 | +</code> |
| 1657 | + </div> |
| 1658 | + </div> |
| 1659 | + |
| 1660 | + <!-- Right side - Copy button --> |
| 1661 | + <div class="flex items-center gap-2 ml-4"> |
| 1662 | + <button class="shell-copy-btn flex items-center justify-center p-2 rounded-md transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-300 border border-slate-300 dark:border-slate-600 hover:bg-slate-50 dark:hover:bg-slate-700 hover:border-slate-400 dark:hover:border-slate-500" aria-label="Copy command"> |
| 1663 | + <svg class="copied w-4 h-4" style="display:none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg> |
| 1664 | + <svg class="nocopy w-4 h-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg> |
| 1665 | + </button> |
| 1666 | + </div> |
1647 | 1667 | </div> |
1648 | 1668 | </div> |
1649 | | - </div> |
| 1669 | +</div> |
1650 | 1670 | <p>This will allow you to configure which Bot User Agents you want to reject from accessing your site, e.g:</p> |
1651 | 1671 | <pre><code class="language-csharp">services.Configure<UserAgentBlockingOptions>(options => |
1652 | 1672 | { |
|
0 commit comments