Cockpit
Docs
Extending Cockpit
- https://discourse.getcockpit.com/t/how-to-create-a-addon/345/6
- https://github.com/raffaelj/cockpit-scripts
- https://github.com/raffaelj
- GitHub - pauloamgomes/CockpitCMS-Helpers: Cockpit CMS Addon with a set of useful helpers (that alone don't justify a new Addon).
API
Custom Endpoints
- https://discourse.getcockpit.com/t/how-to-create-custom-api-endpoints/202/5
- https://discourse.getcockpit.com/t/how-to-filter-fields-on-api-response/1312
MySQL
- https://github.com/piotr-cz/cockpit-sql-driver
- https://discourse.getcockpit.com/t/new-addon-sql-driver-for-cockpit/1029
Field Types
Conditional Fields
... don't exist, but there is an experimental setting: https://discourse.getcockpit.com/t/conditionally-show-field-based-on-another-field/859/4
in the field options you can define a
@visibility
property, e.g:
"@visibility": "$.external_link === true"
This feature is experimental, that’s why it isn’t documented anywhere. But feel free to try it out.
Repeater Field
💡 add options
field for type set https://discourse.getcockpit.com/t/fieldtype-set-in-repeater-field/362/2
{
"fields": [
{
"type": "set",
"label": "Set",
"options": {
"fields": [
{
"label": "Druck",
"name": "druck",
"type": "text"
},
{
"label": "Temperatur",
"name": "temperature",
"type": "text"
}
]
}
},
{
"type": "html",
"label": "Html Code"
}
]
}
Set
Provides a field group.
Key Value Store
{
"fields": [
{
"name": "Pressure",
"type": "text"
},
{
"name": "Temperature",
"type": "text"
}
]
}
Layout
Gutenberg-like Block Editor
https://discourse.getcockpit.com/t/layout-field-type/303
Create Layout Components with https://github.com/agentejo/LayoutComponents
Add Column
Key-Value (Custom Tag)
https://github.com/raffaelj/cockpit-scripts/blob/master/custom-fields/field-key-value-pair.md
{
"prefix": "og:", // (string), default: ""
"format": "array", // (string) "array|object", default: "object"
"limit": 5, // (int), default: 0 (unlimited)
"sortable": true, // (bool), default: false
"safeDelete": true, // (bool), default: false
"defaultKeys" : ['title', 'description'], // (array), default: []
"displayPrefix" : "og:" // (string), default: ""
}
💡 Based on this tag it should be possible to create a version of Wordpress custom fields.
I need something with typeahead and pre-populated fragments based on a collection.
See also: https://github.com/agentejo/cockpit/issues/1308