mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-06-21 04:35:07 -04:00
Bunch more new UI
This commit is contained in:
@@ -6,7 +6,9 @@ import WeatherUpdate from '@/models/weather/weather-update';
|
||||
import WeatherRecent from '@/models/weather/weather-recent';
|
||||
import WeatherValueType from '@/models/weather/weather-value-type';
|
||||
import WeatherValueGrouped from '@/models/weather/weather-value-grouped';
|
||||
import { WeatherAggregates } from '@/models/weather/weather-aggregates';
|
||||
import WeatherHistoryGrouped from '@/models/weather/weather-history-grouped';
|
||||
import WindHistoryGrouped from '@/models/weather/wind-history-grouped';
|
||||
import WeatherAggregates from '@/models/weather/weather-aggregates';
|
||||
|
||||
export const useWeatherStore = defineStore('weather', {
|
||||
state: () => {
|
||||
@@ -43,18 +45,11 @@ export const useWeatherStore = defineStore('weather', {
|
||||
this._connection = null;
|
||||
},
|
||||
async getLatest(): Promise<WeatherRecent> {
|
||||
const response = await axios.get<WeatherRecent>(
|
||||
Environment.getUrlPrefix() + `/api/weather/readings/recent`
|
||||
);
|
||||
const response = await axios.get<WeatherRecent>(Environment.getUrlPrefix() + `/api/weather/readings/recent`);
|
||||
|
||||
return response.data;
|
||||
},
|
||||
async getReadingValueHistoryGrouped(
|
||||
valueType: WeatherValueType,
|
||||
start: Date,
|
||||
end: Date,
|
||||
bucketMinutes: number
|
||||
): Promise<WeatherValueGrouped[]> {
|
||||
async getReadingValueHistoryGrouped(valueType: WeatherValueType, start: Date, end: Date, bucketMinutes: number): Promise<WeatherValueGrouped[]> {
|
||||
const startString = start.toISOString();
|
||||
const endString = end.toISOString();
|
||||
|
||||
@@ -65,16 +60,32 @@ export const useWeatherStore = defineStore('weather', {
|
||||
|
||||
return response.data;
|
||||
},
|
||||
async getReadingAggregate(
|
||||
start: Date,
|
||||
end: Date
|
||||
): Promise<WeatherAggregates | undefined> {
|
||||
async getReadingAggregate(start: Date, end: Date): Promise<WeatherAggregates | undefined> {
|
||||
const startString = start.toISOString();
|
||||
const endString = end.toISOString();
|
||||
|
||||
const response = await axios.get<WeatherAggregates>(
|
||||
Environment.getUrlPrefix() +
|
||||
`/api/weather/readings/aggregate?start=${startString}&end=${endString}`
|
||||
Environment.getUrlPrefix() + `/api/weather/readings/aggregate?start=${startString}&end=${endString}`
|
||||
);
|
||||
|
||||
return response.data;
|
||||
},
|
||||
async getReadingHistoryGrouped(start: Date, end: Date, bucketMinutes: number): Promise<WeatherHistoryGrouped[]> {
|
||||
const startString = start.toISOString();
|
||||
const endString = end.toISOString();
|
||||
|
||||
const response = await axios.get<WeatherHistoryGrouped[]>(
|
||||
Environment.getUrlPrefix() + `/api/weather/readings/history-grouped?start=${startString}&end=${endString}&bucketMinutes=${bucketMinutes}`
|
||||
);
|
||||
|
||||
return response.data;
|
||||
},
|
||||
async getWindHistoryGrouped(start: Date, end: Date, bucketMinutes: number): Promise<WindHistoryGrouped[]> {
|
||||
const startString = start.toISOString();
|
||||
const endString = end.toISOString();
|
||||
|
||||
const response = await axios.get<WindHistoryGrouped[]>(
|
||||
Environment.getUrlPrefix() + `/api/weather/readings/wind-history-grouped?start=${startString}&end=${endString}&bucketMinutes=${bucketMinutes}`
|
||||
);
|
||||
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user