534 Commits

Author SHA1 Message Date
Pablo Vazquez
a22e3c9064 Web: Use custom CSS file for Tabulator
Forked from "Midnight" built-in theme.
2022-05-03 19:28:32 +02:00
Pablo Vazquez
af56fd04e9 Web: Add generic column class to columns 2022-05-03 19:27:47 +02:00
Pablo Vazquez
dfb3b5b221 Web: Add placeholder navbar links 2022-05-03 19:27:31 +02:00
Pablo Vazquez
87b9bcee19 Cleanup: Remove unused classes and style 2022-05-03 19:26:43 +02:00
Pablo Vazquez
26adf0d700 Cleanup: Rename action-bar classes and buttons 2022-05-03 19:26:29 +02:00
Pablo Vazquez
301bff9244 Web: Move basic styling from App to base.css
First step, it should be further split later down the line.
2022-05-03 19:21:19 +02:00
Sybren A. Stüvel
ad04856a02 Web: only use the tasks table if it exists
Because of the `v-if` attribute, `this.$refs.tasksTable` may actually be
`null` if there are no tasks shown.
2022-05-03 16:29:14 +02:00
Sybren A. Stüvel
0c79701bea Web: Don't remember selected task
If the selected task doesn't exist (because you selected another job),
Tabulator would select all tasks. That's not what I want.
2022-05-03 16:28:39 +02:00
Sybren A. Stüvel
f05cf0e9f8 Add another "feature" idea 2022-05-03 16:15:03 +02:00
Sybren A. Stüvel
67bf77de13 Manager: rework mass updates to task statuses
When the job status changes, it impacts the task statuses as well. These
status changes are now no longer done with a single database query, but
instead each affected task is fetched, changed, and saved. This unifies
the regular & mass updates to the tasks, and causes the resulting task
changes to be broadcast to SocketIO clients.
2022-05-03 16:13:44 +02:00
Sybren A. Stüvel
f533ccce43 Add extra "feature" 2022-05-03 16:03:18 +02:00
Sybren A. Stüvel
b3e1d1c6de Cleanup: manager, typo fix 2022-05-03 13:05:30 +02:00
Sybren A. Stüvel
73b122be84 Show task details for selected task
The task details are updated at real-time via SocketIO updates.
2022-05-03 13:05:30 +02:00
Sybren A. Stüvel
18891dda91 Manager: implement FetchTask OAPI endpoint 2022-05-03 13:04:28 +02:00
Sybren A. Stüvel
4da7f67105 OAPI: generate code 2022-05-03 13:03:59 +02:00
Sybren A. Stüvel
adba72176d OAPI: add /api/tasks/{task_id} endpoint
Add an OpenAPI endpoint definition for fetching a single task.
2022-05-03 12:45:08 +02:00
Sybren A. Stüvel
891e791853 Manager: reduce log level of socketIO subscription changes 2022-05-03 12:04:27 +02:00
Sybren A. Stüvel
50c8cd39f2 Task update notifications via SocketIO
Manager now sends out task updates via SocketIO, and the web interface
handles those.

Note that there is a `BroadcastTaskUpdate()` function, but not a
`BroadcastNewTask`. The 'new job' broadcast is sent after the job's
tasks have been created, and thus there is no need for a separate
broadcast per task.
2022-05-03 11:26:24 +02:00
Sybren A. Stüvel
222d618ef6 OAPI: generate code 2022-05-03 11:10:57 +02:00
Sybren A. Stüvel
a3752f3113 OAPI: Add SocketIOTaskUpdate schema
Add the schema for task updates sent via SocketIO.
2022-05-03 11:09:47 +02:00
Sybren A. Stüvel
782c60a6e7 OAPI: remove '-dirty' suffix from the version number in generated code
The version number used in the OpenAPI-generated code shouldn't contain
the `-dirty` suffix. In the common development workflow, those files
will always be dirty; because they're only committed after things are
locally working, the implementation has already been written.
2022-05-03 11:09:47 +02:00
Sybren A. Stüvel
bb68488c5e Cleanup: Manager, add bit of documentation 2022-05-03 10:39:44 +02:00
Sybren A. Stüvel
9b330280b7 Add SocketIO subscription system for job-related updates
SocketIO clients can now send a message with `/subscription` event type
in order to subscribe to or unsubscribe from job-related updates.

These job-related updates themselves aren't sent yet, so this is a change
that's impossible to really test. The socketIO code for joining/leaving
rooms is called, though.
2022-05-02 18:36:14 +02:00
Sybren A. Stüvel
824425f466 OAPI: regenerate code 2022-05-02 18:31:29 +02:00
Sybren A. Stüvel
24941142b0 OAPI: add SocketIOSubscription type for managing SocketIO rooms
A client can send a `SocketIOSubscription` object with the
`/subscription` event type, in order to manage the subscriptions to
job-related updates.

Subscribing to a job means receiving updates to its tasks. General job
updates are sent to all clients anyway.

This commit only contains the OpenAPI YAML change, to see if it works
well to separate such commits into three parts:

    - OpenAPI definition change.
    - Regenerated code changes.
    - Hand-written code changes.
2022-05-02 18:29:35 +02:00
Sybren A. Stüvel
d6c257d396 Include .editorconfig file
This is an attempt to get more cross-editor compatibility.
2022-05-02 18:25:40 +02:00
Sybren A. Stüvel
8d69bfe069 Cleanup: Manager, reorganise the socketio code a bit 2022-04-29 16:58:48 +02:00
Sybren A. Stüvel
c07d2e3249 Web: tweak webapp layout 2022-04-29 13:11:44 +02:00
Sybren A. Stüvel
4ebf4f31f9 Web: add task table 2022-04-29 13:11:19 +02:00
Sybren A. Stüvel
03d6f99c3d Makefile: include getting webapp dependencies with yarn install
Running `make` will now also run `yarn install` for the webapp.
2022-04-29 12:30:02 +02:00
Sybren A. Stüvel
629c073ed7 Manager: fix query for job tasks 2022-04-29 12:26:53 +02:00
Sybren A. Stüvel
cbc8600d90 FEATURES: reorder by priority and add some new things 2022-04-29 11:16:47 +02:00
Sybren A. Stüvel
cc58f0d81a Web: remove unused parts of the Vue template project
The project was created with things (components, router, views) we don't
use at the moment. To keep a clearer separation between "our code" and
"example code", I just removed the latter.
2022-04-25 17:12:52 +02:00
Sybren A. Stüvel
54587348e3 Web: remove unused import 2022-04-25 17:06:25 +02:00
Sybren A. Stüvel
992fc38604 OAPI: add endpoint for fetching the tasks of a job
Add `fetchJobTasks` operation to the Jobs API. This returns a summary of
each of the job's tasks, suitable for display in a task list view.

The actually used fields may need tweaking once we actually have a task
list view, but at least the functionality is there.
2022-04-22 12:52:57 +02:00
Sybren A. Stüvel
e399b14e66 Manager: cleanup, rename jobId to jobID
No functional changes.
2022-04-22 12:16:11 +02:00
Sybren A. Stüvel
634d59e622 Use VSCode + Prettier to reformat YAML
This commit includes settings for Visual Studio Code, so that at least
different people with the same editor (or me on multiple machines) get the
same formatting.

No functional changes.
2022-04-22 12:01:09 +02:00
Sybren A. Stüvel
0cd478a409 Manager: move FetchJob function into jobs_query.go
I want to put more of the "get stuff" code into `jobs_query.go`, keeping
`jobs.go` for creationg & manipulation.
2022-04-22 11:51:02 +02:00
Sybren A. Stüvel
fc4cc11483 Web: style buttons and footer in Blender Blue 2022-04-22 11:46:45 +02:00
Sybren A. Stüvel
4129ed11bb Web: use wrapper for the OpenAPI client to track requests
A wrapper for the generated `ApiClient` class tracks the number of running
queries. This makes it much simpler to show the "API calls pending" UI
element, regardless of which part of the webapp performs the queries.
2022-04-22 11:46:33 +02:00
Sybren A. Stüvel
fc68e8a413 Web: action button styling
Making the button respond to hovering makes it slightly easier to see
which button is enabled and which is disabled.
2022-04-22 10:33:19 +02:00
Sybren A. Stüvel
e34a0ba6ea Worker: more granular locking when flushing upstream buffer
Only lock the database mutex when actual queries are performed, but not
during the entire flush loop.
2022-04-21 19:19:01 +02:00
Sybren A. Stüvel
8937a6f06f Cleanup: worker, remove debug timers
Remove accidentally committed debug timing code.
2022-04-21 19:14:09 +02:00
Sybren A. Stüvel
bcbacf6c42 Worker: fix race condition getting logger with worker status 2022-04-21 19:12:53 +02:00
Sybren A. Stüvel
6bdc198301 Manager: more graceful errors when receiving task update of unknown task
Return a 404 Not Found when the task can't be found, and a 500 on other
errors.
2022-04-21 19:06:18 +02:00
Sybren A. Stüvel
1176d85496 Worker: add -flush CLI option to just flush the buffer and quit
Add `-flush` CLI option to just flush the upstream queue and then quit.
2022-04-21 19:06:18 +02:00
Sybren A. Stüvel
55d264632f Worker: completely flush upstream buffer at startup
Completely flush the upstream buffer at startup, before attempting to
fetch a new task. These updates could impact any task on the Manager side,
and first flushing the buffer before appending new updates also seems
like a good idea.
2022-04-21 19:06:18 +02:00
Sybren A. Stüvel
90be370095 Manager: reduce password strength of Workers
The password check of worker API calls was 2 orders of magnitude slower
than actually handling the API call itself. Since the Worker authentication
is not that important (it's all on the same network anyway, and Worker
account registration is automatic too), lowering the BCrypt cost to the
minimum helps.

On my machine, this reduces the time for password checks from 50 to 2 ms.
2022-04-21 19:06:18 +02:00
Sybren A. Stüvel
65427ee38e Manager: use e.NoContent(http.StatusNoContent) to return "no content"
No functional changes, just the right call for the job.
2022-04-21 19:06:18 +02:00
Sybren A. Stüvel
d0e96ad7bd Web: hide the "delete job" action button
Hide the "Delete job" action button, as it has no backend implementation
yet.
2022-04-21 19:06:18 +02:00