【问题标题】:How to apply 'out of the box' Cumulocity Widgets (such as 'Radial Gauge') in custom Cumulocity applications如何在自定义 Cumulocity 应用程序中应用“开箱即用”的 Cumulocity 小部件(例如“径向计”)
【发布时间】:2018-05-22 15:32:23
【问题描述】:

所以我一直在尝试在 Cumulocity 中制作一个定制的应用程序。但是,我想保持驾驶舱和我的自定义应用程序的一致性,所以我只是想知道有没有办法将“开箱即用”小部件应用到我们自己的应用程序中?

谢谢

【问题讨论】:

    标签: cumulocity


    【解决方案1】:

    您可以通过应用程序中的清单文件 (cumulocity.json) 来实现。只需列出您想要包含在自定义应用程序中的插件即可。

    {
      "availability": "MARKET",
      "contextPath": "charts",
      "key": "charts-app-key",
      "name": "Charts",
      "resourcesUrl": "/",
      "type": "HOSTED",
      "imports": [
        "core/c8yBranding",
        "charts/dygraphsHour",
        "charts/dygraphsTenMin",
        "administration/alarmMapping"
      ]
    }
    

    您可以使用 CLI 工具列出默认应用程序的所有导入。

    c8y util:showimports cockpit
    

    如果您想拥有完整的驾驶舱应用程序并且只添加插件,那么使用目标文件可能会更容易:

    {
        "name": "Training",
        "comment": "Release with additional example plugins",
        "applications": [
            {
                "contextPath": "cockpit",
                "addImports": [ "charts/dygraphsHour", "core/c8yBranding"]
            }
        ]
    }
    

    这将使用完整的驾驶舱并仅添加列出的 wo 插件。它将用您的扩展驾驶舱替换您的默认驾驶舱。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-05
      • 1970-01-01
      • 2016-10-16
      • 2018-10-27
      相关资源
      最近更新 更多