Skip to content

Latest commit

 

History

History
39 lines (33 loc) · 1.27 KB

README.md

File metadata and controls

39 lines (33 loc) · 1.27 KB

CockpitSpecificationsField

Addon to agentejo/Cockpit with a field type that contains specifications using specifications templates.

Specifications are stored using ids referencing the specifications templates collection for keys and they are substituted for strings when fetched by the API.

Specifications will be transformed into an array of key-value pairs when fetched by the API, ie.

{
    ...
    "specifications": [
        {
            "name": "Width",
            "value": "128 mm"
        }, {
            "name": "Length",
            "value": "2200 mm"
        }
     ],
    ...
}

Specification values are trimmed and keys containing empty values won't exist.

Requirements

Installation

Clone this repo into addon/CockpitSpecificationsField in your cockpit root directory.

Options

template_collection (required) The name of the collection to use for specifications templates.

Example options:

{
    "template_collection": "specifications_templates"
}