29 Commits

Author SHA1 Message Date
Pablo Vazquez
b8c49acf71 Cleanup: Rename window-footer to app-footer
Follow the naming used in other places like app-version or #app.
2022-07-07 17:49:23 +02:00
Sybren A. Stüvel
beb8684a38 Web: fix styling of last-rendered image in job details
Instead of putting the styling in `<style scoped>`, I moved it to the
global `base.css`. This made things work again.
2022-07-01 13:10:51 +02:00
Sybren A. Stüvel
d25151184d Add a "Last Rendered" view
Add a "Last Rendered" view to the webapp.

The Manager now stores (in the database) which job was the last
recipient of a rendered image, and serves that to the appropriate
OpenAPI endpoint.

A new SocketIO subscription + accompanying room makes it possible for
the web interface to receive all rendered images (if they survive the
queue, which discards images when it gets too full).
2022-07-01 12:34:40 +02:00
Sybren A. Stüvel
84d598c813 Web: reload the last-rendered image on SocketIO notification 2022-06-30 18:37:12 +02:00
Sybren A. Stüvel
2b89399206 Manager: handle allJobs subscription
SocketIO clients no longer automatically subscribe to the jobs updates.
This is now done explicitly via the `allJobs` subscription type, and
unsubscribing is also possible.
2022-05-31 15:00:37 +02:00
Sybren A. Stüvel
e492a31abb Web: cleanup, move job/task-related components into jobs subdir
Move job and task components into `components/jobs`.

No functional changes.
2022-05-30 19:18:01 +02:00
Sybren A. Stüvel
88346d8244 Web: first implementation of Workers overview
Show workers with their status, and allow clicking on a worker to activate
it and show its details (which currently is limited to just its ID). Does
include Vue Router handling of the active worker ID and CSS classes for
worker statuses.

This basically copies the `JobsTable` component to `workers/WorkersTable`.
The intention is that all the jobs-specific components will move into a
`jobs` subdirectory at some point.
2022-05-30 18:52:02 +02:00
Pablo Vazquez
74f875957f Web: Move overflow and position properties to affect all columns 2022-05-30 15:44:38 +02:00
Sybren A. Stüvel
81aec77059 Resize the Tasks table when necessary
The `JobDetails` component now emits a `reshuffled` event whenever its
contents have changed, so that other components can respond to any changes
in available space. This event now triggers a resize of the tasks table
on the next DOM tick (so that the new sizes of the HTML elements are
available).

The `TasksTable` component also recomputes the table size when the task
status filters change (because that might have triggered a show/hide of
the filter bar). It also computes the available height slightly differently
so that it's all done relative to the tabulator element.

There is just one TODO left, which is a hard-coded offset of 12 that
should be obtained dynamically from somewhere -- no idea where it comes
from or why it's necessary.
2022-05-30 15:08:34 +02:00
Pablo Vazquez
1310e5c9e2 Web: Set height for Tasks List on load and window resize
Calculate the Tasks List height by subtracting its offsetTop from
the Jobs Details column height.

Known issues:
There is a glitch in which the height can be sometimes longer or shorter
than expected, due to asynchronous loading of other components in Job Details
(such as Job Settings or table filters).
2022-05-25 17:14:21 +02:00
Sybren A. Stüvel
72487e3fb4 Web: only load task log tail when task log viewer is visible
The code to fetch the task log tail is moved from `JobsView.vue` to
`TaskLog.vue`, as that knows exactly when it's shown & hidden.

The subscriptions to the task log updates will have to be managed in the
same way; that's for another commit.
2022-05-24 16:04:03 +02:00
Sybren A. Stüvel
ae0f4a7ca4 Show task log tail in the web interface 2022-05-20 16:49:51 +02:00
Sybren A. Stüvel
4562e98df5 Web: store footer popover state in local storage
Keep the footer popover state in the local storage, restoring it on load:
- Visibility of the popover
- Current tab of the popover
2022-05-20 14:43:30 +02:00
Sybren A. Stüvel
fa7bfaabee Web: cleanup, move footer components into a footer subdirectory
No functional changes.
2022-05-20 13:41:32 +02:00
Sybren A. Stüvel
3e5f681321 Task log broadcasting via SocketIO
Implement task log broadcasting via SocketIO. The logs aren't shown in the
web interface yet, but do arrive there in a Pinia store. That store is
capped at 1000 lines to keep memory requirements low-ish.
2022-05-20 13:03:41 +02:00
Sybren A. Stüvel
34bccd9277 Cleanup, web: rename subscribedJob to subscribedJobID
The prop contains the job ID, not the job itself, which is now reflected
in the name.

No functional changes.
2022-05-20 11:27:23 +02:00
Sybren A. Stüvel
22ce5a3e13 Web: only show tasks table if there is job data to show
Without this, the tasks table would be shown (off-screen, so you'd have
to scroll to see it) when there is an active job ID, but no data loaded
due to the backend being unavailable.
2022-05-19 15:42:57 +02:00
Sybren A. Stüvel
0242f2d217 Web: show job updates in the notifications popover 2022-05-19 15:18:19 +02:00
Sybren A. Stüvel
03a021e14f Web: don't deactivate current task when clicking on current job 2022-05-19 14:28:54 +02:00
Sybren A. Stüvel
4602ef2523 Web: show task status changes in the notifications
This of course only shows notifications about tasks of the active job,
as otherwise things would get messy.
2022-05-19 14:28:37 +02:00
Sybren A. Stüvel
40bed3db5e Web: add notification history pop-over
Add a notification pop-over, which can be opened by clicking the footer
bar.
2022-05-19 12:57:00 +02:00
Sybren A. Stüvel
bc355d68ab Web: cleanup JobsView, reorder imports of components
Order component imports alphabetically, so it's easier to add new ones.
2022-05-19 12:56:12 +02:00
Sybren A. Stüvel
42c81e9900 Web: remove some debug logging, and convert one log into warning 2022-05-17 14:52:27 +02:00
Sybren A. Stüvel
530520b1c7 Implement mass updating of tasks when JobUpdate.refresh_tasks = true
Send & handle `JobUpdate.refresh_tasks = true` when many tasks are
updated simultaneously. This applies to things like cancelling &
requeueing an entire job.

This partially rolls back 67bf77de13d99b1bc5d7344951068822c4fadd88, as
it was too slow when 1000+ tasks were being updated all at once.
2022-05-17 14:48:50 +02:00
Sybren A. Stüvel
0b39f229a1 Implement may-I-keep-running protocol
Worker and Manager implementation of the "may-I-kee-running" protocol.

While running tasks, the Worker will ask the Manager periodically
whether it's still allowed to keep running that task. This allows the
Manager to abort commands on Workers when:

- the Worker should go to another state (typically 'asleep' or
  'shutdown'),
- the task changed status from 'active' to something non-runnable
  (typically 'canceled' when the job as a whole is canceled).
- the task has been assigned to a different Worker. This can happen when
  a Worker loses its connection to its Manager, resulting in a task
  timeout (not yet implemented) after which the task can be assigned to
  another Worker. If then the connectivity is restored, the first Worker
  should abort (last-assigned Worker wins).
2022-05-12 15:06:05 +02:00
Sybren A. Stüvel
cc10d3e4bb Web: also let Vue Router track the active task
This basically does the same as 63ac7287321a101c3f601eeb151be73154ef7720
but then for tasks.
2022-05-11 15:02:02 +02:00
Sybren A. Stüvel
d2f5fa5ca7 Web: simplify handling of job updates 2022-05-11 15:00:05 +02:00
Sybren A. Stüvel
63ac728732 Web: remove concept of "selected jobs" and replace with "active job"
The selection mechanism of Tabulator was getting in the way of having nice
navigation, as it would deselect (i.e. nav to "/") before selecting the
next job (i.e. nav to "/jobs/{job-id}").

The active job is now determined by the URL and thus handled by Vue Router.
Clicking on a job simply navigates to its URL, which causes the reactive
system to load & display it.

It is still intended to get job selection for "mass actions", but that's
only possible after normal navigation is working well.
2022-05-11 12:13:25 +02:00
Sybren A. Stüvel
af39414a06 Web: introduce VueRouter and split up into more components
Most of the code moved from `App.vue` to `views/JobsView.vue`.
Notification bar has its own component, and there are placeholder
"views" for Workers and Settings pages.

There is still some clunky handling of updates via SocketIO, as those
are a mix of job-specific and global (like SocketIO reconnection
events). The advantage of the current approach is that SocketIO
connections are closed when you leave the Jobs page, and reopened when
you enter the Workers page. My gut feeling says this is nice because it
ensures that all SocketIO connection-specific things are cleaned up when
you navigate.
2022-05-06 16:50:20 +02:00