-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extract components
- Loading branch information
Showing
5 changed files
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Link from "next/link"; | ||
|
||
export function Header() { | ||
return <header className="flex w-full gap-4 flex-wrap"> | ||
<Link href="/"> | ||
<h1 className="text-5xl">Comfy-PR</h1> | ||
</Link> | ||
<nav className="flex gap-2 flex-wrap"> | ||
<Link href="/details" className="text-2xl"> | ||
Details | ||
</Link> | ||
<Link href="/rules" className="text-2xl"> | ||
Rules | ||
</Link> | ||
<Link href="/tasks" className="text-2xl"> | ||
Tasks | ||
</Link> | ||
</nav> | ||
</header>; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { getAuthUser } from "@/app/(dashboard)/rules/getAuthUser"; | ||
import "@/app/markdown.css"; | ||
import "@/app/tasks-panel.css"; | ||
import { | ||
|
@@ -8,13 +9,16 @@ import { | |
import { parseTitleBodyOfMarkdown } from "@/src/parseTitleBodyOfMarkdown"; | ||
import { yaml } from "@/src/utils/yaml"; | ||
import DIE from "@snomiao/die"; | ||
import { forbidden } from "next/navigation"; | ||
import Markdown from "react-markdown"; | ||
import remarkGfm from "remark-gfm"; | ||
/** | ||
* | ||
* @author: snomiao <[email protected]> | ||
*/ | ||
export default async function GithubActionUpdateTaskPage() { | ||
const user = await getAuthUser(); | ||
if (!user.admin) forbidden(); | ||
const data = await listGithubActionUpdateTask(); | ||
const errorData = data.filter((e) => e.error); | ||
const processingData = data.filter((e) => !e.pullRequestMessage); | ||
|
@@ -29,6 +33,13 @@ export default async function GithubActionUpdateTaskPage() { | |
return ( | ||
<div className="tasks-panel"> | ||
<h1>GithubActionUpdateTasks in Total x{data.length}</h1> | ||
<ul className="pl-4"> | ||
<li>1. Drafting PRs x{processingData.length}</li> | ||
<li>2. Pending Reviews x{pendingReviewsData.length}</li> | ||
<li>3. Pending Create Pull Request x{pendingCreatePRData.length}</li> | ||
<li>4. Pull Request Created x{prCreatedData.length}</li> | ||
<li>5. Errors x{errorData.length}</li> | ||
</ul> | ||
|
||
<h2>1. Drafting PRs x{processingData.length}</h2> | ||
<ol className="flex flex-col max-w-full px-4"> | ||
|
@@ -60,6 +71,7 @@ export default async function GithubActionUpdateTaskPage() { | |
className="btn" | ||
onClick={async () => { | ||
"use server"; | ||
await getAuthUser(); | ||
await approveGithubActionUpdateTask(e.repo, e.branchVersionHash ?? DIE("missing branchVersionHash")); | ||
return "ok"; | ||
}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters