Files
llmgw/internal/web/images.go
T
Ilker ManapandClaude Opus 5.5 2f54780802 G4: a page that makes 3D models, and ctl 3d
/3d beside /images, while some model makes meshes: a picture chosen, the
job asked for through the same path an API client's takes, its progress
shown (waiting for the card, n ahead; making it, the node and percent),
and the mesh in a viewer — model-viewer 4.4.0 (Apache 2.0, with three.js
and lit), served from the gateway since the page's policy loads scripts
from nowhere else — with a download and the model's licence. The mesh is
served to its owner from /3d/jobs/{id}/file; another project's person is
told there is no such job.

A job made from the portal acted for a key that does not exist: the
worker now rebuilds a session's principal from the account that made it,
while it is active and still in the project the job is charged to.

ctl 3d list|get|cancel, over /api/v1/client-jobs (/api/v1/jobs is the
control plane's own work, which ctl jobs shows).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 19:16:20 +02:00

54 lines
1.7 KiB
Go

package web
import (
"net/http"
"time"
"gitea.mynodes.xyz/ilker/llmgw/internal/store"
)
type imagesData struct {
Nav Nav
Contexts []ChatContext
Context string
User store.User
Models []ChatModel
CSRF string
Version string
Now string
}
// Images renders the page that makes pictures, for one signed-in person.
// Its models are those that make them, as the chat's are those that write.
func Images(user store.User, models []ChatModel, contexts []ChatContext, current, version string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
noStore(w)
render(w, r, "images", imagesData{
Nav: navFrom(r, "images"),
Contexts: contexts, Context: current,
User: user, Models: models, CSRF: csrfFor(r),
Version: version, Now: time.Now().UTC().Format(time.RFC3339),
})
}
}
// SetImages has the menu offer the pictures page while some model makes
// them. Asked on every page, so it must be cheap: the catalog, not a request.
func (p *AccountPages) SetImages(available func() bool) { p.images = available }
// Meshes renders the page that makes 3D models from a picture.
func Meshes(user store.User, models []ChatModel, contexts []ChatContext, current, version string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
noStore(w)
render(w, r, "meshes", imagesData{
Nav: navFrom(r, "meshes"),
Contexts: contexts, Context: current,
User: user, Models: models, CSRF: csrfFor(r),
Version: version, Now: time.Now().UTC().Format(time.RFC3339),
})
}
}
// SetMeshes has the menu offer the 3D page while some model makes meshes.
func (p *AccountPages) SetMeshes(available func() bool) { p.meshes = available }