-
Notifications
You must be signed in to change notification settings - Fork 0
Island rhythms/task visualizer #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
296417f
d725ccc
4c8f9dc
5bbc944
d32696c
3d920a0
9ddb57c
fe02cfd
974a9b8
538b843
86d3e59
451045b
5f57994
7f04242
386b5a8
6e104bb
4cd32ea
c066231
9e2f44d
a4fd90f
29c9bdf
684d890
8a27ee2
24dd8ca
c55eba7
8b3943a
fd26468
57da3ce
5a994ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| 'use strict'; | ||
|
|
||
| const Archetype = require('archetype'); | ||
|
|
||
| const GetTasksParams = new Archetype({ | ||
| start: { | ||
|
Check warning on line 6 in backend/actions/Task/getTasks.js
|
||
| $type: Date | ||
|
Check warning on line 7 in backend/actions/Task/getTasks.js
|
||
| }, | ||
|
Check warning on line 8 in backend/actions/Task/getTasks.js
|
||
| end: { | ||
|
Check warning on line 9 in backend/actions/Task/getTasks.js
|
||
| $type: Date | ||
|
Check warning on line 10 in backend/actions/Task/getTasks.js
|
||
| }, | ||
|
Check warning on line 11 in backend/actions/Task/getTasks.js
|
||
| status: { | ||
|
Check warning on line 12 in backend/actions/Task/getTasks.js
|
||
| $type: 'string' | ||
|
Check warning on line 13 in backend/actions/Task/getTasks.js
|
||
| } | ||
|
Check warning on line 14 in backend/actions/Task/getTasks.js
|
||
| }).compile('GetTasksParams'); | ||
|
|
||
| module.exports = ({ db }) => async function getTasks(params) { | ||
| params = new GetTasksParams(params); | ||
| const { start, end, status } = params; | ||
| const { Task } = db.models; | ||
|
|
||
| const filter = {}; | ||
|
|
||
| if (start && end) { | ||
| filter.scheduledAt = { $gte: start, $lte: end }; | ||
| } else if (start) { | ||
| filter.scheduledAt = { $gte: start } | ||
|
Check failure on line 27 in backend/actions/Task/getTasks.js
|
||
| } | ||
| if (status) { | ||
| filter.status = status; | ||
| } | ||
|
|
||
| const tasks = await Task.find(filter); | ||
|
|
||
| return { | ||
| tasks | ||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| 'use strict'; | ||
|
|
||
| exports.getTasks = require('./getTasks') | ||
|
Check failure on line 3 in backend/actions/Task/index.js
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| <div class="p-4 space-y-6"> | ||
| <h1 class="text-2xl font-bold text-gray-700">Task Overview</h1> | ||
IslandRhythms marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <!-- Task List --> | ||
| <div class="bg-white p-4 rounded-lg shadow"> | ||
| <div class="mb-4"> | ||
| <label class="block text-sm font-medium text-gray-700 mb-1">Filter by Date:</label> | ||
| <select v-model="selectedRange" @change="updateDateRange" class="border-gray-300 rounded-md shadow-sm w-full p-2"> | ||
| <option v-for="option in dateFilters" :key="option.value" :value="option.value"> | ||
| {{ option.label }} | ||
| </option> | ||
| </select> | ||
| </div> | ||
| <div class="mb-4"> | ||
| <label class="block text-sm font-medium text-gray-700 mb-1">Filter by Status:</label> | ||
| <select v-model="selectedStatus" @change="getTasks" class="border-gray-300 rounded-md shadow-sm w-full p-2"> | ||
| <option v-for="option in statusFilters" :key="option.value" :value="option.value"> | ||
| {{ option.label }} | ||
| </option> | ||
| </select> | ||
| </div> | ||
| <div class="mb-6"> | ||
| <button | ||
| @click="resetFilters" | ||
| class="w-full bg-gray-200 text-gray-700 hover:bg-gray-300 font-medium py-2 px-4 rounded-md transition" | ||
| > | ||
| Reset Filters | ||
| </button> | ||
| </div> | ||
| <!-- Summary Section --> | ||
| <div class="grid grid-cols-2 sm:grid-cols-4 gap-4"> | ||
| <div class="bg-yellow-100 text-yellow-800 p-4 rounded-lg shadow"> | ||
| <div class="text-sm">Scheduled</div> | ||
| <div class="text-2xl font-bold">{{pendingCount}}</div> | ||
| </div> | ||
| <div class="bg-green-100 text-green-800 p-4 rounded-lg shadow"> | ||
| <div class="text-sm">Completed</div> | ||
| <div class="text-2xl font-bold">{{succeededCount}}</div> | ||
| </div> | ||
| <div class="bg-red-100 text-red-800 p-4 rounded-lg shadow"> | ||
| <div class="text-sm">Failed</div> | ||
| <div class="text-2xl font-bold">{{failedCount}}</div> | ||
| </div> | ||
| <div class="bg-blue-100 text-blue-800 p-4 rounded-lg shadow"> | ||
| <div class="text-sm">Cancelled</div> | ||
| <div class="text-2xl font-bold">{{cancelledCount}}</div> | ||
| </div> | ||
| </div> | ||
| <ul class="divide-y divide-gray-200"> | ||
| <li v-for="task in tasks" :key="task.id" class="py-3 flex items-center justify-between"> | ||
| <div> | ||
| <div class="font-medium">{{ task.name }}</div> | ||
IslandRhythms marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <div class="text-sm text-gray-500">{{ new Date(task.scheduledAt).toLocaleString() }}</div> | ||
| </div> | ||
| <span | ||
| class="text-xs px-2 py-1 rounded-full font-medium" | ||
| :class="getStatusColor(task.status)" | ||
| > | ||
| {{ task.status }} | ||
| </span> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The global navigation guard's logic appears inverted: routes marked as 'authorized' are immediately permitted without an access check, while those with 'authorized' set to false require role validation. Please verify that the flag's semantics and its usage in routes match the intended access control behavior.