update
This commit is contained in:
@@ -21,13 +21,11 @@
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Edit"
|
||||
Color="Color.Primary"
|
||||
Size="Size.Small"
|
||||
OnClick="@(() => EditNodeAsync(node))"
|
||||
StopPropagation />
|
||||
OnClick="@(() => EditNodeAsync(node))" />
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
Color="Color.Error"
|
||||
Size="Size.Small"
|
||||
OnClick="@(() => RemoveNodeAsync(node))"
|
||||
StopPropagation />
|
||||
OnClick="@(() => RemoveNodeAsync(node))" />
|
||||
</div>
|
||||
</div>
|
||||
</TitleContent>
|
||||
@@ -78,22 +76,22 @@
|
||||
Label="Y" />
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12">
|
||||
@* <MudItem xs="12">
|
||||
<MudTextField Value="@node.NodePosition.MapId"
|
||||
ValueChanged="@((string v) => SetValue(() => node.NodePosition.MapId = v))"
|
||||
Immediate="true"
|
||||
Label="Map ID" />
|
||||
</MudItem>
|
||||
</MudItem> *@
|
||||
|
||||
<MudItem xs="6">
|
||||
@* <MudItem xs="6">
|
||||
<MudNumericField T="double"
|
||||
Value="@node.NodePosition.Theta"
|
||||
ValueChanged="@((double v) => SetValue(() => node.NodePosition.Theta = v))"
|
||||
Immediate="true"
|
||||
Label="Theta (rad)" />
|
||||
</MudItem>
|
||||
</MudItem> *@
|
||||
|
||||
<MudItem xs="6">
|
||||
@* <MudItem xs="6">
|
||||
<MudNumericField T="double"
|
||||
Value="@node.NodePosition.AllowedDeviationXY"
|
||||
ValueChanged="@((double v) => SetValue(() => node.NodePosition.AllowedDeviationXY = v))"
|
||||
@@ -107,7 +105,7 @@
|
||||
ValueChanged="@((double v) => SetValue(() => node.NodePosition.AllowedDeviationTheta = v))"
|
||||
Immediate="true"
|
||||
Label="Allowed Dev Theta" />
|
||||
</MudItem>
|
||||
</MudItem> *@
|
||||
|
||||
<!-- Actions -->
|
||||
<MudItem xs="12">
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
});
|
||||
}
|
||||
private async Task OpenImportDialog()
|
||||
@@ -220,7 +220,12 @@
|
||||
|
||||
try
|
||||
{
|
||||
var orderMsg = JsonSerializer.Deserialize<OrderMsg>(OrderJson);
|
||||
var orderMsg = JsonSerializer.Deserialize<OrderMsg>(OrderJson,
|
||||
new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
});
|
||||
if (orderMsg is null)
|
||||
{
|
||||
Snackbar.Add("Unable to convert JSON to Order", Severity.Warning);
|
||||
@@ -251,20 +256,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
var response = await Http.PostAsJsonAsync(
|
||||
"/api/order",
|
||||
JsonSerializer.Deserialize<OrderMsg>(OrderJson)
|
||||
);
|
||||
var response = await Http.PostAsJsonAsync("/api/order",orderMsg);
|
||||
|
||||
sendSuccess = response.IsSuccessStatusCode;
|
||||
|
||||
}
|
||||
catch(JsonException jsonEx)
|
||||
{
|
||||
Snackbar.Add($"Json to Order failed: {jsonEx.Message}", Severity.Warning);
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"Send Order failed: {ex.Message}", Severity.Warning);
|
||||
sendSuccess = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user