Bouton Actualiser

This commit is contained in:
Friend2868
2023-06-07 08:50:47 +02:00
parent 1028cbfb40
commit 14fa374bb7
5 changed files with 10 additions and 10 deletions
@@ -127,7 +127,7 @@
</Row>
<Row Padding="Padding.Is3">
<Column>
<Button Color="Color.Primary" Style="border-radius: 0px" Clicked="@(async () => await HandleRedraw())">Aktualisieren</Button>
<Button Color="Color.Primary" Style="border-radius: 0px" Clicked="@(async () => await HandleRedraw())">Bouton Actualiser</Button>
<LineChart Height="Height.Is100" Width="Width.Is100" @ref="lineChart" TItem="double" />
</Column>
</Row>
@@ -64,9 +64,9 @@ public partial class Dashboard
double energyPrice = MainDatabaseContext.EnergyPriceChanges.OrderByDescending(e =>e.DateTime).FirstOrDefault()?.EnergyPrice ?? 0;
PrometheusDataWrapper? deviceData = (await promQueryer.Query($$"""sum(power{sensor=~"{{plugnames}}"})[1h:1m]"""))?.Data;
PrometheusDataWrapper? priceData = (await promQueryer.Query($$"""sum(sum_over_time(power{sensor=~"{{plugnames}}"}[1y])*{{energyPrice}})"""))?.Data;
//PrometheusDataWrapper? priceData = (await promQueryer.Query($$"""sum(sum_over_time(power{sensor=~"{{plugnames}}"}[1y])*{{energyPrice}})"""))?.Data;
Console.WriteLine(priceData.VectorTypeToTimestampFloatTuple());
//Console.WriteLine(priceData.VectorTypeToTimestampFloatTuple());
var r = new Random(DateTime.Now.Millisecond);
@@ -92,7 +92,7 @@
Here you can change the name of your plug
</Paragraph>
</FieldLabel>
<TextEdit MaxLength="30" @bind-Text="@DeviceCopy.Name" Placeholder="Enter Name" />
<TextEdit MaxLength="20" @bind-Text="@DeviceCopy.Name" Placeholder="Enter Name" />
</Field>
<br />
<br />
@@ -171,8 +171,8 @@
{
if (hideButtonSettings)
{
MainDatabaseContext.EnergyPriceChanges.Add(new EnergyPriceChange(electricityPrice));
MainDatabaseContext.ChangeTracker.Clear();
MainDatabaseContext.EnergyPriceChanges.Add(new EnergyPriceChange(electricityPrice));
await MainDatabaseContext.SaveChangesAsync();
}
else if(DeviceCopy is not null && SelectedDevice is not null)
@@ -27,8 +27,8 @@ public class UpdateService : IUpdateService
}
}
public DateTime FirstExecutionTime { get; } = DateTime.Now.AddSeconds(15);
public TimeSpan ExecutionRepeatDelay { get; } = TimeSpan.FromSeconds(15);
public DateTime FirstExecutionTime { get; } = DateTime.Now.AddSeconds(10);
public TimeSpan ExecutionRepeatDelay { get; } = TimeSpan.FromSeconds(1);
public async void Update()
{
@@ -1,6 +1,6 @@
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_interval: 1s
evaluation_interval: 1s
rule_files:
# - "first.rules"