DashboardController
class DashboardController extends Controller
Traits
Constants
| ACTIVITY_SCAN_LIMIT |
Number of annotation labels that are inspected to find recently annotated files. |
Methods
Determines if the request was done by an automated script (with API token or ajax).
Create a new instance.
Show the application dashboard to the user.
Get the most recently created volume a user.
Get the most recently annotated images of a user.
Get the most recently annotated videos of a user.
Get the files that a user annotated most recently.
Assemble the dashboard activity items for the given files.
Show the landing page if no user is authenticated.
Details
in
Controller at line 21
bool
isAutomatedRequest(Request|null $request = null)
Determines if the request was done by an automated script (with API token or ajax).
at line 26
__construct()
Create a new instance.
at line 38
index(Guard $auth)
Show the application dashboard to the user.
at line 52
protected
indexDashboard(User $user)
Show the dashboard for a logged in user.
at line 94
array
volumesActivityItems(User $user, int $limit = 3, string $newerThan = null)
Get the most recently created volume a user.
at line 120
array
annotationsActivityItems(User $user, int $limit = 3, string $newerThan = null)
Get the most recently annotated images of a user.
at line 147
array
videosActivityItems(User $user, int $limit = 3, string $newerThan = null)
Get the most recently annotated videos of a user.
at line 183
protected array
recentlyAnnotatedFiles(string $labelTable, string $annotationTable, string $fileKey, User $user, int $limit, string $newerThan = null)
Get the files that a user annotated most recently.
Aggregating all annotation labels of a user is prohibitively expensive for users with many annotations. Instead, only the most recent ACTIVITY_SCAN_LIMIT annotation labels are inspected, which is cheap with the user_id/created_at index. A user who spread fewer than $limit files over more annotation labels than that may see fewer activity items.
at line 216
protected array
buildActivityItems(string $model, array $timestamps, string $include)
Assemble the dashboard activity items for the given files.
at line 238
protected
indexLandingPage()
Show the landing page if no user is authenticated.