From 5605759e49ce1a82fd7fa8e130a2884f8bf58c85 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 1 Nov 2022 14:36:16 +0800 Subject: [PATCH] perf: use the new formkit custom input for system setting forms schema (#2646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /milestone 2.0 /area core #### What this PR does / why we need it: 更新系统设置的表单定义,为 Logo / Favicon 使用新的选择附件输入框,为代码注入部分设置使用新的代码编辑器输入框。 #### Which issue(s) this PR fixes: Ref https://github.com/halo-dev/halo/issues/2558 #### Special notes for your reviewer: /hold 请等待以下 PR 合并: - https://github.com/halo-dev/console/pull/674 - https://github.com/halo-dev/console/pull/672 - https://github.com/halo-dev/console/pull/675 测试方式: 1. Console 需要使用最新的 main 分支。 2. 测试系统设置中的 Logo / Favicon 和代码注入部分的设置项是否正常使用。 #### Does this PR introduce a user-facing change? ```release-note 更新系统设置的表单定义,提供更便捷的代码和附件选择输入框。 ``` --- .../resources/extensions/system-setting.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/resources/extensions/system-setting.yaml b/src/main/resources/extensions/system-setting.yaml index 5090d5698..102d592a7 100644 --- a/src/main/resources/extensions/system-setting.yaml +++ b/src/main/resources/extensions/system-setting.yaml @@ -14,10 +14,10 @@ spec: - $formkit: text label: "站点副标题" name: subtitle - - $formkit: text + - $formkit: attachment label: Logo name: logo - - $formkit: text + - $formkit: attachment label: Favicon name: favicon - group: post @@ -113,15 +113,21 @@ spec: - group: codeInjection label: 代码注入 formSchema: - - $formkit: textarea + - $formkit: code + language: html + height: 200px label: "全局 head 标签" name: globalHead help: "注入代码到所有页面的 head 标签部分" - - $formkit: textarea + - $formkit: code + language: html + height: 200px label: "内容页 head 标签" name: contentHead help: "注入代码到文章页面和自定义页面的 head 标签部分" - - $formkit: textarea + - $formkit: code + language: html + height: 200px label: "页脚" name: footer help: "注入代码到所有页面的页脚部分"