Human readable entry source

This commit is contained in:
Kuba Orlik 2021-11-07 19:19:38 +01:00
parent e989d6d33d
commit 070ac44839
1 changed files with 10 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import React, { useState } from "react";
import ReactDOM from "react-dom";
import { getMemory } from "../memory";
import { RequestCluster } from "../request-cluster";
import { Classifications } from "../stolen-data-entry";
import { Classifications, Sources } from "../stolen-data-entry";
import { getDate } from "../util";
const emailClassifications: Record<keyof typeof Classifications, string> = {
@ -10,6 +10,13 @@ const emailClassifications: Record<keyof typeof Classifications, string> = {
history: "część mojej historii przeglądania",
};
const emailSources: Record<Sources, string> = {
header: "w nagłówku HTTP",
cookie: "z pliku Cookie",
pathname: "jako części adresu URL",
queryparams: "jako część adresu URL (query-params)",
};
type PopupState = "not_clicked" | "clicked_but_invalid";
function DomainSummary({ cluster }: { cluster: RequestCluster }) {
@ -31,7 +38,8 @@ function DomainSummary({ cluster }: { cluster: RequestCluster }) {
}, [])
.map((entry) => (
<li>
{emailClassifications[entry.classification]} w {entry.source}
{emailClassifications[entry.classification]}{" "}
{emailSources[entry.source]}
&nbsp;(<code>{entry.name.trim()}</code>)
</li>
))}