MCPcopy Create free account

hub / github.com/Gridea-Pro/gridea-pro / functions

Functions1,756 in github.com/Gridea-Pro/gridea-pro

↓ 1 callersFunctionrenderKatex
renderKatex 调 KaTeX 把公式渲染成 HTML。 内部用一个全局 QuickJS VM;多个 goroutine 调用时通过 vmMu 串行。 VM 若出错(panic / Eval 失败)会被关闭,下一次调用自动重建。
backend/internal/utils/markdown_katex.go:308
↓ 1 callersFunctionrenderResults
(results, terms)
frontend/public/default-files/themes/letters-theme/assets/js/search.js:185
↓ 1 callersFunctionrenderSiteHandler
(s *engine.Engine)
backend/internal/mcp/tool_advanced.go:22
↓ 1 callersFunctionrenderSiteTool
Render Site
backend/internal/mcp/tool_advanced.go:18
↓ 1 callersMethodrenderViaGoja
renderViaGoja 通过 Goja 直接执行 EJS
backend/internal/render/ejs_renderer.go:134
↓ 1 callersFunctionreplyCommentHandler
(s *service.CommentService)
backend/internal/mcp/tool_comment.go:43
↓ 1 callersFunctionreplyCommentTool
()
backend/internal/mcp/tool_comment.go:34
↓ 1 callersMethodresolveProvider
resolveProvider 根据当前 AI 设置返回 (provider, model, apiKey, isBuiltIn, error)
backend/internal/service/ai_service.go:67
↓ 1 callersMethodrewriteCdnURLs
rewriteCdnURLs 将静态资源路径替换为 CDN 地址
backend/internal/engine/html_postprocessor.go:441
↓ 1 callersMethodrunCallbackServer
(ctx context.Context, listener net.Listener, providerID, lang string, p *oauth.Provider, redirectURI, expected
backend/internal/service/oauth_service.go:222
↓ 1 callersFunctions
backend/internal/utils/katexjs/katex.min.js:1
↓ 1 callersFunctionsafeEventsOn
(eventName: string, callback: (...data: any[]) => void)
frontend/src/helpers/wailsRuntime.ts:33
↓ 1 callersMethodsanitizeData
sanitizeData 确保 TemplateData 中的 nil slice 被初始化为空 slice 避免 json.Marshal 生成 null,导致前端 EJS 遍历报错
backend/internal/render/ejs_renderer.go:210
↓ 1 callersMethodsanitizeData
sanitizeData 确保 nil slice 初始化为空 slice,避免模板遍历时报错
backend/internal/render/jinja2_renderer.go:336
↓ 1 callersFunctionsanitizeFilename
sanitizeFilename 去除路径分隔符、文件系统非法字符与控制字符并限制长度, 供另存为对话框的默认名使用(不含扩展名)。
backend/internal/app/app.go:537
↓ 1 callersFunctionsanitizeName
(name string)
backend/internal/facade/update_facade.go:755
↓ 1 callersFunctionsanitizeSlug
sanitizeSlug 清理模型输出,只保留字母/数字/连字符
backend/internal/service/ai_service.go:197
↓ 1 callersFunctionsanitizeTemplate
sanitizeTemplate 清理模板内容,将标签内的换行符替换为空格 这使得标准 Jinja2 的多行标签写法能被 Pongo2 的严格 Lexer 接受
backend/internal/render/jinja2_loader.go:51
↓ 1 callersFunctionsanitizeTemplate
(content []byte)
backend/cmd/test_sanitize/main.go:18
↓ 1 callersFunctionsaveManifest
(manifestPath string, m *scaffoldManifest)
backend/internal/service/scaffold_service.go:49
↓ 1 callersMethodscanAndHashFiles
scanAndHashFiles 遍历目录,返回 map["/relPath"] = "sha1hex"
backend/internal/deploy/netlify_deployer.go:221
↓ 1 callersMethodscanAndHashFiles
scanAndHashFiles 遍历目录,计算每个文件的 SHA1 值及文件大小
backend/internal/deploy/vercel_deployer.go:152
↓ 1 callersFunctionscorePost
Score a single post. Returns { score, titleHL, excerptHL } or null.
frontend/public/default-files/themes/flavor-theme/assets/scripts/search.js:114
↓ 1 callersFunctionsearch
(query)
frontend/public/default-files/themes/letters-theme/assets/js/search.js:79
↓ 1 callersFunctionsendPlatform
sendPlatform 走 D-Bus org.freedesktop.Notifications,显式传 app_name + app_icon。 覆盖所有遵循 freedesktop.org 规范的桌面环境(GNOME / KDE / XFCE / Cinnamon / MATE / LXQt
backend/internal/notify/notify_linux.go:14
↓ 1 callersMethodsendToast
(ctx context.Context, message, toastType string)
backend/internal/service/preview_service.go:230
↓ 1 callersMethodsetAttribute
(e,t)
backend/internal/utils/katexjs/katex.min.js:1
↓ 1 callersMethodsetFallback
(key, value string)
backend/internal/service/credential/keychain.go:97
↓ 1 callersFunctionsetupApp
(app: VueApp)
frontend/src/main.ts:16
↓ 1 callersFunctionslugPrompt
slugPrompt 构建生成 Slug 的提示词
backend/internal/service/ai_service.go:161
↓ 1 callersFunctionstripHTMLForSearch
stripHTMLForSearch 移除 HTML 标签,返回纯文本(用于搜索索引)。
backend/internal/engine/search_builder.go:78
↓ 1 callersFunctiontoJSON
toJSON 将 map 转换为 JSON 字符串(用于 JS 调用)
backend/internal/engine/data_builder.go:668
↓ 1 callersMethodtoText
()
backend/internal/utils/katexjs/katex.min.js:1
↓ 1 callersFunctiontrapFocus
(e)
frontend/public/default-files/themes/flavor-theme/assets/scripts/search.js:253
↓ 1 callersFunctiontruncateRunes
(s string, max int)
backend/internal/service/deploy_service.go:296
↓ 1 callersFunctiontrustedRedirectChecker
trustedRedirectChecker 作为 http.Client.CheckRedirect 使用, 限制 3xx 跳转只能落到 github 体系内的 HTTPS 地址,且跳转总数 < 10。
backend/internal/facade/update_facade.go:84
↓ 1 callersMethodtryDownload
tryDownload 执行一次完整的下载尝试。成功时写入 readyPath / readyAssetName 并 emitReady, 失败时返回 error(调用方决定是否重试)。调用方负责在 ctx 取消时不要再次调用本函数。
backend/internal/facade/update_facade.go:354
↓ 1 callersMethodtryGetGithubFileSHA
tryGetGithubFileSHA 执行一次 GET+解析。 状态码映射:200 → sha、404 → errRemoteFileNotFound、其他 → HTTP X 错误(可重试判定)。
backend/internal/service/cdn_upload_service.go:300
↓ 1 callersFunctionunzip
(src, dst string)
backend/internal/facade/update_installer_darwin.go:113
↓ 1 callersFunctionupdateCategoryHandler
(s *service.CategoryService)
backend/internal/mcp/tool_others.go:209
↓ 1 callersFunctionupdateCategoryTool
()
backend/internal/mcp/tool_others.go:199
↓ 1 callersFunctionupdateLinkHandler
(s *service.LinkService)
backend/internal/mcp/tool_link_menu.go:84
↓ 1 callersFunctionupdateLinkTool
()
backend/internal/mcp/tool_link_menu.go:73
↓ 1 callersFunctionupdateMemoHandler
(s *service.MemoService)
backend/internal/mcp/tool_memo.go:113
↓ 1 callersFunctionupdateMemoTool
Update Memo
backend/internal/mcp/tool_memo.go:105
↓ 1 callersFunctionupdateMenuHandler
(s *service.MenuService)
backend/internal/mcp/tool_link_menu.go:242
↓ 1 callersFunctionupdateMenuTool
()
backend/internal/mcp/tool_link_menu.go:232
↓ 1 callersFunctionupdatePostHandler
(s *service.PostService)
backend/internal/mcp/tool_post.go:150
↓ 1 callersFunctionupdatePostTool
Update Post
backend/internal/mcp/tool_post.go:139
↓ 1 callersFunctionupdateSettingsHandler
(s *service.SettingService)
backend/internal/mcp/tool_config.go:171
↓ 1 callersFunctionupdateSettingsTool
()
backend/internal/mcp/tool_config.go:157
↓ 1 callersFunctionupdateTagHandler
(s *service.TagService)
backend/internal/mcp/tool_others.go:80
↓ 1 callersFunctionupdateTagTool
()
backend/internal/mcp/tool_others.go:70
↓ 1 callersFunctionupdateThemeConfigHandler
(s *service.ThemeService)
backend/internal/mcp/tool_config.go:56
↓ 1 callersFunctionupdateThemeConfigTool
()
backend/internal/mcp/tool_config.go:43
↓ 1 callersMethoduploadFile
uploadFile 上传单个文件
backend/internal/deploy/sftp_deployer.go:267
↓ 1 callersMethoduploadFile
uploadFile 上传单个文件
backend/internal/deploy/ftp_deployer.go:250
↓ 1 callersMethoduploadFiles
uploadFiles 并发上传缺失文件到 Netlify
backend/internal/deploy/netlify_deployer.go:312
↓ 1 callersMethoduploadFiles
uploadFiles 并发上传文件到 Vercel
backend/internal/deploy/vercel_deployer.go:203
↓ 1 callersFunctionuploadImageFiles
(files: domain.UploadedFile[])
frontend/src/views/articles/editor/composables/useEditorHelper.ts:94
↓ 1 callersFunctionuploadImages
(files: File[])
frontend/src/views/articles/editor/composables/useFileUpload.ts:58
↓ 1 callersMethoduploadSingleFile
uploadSingleFile 上传单个文件到 Netlify。 PUT 幂等 + Netlify 服务端通过 deployId 锁定目标,5xx/429/网络错误重试安全(见 #46)。
backend/internal/deploy/netlify_deployer.go:345
↓ 1 callersMethoduploadSingleFile
uploadSingleFile 上传单个文件到 Vercel。 带有 x-vercel-digest 的 POST 是内容寻址的幂等写入(见 #46),5xx/429/网络 错误可安全重试,因此这里走 DoHTTPWithRetry 而非直接 client.Do。
backend/internal/deploy/vercel_deployer.go:232
↓ 1 callersFunctionuseArticleImageUrl
()
frontend/src/views/articles/shared/useImageUrl.ts:14
↓ 1 callersFunctionuseArticleStats
(content: () => string)
frontend/src/views/articles/editor/composables/useArticleStats.ts:11
↓ 1 callersMethoduseStrictBehavior
(e,t,r)
backend/internal/utils/katexjs/katex.min.js:1
↓ 1 callersFunctionverifyUsageSig
verifyUsageSig 校验 sig 是否合法
backend/internal/repository/ai_usage_repo.go:53
↓ 1 callersMethodwatchLoop
()
backend/internal/service/resource_watcher.go:73
↓ 1 callersMethodwithTextFontFamily
(e)
backend/internal/utils/katexjs/katex.min.js:1
↓ 1 callersMethodwithTextFontWeight
(e)
backend/internal/utils/katexjs/katex.min.js:1
↓ 1 callersFunctionwordCount
(content?: any, transformFn?: (count: number) => any)
frontend/src/helpers/words-count.ts:20
↓ 1 callersFunctionwriteDebugLog
(title, body string, err error)
backend/internal/notify/debug_log.go:36
↓ 1 callersFunctionwriteFiles
writeFiles 在临时目录下批量写入模板文件。
backend/internal/render/factory_test.go:10
↓ 1 callersFunctionxr
(e,t,r)
backend/internal/utils/katexjs/katex.min.js:1
↓ 1 callersFunctionyr
(e,t)
backend/internal/utils/katexjs/katex.min.js:1
↓ 1 callersFunctionzipDirectory
zipDirectory 将 srcDir 目录下所有文件递归压缩到 dstZip。
backend/internal/app/app.go:557
FunctionA
(e)
frontend/public/default-files/themes/amore/assets/lib/Valine.min.js:12
FunctionA
(e)
frontend/public/default-files/themes/amore-jinja2/assets/lib/Valine.min.js:12
MethodAddSite
AddSite 添加新站点
backend/internal/app/app.go:218
FunctionAn
(e,t)
backend/internal/utils/katexjs/katex.min.js:1
MethodCanAcceptIndentedLine
()
backend/internal/utils/markdown_katex.go:151
MethodCanInterruptParagraph
()
backend/internal/utils/markdown_katex.go:150
MethodCancelDeploy
CancelDeploy 对外暴露给前端调用;正在进行的部署会被 ctx 取消(见 #42)。 空闲时 no-op。
backend/internal/facade/deploy_facade.go:27
MethodCancelDeploy
CancelDeploy 中断当前正在进行的部署。 若当前空闲则 no-op,不返回错误。取消后 DeployToRemote 会收到 ctx.Canceled 并尽可能快地退出(各 provider 内部的 HTTP / walk 循环都要尊重 ctx)。
backend/internal/service/deploy_service.go:235
MethodCancelDownload
CancelDownload 取消正在进行的下载
backend/internal/facade/update_facade.go:215
MethodCancelOAuthFlow
CancelOAuthFlow 取消正在进行的 OAuth 流程
backend/internal/facade/oauth_facade.go:30
MethodCancelOAuthFlow
CancelOAuthFlow 取消正在进行的 OAuth 流程(关闭本地回调服务器)
backend/internal/service/oauth_service.go:108
MethodChat
(ctx context.Context, req ChatRequest, apiKey string, httpClient *http.Client)
backend/internal/service/ai/gemini.go:53
MethodChat
(ctx context.Context, req ChatRequest, apiKey string, httpClient *http.Client)
backend/internal/service/ai/anthropic.go:49
MethodChat
(ctx context.Context, req ChatRequest, apiKey string, httpClient *http.Client)
backend/internal/service/ai/openai_compat.go:49
MethodCheckUpdate
CheckUpdate 请求 GitHub Releases 接口,返回版本对比结果
backend/internal/facade/update_facade.go:130
MethodClearCache
ClearCache 实现 ThemeRenderer 接口
backend/internal/render/ejs_renderer.go:124
MethodClearCache
ClearCache 清除所有模板缓存 用于开发模式下主题文件变更后的热重载
backend/internal/render/jinja2_renderer.go:126
MethodClearCache
ClearCache 实现 ThemeRenderer 接口
backend/internal/render/go_renderer.go:68
MethodContinue
(node ast.Node, reader text.Reader, pc parser.Context)
backend/internal/utils/markdown_katex.go:121
MethodCreate
(ctx context.Context, memo *domain.Memo)
backend/internal/repository/memo_repo.go:177
MethodCreate
(ctx context.Context, post *domain.Post)
backend/internal/repository/post_repo.go:54
MethodCreate
(ctx context.Context, tag *domain.Tag)
backend/internal/repository/tag_repo.go:27
MethodCreate
(ctx context.Context, link *domain.Link)
backend/internal/repository/link_repo.go:27
MethodCreate
(ctx context.Context, menu *domain.Menu)
backend/internal/repository/menu_repo.go:27
← previousnext →1,001–1,100 of 1,756, ranked by callers