1
0

Refactor application structure and components

- Moved components to a new layout directory for better organization.
- Updated App component to include GroupView and adjust routing.
- Removed unused components (App.jsx, Card.jsx, CardContainer.jsx, Header.jsx, MenuButton.jsx, SideMenu.jsx, ThemeButton.jsx).
- Introduced LoadingIcon component for loading states.
- Updated PollutionMap, SummaryCards, and HistoryCharts components to accept groupId as a prop.
- Modified API endpoint configurations in settings.prod.json for better clarity and consistency.
- Enhanced chart options in historyChartConfig for improved visual representation.
- Updated favicon and logo images.
This commit is contained in:
Jose
2025-05-09 22:47:13 +02:00
parent 02a2a2ce07
commit 0ce48c18e2
18 changed files with 297 additions and 268 deletions

View File

@@ -1,98 +1,77 @@
{
"userConfig": {
"city": [
37.38283,
-5.97317
]
"userConfig": {
"city": [37.38283, -5.97317]
},
"appConfig": {
"endpoints": {
"DATA_URL": "http://localhost:8081/api/raw/v1",
"LOGIC_URL": "http://localhost:8082/api/v1",
"GET_GROUPS": "/groups",
"GET_GROUP_BY_ID": "/groups/:groupId",
"POST_GROUPS": "/groups",
"PUT_GROUP_BY_ID": "/groups/:groupId",
"GET_GROUP_DEVICES": "/groups/:groupId/devices",
"GET_DEVICE_BY_ID": "/groups/:groupId/devices/:deviceId",
"POST_DEVICES": "/groups/:groupId/devices",
"PUT_DEVICE_BY_ID": "/groups/:groupId/devices/:deviceId",
"GET_DEVICE_LATEST_VALUES": "/groups/:groupId/devices/:deviceId/latest-values",
"GET_DEVICE_POLLUTION_MAP": "/groups/:groupId/devices/:deviceId/pollution-map",
"GET_DEVICE_HISTORY": "/groups/:groupId/devices/:deviceId/history",
"GET_DEVICE_SENSORS": "/groups/:groupId/devices/:deviceId/sensors",
"GET_SENSOR_BY_ID": "/groups/:groupId/devices/:deviceId/sensors/:sensorId",
"POST_SENSORS": "/groups/:groupId/devices/:deviceId/sensors",
"PUT_SENSOR_BY_ID": "/groups/:groupId/devices/:deviceId/sensors/:sensorId",
"GET_SENSOR_VALUES": "/groups/:groupId/devices/:deviceId/sensors/:sensorId/values",
"GET_ACTUATORS": "/groups/:groupId/devices/:deviceId/actuators",
"GET_ACTUATOR_BY_ID": "/groups/:groupId/devices/:deviceId/actuators/:actuator_id",
"POST_ACTUATORS": "/groups/:groupId/devices/:deviceId/actuators",
"PUT_ACTUATOR_BY_ID": "/groups/:groupId/devices/:deviceId/actuators/:actuator_id",
"GET_ACTUATOR_STATUS": "/groups/:groupId/devices/:deviceId/actuators/:actuator_id/status",
"VIEW_LATEST_VALUES": "/v_latest_values",
"VIEW_POLLUTION_MAP": "/v_pollution_map",
"VIEW_SENSOR_HISTORY": "/v_sensor_history_by_device",
"VIEW_SENSOR_VALUES": "/v_sensor_values",
"VIEW_CO_BY_DEVICE": "/v_co_by_device",
"VIEW_GPS_BY_DEVICE": "/v_gps_by_device",
"VIEW_WEATHER_BY_DEVICE": "/v_weather_by_device"
},
"appConfig": {
"endpoints": {
"DATA_URL": "https://contaminus.miarma.net/api/raw/v1",
"LOGIC_URL": "https://contaminus.miarma.net/api/v1",
"GET_GROUPS": "/groups",
"GET_GROUP_BY_ID": "/groups/{0}",
"GET_GROUP_DEVICES": "/groups/{0}/devices",
"POST_GROUPS": "/groups",
"PUT_GROUP_BY_ID": "/groups/{0}",
"GET_DEVICES": "/devices",
"GET_DEVICE_BY_ID": "/devices/{0}",
"GET_DEVICE_SENSORS": "/devices/{0}/sensors",
"GET_DEVICE_LATEST_VALUES": "/devices/{0}/latest",
"GET_DEVICE_POLLUTION_MAP": "/devices/{0}/pollution-map",
"GET_DEVICE_HISTORY": "/devices/{0}/history",
"POST_DEVICES": "/devices",
"PUT_DEVICE_BY_ID": "/devices/{0}",
"GET_SENSORS": "/sensors",
"GET_SENSOR_BY_ID": "/sensors/{0}",
"GET_SENSOR_VALUES": "/sensors/{0}/values",
"POST_SENSORS": "/sensors",
"PUT_SENSOR_BY_ID": "/sensors/{0}",
"GET_ACTUATORS": "/actuators",
"GET_ACTUATOR_BY_ID": "/actuators/{0}",
"POST_ACTUATORS": "/actuators",
"PUT_ACTUATOR_BY_ID": "/actuators/{0}",
"GET_GPS_VALUES": "/gps-values",
"GET_GPS_VALUE_BY_ID": "/gps-values/{0}",
"POST_GPS_VALUES": "/gps-values",
"GET_AIR_VALUES": "/air-values",
"GET_AIR_VALUE_BY_ID": "/air-values/{0}",
"POST_AIR_VALUES": "/air-values"
"historyChartConfig": {
"chartOptionsDark": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": { "color": "rgba(255, 255, 255, 0.1)" },
"ticks": { "color": "#E0E0E0" }
},
"y": {
"grid": { "color": "rgba(255, 255, 255, 0.1)" },
"ticks": { "color": "#E0E0E0" }
}
},
"historyChartConfig": {
"chartOptionsDark": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": {
"color": "rgba(255, 255, 255, 0.1)"
},
"ticks": {
"color": "#E0E0E0"
}
},
"y": {
"grid": {
"color": "rgba(255, 255, 255, 0.1)"
},
"ticks": {
"color": "#E0E0E0"
}
}
},
"plugins": {
"legend": {
"display": false
}
}
},
"chartOptionsLight": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": {
"color": "rgba(0, 0, 0, 0.1)"
},
"ticks": {
"color": "#333"
}
},
"y": {
"grid": {
"color": "rgba(0, 0, 0, 0.1)"
},
"ticks": {
"color": "#333"
}
}
},
"plugins": {
"legend": {
"display": false
}
}
}
}
"plugins": { "legend": { "display": false } }
},
"chartOptionsLight": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": { "color": "rgba(0, 0, 0, 0.1)" },
"ticks": { "color": "#333" }
},
"y": {
"grid": { "color": "rgba(0, 0, 0, 0.1)" },
"ticks": { "color": "#333" }
}
},
"plugins": { "legend": { "display": false } }
}
}
}
}
}

View File

@@ -1,98 +1,77 @@
{
"userConfig": {
"city": [
37.38283,
-5.97317
]
"userConfig": {
"city": [37.38283, -5.97317]
},
"appConfig": {
"endpoints": {
"DATA_URL": "https://contaminus.miarma.net/api/raw/v1",
"LOGIC_URL": "https://contaminus.miarma.net/api/v1",
"GET_GROUPS": "/groups",
"GET_GROUP_BY_ID": "/groups/:groupId",
"POST_GROUPS": "/groups",
"PUT_GROUP_BY_ID": "/groups/:groupId",
"GET_GROUP_DEVICES": "/groups/:groupId/devices",
"GET_DEVICE_BY_ID": "/groups/:groupId/devices/:deviceId",
"POST_DEVICES": "/groups/:groupId/devices",
"PUT_DEVICE_BY_ID": "/groups/:groupId/devices/:deviceId",
"GET_DEVICE_LATEST_VALUES": "/groups/:groupId/devices/:deviceId/latest-values",
"GET_DEVICE_POLLUTION_MAP": "/groups/:groupId/devices/:deviceId/pollution-map",
"GET_DEVICE_HISTORY": "/groups/:groupId/devices/:deviceId/history",
"GET_DEVICE_SENSORS": "/groups/:groupId/devices/:deviceId/sensors",
"GET_SENSOR_BY_ID": "/groups/:groupId/devices/:deviceId/sensors/:sensorId",
"POST_SENSORS": "/groups/:groupId/devices/:deviceId/sensors",
"PUT_SENSOR_BY_ID": "/groups/:groupId/devices/:deviceId/sensors/:sensorId",
"GET_SENSOR_VALUES": "/groups/:groupId/devices/:deviceId/sensors/:sensorId/values",
"GET_ACTUATORS": "/groups/:groupId/devices/:deviceId/actuators",
"GET_ACTUATOR_BY_ID": "/groups/:groupId/devices/:deviceId/actuators/:actuator_id",
"POST_ACTUATORS": "/groups/:groupId/devices/:deviceId/actuators",
"PUT_ACTUATOR_BY_ID": "/groups/:groupId/devices/:deviceId/actuators/:actuator_id",
"GET_ACTUATOR_STATUS": "/groups/:groupId/devices/:deviceId/actuators/:actuator_id/status",
"VIEW_LATEST_VALUES": "/v_latest_values",
"VIEW_POLLUTION_MAP": "/v_pollution_map",
"VIEW_SENSOR_HISTORY": "/v_sensor_history_by_device",
"VIEW_SENSOR_VALUES": "/v_sensor_values",
"VIEW_CO_BY_DEVICE": "/v_co_by_device",
"VIEW_GPS_BY_DEVICE": "/v_gps_by_device",
"VIEW_WEATHER_BY_DEVICE": "/v_weather_by_device"
},
"appConfig": {
"endpoints": {
"DATA_URL": "https://contaminus.miarma.net/api/raw/v1",
"LOGIC_URL": "https://contaminus.miarma.net/api/v1",
"GET_GROUPS": "/groups",
"GET_GROUP_BY_ID": "/groups/{0}",
"GET_GROUP_DEVICES": "/groups/{0}/devices",
"POST_GROUPS": "/groups",
"PUT_GROUP_BY_ID": "/groups/{0}",
"GET_DEVICES": "/devices",
"GET_DEVICE_BY_ID": "/devices/{0}",
"GET_DEVICE_SENSORS": "/devices/{0}/sensors",
"GET_DEVICE_LATEST_VALUES": "/devices/{0}/latest",
"GET_DEVICE_POLLUTION_MAP": "/devices/{0}/pollution-map",
"GET_DEVICE_HISTORY": "/devices/{0}/history",
"POST_DEVICES": "/devices",
"PUT_DEVICE_BY_ID": "/devices/{0}",
"GET_SENSORS": "/sensors",
"GET_SENSOR_BY_ID": "/sensors/{0}",
"GET_SENSOR_VALUES": "/sensors/{0}/values",
"POST_SENSORS": "/sensors",
"PUT_SENSOR_BY_ID": "/sensors/{0}",
"GET_ACTUATORS": "/actuators",
"GET_ACTUATOR_BY_ID": "/actuators/{0}",
"POST_ACTUATORS": "/actuators",
"PUT_ACTUATOR_BY_ID": "/actuators/{0}",
"GET_GPS_VALUES": "/gps-values",
"GET_GPS_VALUE_BY_ID": "/gps-values/{0}",
"POST_GPS_VALUES": "/gps-values",
"GET_AIR_VALUES": "/air-values",
"GET_AIR_VALUE_BY_ID": "/air-values/{0}",
"POST_AIR_VALUES": "/air-values"
"historyChartConfig": {
"chartOptionsDark": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": { "color": "rgba(255, 255, 255, 0.1)" },
"ticks": { "color": "#E0E0E0" }
},
"y": {
"grid": { "color": "rgba(255, 255, 255, 0.1)" },
"ticks": { "color": "#E0E0E0" }
}
},
"historyChartConfig": {
"chartOptionsDark": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": {
"color": "rgba(255, 255, 255, 0.1)"
},
"ticks": {
"color": "#E0E0E0"
}
},
"y": {
"grid": {
"color": "rgba(255, 255, 255, 0.1)"
},
"ticks": {
"color": "#E0E0E0"
}
}
},
"plugins": {
"legend": {
"display": false
}
}
},
"chartOptionsLight": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": {
"color": "rgba(0, 0, 0, 0.1)"
},
"ticks": {
"color": "#333"
}
},
"y": {
"grid": {
"color": "rgba(0, 0, 0, 0.1)"
},
"ticks": {
"color": "#333"
}
}
},
"plugins": {
"legend": {
"display": false
}
}
}
}
"plugins": { "legend": { "display": false } }
},
"chartOptionsLight": {
"responsive": true,
"maintainAspectRatio": false,
"scales": {
"x": {
"grid": { "color": "rgba(0, 0, 0, 0.1)" },
"ticks": { "color": "#333" }
},
"y": {
"grid": { "color": "rgba(0, 0, 0, 0.1)" },
"ticks": { "color": "#333" }
}
},
"plugins": { "legend": { "display": false } }
}
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 KiB

After

Width:  |  Height:  |  Size: 126 KiB