diff --git a/web/src/components/things/WebsiteDetailedInfo.astro b/web/src/components/things/WebsiteDetailedInfo.astro new file mode 100644 index 0000000..e4d09cb --- /dev/null +++ b/web/src/components/things/WebsiteDetailedInfo.astro @@ -0,0 +1,329 @@ +--- + +import type { WebsiteData } from '@utils/fetch-website-info'; +import { analyzeSecurityChecks } from '@utils/security-check-mappings'; +import FontAwesome from "@components/form/FontAwesome.svelte" +import Button from '@components/form/Button.astro'; + +interface Props { + websiteInfo: WebsiteData; + url: string; +}; + +const { websiteInfo, url } = Astro.props; + +const categoryLabels: {[key: string]: string} = { + is_torrent: 'Torrenting', + is_vpn_provider: 'VPN Provider', + is_free_hosting: 'Free Hosting', + is_anonymizer: 'Anonymizer', + is_url_shortener: 'URL Shortner', + is_free_dynamic_dns: 'Free Dynamic DNS', + is_code_sandbox: 'Code Sandbox', + is_form_builder: 'Form Builder', + is_free_file_sharing: 'File Sharing', + is_pastebin: 'Pastebin' +}; + +const siteCategories = Object.entries(websiteInfo.site_category) + .filter(([key, value]) => value) + .map(([key]) => categoryLabels[key]); + +const securityChecks = analyzeSecurityChecks(websiteInfo.security_checks); + +const risk = websiteInfo.risk_score.result; +let riskText = 'unknown'; +if (risk < 5) riskText = 'safe'; +else if (risk < 15) riskText = 'moderately safe'; +else if (risk < 50) riskText = 'risky'; +else if (risk < 75) riskText = 'dangerous'; +else if (risk >= 75) riskText = 'very dangerous'; + + +const clientSideKey = 'cd02a8520c90410bbc32440950bd3b7e'; +const screenshotOptions = 'format=png&width=960&height=540&ttl=2419200&response_type=image&no_cookie_banners=true&no_ads=true'; +const screenshotEndpoint = 'https://api.apiflash.com/v1'; +const screenshotUrl = `${screenshotEndpoint}/urltoimage?access_key=${clientSideKey}&url=${encodeURIComponent(url)}&${screenshotOptions}`; + +--- + +
+
+

Website

+

+ + {websiteInfo.web_page.title} +

+

{websiteInfo.web_page.description}

+

Redirects

+ {websiteInfo.redirection.found ? ( +

+ + Redirects to {websiteInfo.redirection.url} +

+ ) : ( +

+ + Does not redirect +

+ )} +

Security Checks

+ { securityChecks.failedChecks.length > 0 ? ( + <> +

+ {securityChecks.failedChecks.length} security checks failed ({securityChecks.passedChecks.length} passed) +

+ + + ) : ( +

+ + All {securityChecks.passedChecks.length} security checks passed +

+ )} +

Server Details

+ + + {siteCategories.length > 0 && ( +

Categories

+

Some proxies may block this service, as it falls into the following categories

+ + )} +

Associated Countries

+ +

Saftey Score

+

Website marked as {riskText}

+
+

{100-risk}%

+
+
+
+

Blacklist Check

+

{websiteInfo.url_parts.host} was found on {websiteInfo.domain_blacklist.detections} blacklists

+ +

Website Preview

+ + + +
+
+ + +