-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c204de
commit 3344856
Showing
9 changed files
with
78 additions
and
46 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
Binary file not shown.
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,33 @@ | ||
import React from "react"; | ||
import { useTasks } from "@/services/websocket"; | ||
|
||
export const TaskList = () => { | ||
const tasks = useTasks(); | ||
const maxShownTasks = 5; | ||
const shownTasks = tasks.length > maxShownTasks ? tasks.slice(0, maxShownTasks) : tasks; | ||
|
||
return ( | ||
<> | ||
{tasks.length > 0 && ( | ||
<div> | ||
<div className="text-xs flex align-middle space-x-2 items-center"> | ||
<hr className="flex-1 border-gray-500" /> | ||
<span className="text-gray-500">Tasks {tasks.length > maxShownTasks && `(${tasks.length})`}</span> | ||
<hr className="flex-1 border-gray-500" /> | ||
</div> | ||
<div className="flex flex-col space-y-2"> | ||
{shownTasks.map(i => ( | ||
<div key={i.id}> | ||
<div className="flex mb-1 text-xs font-semibold text-gray-400"> | ||
<div className="flex-1">{i.name}</div> | ||
<div>{i.progress}%</div> | ||
</div> | ||
<div className="h-[6px] bg-slate-400" style={{ width: `${i.progress}%`, transition: 'width .25s' }} role="progressbar" aria-valuenow={i.progress} aria-valuemin={0} aria-valuemax={1}></div> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
)} | ||
</> | ||
) | ||
} |
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
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
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,10 @@ | ||
import { Layout } from "@/components/layout/Layout"; | ||
import { TestService } from "@/services/openapi"; | ||
|
||
export default function Test() { | ||
return ( | ||
<Layout> | ||
<button className={"m-4 p-2 bg-black"} onClick={() => TestService.testProgressTask()}>Test Task</button> | ||
</Layout> | ||
) | ||
} |