Skip to content

Commit

Permalink
fix: rendering issue due to missing default values (halo-dev#139)
Browse files Browse the repository at this point in the history
* fix: rendering issue due to missing default values

Signed-off-by: Ryan Wang <[email protected]>

* Set default values for captcha

Signed-off-by: Ryan Wang <[email protected]>
  • Loading branch information
ruibaby committed Aug 8, 2024
1 parent 04ee023 commit 59f6d2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface SettingConfigGetter {
@Accessors(chain = true)
class SecurityConfig {
@Getter(onMethod_ = @NonNull)
private CaptchaConfig captcha;
private CaptchaConfig captcha = CaptchaConfig.empty();

public SecurityConfig setCaptcha(CaptchaConfig captcha) {
this.captcha = (captcha == null ? CaptchaConfig.empty() : captcha);
Expand Down
19 changes: 11 additions & 8 deletions src/main/resources/extensions/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ spec:
- $formkit: group
name: captcha
label: 验证码
value:
enable: false
type: ALPHANUMERIC
children:
- $formkit: checkbox
label: 匿名评论需要验证码
Expand Down Expand Up @@ -68,8 +71,8 @@ spec:
if: "$get(enable).value === true"
name: provider
options:
- label: 'Gravatar'
value: 'gravatar'
- label: "Gravatar"
value: "gravatar"
value: "gravatar"
- $formkit: text
label: 头像服务镜像地址
Expand All @@ -82,10 +85,10 @@ spec:
if: "$get(enable).value === true"
name: policy
options:
- label: '仅匿名用户'
value: 'anonymousUser'
- label: '所有用户'
value: 'allUser'
- label: '匿名&无头像用户'
value: 'noAvatarUser'
- label: "仅匿名用户"
value: "anonymousUser"
- label: "所有用户"
value: "allUser"
- label: "匿名&无头像用户"
value: "noAvatarUser"
value: "anonymousUser"

0 comments on commit 59f6d2c

Please sign in to comment.