Add stuff

This commit is contained in:
Rasmus Rasmussen 2025-01-16 11:10:43 +01:00
parent 7abe904997
commit 41dfb5809a
4 changed files with 59 additions and 24 deletions

View File

@ -60,7 +60,7 @@ progressApi.MapGet("/", (IMemoryCache memoryCache) =>
return scanningStatus;
});
/*
RouteGroupBuilder searchApi = app.MapGroup("/search");
searchApi.MapGet("/{term}", (string term) =>
{
@ -78,7 +78,7 @@ searchApi.MapGet("/{term}", (string term) =>
return JsonSerializer.Deserialize<SearchResults?>(msg);
});
*/
app.Run();
[JsonSerializable(typeof(ScanningStatus))]

View File

@ -16,8 +16,5 @@ useHead({
</ul>
</div>
<NuxtPage page-key="static" />
<NuxtPage page-key="static" />
</template>

View File

@ -39,23 +39,51 @@ fetchMyData();
<template>
<div class="h-screen grid place-items-center">
<div v-if="dict">
<table class="table-auto border-gray-300">
<thead>
<tr>
<th class="px-4 py-2">Metric</th>
<th class="px-4 py-2">Value</th>
</tr>
</thead>
<table class="table-auto border-gray-300">
<thead>
<tr>
<th class="px-4 py-2">Metric</th>
<th class="px-4 py-2">Value</th>
</tr>
</thead>
<tbody>
<tr v-for="d in dict">
<td class="px-4 py-2">{{d.description}}</td>
<td class="px-4 py-2">{{d.value}}</td>
</tr>
</tbody>
</table>
</div>
<tbody v-if="dict">
<tr v-for="d in dict">
<td class="px-4 py-2">{{d.description}}</td>
<td class="px-4 py-2">{{d.value}}</td>
</tr>
</tbody>
<tbody v-else>
<tr>
<td class="px-4 py-2">Percentage of Ipv4 scanned</td>
<td class="px-4 py-2"></td>
</tr>
<tr>
<td class="px-4 py-2">Total filtered</td>
<td class="px-4 py-2"></td>
</tr>
<tr>
<td class="px-4 py-2">Total Discarded</td>
<td class="px-4 py-2"></td>
</tr>
<tr>
<td class="px-4 py-2">Amount of Ipv4 left</td>
<td class="px-4 py-2"></td>
</tr>
<tr>
<td class="px-4 py-2">Discarded db size</td>
<td class="px-4 py-2"></td>
</tr>
<tr>
<td class="px-4 py-2">Filtered db size</td>
<td class="px-4 py-2"></td>
</tr>
<tr>
<td class="px-4 py-2">Unfiltered db size</td>
<td class="px-4 py-2"></td>
</tr>
</tbody>
</table>
</div>
</template>

View File

@ -6,12 +6,22 @@ interface ProgressType {
discardedDbSize: bigint;
filteredDbSize: bigint;
myDbSize: bigint;
}
};
interface ProgressDictionary {
description: string;
value: string;
}
};
interface SearchResult {
title: string;
description: string;
url: string;
};
interface SearchResults {
results: SearchResult[];
};
type CacheEntry<T> = {
data: T;