Compare commits
2 Commits
a1fc19b202
...
935331e825
| Author | SHA1 | Date | |
|---|---|---|---|
| 935331e825 | |||
| 58e3fb73b1 |
13
public/images/SPD-arrows.svg
Normal file
13
public/images/SPD-arrows.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
width="409.96661"
|
||||
height="409.98404"
|
||||
viewBox="0 0 409.96661 409.98404"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="m 198.43447,409.88349 c -16.87402,-0.52429 -33.96148,-3.20112 -50.15064,-7.85635 -16.89988,-4.85959 -33.4194,-12.04085 -48.45,-21.06187 C 89.057412,374.49751 79.188152,367.3017 69.836023,359.09346 63.443873,353.48316 56.486693,346.52267 50.841584,340.09001 23.882655,309.37001 6.733496,271.34323 1.6401223,230.99002 -3.0267695,194.01569 2.3071672,156.75191 17.114155,122.88582 c 2.83776,-6.49044 6.63732,-14.00102 10.21694,-20.1958 C 42.991144,75.589277 64.616853,52.405411 90.533832,34.933461 108.33243,22.934523 127.85299,13.821763 148.38383,7.9274153 c 26.15516,-7.50907673 53.79077,-9.7183097 81.05,-6.4792629 50.21751,5.9670387 96.51852,30.4672236 130.00448,68.7918786 26.75943,30.626139 43.81786,68.571209 48.88922,108.749989 4.86563,38.54882 -1.15232,77.44493 -17.37657,112.31081 -8.98481,19.30835 -20.76424,36.8569 -35.46819,52.83918 -2.44277,2.65514 -8.7281,8.94409 -11.35114,11.35768 -14.70283,13.5288 -30.43046,24.37645 -48.03196,33.12859 -4.05332,2.01546 -5.5776,2.72668 -9.56585,4.46335 -27.56473,12.00295 -57.65906,17.73965 -88.09935,16.79386 z m 13.44936,-34.9928 c 25.01212,-1.07439 48.36413,-7.17806 70.34385,-18.38623 19.2632,-9.82294 36.50092,-23.26822 50.87783,-39.6843 7.86352,-8.97886 15.0508,-19.24676 20.93747,-29.91169 1.47754,-2.67687 4.04205,-7.75113 5.39976,-10.6842 8.41325,-18.17525 13.5806,-38.08598 15.08733,-58.13425 0.35814,-4.76539 0.40375,-6.24526 0.40375,-13.1 0,-7.80507 -0.13553,-10.87819 -0.75413,-17.1 -3.3773,-33.96857 -16.9036,-65.97946 -39.00164,-92.299992 -4.83753,-5.76189 -10.83367,-11.955826 -16.62603,-17.174494 -16.89903,-15.22529 -37.39974,-27.226947 -58.91819,-34.492262 -15.49468,-5.231496 -31.10132,-8.118781 -47.75,-8.833924 -2.89874,-0.124515 -10.90126,-0.124515 -13.8,0 -16.64507,0.714988 -32.25869,3.603565 -47.75,8.833924 -22.42114,7.57009 -43.37752,20.065402 -60.949998,36.341643 -2.01749,1.868667 -6.68465,6.525563 -8.64412,8.625113 -18.522729,19.846862 -31.943938,43.538062 -39.299728,69.372092 -3.13635,11.01509 -5.12484,22.15786 -6.00108,33.6279 -0.35666,4.6688 -0.40507,6.2343 -0.40507,13.1 0,6.8657 0.04841,8.4312 0.40507,13.1 1.22839,16.0797 4.67357,31.67931 10.32477,46.75 5.59407,14.91838 13.591089,29.46979 23.231919,42.27293 12.532319,16.64308 28.020458,30.89004 45.549847,41.8996 16.73723,10.51204 34.82788,17.91208 54.08839,22.12504 9.16278,2.00422 19.45487,3.32848 29.1,3.74422 2.65778,0.11456 11.5597,0.12015 14.15,0.009 z m -37.2,-46.83768 v -30.8126 l 9.28842,9.28802 9.28842,9.28802 76.72486,-76.72488 76.72486,-76.72488 12.28672,12.28673 12.28673,12.28673 -76.64997,76.64993 c -42.15747,42.15746 -76.64998,76.71734 -76.65,76.79973 -2e-5,0.0824 4.12343,4.27345 9.16323,9.31347 l 9.16327,9.16368 -30.81327,-0.001 -30.81327,-10e-4 v -30.81259 z m -61.7,-31.04633 c -0.0664,-0.0221 -0.1,-10.37788 -0.1,-30.79993 v -30.7666 l 9.2544,9.2544 9.2544,9.2544 76.72511,-76.72511 76.7251,-76.72511 12.29318,12.29349 12.29318,12.29349 -76.64567,76.64613 c -42.15513,42.15537 -76.66344,76.6994 -76.68514,76.7645 -0.0217,0.0651 4.0948,4.25282 9.14779,9.30603 5.05298,5.0532 9.16483,9.1914 9.13745,9.19599 -0.1628,0.0273 -61.31804,0.0356 -61.3998,0.008 z M 51.026084,235.09894 c -0.02324,-0.0232 -0.04225,-13.88347 -0.04225,-30.80052 v -30.75827 l 9.266339,9.26634 9.26633,9.26634 76.638487,-76.63848 c 42.15116,-42.151155 76.68658,-76.668199 76.74537,-76.704532 0.06,-0.03707 5.49452,5.321436 12.38275,12.209497 l 12.27587,12.275559 -76.68758,76.687446 c -42.17816,42.1781 -76.687569,76.72116 -76.687569,76.76237 0,0.0412 4.140059,4.21517 9.200129,9.27546 l 9.20013,9.20054 H 81.826212 c -16.916829,0 -30.776888,-0.0188 -30.800128,-0.042 z"
|
||||
id="path3338"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.7 KiB |
@@ -34,8 +34,44 @@ export default function RootLayout({
|
||||
return [client, ssr];
|
||||
}, []);
|
||||
|
||||
const title = "Nazi Site Patrol Stats";
|
||||
const description =
|
||||
"A website to display various stats for the Nazi Site Patrol bot for Telegram. Developed and maintained by Werewolf Kid Creations.";
|
||||
const url = "https://bot-stats.werewolfkid.monster";
|
||||
const img = "/images/SPD-arrows.svg";
|
||||
const domain = "werewolfkid.monster";
|
||||
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<title>{title}</title>
|
||||
<meta name="description" content={description} />
|
||||
<meta property="title" content={title} />
|
||||
<meta name="theme-color" content="#00ffff" />
|
||||
<link rel="icon" href={img} sizes="any" type="image/png" />
|
||||
<meta property="image" content={img} />
|
||||
<meta property="image:type" content="image/png" />
|
||||
<meta property="image:width" content="653px" />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:url" content={url} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:image" content={img} />
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
<meta property="og:image:width" content="653px" />
|
||||
<meta property="og:image:height" content="651px" />
|
||||
<meta property="image:height" content="651px" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta property="twitter:domain" content={domain} />
|
||||
<meta property="twitter:url" content={url} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta name="twitter:image" content={img} />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta httpEquiv="content-language" content="en_US" />
|
||||
<meta charSet="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href={img} />
|
||||
<link rel="shortcut icon" href={img} />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href={img} />
|
||||
<link rel="manifest" href={img} />
|
||||
<body>
|
||||
<UrqlProvider client={client} ssr={ssr}>
|
||||
<Provider>{children}</Provider>
|
||||
|
||||
@@ -18,12 +18,12 @@ import LinksDeletedChart from "./LinksDeletedChart";
|
||||
import { LineChartArr } from "@/types/LineChartStats";
|
||||
import CommandResponsesChart from "./CommandResponsesChart";
|
||||
import TimedTriggeredChart from "./TimesTriggeredChart";
|
||||
import GetStatsRange from "@/graphql/queries/getStatsRange";
|
||||
import Image from "next/image";
|
||||
import StatsList from "./StatsList";
|
||||
import GetTotalGroupsQuery from "@/graphql/queries/getTotalGroups";
|
||||
import GetTotalStatsQuery from "@/graphql/queries/getTotalStats";
|
||||
import GetTodaysStatsQuery from "@/graphql/queries/getTodaysStats";
|
||||
import Image from "next/image";
|
||||
import GetStatsRange from "@/graphql/queries/getStatsRange";
|
||||
|
||||
export default function Home() {
|
||||
// * Total Groups * //
|
||||
@@ -57,12 +57,14 @@ export default function Home() {
|
||||
// * 30 Day Stats * //
|
||||
|
||||
// Dates
|
||||
const [currDate, setCurrDate] = useState<Date>();
|
||||
const [date30DaysAgo, setDate30DaysAgo] = useState<Date>();
|
||||
const [currDate, setCurrDate] = useState<String>();
|
||||
const [date30DaysAgo, setDate30DaysAgo] = useState<String>();
|
||||
|
||||
useEffect(() => {
|
||||
setCurrDate(new Date());
|
||||
setDate30DaysAgo(new Date(new Date().setDate(new Date().getDay() - 30)));
|
||||
setCurrDate(new Date().toJSON());
|
||||
setDate30DaysAgo(
|
||||
new Date(new Date().setDate(new Date().getDay() - 30)).toJSON()
|
||||
);
|
||||
}, []);
|
||||
|
||||
const [
|
||||
@@ -74,8 +76,8 @@ export default function Home() {
|
||||
] = useQuery({
|
||||
query: GetStatsRange,
|
||||
variables: {
|
||||
stateDate: currDate,
|
||||
endDate: date30DaysAgo
|
||||
startDate: currDate || "",
|
||||
endDate: date30DaysAgo || ""
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { gql } from "@urql/next";
|
||||
|
||||
const GetStatsRange = gql`
|
||||
query getStatsRange($startDate: Date, $endDate: Date) {
|
||||
query getStatsRange($startDate: String!, $endDate: String!) {
|
||||
getStatsRange(endDate: $startDate, startDate: $endDate) {
|
||||
commandResponses
|
||||
createdAt
|
||||
|
||||
@@ -33,15 +33,20 @@ export const resolvers = {
|
||||
}),
|
||||
getStatsRange: async (
|
||||
_parent: unknown,
|
||||
data: { startDate: Date; endDate: Date }
|
||||
data: { startDate: string; endDate: string }
|
||||
// _ctx: unknown
|
||||
) => {
|
||||
const { startDate, endDate } = data;
|
||||
|
||||
if (startDate === "" || endDate === "") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await prisma.dailyStats.findMany({
|
||||
where: {
|
||||
createdAt: {
|
||||
gt: startDate,
|
||||
lte: endDate
|
||||
gt: new Date(startDate),
|
||||
lte: new Date(endDate)
|
||||
}
|
||||
},
|
||||
orderBy: {
|
||||
|
||||
@@ -7,7 +7,7 @@ const typeDefs = /* GraphQL */ `
|
||||
type Query {
|
||||
getTotalGroups: Int!
|
||||
getTodayStats: DailyStats!
|
||||
getStatsRange(startDate: Date, endDate: Date): [DailyStats]
|
||||
getStatsRange(startDate: String!, endDate: String!): [DailyStats]
|
||||
getTotalStats: TotalStats!
|
||||
getGroupStats(groupID: BigInt!): Groups
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ const config: runtime.GetPrismaClientConfig = {
|
||||
"value": "prisma-client"
|
||||
},
|
||||
"output": {
|
||||
"value": "/home/lucid/work/cove-gitea/no-twitter-bot-stats/src/prisma/generated",
|
||||
"value": "/home/lucid/work/WKC/no-twitter-bot-stats/src/prisma/generated",
|
||||
"fromEnvVar": null
|
||||
},
|
||||
"config": {
|
||||
@@ -37,7 +37,7 @@ const config: runtime.GetPrismaClientConfig = {
|
||||
}
|
||||
],
|
||||
"previewFeatures": [],
|
||||
"sourceFilePath": "/home/lucid/work/cove-gitea/no-twitter-bot-stats/src/prisma/schema.prisma",
|
||||
"sourceFilePath": "/home/lucid/work/WKC/no-twitter-bot-stats/src/prisma/schema.prisma",
|
||||
"isCustomOutput": true
|
||||
},
|
||||
"relativePath": "..",
|
||||
|
||||
Reference in New Issue
Block a user