{ "id": "3_recent_orders_table", "title": "รายการสั่งซื้อล่าสุด", "type": "table", "refreshInterval": 60000, "dataSource": { "type": "db", "connection": { "host": "localhost", "dbname": "my_dashboard_db", "user": "root", "password": "" }, "query": "SELECT order_id, customer_username, order_date, total_amount, status FROM orders ORDER BY order_id DESC" }, "displayOptions": { "pagination": { "enabled": true, "limit": 5 }, "columns": [ { "dataKey": "order_id", "displayName": "ID", "visible": true }, { "dataKey": "customer_username", "displayName": "ลูกค้า", "visible": true }, { "dataKey": "total_amount", "displayName": "ยอดรวม", "visible": true }, { "dataKey": "status", "displayName": "สถานะ", "visible": true } ], "conditionalFormatting": [ { "column": "status", "operator": "===", "value": "Completed", "applyTo": "row", "class": "row-success" }, { "column": "status", "operator": "===", "value": "Processing", "applyTo": "row", "class": "row-warning" }, { "column": "status", "operator": "===", "value": "Shipped", "applyTo": "row", "class": "row-info" }, { "column": "status", "operator": "===", "value": "Cancelled", "applyTo": "row", "class": "row-danger" } ] } }