Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Commit

Permalink
Update v4.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DevanAbinaya committed Sep 26, 2023
1 parent aabc5ff commit 20b8a72
Show file tree
Hide file tree
Showing 26 changed files with 716 additions and 295 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

## Introduction

<p><a href="https://moopa.live">Moopa</a> is an anime streaming website made possible by <a href="https://github.com/consumet">Consumet API</a> build with <a href="https://github.com/vercel/next.js/">NextJs</a> and <a href="https://github.com/tailwindlabs/tailwindcss">Tailwind</a> with a sleek and modern design that offers Anilist integration to help you keep track of your favorite anime series. Moopa is entirely free and does not feature any ads, making it a great option for you who want an uninterrupted viewing experience.</p>
<p><a href="https://moopa.live">Moopa</a> is an anime streaming website made possible by the <a href="https://github.com/consumet">Consumet API</a>, built with <a href="https://github.com/vercel/next.js/">Next.js</a> and <a href="https://github.com/tailwindlabs/tailwindcss">Tailwind</a>, featuring a sleek and modern design. It offers Anilist integration to help you keep track of your favorite anime series. Moopa is entirely free and does not display any ads, making it a great option for those who want an uninterrupted viewing experience.</p>

## Features

Expand Down Expand Up @@ -80,7 +80,7 @@ If you encounter any issues or bug on the site please head to [issues](https://g

## For Local Development

> If you host this site for personal use, please refrain from cloning it or adding ads. This project is non-profit and ads may violate its terms, leading to legal action or site takedown. Uphold these guidelines to maintain its integrity and mission.
> If you want to self-host this app, please note that it is only allowed for personal use. Commercial use is not permitted, and including ads on your self-hosted site may result in actions such as site takedown.
1. Clone this repository using :

Expand Down
134 changes: 134 additions & 0 deletions components/admin/dashboard/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import React, { useState } from "react";

export default function AdminDashboard({
animeCount,
infoCount,
metaCount,
report,
}) {
const [message, setMessage] = useState("");
const [selectedTime, setSelectedTime] = useState("");
const [unixTimestamp, setUnixTimestamp] = useState(null);

const handleSubmit = (e) => {
e.preventDefault();

if (selectedTime) {
const unixTime = Math.floor(new Date(selectedTime).getTime() / 1000);
setUnixTimestamp(unixTime);
}
};
return (
<div className="flex flex-col gap-5 px-5 py-10 h-full">
<div className="flex flex-col gap-2">
<p className="font-semibold">Stats</p>
<div className="grid grid-cols-3 gap-5">
<div className="flex-center flex-col bg-secondary rounded p-5">
<p className="font-karla text-4xl">{animeCount}</p>
<p className="font-karla text-xl">Anime</p>
</div>
<div className="flex-center flex-col bg-secondary rounded p-5">
<p className="font-karla text-4xl">{infoCount}</p>
<p className="font-karla text-xl">detail info</p>
</div>
<div className="flex-center flex-col bg-secondary rounded p-5">
<p className="font-karla text-4xl">{metaCount}</p>
<p className="font-karla text-xl">Metadata</p>
</div>
</div>
</div>
<div className="grid grid-cols-2 gap-5 h-full">
<div className="flex flex-col gap-2">
<p className="font-semibold">Broadcast</p>
<div className="flex flex-col justify-between bg-secondary rounded p-5 h-full">
<form onSubmit={handleSubmit}>
<div className="mb-4">
<label
htmlFor="message"
className="block text-txt font-light mb-2"
>
Message
</label>
<input
type="text"
id="message"
value={message}
onChange={(e) => setMessage(e.target.value)}
required
className="w-full px-3 py-2 border rounded-md focus:outline-none text-black"
/>
</div>
<div className="mb-4">
<label
htmlFor="selectedTime"
className="block text-txt font-light mb-2"
>
Select Time
</label>
<input
type="datetime-local"
id="selectedTime"
value={selectedTime}
onChange={(e) => setSelectedTime(e.target.value)}
required
className="w-full px-3 py-2 border rounded-md focus:outline-none text-black"
/>
</div>
<button
type="submit"
className="bg-image text-white py-2 px-4 rounded-md hover:bg-opacity-80 transition duration-300"
>
Submit
</button>
</form>
{unixTimestamp && (
<p>
Unix Timestamp: <strong>{unixTimestamp}</strong>
</p>
)}
</div>
</div>
<div className="flex flex-col gap-2">
<p className="font-semibold">Recent Reports</p>
<div className="bg-secondary rounded p-5 h-full">
<div className="rounded overflow-hidden w-full h-full">
{report?.map((i, index) => (
<div
key={index}
className="odd:bg-primary/80 even:bg-primary/40 p-2 flex justify-between items-center"
>
{i.desc}{" "}
{i.severity === "Low" && (
<span className="relative w-5 h-5 flex-center shrink-0">
{/* <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-rose-500 opacity-75"></span> */}
<span className="relative inline-flex rounded-full h-3 w-3 bg-green-500"></span>
</span>
)}
{i.severity === "Medium" && (
<span className="relative w-5 h-5 flex-center shrink-0">
{/* <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-rose-500 opacity-75"></span> */}
<span className="relative inline-flex rounded-full h-3 w-3 bg-amber-500"></span>
</span>
)}
{i.severity === "High" && (
<span className="relative w-5 h-5 flex-center shrink-0">
{/* <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-rose-500 opacity-75"></span> */}
<span className="relative animate-pulse inline-flex rounded-full h-3 w-3 bg-rose-500"></span>
</span>
)}
{i.severity === "Critical" && (
<span className="relative w-5 h-5 flex-center shrink-0">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-900 opacity-75"></span>
<span className="relative inline-flex rounded-full h-3 w-3 bg-red-900"></span>
</span>
)}
</div>
))}
</div>
</div>
</div>
</div>
<div className="w-full h-full">a</div>
</div>
);
}
75 changes: 75 additions & 0 deletions components/admin/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import {
CloudArrowUpIcon,
Cog6ToothIcon,
HomeIcon,
UserIcon,
} from "@heroicons/react/24/outline";
import Link from "next/link";
import { useRouter } from "next/router";
import React from "react";

const Navigation = [
{
name: "Dashboard",
page: 1,
icon: <HomeIcon />,
current: false,
},
{
name: "Metadata",
page: 2,
icon: <CloudArrowUpIcon />,
current: false,
},
{
name: "Users",
page: 3,
icon: <UserIcon />,
current: false,
},
{
name: "Settings",
page: 4,
icon: <Cog6ToothIcon />,
current: false,
},
];

export default function AdminLayout({ children, page, setPage }) {
return (
<div className="relative w-screen h-screen">
<div className="absolute flex flex-col gap-5 top-0 left-0 py-2 bg-secondary w-[14rem] h-full">
<div className="flex flex-col px-3">
<p className="text-sm font-light text-action font-outfit">moopa</p>
<h1 className="text-2xl font-bold text-white">
Admin <br />
Dashboard
</h1>
</div>
<div className="flex flex-col px-1">
{Navigation.map((item, index) => (
<button
key={item.name}
onClick={() => {
setPage(item.page);
}}
className={`flex items-center gap-2 p-2 group ${
page == item.page ? "bg-image/50" : "text-txt"
} hover:bg-image rounded transition-colors duration-200 ease-in-out`}
>
<div
className={`w-5 h-5 ${
page == item.page ? "text-action" : "text-txt"
} group-hover:text-action`}
>
{item.icon}
</div>
<p>{item.name}</p>
</button>
))}
</div>
</div>
<div className="ml-[14rem] overflow-x-hidden h-full">{children}</div>
</div>
);
}
Loading

0 comments on commit 20b8a72

Please sign in to comment.