code-kern-ai / refinery

The data scientist's open-source choice to scale, assess and maintain natural language data. Treat training data like a software artifact.
https://www.kern.ai
Apache License 2.0
1.39k stars 66 forks source link

Admin features #239

Closed lumburovskalina closed 1 year ago

lumburovskalina commented 1 year ago

Is your feature request related to a problem? Please describe. Adding new page for admin messages for notifying users, adding last interaction for users and check if something is running (ex. heuristics..).

Describe the solution you'd like Admin dashboard: Admin messages page: create new page, where the user can create new admin messages, archive them manually with an archive reason, and see the data for those messages (who and when created the message, who and when archived the messages, type of the message and if the message is still active or not). Add the automatically archiving of the messages. Extending users page: add field in the users page that is displaying the last interaction of the user. Add filter than can display the active users in the last X minutes (or/and a button for showing all active users). Check if something is running page: add new page that shows which processes are still running (ex heuristics...) and show more data about those. Platform: Implement websocket notifications on refinery, workflow and gates and add the active messages on the platform. The messages should be removed once the archive date is not valid.

lumburovskalina commented 1 year ago

Front-end planning:

  1. Admin messages page:

    • Create new page and add suitable routing(15min)
    • Add modal for creating new message (text,timestamp) + validations - 30minutes
    • Add modal for archiving message and storing the reason for it - 30 minutes
    • Display data into table for admin messages - 1h 30 min
    • Add queries (get all) and mutations(new admin message and archive message) - 1h
    • Automatically archiving messages - 1h - 2h
    • UI fixes - 30 minutes
    • Link for navigating to welcome screen is missing - 15min
  2. Extend users page:

    • Add field last interaction in the table and add icon if the user is not active in longer time - 30 min
    • Add filter which displays active users in the last X minutes - 1h
    • Button show all active users? - 1h
    • UI fixes - 30 minutes
  3. Check if something is running

    • Create new page and add suitable routing(15min)
    • Display data for those processes (not sure which fields) - 2h
    • UI fixes - 30 minutes
  4. Implement messages in the platform

    • Add active messages in refinery, gates, platform - 2h
    • Websocker notificatications - 2h

Testing: 2h PR comments: 2h - 3h

Implementation: 15h - 16h Testing: 2h PR: 4h - 5h SUM: 21h - 23h

SimonDegrafKern commented 1 year ago

PRS: Gateway https://github.com/code-kern-ai/refinery-gateway/pull/116 Model submodule https://github.com/code-kern-ai/refinery-submodule-model/pull/36 Admin dashboard: https://github.com/code-kern-ai/admin-dashboard/pull/62

Backend Planning

  1. Admin messages Concept 1h Implementing Model/BO/Controller/Api 2 h Testing and Fixing 1 h

  2. Active User Concept 1h Implementing Model/BO/Controller/Api 1 h Testing and Fixing 1 h

  3. Check what is Running Concept 1h Writing SQL 1-2 h Implementing Model/BO/Controller/Api 1 h Testing and Fixing 1 h

Round about 12 hours in total

Description admin messages: Can be created and archived. Active messages can be read by all users, all messages (incl. archived) can be read by kern admins. We want to have a strict history of our messages, that's why we don't allow update of the text. We want to store the id if someone manually archived a message. Messages get checked on read if they should get archived. Frontend gets notified by WebSocket if a message was archived or created.

Description last active: We store the information when a user last interacted with the app by writing in into the database on check of permissions. This is throttled on one minute. We can then see when a user was last active and query for an range of minutes which users interacted with the app e.g. last 5 minutes.

Description what is running: Most certainly one big fat SQL statement to query all entities with running state, so it is about UploadTask, TokenizationTask, WeakSupervisionTask and InformationSourcePayload. This would be interesting to see for the user, too, I think!

SimonDegrafKern commented 1 year ago

Acceptance Tests:

Admin Message:

  1. When creating a new admin message it should be correctly displayed for all users on the platform and in the admin dashboard.
  2. When a message is archived it should be removed for users and displayed as archived on the platform
  3. After time runs out a message should be removed automatically.

Last Active:

  1. If a user interacts with the app the timestamp of the last interaction should be displayed in admin dashboard
  2. If a user interacts with the app in the last X minutes it should be displayed in admin dashboard if queried with X as minutes.

Running:

  1. All running tasks should be displayed on admin dashboard for all projects
  2. If a new task gets started it should be added on admin dashboard
  3. If a task finishes it should be removed on admin dashboard 4.All running tasks should be displayed in refinery for a specific project.