From bfbca99f1b712060cf63f17c5d0e4f5a16695dfe Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 10 Jun 2025 17:58:35 +0800 Subject: [PATCH] refactor: update attachment policy form using new configMap API (#7531) #### What type of PR is this? /area ui /kind improvement /milestone 2.21.x #### What this PR does / why we need it: Update attachment policy form using new configMap API #### Does this PR introduce a user-facing change? ```release-note None ``` --- .../extensions/attachment-local-policy.yaml | 11 +- .../AttachmentPolicyEditingModal.vue | 179 ++++++++++-------- 2 files changed, 105 insertions(+), 85 deletions(-) diff --git a/application/src/main/resources/extensions/attachment-local-policy.yaml b/application/src/main/resources/extensions/attachment-local-policy.yaml index c4a6684b9..8aef2a6df 100644 --- a/application/src/main/resources/extensions/attachment-local-policy.yaml +++ b/application/src/main/resources/extensions/attachment-local-policy.yaml @@ -68,12 +68,18 @@ spec: value: ARCHIVE - $formkit: checkbox name: alwaysRenameFilename + id: alwaysRenameFilename label: 是否总是重命名文件名 help: 勾选后上传后的文件名将被重命名 + value: false - $formkit: group - if: $alwaysRenameFilename + if: $get(alwaysRenameFilename).value + id: renameStrategy name: renameStrategy label: 重命名策略 + value: + method: RANDOM + randomLength: 32 children: - $formkit: radio name: method @@ -87,8 +93,9 @@ spec: value: TIMESTAMP - $formkit: number number: integer - if: $renameStrategy.renameMethod === RANDOM + if: "$value.method === RANDOM" name: randomLength + id: randomLength label: 随机文件名长度 help: 默认值为 32。因为文件名的长度限制,随机文件名的长度范围为 [8, 64]。 validation: "between:8,64" diff --git a/ui/console-src/modules/contents/attachments/components/AttachmentPolicyEditingModal.vue b/ui/console-src/modules/contents/attachments/components/AttachmentPolicyEditingModal.vue index a36995dca..42f74a01d 100644 --- a/ui/console-src/modules/contents/attachments/components/AttachmentPolicyEditingModal.vue +++ b/ui/console-src/modules/contents/attachments/components/AttachmentPolicyEditingModal.vue @@ -1,15 +1,16 @@