Add Python/Ruby code pieces and fix template loading performance
- Add Python code execution piece with subprocess-based runner - Add Ruby code execution piece with subprocess-based runner - Fix template loading: fetch individual templates from cloud for community edition - Add piece name aliasing for renamed pieces (piece-text-ai → piece-ai, etc.) - Add dev pieces caching to avoid disk reads on every request (60s TTL) - Add Python and Ruby logos to Django static files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,14 @@ const edition = system.getEdition()
|
||||
|
||||
export const templateController: FastifyPluginAsyncTypebox = async (app) => {
|
||||
app.get('/:id', GetParams, async (request) => {
|
||||
// For community edition, try to fetch from cloud templates first
|
||||
if (edition !== ApEdition.CLOUD) {
|
||||
const cloudTemplate = await communityTemplates.getById(request.params.id)
|
||||
if (!isNil(cloudTemplate)) {
|
||||
return cloudTemplate
|
||||
}
|
||||
}
|
||||
// Fall back to local database
|
||||
return templateService().getOneOrThrow({ id: request.params.id })
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user