-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<script lang="ts"> | ||
import Pagination from './Pagination.svelte'; | ||
import { DataHandler } from '@vincjo/datatables/legacy/remote'; | ||
import type { State } from '@vincjo/datatables/legacy/remote'; | ||
import type { AdsTxtEntries } from '../types'; | ||
interface Props { | ||
entries_table: AdsTxtEntries[]; | ||
} | ||
let { entries_table }: Props = $props(); | ||
const totalRows = entries_table.length; | ||
const rowsPerPage = 50; | ||
const handler = new DataHandler<AdsTxtEntries>([], { | ||
rowsPerPage: rowsPerPage, | ||
totalRows: totalRows | ||
}); | ||
const rows = handler.getRows(); | ||
handler.onChange((state: State) => | ||
Promise.resolve( | ||
entries_table.slice( | ||
0 + (state.pageNumber - 1) * state.rowsPerPage, | ||
state.rowsPerPage * state.pageNumber | ||
) | ||
) | ||
); | ||
handler.invalidate(); | ||
</script> | ||
|
||
<div class="table-container space-y-4"> | ||
<div class="overflow-x-auto pl-0"> | ||
<table class="table table-hover table-compact table-auto w-full"> | ||
<thead> | ||
<tr> | ||
<th class="table-cell-fit">Publisher ID</th> | ||
<th class="table-cell-fit">Related Apps</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{#each $rows as row} | ||
<tr> | ||
<td class="table-cell-fit text-sm md:text-base max-w-[100px] truncate"> | ||
<!-- <a href={`/ads-txt/unrulymedia.com/${row.publisher_id}`}>{row.publisher_id}</a> --> | ||
{row.publisher_id} | ||
</td> | ||
<td class="table-cell-fit text-sm md:text-base"> | ||
{row.app_count} | ||
</td> | ||
</tr> | ||
{/each} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<script lang="ts"> | ||
function formatNumber(num: number) { | ||
return new Intl.NumberFormat('en-US').format(num); | ||
} | ||
let { myTotals } = $props(); | ||
</script> | ||
|
||
<hr /> | ||
|
||
<div class="text-md text-primary-800-200 uppercase tracking-wide">Ads.txt DIRECT Totals</div> | ||
<div class="grid grid-cols-2 gap-4 p-4"> | ||
<div class="stat-container"> | ||
<div class="text-sm text-primary-800-200 uppercase tracking-wide">Android Pub IDs</div> | ||
<div class="text-2xl font-bold text-primary-900"> | ||
{formatNumber(myTotals.google.direct.publisher_id_count)} | ||
</div> | ||
</div> | ||
|
||
<div class="stat-container"> | ||
<div class="text-sm text-primary-800-200 uppercase tracking-wide">iOS Pub IDs</div> | ||
<div class="text-2xl font-bold text-primary-900"> | ||
{formatNumber(myTotals.apple.direct.publisher_id_count)} | ||
</div> | ||
</div> | ||
|
||
<div class="stat-container"> | ||
<div class="text-sm text-primary-800-200 uppercase tracking-wide">Android Developers</div> | ||
<div class="text-2xl font-bold text-primary-900"> | ||
{formatNumber(myTotals.google.direct.developer_count)} | ||
</div> | ||
</div> | ||
|
||
<div class="stat-container"> | ||
<div class="text-sm text-primary-800-200 uppercase tracking-wide">iOS Developers</div> | ||
<div class="text-2xl font-bold text-primary-900"> | ||
{formatNumber(myTotals.apple.direct.developer_count)} | ||
</div> | ||
</div> | ||
|
||
<div class="stat-container"> | ||
<div class="text-sm text-primary-800-200 uppercase tracking-wide">Android Apps</div> | ||
<div class="text-2xl font-bold text-primary-900"> | ||
{formatNumber(myTotals.google.direct.app_count)} | ||
</div> | ||
</div> | ||
|
||
<div class="stat-container"> | ||
<div class="text-sm text-primary-800-200 uppercase tracking-wide">iOS Apps</div> | ||
<div class="text-2xl font-bold text-primary-900"> | ||
{formatNumber(myTotals.apple.direct.app_count)} | ||
</div> | ||
</div> | ||
</div> | ||
<hr /> | ||
<div class="text-md text-primary-800-200 uppercase tracking-wide">Ads.txt RESELLER Totals</div> | ||
<div class="grid grid-cols-2 gap-4 p-4"> | ||
<div class="stat-container"> | ||
<div class="text-sm text-primary-800-200 uppercase tracking-wide">Android Apps</div> | ||
<div class="text-2xl font-bold text-primary-900"> | ||
{formatNumber(myTotals.google.reseller.app_count)} | ||
</div> | ||
</div> | ||
<div class="stat-container"> | ||
<div class="text-sm text-primary-800-200 uppercase tracking-wide">iOS Apps</div> | ||
<div class="text-2xl font-bold text-primary-900"> | ||
{formatNumber(myTotals.apple.reseller.app_count)} | ||
</div> | ||
</div> | ||
</div> |