Refactor web build process and update documentation

- Removed Node.js build artifacts from .gitignore and adjusted Makefile to reflect changes in web UI build process, now using server-rendered Go templates instead of React.
- Updated README to clarify the new web UI architecture and output formats, emphasizing the removal of the Node.js build step.
- Added a command to set the number of frames per render task in manager configuration, enhancing user control over rendering settings.
- Improved Gitea workflow by removing unnecessary npm install step, streamlining the CI process.
This commit is contained in:
2026-03-12 19:44:40 -05:00
parent d3c5ee0dba
commit 2deb47e5ad
78 changed files with 3895 additions and 12499 deletions

View File

@@ -275,7 +275,8 @@ type NextJobTaskInfo struct {
TaskID int64 `json:"task_id"`
JobID int64 `json:"job_id"`
JobName string `json:"job_name"`
Frame int `json:"frame"`
Frame int `json:"frame"` // frame start (inclusive)
FrameEnd int `json:"frame_end"` // frame end (inclusive); same as Frame for single-frame
TaskType string `json:"task_type"`
Metadata *types.BlendMetadata `json:"metadata,omitempty"`
}
@@ -376,6 +377,7 @@ func (s *Manager) handleNextJob(w http.ResponseWriter, r *http.Request) {
TaskID int64
JobID int64
Frame int
FrameEnd sql.NullInt64
TaskType string
JobName string
JobUserID int64
@@ -385,7 +387,7 @@ func (s *Manager) handleNextJob(w http.ResponseWriter, r *http.Request) {
err = s.db.With(func(conn *sql.DB) error {
rows, err := conn.Query(
`SELECT t.id, t.job_id, t.frame, t.task_type,
`SELECT t.id, t.job_id, t.frame, t.frame_end, t.task_type,
j.name as job_name, j.user_id, j.blend_metadata,
t.condition
FROM tasks t
@@ -403,7 +405,7 @@ func (s *Manager) handleNextJob(w http.ResponseWriter, r *http.Request) {
for rows.Next() {
var task taskCandidate
var condition sql.NullString
err := rows.Scan(&task.TaskID, &task.JobID, &task.Frame, &task.TaskType,
err := rows.Scan(&task.TaskID, &task.JobID, &task.Frame, &task.FrameEnd, &task.TaskType,
&task.JobName, &task.JobUserID, &task.BlendMetadata, &condition)
if err != nil {
continue
@@ -549,6 +551,11 @@ func (s *Manager) handleNextJob(w http.ResponseWriter, r *http.Request) {
// Update job status
s.updateJobStatusFromTasks(selectedTask.JobID)
// Frame end for response: use task range or single frame (NULL frame_end)
frameEnd := selectedTask.Frame
if selectedTask.FrameEnd.Valid {
frameEnd = int(selectedTask.FrameEnd.Int64)
}
// Build response
response := NextJobResponse{
JobToken: jobToken,
@@ -558,6 +565,7 @@ func (s *Manager) handleNextJob(w http.ResponseWriter, r *http.Request) {
JobID: selectedTask.JobID,
JobName: selectedTask.JobName,
Frame: selectedTask.Frame,
FrameEnd: frameEnd,
TaskType: selectedTask.TaskType,
Metadata: metadata,
},
@@ -1959,6 +1967,12 @@ func (s *Manager) updateJobStatusFromTasks(jobID int64) {
return
}
// Cancellation is terminal from the user's perspective.
// Do not allow asynchronous task updates to revive cancelled jobs.
if currentStatus == string(types.JobStatusCancelled) {
return
}
// Count total tasks and completed tasks
var totalTasks, completedTasks int
err = s.db.With(func(conn *sql.DB) error {