apiVersion: v1alpha1
kind: Setting
metadata:
  name: theme-pix-setting
spec:
  forms:
    - group: base_set
      label: 常规设置
      formSchema:
        - $formkit: attachment
          name: favicon
          label: favicon
          value: /themes/theme-pix/assets/img/favicon.ico
          help: 建议制作一张400x400的png图像, 然后等比缩小到你想转换的ico尺寸,最后通过网上的工具转换成ico图标格式.
        - $formkit: menuRadio
          name: left_nav
          label: 左侧菜单/移动端菜单
          help: 默认只有主菜单，可前往【外观】—>【菜单】新建菜单组
          value: ""
        - $formkit: radio
          name: site_pjax
          label: 全站PJAX
          value: false
          options:
            - label: 开启
              value: true
            - label: 关闭
              value: false
        - $formkit: checkbox
          name: login_button
          label: 显示登录按钮
          value: true
        - $formkit: text
          name: site_page
          label: 全站分页名称
          value: LOAD MORE
        - $formkit: text
          name: custom_fonts
          label: 自定义字体链接
        - $formkit: text
          name: nice_name
          label: 博主自定义昵称
          value: 倒霉蛋
        - $formkit: text
          name: admin_des
          label: 博主简介
          value: Born for design
        - $formkit: attachment
          name: default_avatar
          label: 博主头像
          value: /themes/theme-pix/assets/img/avatar.png

    - group: base_top_set
      label: 顶部设置
      formSchema:
        - $formkit: attachment
          name: site_logo
          label: 常规LOGO
          value: /themes/theme-pix/assets/img/avatar.png
        - $formkit: number
          name: logo_height
          label: 常规LOGO高度尺寸
          value: 38
          help: 只填写数值即可
        - $formkit: attachment
          name: m_site_logo
          label: 方形LOGO
          help: 建议制作一张48*48的方形LOGO
          value: /themes/theme-pix/assets/img/avatar.png
        - $formkit: attachment
          name: mobile_logo
          label: 移动端LOGO
          value: /themes/theme-pix/assets/img/avatar.png
        - $formkit: checkbox
          name: top_nav_on_web
          id: top_nav_on_web
          key : top_nav_on_web
          label: WEB 端顶部菜单开关
        - $formkit: menuRadio
          name: top_nav
          if: $get(top_nav_on_web).value == true
          label: WEB 端顶部菜单
          help: 默认只有主菜单，可前往【外观】—>【菜单】新建菜单组
          value: ""

    - group: base_footer_set
      label: 底部设置
      formSchema:
        - $formkit: repeater
          name: sfooter_info
          label: 底部信息
          value: [ ]
          children:
            - $formkit: text
              name: sf_title
              label: 信息文本
            - $formkit: text
              name: sf_link
              label: 信息链接
            - $formkit: attachment
              name: sf_img
              label: 图标
            - $formkit: radio
              name: sf_open_new
              label: 打开方式
              value: _blank
              options:
                - label: 新窗口
                  value: _blank
                - label: 当前窗口
                  value: _self
        - $formkit: group
          label: 移动端底部导航设置
          name: footer_fpush
          value:
            fpush_open: true
            footmenu_left:
          children:
            - $formkit: radio
              label: 移动端底部导航
              name: fpush_open
              key: fpush_open
              id: fpush_open
              options:
                - label: 显示
                  value: true
                - label: 隐藏
                  value: false
            - $formkit: repeater
              name: footmenu_left
              if: $get(fpush_open).value
              label: 底部导航左侧区域
              value: [ ]
              children:
                - $formkit: text
                  name: title
                  label: 菜单文本
                - $formkit: text
                  name: icon
                  label: 图标
                  help: 图标为空则使用默认图标
                - $formkit: radio
                  name: fmenu_type
                  id: fmenu_type
                  key: fmenu_type
                  label: 菜单类型
                  value: normal
                  options:
                    - label: 自定义链接
                      value: normal
                    - label: 返回顶部
                      value: top
                    - label: 搜索
                      value: search
                    - label: 黑夜切换
                      value: dark
                - $formkit: text
                  if: $get(fmenu_type).value == 'normal'
                  name: link
                  label: 信息链接
                - $formkit: radio
                  if: $get(fmenu_type).value == 'normal'
                  name: open_new
                  label: 打开方式
                  value: _blank
                  options:
                    - label: 新窗口
                      value: _blank
                    - label: 当前窗口
                      value: _self
            - $formkit: repeater
              name: footmenu_right
              if: $get(fpush_open).value
              label: 底部导航右侧区域
              max: 3
              children:
                - $formkit: text
                  name: title
                  label: 菜单文本
                - $formkit: text
                  name: icon
                  label: 图标
                - $formkit: radio
                  name: fmenu_type
                  id: fmenu_type
                  key: fmenu_type
                  label: 菜单类型
                  value: normal
                  options:
                    - label: 自定义链接
                      value: normal
                    - label: 返回顶部
                      value: top
                    - label: 搜索
                      value: search
                    - label: 黑夜切换
                      value: dark
                - $formkit: text
                  if: $get(fmenu_type).value == 'normal'
                  name: link
                  label: 信息链接
                - $formkit: radio
                  if: $get(fmenu_type).value == 'normal'
                  name: open_new
                  label: 打开方式
                  value: _blank
                  options:
                    - label: 新窗口
                      value: _blank
                    - label: 当前窗口
                      value: _self

    - group: style
      label: 外观设置
      formSchema:
        - $formkit: select
          name: theme_set
          id: theme_set
          label: 主题风格
          value: green-normal
          options:
            - label: 绿色
              value: green-normal
            - label: 紫色
              value: purple-gay
            - label: 黑暗
              value: dark-theme
        - $el: div
          if: $get(theme_set).value === 'green-normal'
          attrs:
            fill: none
            viewBox: "0 0 120 87"
            style: |
              width: 100%;
              display: block;
              background-image: url('/themes/theme-pix/assets/img/theme/green.png') 100% / contain
        - $el: div
          if: $get(theme_set).value === 'purple-gay'
          attrs:
            fill: none
            viewBox: "0 0 120 87"
            style: |
              width: 120px;
              height: 87px;
              background-image: url('/themes/theme-pix/assets/img/theme/blue.png')
        - $el: div
          if: $get(theme_set).value === 'dark-theme'
          attrs:
            fill: none
            viewBox: "0 0 120 87"
            style: |
              width: 120px;
              height: 87px;
              background-image: url('/themes/theme-pix/assets/img/theme/dark.png')
        - $formkit: select
          name: layout_set
          id: layout_set
          label: 主题布局
          value: mod_single
          options:
            - label: single
              value: mod_single
            - label: lbc
              value: lbc
            - label: double
              value: mod_double
            - label: third-s
              value: mod_third_s
            - label: third
              value: mod_third
        - $el: div
          if: $get(layout_set).value === mod_single
          attrs:
            fill: none
            viewBox: "0 0 120 87"
            style: |
              width: 120px;
              height: 87px;
              background-image: url('/themes/theme-pix/assets/img/theme/single.png')
        - $el: div
          if: $get(layout_set).value === lbc
          attrs:
            fill: none
            viewBox: "0 0 120 87"
            style: |
              width: 120px;
              height: 87px;
              background-image: url('/themes/theme-pix/assets/img/theme/lbc.png')
        - $el: div
          if: $get(layout_set).value === mod_double
          attrs:
            fill: none
            viewBox: "0 0 120 87"
            style: |
              width: 120px;
              height: 87px;
              background-image: url('/themes/theme-pix/assets/img/theme/double.png')
        - $el: div
          if: $get(layout_set).value === mod_third_s
          attrs:
            fill: none
            viewBox: "0 0 120 87"
            style: |
              width: 120px;
              height: 87px;
              background-image: url('/themes/theme-pix/assets/img/theme/third-s.png')
        - $el: div
          if: $get(layout_set).value === mod_third
          attrs:
            fill: none
            viewBox: "0 0 120 87"
            style: |
              width: 120px;
              height: 87px;
              background-image: url('/themes/theme-pix/assets/img/theme/third.png')
        - $formkit: attachment
          name: topbg_banner
          label: 顶部封面图
          value: /themes/theme-pix/assets/img/banner.jpg
        - $formkit: radio
          name: home_post_type
          label: 首页类型模式
          value: moment
          help: 瞬间模式需要启用瞬间插件
          options:
            - label: 瞬间模式
              value: moment
            - label: 博客模型
              value: post

    - group: post
      label: 文章设置
      formSchema:
        - $formkit: radio
          name: post_list_type
          label: 首页文章展示类型
          value: card
          options:
            - label: 常规
              value: normal
            - label: 网格
              value: grid
            - label: 卡片
              value: card
            - label: 无图
              value: notimg
        - $formkit: select
          name: post_nav
          id: post_nav
          key: post_nav
          value: category
          label: 首页文章导航条显示内容
          options:
            - label: 分类
              value: category
            - label: 自定义分类
              value: custom_category
        - $formkit: categorySelect
          if: $get(post_nav).value === 'custom_category'
          name: nav_category
          key: nav_category
          label: 自定义分类
          multiple: true
          clearable: true
          searchable: true
          sortable: true
        - $formkit: color
          name: tocColor
          label: 颜色
          value: "#58a5c3"
        - $formkit: attachment
          name: post_banner
          label: 文章默认封面图
          value: https://www.dmoe.cc/random.php
          help: 支持随机图api(例如：https://www.dmoe.cc/random.php)
        - $formkit: attachment
          name: category_banner
          label: 分类默认封面图
          value: https://www.dmoe.cc/random.php
          help: 支持随机图api(例如：https://www.dmoe.cc/random.php)
        - $formkit: attachment
          name: tag_banner
          label: 标签默认封面图
          value: https://www.dmoe.cc/random.php
          help: 支持随机图api(例如：https://www.dmoe.cc/random.php)
        - $formkit: number
          name: post_word_max
          label: 文章列表摘要字数
          value: 100
        - $formkit: group
          label: 目录设置
          name: toc
          value:
            all_open: true
            mobile_open: true
          children:
            - $formkit: checkbox
              name: all_open
              id: all_open
              key: all_open
              label: 显示目录
              value: true
            - $formkit: checkbox
              if: $get(all_open).value
              name: mobile_open
              label: 显示移动端目录
              value: true
        - $formkit: radio
          name: donate_on
          key: donate_on
          id: donate_on
          label: 文章打赏
          value: false
          options:
            - label: 显示
              value: true
            - label: 隐藏
              value: false
        - $formkit: textarea
          if: $get(donate_on).value
          name: donate_des
          label: 打赏文案
          value: 求求你赏口饭吃吧！
        - $formkit: attachment
          if: $get(donate_on).value
          name: donate_pic
          label: 打赏二维码
          value: /themes/theme-pix/assets/img/avatar.png

    - group: moments
      label: 瞬间设置
      formSchema:
        - $formkit: radio
          name: img_style
          label: 图片样式
          value: one
          options:
            - label: 样式一
              value: one
            - label: 样式二
              value: two
        - $formkit: text
          name: topics_de_cat
          label: 默认瞬间发布标签
          value: 日常
        - $formkit: number
          name: min_push_num
          label: 瞬间发布最少字数限制
          value: 6
          help: 如果不限制，请输入-1
        - $formkit: attachment
          name: banner
          label: 瞬间分享背景
          value: /themes/theme-pix/assets/img/banner.jpg
        - $formkit: attachmentPolicySelect
          name: attachmentPolicy
          label: 附件存储策略
          help: 瞬间图片上传功能必填项
          value: ""
          validation: required
        - $formkit: attachmentGroupSelect
          name: attachmentGroup
          label: 附件分组
          value: ""
          validation: required
        - $formkit: text
          name: gaode_key
          label: 高德开放平台应用KEY
          value:
          help: "https://console.amap.com/"



    - group: sidebar
      label: 侧边栏
      formSchema:
        - $formkit: repeater
          name: sidebar_left
          id: sidebar_left
          label: 左侧小工具栏
          children:
            - $formkit: select
              name: widget
              id: widget
              key: widget
              label: "小工具"
              options:
                - value: "user_widget"
                  label: 博主社交信息
                - value: "adinfo_widget"
                  label: 博主基础信息
                - value: "posts_show_widget"
                  label: 文章展示
                - value: "hot_cat"
                  label: 专题推荐
                - value: "tag_cloud"
                  label: 标签
                - value: "cst_widget_comment"
                  label: 最新评论
                - value: "pix_widget_tongji"
                  label: 站点统计
                - value: "pix_widget_yiyan"
                  label: 一言
                - value: "custom_html"
                  label: 自定义
            - $formkit: group
              name: custom_html
              if: $value.widget == 'custom_html'
              key: custom_html
              label: 自定义内容
              children:
                - $formkit: text
                  name: title
                  label: 标题
                - $formkit: code
                  name: html
                  label: 内容
                  height: 200px
                  help: 支持html语法
                  language: html

        - $formkit: repeater
          name: sidebar_right
          id: sidebar_right
          label: 右侧小工具栏
          children:
            - $formkit: select
              name: widget
              id: widget
              key: widget
              label: "小工具"
              options:
                - value: "user_widget"
                  label: 博主社交信息
                - value: "adinfo_widget"
                  label: 博主基础信息
                - value: "posts_show_widget"
                  label: 文章展示
                - value: "hot_cat"
                  label: 专题推荐
                - value: "tag_cloud"
                  label: 标签
                - value: "cst_widget_comment"
                  label: 最新评论
                - value: "pix_widget_tongji"
                  label: 站点统计
                - value: "pix_widget_yiyan"
                  label: 一言
                - value: "custom_html"
                  label: 自定义
            - $formkit: group
              name: custom_html
              if: $value.widget == 'custom_html'
              key: custom_html
              label: 自定义内容
              children:
                - $formkit: text
                  name: title
                  label: 标题
                - $formkit: code
                  name: html
                  label: 内容
                  height: 200px
                  help: 支持html语法
                  language: html
        - $formkit: group
          name: user_widget
          label: 博主社交信息
          help: 展示博主社交资料
          children:
            - $formkit: text
              name: title
              label: 菜单名称
            - $formkit: repeater
              name: admin_info
              id: admin_info
              label: 博主社交资料
              children:
                - $formkit: text
                  name: ad_title
                  label: 名称
                - $formkit: color
                  name: s_btn_bg
                  label: 按钮背景颜色
                  value: "#2f2f2f"
                - $formkit: text
                  name: ad_icon
                  label: 图标
                  help: 图标和图片二选一
                - $formkit: attachment
                  name: ad_img
                  label: 图标图片
                  help: 建议18x18(px)方形的PNG图像
                - $formkit: radio
                  name: ad_show_type
                  key: ad_show_type
                  id: ad_show_type
                  label: 信息展示方式
                  value: link
                  options:
                    - label: 跳转链接
                      value: link
                    - label: 二维码
                      value: qrcode
                - $formkit: text
                  name: ad_link
                  key: ad_link
                  if: $value.ad_show_type == 'link'
                  label: 自定义链接
                - $formkit: radio
                  if: $value.ad_show_type == 'link'
                  name: ad_open_new
                  key: ad_open_new
                  label: 打开方式
                  value: _blank
                  options:
                    - label: 新窗口
                      value: _blank
                    - label: 当前窗口
                      value: _self
                - $formkit: attachment
                  if: $value.ad_show_type == 'qrcode'
                  name: ad_qrcode
                  key: ad_qrcode
                  label: 二维码
                  help: 建议尺寸不要太大
        - $formkit: group
          name: adinfo_widget
          label: 博主基础信息
          help: 展示博主个人资料
          value:
            title: About Me
          children:
            - $formkit: text
              name: title
              label: 菜单名称
            - $formkit: repeater
              name: base_info
              id: base_info
              label: 博主个人资料
              children:
                - $formkit: text
                  name: ba_title
                  label: 名称
                - $formkit: text
                  name: ba_icon
                  label: 图标
                  help: 图标和图片二选一
                - $formkit: attachment
                  name: ba_img
                  label: 图标图片
                  help: 建议18x18(px)方形的PNG图像
                - $formkit: text
                  name: ba_des
                  label: 描述
                - $formkit: text
                  name: ba_link
                  label: 自定义链接
                  help: 可不填
                - $formkit: radio
                  name: ba_open_new
                  label: 打开方式
                  value: _blank
                  options:
                    - label: 新窗口
                      value: _blank
                    - label: 当前窗口
                      value: _self
        - $formkit: group
          name: posts_show_widget
          label: 文章展示
          help: 展示站点文章
          value:
            title: 热门文章
            posts_number: 6
            show_style: small_img
          children:
            - $formkit: text
              name: title
              label: 标题
            - $formkit: number
              name: posts_number
              label: 文章数量
            - $formkit: select
              name: show_style
              label: 展示形式
              options:
                - label: 无图列表
                  value: no_img
                - label: 小图列表
                  value: small_img
        - $formkit: group
          name: hot_cat
          label: 专题推荐
          help: 展示推荐的分类专题
          value:
            title: 专题推荐
          children:
            - $formkit: text
              name: title
              label: 标题
            - $formkit: categorySelect
              name: widget_cat_select
              label: 自定义分类
              multiple: true
              clearable: true
              searchable: true
              sortable: true
        - $formkit: group
          name: cst_widget_comment
          label: 最新评论
          help: 展示站最新评论
          value:
            title: 最新评论
            number: 5
          children:
            - $formkit: text
              name: title
              label: 标题
            - $formkit: number
              name: number
              label: 评论数量
        - $formkit: group
          name: pix_widget_tongji
          label: 站点统计
          value:
            title: 站点统计
            posts_count: true
            moments_count: true
            tags_count: true
            comments_count: true
            cat_count: true
            site_day: true
            build_date: "2023-11-02"
          children:
            - $formkit: text
              name: title
              label: 标题
            - $formkit: checkbox
              name: posts_count
              label: 文章数
            - $formkit: checkbox
              name: moments_count
              label: 片刻数
            - $formkit: checkbox
              name: tags_count
              label: 标签数
            - $formkit: checkbox
              name: comments_count
              label: 评论数
            - $formkit: checkbox
              name: cat_count
              label: 分类数
            - $formkit: checkbox
              name: site_day
              label: 运行时间
            - $formkit: date
              name: build_date
              label: 建站日期
              validation: required
        - $formkit: group
          name: pix_widget_yiyan
          label: 一言
          value:
            title: 一言
            yiyan_bg: /themes/theme-pix/assets/img/banner.jpg
          children:
            - $formkit: text
              name: title
              label: 标题
            - $formkit: attachment
              name: yiyan_bg
              label: 背景图
            - $formkit: text
              name: api
              label: api地址
              help: 不填默认为内置api

    - group: music
      label: 音乐设置
      formSchema:
        - $formkit: text
          name: pix_mu_api
          label: 音乐API地址
          help: 填写音乐api地址所在域名，例如 https://api.i-meto.com/meting/api 即可，不填则使用默认api
        - $formkit: checkbox
          name: bgm_open
          id: bgm_open
          key: bgm_open
          label: 开启音乐播放器
          value: false
        - $formkit: checkbox
          if: $get(bgm_open).value
          name: lrc_open
          label: 开启右侧音乐歌词
          value: false
        - $formkit: select
          if: $get(bgm_open).value
          name: m_loop
          label: 歌单播放类型
          value: all
          options:
            - label: 循环
              value: all
            - label: 单曲循环播放
              value: one
            - label: 随机播放
              value: none
        - $formkit: select
          if: $get(bgm_open).value
          name: mu_type
          label: 歌曲列表类型
          value: playlist
          options:
            - label: 歌曲列表
              value: playlist
            - label: 专辑列表
              value: album
        - $formkit: select
          if: $get(bgm_open).value
          name: mu_source
          label: 歌曲源
          value: netease
          options:
            - label: 网易云
              value: netease
            - label: QQ音乐
              value: tencent
            - label: 酷狗音乐
              value: kugou
            - label: 酷我音乐
              value: kuwo
        - $formkit: text
          name: play_id
          if: $get(bgm_open).value
          label: 列表ID


    - group: com
      label: 评论设置
      formSchema:
        - $formkit: checkbox
          name: com_close
          label: 关闭所有评论
          value: false
          help: 备案期间可开启
        - $formkit: text
          label: 头像服务镜像地址
          name: providerMirror
          value: "https://cravatar.cn"

    - group: landing_set
      label: 落地页设置
      formSchema:
        - $formkit: select
          name: land_type
          id: land_type
          key: land_type
          label: 落地页风格
          value: card
          options:
            - label: landcard
              value: card
            - label: landsimple
              value: simple
        - $formkit: checkbox
          name: land_dark
          label: 暗黑模式
          value: false
        - $formkit: attachment
          name: land_logo
          label: LOGO或头像
          value: /themes/theme-pix/assets/img/avatar.png
        - $formkit: attachment
          name: land_feature
          label: 封面头图
          value: /themes/theme-pix/assets/img/landimg.jpg
        - $formkit: text
          name: land_title
          label: 标题或名称
          value: 我的博客
        - $formkit: code
          name: land_des
          label: 描述
          height: 100px
          language: html
          value: WELCOME TO MY BLOG 欢迎访问PIXIT , 接下来请享受丝滑的体验.
        - $formkit: text
          name: land_diy
          label: 底部自定义文案
          value: "- Born for design"
        - $formkit: code
          name: land_html
          if: $get(land_type).value == 'simple'
          label: 自定义HTML
          height: 200px
          language: html
          value: css javascript
        - $formkit: repeater
          name: land_btn
          label: 按钮组
          children:
            - $formkit: text
              name: icon
              label: 图标
            - $formkit: text
              name: name
              label: 名称
            - $formkit: text
              name: link
              label: 按钮链接
            - $formkit: radio
              name: open_new
              label: 打开方式
              value: _self
              options:
                - label: 新窗口
                  value: _blank
                - label: 当前窗口
                  value: _self

    - group: login_page
      label: 登录页相关
      formSchema:
        - $formkit: attachment
          name: custom_login_logo
          label: 登录页 Logo
          help: 推荐的像素为：宽度 288px，高度任意。如果不填写，将使用默认的 Halo 标志
          value: /images/wordmark.svg
          validation: required
        - $formkit: "range"
          name: custom_login_logo_size
          id: custom_login_logo_size
          label: 登录页 Logo 大小
          help: "$get(custom_login_logo_size).value + '%'"
          value: 50
          validation: required
        - $formkit: attachment
          name: custom_login_background
          label: 背景图
          value: /themes/theme-pix/assets/img/default-header.png
          accepts:
            - "image/*"

    - group: custom
      label: 扩展设置
      formSchema:
        - $formkit: code
          name: head_html
          label: 头部HTML代码
          height: 200px
          language: html
        - $formkit: code
          name: footer_html
          label: 底部HTML代码
          height: 200px
          language: html
        - $formkit: code
          name: code_css
          label: 自定义CSS
          height: 200px
          language: css
        - $formkit: code
          name: code_js
          label: 自定义Javascript
          height: 200px
          language: javascript
        
