Cotton code
355 lines · 7.0 KB · JSONRaw
{  "id": "machine",  "name": "Machine",  "plural": "Machines",  "picture": "tool-devices",  "builtin": false,  "visibility": "owner",  "engine": null,  "columns": [    {      "key": "name",      "name": "Name",      "type": "text",      "required": true,      "readonly": true,      "placeholder": "The Mac's name"    },    {      "key": "chip",      "name": "Chip",      "type": "text",      "readonly": true    },    {      "key": "model",      "name": "Model",      "type": "text",      "placeholder": "Mac mini"    },    {      "key": "memory",      "name": "Memory",      "type": "text",      "readonly": true,      "placeholder": "10 of 24 GB free"    },    {      "key": "disk",      "name": "Disk",      "type": "text",      "readonly": true,      "placeholder": "69 of 460 GB free"    },    {      "key": "load",      "name": "Load",      "type": "text",      "readonly": true,      "placeholder": "6.3 on 12 cores"    },    {      "key": "load_1",      "name": "Load, 1 min",      "type": "number",      "readonly": true    },    {      "key": "capabilities",      "name": "Releases",      "type": "text",      "readonly": true,      "placeholder": "builder, signer"    },    {      "key": "sessions",      "name": "Coding sessions",      "type": "number",      "readonly": true    },    {      "key": "cpu_count",      "name": "Cores",      "type": "number",      "readonly": true    },    {      "key": "mem_total_gb",      "name": "Memory, GB",      "type": "number",      "readonly": true    },    {      "key": "mem_free_gb",      "name": "Memory free, GB",      "type": "number",      "readonly": true    },    {      "key": "mem_used_gb",      "name": "Memory used (GB)",      "type": "number"    },    {      "key": "disk_total_gb",      "name": "Disk, GB",      "type": "number",      "readonly": true    },    {      "key": "disk_free_gb",      "name": "Disk free, GB",      "type": "number",      "readonly": true    },    {      "key": "disk_used_gb",      "name": "Disk used (GB)",      "type": "number"    },    {      "key": "os_version",      "name": "macOS",      "type": "text",      "readonly": true    },    {      "key": "app_version",      "name": "Cotton",      "type": "text",      "readonly": true    },    {      "key": "sampled_at",      "name": "Sampled",      "type": "date",      "readonly": true,      "format": "ago"    },    {      "key": "notes",      "name": "Notes",      "type": "longtext",      "markdown": true    },    {      "key": "definition_job",      "name": "Job",      "type": "choice",      "choices": [        "ship-definitions"      ],      "labels": {        "ship-definitions": "Definition shipping"      }    },    {      "key": "definition_job_at",      "name": "Last run",      "type": "date",      "format": "ago"    },    {      "key": "definition_job_result",      "name": "Result",      "type": "choice",      "choices": [        "shipped",        "no_changes",        "held",        "refused"      ],      "labels": {        "shipped": "Shipped",        "no_changes": "Nothing changed",        "held": "Held",        "refused": "Refused"      }    },    {      "key": "definition_job_reason",      "name": "Reason",      "type": "choice",      "choices": [        "landed",        "equal_product",        "later_main_change",        "scan_refused",        "job_failed"      ],      "labels": {        "landed": "Refinements landed",        "equal_product": "Product already equal",        "later_main_change": "Main changed after this build",        "scan_refused": "Owner data scan refused",        "job_failed": "Job failed"      }    },    {      "key": "definition_job_count",      "name": "Definitions",      "type": "number"    },    {      "key": "definition_job_commit",      "name": "Commit",      "type": "text"    },    {      "key": "installed_at",      "name": "Installed",      "type": "date",      "format": "ago"    }  ],  "title": "name",  "date": null,  "project": null,  "order": null,  "slip": {    "title": "name",    "subtitle": [      "memory",      "disk",      "sampled_at"    ],    "trailing": "load",    "photo": null,    "toggle": null  },  "tile": {    "face": "slip-list"  },  "page": [    {      "heading": null,      "columns": [        "name",        "chip",        "os_version",        "app_version"      ]    },    {      "heading": "Right now",      "columns": [        "capabilities",        "memory",        "disk",        "load",        "sessions",        "sampled_at",        "mem_used_gb",        "disk_used_gb"      ]    },    {      "heading": "Capacity",      "columns": [        "cpu_count",        "mem_total_gb",        "mem_free_gb",        "disk_total_gb",        "disk_free_gb",        "load_1"      ]    },    {      "heading": "Notes",      "columns": [        "notes"      ]    },    {      "heading": "Definition shipping",      "columns": [        "definition_job",        "definition_job_at",        "definition_job_result",        "definition_job_reason",        "definition_job_count",        "definition_job_commit"      ]    },    {      "heading": "CottonDB",      "columns": [        "installed_at"      ]    },    {      "heading": "System",      "columns": [        "model"      ]    }  ],  "sort": {    "column": "name"  },  "empty": {    "title": "No machines yet",    "message": "Each Mac writes its own row every few minutes."  },  "create": {    "label": "Add a machine"  },  "instructions": "One row per Mac in the household, kept by the sessions running on it: memory and disk are human lines (\"10 of 24 GB free\"), the numeric columns carry the same readings for sorting, load is the one-minute load average against the cores (\"6.3 on 12 cores\"), load_1 the bare number, sessions the coding sessions running, sampled_at when the row was last written. Update a Mac's row in place; never make a second row for the same name.",  "card": {    "face": "machine",    "fields": [      {        "slot": "title",        "column": "name"      },      {        "slot": "subtitle",        "column": "chip"      },      {        "slot": "memory_dial",        "column": "mem_used_gb",        "also": [          "mem_total_gb"        ]      },      {        "slot": "disk_dial",        "column": "disk_used_gb",        "also": [          "disk_total_gb"        ]      },      {        "slot": "load_dial",        "column": "load_1",        "also": [          "cpu_count"        ]      },      {        "slot": "facts",        "column": "chip",        "also": [          "memory",          "disk",          "load",          "sessions"        ]      },      {        "slot": "body",        "column": "os_version"      },      {        "slot": "model",        "column": "model"      },      {        "slot": "date",        "column": "sampled_at",        "form": "ago"      }    ]  }}