-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from hotosm/feat/dashboard-update
Feat/dashboard update
- Loading branch information
Showing
7 changed files
with
174 additions
and
37 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
60 changes: 60 additions & 0 deletions
60
src/frontend/src/components/Dashboard/TaskLogs/TaskLogsTable.tsx
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,60 @@ | ||
import { format } from 'date-fns'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
interface ITaskLogsTableProps { | ||
data: any[]; | ||
} | ||
|
||
const TaskLogsTable = ({ data: taskList }: ITaskLogsTableProps) => { | ||
const navigate = useNavigate(); | ||
return ( | ||
<div className="flex"> | ||
<table className="naxatw-w-full naxatw-overflow-hidden naxatw-rounded-lg"> | ||
<thead> | ||
<tr className="naxatw-bg-red naxatw-text-left naxatw-font-normal naxatw-text-white"> | ||
<td className="naxatw-w-80 naxatw-border-r-2 naxatw-px-2 naxatw-py-1"> | ||
ID | ||
</td> | ||
<td className="naxatw-border-r-2 naxatw-px-2 naxatw-py-1"> | ||
Total task area | ||
</td> | ||
<td className="naxatw-border-r-2 naxatw-px-2 naxatw-py-1"> | ||
Est.flight time | ||
</td> | ||
<td className="naxatw-border-r-2 naxatw-px-2 naxatw-py-1"> | ||
Created Date | ||
</td> | ||
<td className="naxatw-border-r-2 naxatw-px-2 naxatw-py-1"> | ||
Status | ||
</td> | ||
<td className="naxatw-w-12" /> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{taskList?.map(task => ( | ||
<tr key={task.task_id}> | ||
<td className="naxatw-px-2 naxatw-py-1">{task.task_id}</td> | ||
<td className="naxatw-px-2 naxatw-py-1">{task.task_area}</td> | ||
<td className="naxatw-px-2 naxatw-py-1">-</td> | ||
<td className="naxatw-px-2 naxatw-py-1"> | ||
{format(new Date(task.created_at), 'yyyy-MM-dd')} | ||
</td> | ||
<td className="naxatw-px-2">{task.state}</td> | ||
<td className="naxatw-flex naxatw-items-center naxatw-px-2"> | ||
<div | ||
className="naxatw-flex naxatw-h-8 naxatw-w-8 naxatw-cursor-pointer naxatw-items-center naxatw-justify-center naxatw-rounded-lg hover:naxatw-bg-gray-200" | ||
role="presentation" | ||
onClick={() => navigate(`/tasks/${task.task_id}`)} | ||
> | ||
<i className="material-icons-outlined">zoom_in</i> | ||
</div> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TaskLogsTable; |
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,6 @@ | ||
import { authenticated, api } from '.'; | ||
|
||
export const getTaskStatistics = () => | ||
authenticated(api).get('/tasks/statistics/'); | ||
|
||
export const getTaskList = () => authenticated(api).get('/tasks/'); |
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