Prototype of the first automation stull ugly
This commit is contained in:
@@ -267,6 +267,48 @@
|
||||
"legendFormat": "{{type}} {{direction}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"title": "Machine State (Relay)",
|
||||
"type": "stat",
|
||||
"gridPos": { "h": 8, "w": 6, "x": 18, "y": 8 },
|
||||
"datasource": { "type": "prometheus", "uid": "${datasource}" },
|
||||
"options": {
|
||||
"colorMode": "background",
|
||||
"graphMode": "none",
|
||||
"justifyMode": "auto"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"mappings": [
|
||||
{
|
||||
"options": { "0": { "color": "green", "index": 0, "text": "RUNNING" } },
|
||||
"type": "value"
|
||||
},
|
||||
{
|
||||
"options": { "1": { "color": "red", "index": 1, "text": "STOPPED" } },
|
||||
"type": "value"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"expr": "sensor_aggregate{type=\"relay\", stat=\"max\"}",
|
||||
"refId": "A"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"title": "Manual Control",
|
||||
"type": "text",
|
||||
"gridPos": { "h": 8, "w": 6, "x": 18, "y": 16 },
|
||||
"options": {
|
||||
"mode": "html",
|
||||
"content": "<div style=\"text-align: center; margin-top: 20px;\">\n <button onclick=\"fetch('http://localhost:9002/trigger', {method: 'POST'})\" style=\"padding: 15px 30px; font-size: 20px; background: #e24d42; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; width: 100%;\">\n 🚨 TRIGGER PRESENCE\n </button>\n</div>"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user