mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-07 12:00:44 +08:00
### Summary The Go backend never seeded the `canvas_template` table, so the "Create agent from template" page was blank when the frontend proxies to the Go API (`API_PROXY_SCHEME=go`). This PR adds `SeedCanvasTemplates()` in `internal/dao`, invoked from `InitDB()` after migrations, which loads `agent/templates/*.json` and mirrors Python's `add_graph_templates()` behavior. Changes: - Add `internal/dao/canvas_template_seed.go` to parse and upsert built-in templates. - Call `SeedCanvasTemplates()` in `InitDB()`. - Add `CanvasTypes` (`JSONSlice`) to `entity.CanvasTemplate` so the frontend can filter/group by category. - Skip seeding gracefully when the templates directory is absent. This fixes the blank template catalogue in Go mode.