diff --git a/crawler/src/crawl/community.ts b/crawler/src/crawl/community.ts index 4d71909..837119c 100644 --- a/crawler/src/crawl/community.ts +++ b/crawler/src/crawl/community.ts @@ -52,7 +52,7 @@ export default class CommunityCrawler { // validate the community actor_id matches the domain if (basePart != this.crawlDomain || communityPart != community.community.name) { logging.error( - `${this.logPrefix} Community actor_id does not match domain: ${community.community.actor_id} ${community.community.name}`, + `${this.logPrefix} Community actor_id does not match domain: ${JSON.stringify(community.community)}`, ); return false; } diff --git a/crawler/src/output/output.ts b/crawler/src/output/output.ts index 312bb41..dca8326 100644 --- a/crawler/src/output/output.ts +++ b/crawler/src/output/output.ts @@ -355,7 +355,7 @@ export default class CrawlOutput { // remove communities with age more than the max const recordAge = Date.now() - instance.lastCrawled; if (recordAge > OUTPUT_MAX_AGE.INSTANCE) { - console.log("Sus Site too old", instance.base); + console.log("Sus Site has expired, the age of the record is too old", instance.base); return false; } diff --git a/frontend/src/components/Inspector/ScatterGrid.tsx b/frontend/src/components/Inspector/ScatterGrid.tsx index 797283a..31b4f29 100644 --- a/frontend/src/components/Inspector/ScatterGrid.tsx +++ b/frontend/src/components/Inspector/ScatterGrid.tsx @@ -1,145 +1,145 @@ -import React, { PureComponent } from "react"; -import { ScatterChart, Scatter, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts"; - -import { Treemap } from "recharts"; - -type ICustomTooltipProps = { - active: boolean; - payload: any; - label?: any; -}; - -const CustomTooltip = ({ active, payload, label }: ICustomTooltipProps) => { - if (active && payload && payload.length) { - return ( -
- {/*

ActiveMonth: {payload[0].metrics.userActiveMonthScore}

*/} -

{JSON.stringify(payload[0].payload.instance.baseurl)}

-

- userActiveMonthScore {JSON.stringify(payload[0].payload.instance.metrics.userActiveMonthScore)} -

-

- averagePerMinute {JSON.stringify(payload[0].payload.instance.metrics.averagePerMinute)} -

-
- ); - } - - return null; -}; - -const CustomTooltip1 = ({ active, payload, label }: ICustomTooltipProps) => { - if (active && payload && payload.length) { - return ( -
-

{JSON.stringify(payload[0].payload.instance.baseurl)}

-

- totalActivity {JSON.stringify(payload[0].payload.instance.metrics.totalActivity)} -

-

- userActivityScore {JSON.stringify(payload[0].payload.instance.metrics.userActivityScore)} -

-
- ); - } - - return null; -}; - -type IScatterGridProps = { - instances: any[]; -}; - -export function ScatterGrid({ instances }: IScatterGridProps) { - // x: instance users userActiveMonthScore - // y: instance sus score userActivityScore - - const data = []; - - instances.forEach((instance) => { - data.push({ - x: instance.metrics.userActiveMonthScore, - y: instance.metrics.averagePerMinute, - instance: instance, - }); - }); - - // const data = [ - // { x: 100, y: 200, z: 200 }, - // { x: 120, y: 100, z: 260 }, - // { x: 170, y: 300, z: 400 }, - // { x: 140, y: 250, z: 280 }, - // { x: 150, y: 400, z: 500 }, - // { x: 110, y: 280, z: 200 }, - // ]; - - return ( - - - - - - {/* } /> */} - - - - ); -} - -export function ScatterGrid1({ instances }: IScatterGridProps) { - // x: instance users userActiveMonthScore - // y: instance sus score userActivityScore - - const data = []; - - instances.forEach((instance) => { - data.push({ - x: instance.metrics.totalActivity, - y: instance.metrics.usersTotal, - instance: instance, - }); - }); - - // const data = [ - // { x: 100, y: 200, z: 200 }, - // { x: 120, y: 100, z: 260 }, - // { x: 170, y: 300, z: 400 }, - // { x: 140, y: 250, z: 280 }, - // { x: 150, y: 400, z: 500 }, - // { x: 110, y: 280, z: 200 }, - // ]; - - return ( - - - - - - {/* } /> */} - - - - ); -} +// import React, { PureComponent } from "react"; +// import { ScatterChart, Scatter, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from "recharts"; + +// import { Treemap } from "recharts"; + +// type ICustomTooltipProps = { +// active: boolean; +// payload: any; +// label?: any; +// }; + +// const CustomTooltip = ({ active, payload, label }: ICustomTooltipProps) => { +// if (active && payload && payload.length) { +// return ( +//
+// {/*

ActiveMonth: {payload[0].metrics.userActiveMonthScore}

*/} +//

{JSON.stringify(payload[0].payload.instance.baseurl)}

+//

+// userActiveMonthScore {JSON.stringify(payload[0].payload.instance.metrics.userActiveMonthScore)} +//

+//

+// averagePerMinute {JSON.stringify(payload[0].payload.instance.metrics.averagePerMinute)} +//

+//
+// ); +// } + +// return null; +// }; + +// const CustomTooltip1 = ({ active, payload, label }: ICustomTooltipProps) => { +// if (active && payload && payload.length) { +// return ( +//
+//

{JSON.stringify(payload[0].payload.instance.baseurl)}

+//

+// totalActivity {JSON.stringify(payload[0].payload.instance.metrics.totalActivity)} +//

+//

+// userActivityScore {JSON.stringify(payload[0].payload.instance.metrics.userActivityScore)} +//

+//
+// ); +// } + +// return null; +// }; + +// type IScatterGridProps = { +// instances: any[]; +// }; + +// export function ScatterGrid({ instances }: IScatterGridProps) { +// // x: instance users userActiveMonthScore +// // y: instance sus score userActivityScore + +// const data = []; + +// instances.forEach((instance) => { +// data.push({ +// x: instance.metrics.userActiveMonthScore, +// y: instance.metrics.averagePerMinute, +// instance: instance, +// }); +// }); + +// // const data = [ +// // { x: 100, y: 200, z: 200 }, +// // { x: 120, y: 100, z: 260 }, +// // { x: 170, y: 300, z: 400 }, +// // { x: 140, y: 250, z: 280 }, +// // { x: 150, y: 400, z: 500 }, +// // { x: 110, y: 280, z: 200 }, +// // ]; + +// return ( +// +// +// +// +// +// {/* } /> */} +// +// +// +// ); +// } + +// export function ScatterGrid1({ instances }: IScatterGridProps) { +// // x: instance users userActiveMonthScore +// // y: instance sus score userActivityScore + +// const data = []; + +// instances.forEach((instance) => { +// data.push({ +// x: instance.metrics.totalActivity, +// y: instance.metrics.usersTotal, +// instance: instance, +// }); +// }); + +// // const data = [ +// // { x: 100, y: 200, z: 200 }, +// // { x: 120, y: 100, z: 260 }, +// // { x: 170, y: 300, z: 400 }, +// // { x: 140, y: 250, z: 280 }, +// // { x: 150, y: 400, z: 500 }, +// // { x: 110, y: 280, z: 200 }, +// // ]; + +// return ( +// +// +// +// +// +// {/* } /> */} +// +// +// +// ); +// } diff --git a/frontend/src/components/Inspector/Sus.tsx b/frontend/src/components/Inspector/Sus.tsx index 762427a..899e867 100644 --- a/frontend/src/components/Inspector/Sus.tsx +++ b/frontend/src/components/Inspector/Sus.tsx @@ -7,7 +7,7 @@ import Box from "@mui/joy/Box"; import Typography from "@mui/joy/Typography"; import SusTable from "./SusTable"; -import { ScatterGrid, ScatterGrid1 } from "./ScatterGrid"; +// import { ScatterGrid, ScatterGrid1 } from "./ScatterGrid"; export default function InspectorOverview() { const { @@ -145,7 +145,7 @@ export default function InspectorOverview() { /> )} - - {isSuccessIns && } + {isSuccessIns && } */} ); } diff --git a/frontend/src/components/Inspector/Versions.tsx b/frontend/src/components/Inspector/Versions.tsx index 3ddc397..1ef29be 100644 --- a/frontend/src/components/Inspector/Versions.tsx +++ b/frontend/src/components/Inspector/Versions.tsx @@ -3,7 +3,7 @@ import React, { PureComponent } from "react"; import useCachedMultipart from "../../hooks/useCachedMultipart"; import Box from "@mui/joy/Box"; -import Typography from "@mui/joy/Typography"; +// import Typography from "@mui/joy/Typography"; import { Treemap, ResponsiveContainer, Tooltip } from "recharts"; @@ -75,6 +75,7 @@ function VersionDist({ instances }) { instances.map((instance) => { const version = instance.version; + console.log("version", version); if (versionsCounts[version]) { versionsCounts[version] += 1; } else { @@ -97,11 +98,11 @@ function VersionDist({ instances }) { return { name: version, size: versionsCounts[version] }; }); - const unknown = Object.keys(versionsCounts) - .filter((version) => version === "" || version === "unknown version") - .map((version) => { - return { name: version, size: versionsCounts[version] }; - }); + // const unknown = Object.keys(versionsCounts) + // .filter((version) => version === "" || version === "unknown version") + // .map((version) => { + // return { name: version, size: versionsCounts[version] }; + // }); const data = [ { @@ -112,10 +113,10 @@ function VersionDist({ instances }) { name: "unstable", children: unstable, }, - { - name: "unknown", - children: unknown, - }, + // { + // name: "unknown", + // children: unknown, + // }, ]; console.log("vers data", data); diff --git a/frontend/src/pages/About.tsx b/frontend/src/pages/About.tsx index fedf636..b4c8ef9 100644 --- a/frontend/src/pages/About.tsx +++ b/frontend/src/pages/About.tsx @@ -9,8 +9,30 @@ import Link from "@mui/joy/Link"; import Divider from "@mui/joy/Divider"; import GitHubIcon from "@mui/icons-material/GitHub"; -import ForumIcon from "@mui/icons-material/Forum"; import PaidIcon from "@mui/icons-material/Paid"; +import DataObjectIcon from "@mui/icons-material/DataObject"; + +// this is a Button that links to a Lemmy instance +// it should be outlined, green and have a Lemmy icon +function LemmyLink({ children }: { children: React.ReactNode }) { + return ( + + ); +} export default function About() { return ( @@ -51,17 +73,17 @@ export default function About() { target="_lv_paypal" component="a" > - Buy me a coffee + Donate - {/* */} + Data Access + {/* About section */} @@ -85,7 +107,8 @@ export default function About() { - This is a project that aims to provide a simple way to explore Lemmy Instances and Communities. + This is a project that aims to provide a simple way to explore Lemmy + Instances and Communities. @@ -175,7 +198,14 @@ export default function About() {
    -
  • Logo made by Andy Cuccaro (@andycuccaro) under the CC-BY-SA 4.0 license.
  • +
  • Logo made by Andy Cuccaro (@andycuccaro) under the CC-BY-SA 4.0 license.
  • {" "} +
  • + Lemmy Developers and Community for creating{" "} + + Lemmy + + . +
diff --git a/frontend/yarn.lock b/frontend/yarn.lock index e36da90..6d25d58 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3508,13 +3508,6 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - icss-utils@^5.0.0, icss-utils@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" @@ -4967,7 +4960,7 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": +"safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -5186,19 +5179,11 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" -"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.1, source-map-js@^1.0.2, source-map-js@^1.2.1: +"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.1, source-map-js@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== -source-map-loader@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-5.0.0.tgz#f593a916e1cc54471cfc8851b905c8a845fc7e38" - integrity sha512-k2Dur7CbSLcAH73sBcIkV5xjPV4SzqO1NJ7+XaQl8if3VODDUj3FNchNGpqgJSKbvUfJuhVdv8K2Eu8/TNl2eA== - dependencies: - iconv-lite "^0.6.3" - source-map-js "^1.0.2" - source-map-support@^0.5.16, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"