add trusted image domains whitelist#8285
add trusted image domains whitelist#8285smartcoder0777 wants to merge 8 commits intohalo-dev:mainfrom
Conversation
|
@smartcoder0777: You must be a member of the halo-dev/milestone-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Milestone Maintainers Team and have them propose you as an additional delegate for this responsibility. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
added release note to the commit description |
|
@ruibaby Would you review my PR please? |
…rompt Before prompting to upload external links, now queries the attachment library using status.permalink to check if URLs already exist as attachments. This prevents unnecessary prompts when pasting images that are already in the library. - Add filterNodesNotInAttachmentLibrary() to query existing attachments - Use fieldSelector with status.permalink for efficient lookup - Import coreApiClient for attachment API access - Fix cache condition check for trusted domains Related to halo-dev#8279
… external links Replace Dialog.info() with Toast notification to avoid interrupting the editing flow when external links are detected. The toast shows for 5 seconds and displays the count of external links found. - Remove Dialog import, use Toast.info() instead - Add i18n keys for singular/plural external link messages (en, zh-CN, es) - Set 5 second duration for toast notification - Remove blocking confirmation dialog for batch upload This addresses reviewer feedback to make the external link detection less intrusive and non-blocking. Related to halo-dev#8279
|
@ruibaby 感谢您的反馈!我已根据您的建议更新了实现: 已完成的更改1. ✅ 优先检查附件库 (提交 a025f61)
2. ✅ 非阻塞式 UI (提交 9aa8966)
3. ✅ 信任域名白名单 (原始提交 4a688fe)
当前行为流程粘贴图片时:
权衡说明非阻塞式 toast 不再包含批量上传功能。但用户仍可使用每个图片上的**"保存到本地"**工具栏按钮(现有的 准备好审查实现现在已解决所有反馈要点。如有任何其他问题或需要调整的地方,请告知我! |
LIlGG
left a comment
There was a problem hiding this comment.
2. ✅ 非阻塞式 UI
- 将阻塞式的
Dialog.info()替换为Toast通知
将 Dialog.info() 替换为 Toast 将导致原有的批量处理功能出现异常。我们所期望的应当是��用另类的方式来显著但非阻塞 的展示 UI,并不是仅仅只是一个简单的提示。
3. ✅ 信任域名白名单
这个功能我认为可以移除,不建议在文章设置中增加这种功能。
|
@liigg 感谢您的反馈!我已根据您的建议完全重构了实现: 已完成的更改1. 移除信任域名白名单功能
2. 非阻塞式 UI(保留批量上传功能)我创建了一个新的通知系统来替代阻塞式对话框: 新增组件:
新的交互流程:
关键特性:
代码变更统计
效果对比之前: 阻塞式对话框 → 用户必须点击"确定"或"取消"才能继续 现在: 浮动通知 → 用户可以:
这个方案既满足了非阻塞的要求,又保留了批量上传的功能。请审查! |
…trusted-domains-whitelist
@LIlGG 不好意思。给您麻烦了。再给我一次机会。我尽力。 |
|
|
@LIlGG 感谢您的反馈。我进行了详尽与符合实际的功能测试。 |






Fixes: #8279
What type of PR is this?
/kind feature
/kind improvement
/area ui
What this PR does / why we need it:
Pasting images hosted on a user-owned CDN/S3 custom domain currently triggers the “external link detected” upload prompt every time. This PR adds a configurable trusted-domain whitelist so those URLs are treated as safe and won’t show the prompt.
Which issue(s) this PR fixes:
Fixes #8279
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Yes — admins can configure trusted image domains to suppress the external-link upload dialog when pasting media from those domains.
Release note
Added Trusted Image Domains whitelist to Post Settings. Images (and other media) pasted from these domains won’t trigger the “external link detected” upload-to-attachment prompt.
Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=191128130