组件展示架构

*状态:*正在积极开发中。

*可用性:*在 StackPacks 2.0 功能标志后面。请参阅 自定义集成概述 以了解如何启用该功能。

本文件描述了当前的设计意图以及高层次的配置界面。

注意:尚未实现任何行为和功能。

由于该功能正在积极开发中;随着模型的发展,行为、架构和功能可能会发生变化。

概述

此页面记录了 UI 展示模型使用的配置架构。 它旨在作为定义 UI 展示行为的作者的参考。

此处描述的所有架构都是 StackPacks 2.0 的一部分,并且正在积极开发中。

ComponentPresentation 填充的 UI 页面

请查看以下屏幕截图,以了解 ComponentPresentation 配置涉及的各个页面和 UI 元素。

组件类型概述页面

在下面的架构参考中,请查看 overview 部分。

概述页面

组件高亮页面

在下面的架构参考中,请查看 highlight 部分。

高亮页面

ComponentPresentation

ComponentPresentation 定义了在给定模式和上下文中如何在 UI 中展示匹配的组件。

_type: ComponentPresentation
identifier: urn:...:component-presentation:<presentation-name>
mode: ["observability" | "security" | "all"]

binding:
  _type: ComponentPresentationQueryBinding
  query: string                       # Primitive STQL query used to match components

rank:
  specificity: number                 # Higher values indicate more specific definitions

presentation:
  icon: string                        # Optional icon (base64-encoded)
  name:                               # Optional naming configuration
    plural: string
    singular: string
    title: string

  mainMenu:                           # Optional main menu entry
    group: string                     # Name of an existing MainMenuGroup
    rank: number                      # Optional override within the group

  overview:                           # Optional overview page configuration
    columns:
      - _type: string                 # ViewTypeTableCol*

  highlight:                          # Optional highlight page configuration
    summary:
      ...
    fields:
      - _type: string                 # ComponentTypeField
        fieldId: string
        label:
          title: string
          helpBubbleText: string      # Optional
        valueExtractor:
          _type: string
        display:
          _type: string
    about:
      _type: ComponentTypeAbout
      fields:
        - string

  filter:                             # Optional overview filters
    - _type: FilterField
      name: string
      tagField: string

标识符

标识符应遵循 SUSE® Observability 标识符(即 urn:…​)格式。有关更多信息,请参阅 标识符 文档。

绑定

绑定决定了 ComponentPresentation 适用于哪些组件。

绑定会根据组件数据进行评估,必须简单高效,因为它们在 UI 评估期间使用。

当前支持的 binding 类型:

  • ComponentPresentationQueryBinding:一个STQL查询(有关更多信息,请参阅STQL

等级

rank 部分控制如何组合多个匹配的 ComponentPresentation 定义。

更高的特异性值表示更专业的定义,并在组合展示行为时优先于较低的值。

展示部分

presentation`下的所有字段都是可选的。一个 `ComponentPresentation 可以仅定义展示方面的子集。

当多个定义适用于同一组件时,会组合展示部分。

图标和名称

定义在 UI 中使用的图标和名称。

主菜单

控制匹配组件是否出现在主菜单中。

引用的菜单组必须使用 MainMenuGroup 单独定义。

概述

定义在概览表中显示的列。

列可以覆盖或扩展其他匹配展示定义的列。

高亮显示

定义在高亮页面上显示的字段和部分。

总结

字段

关于

定义在组件高亮页面的关于面板中显示的字段。

过滤器

定义在概览页面中显示的过滤器。

当绑定组件存在匹配数据时,将显示过滤器。