Fixed issue where backend sent wrong data format

This commit is contained in:
Malachy Byrne 2023-05-06 21:47:50 +01:00
parent 06c4acf4fb
commit 797c74b03c
Signed by: malmal200
GPG Key ID: EC21443030A655D9

View File

@ -72,27 +72,33 @@
</div>
<div class="card-body">
<div class="form-group">
<label for="key2">Key</label>
<label for="key2">Host</label>
<input type="text" class="form-control" name="vol_key" @bind="Key2" />
</div>
<div class="form-group">
<label for="value2">Value</label>
<label for="value2">Local</label>
<input type="text" class="form-control" name="vol_val" @bind="Value2" />
</div>
<div class="form-group">
<label for="value3">Tag</label>
<input type="text" class="form-control" name="vol_tag" @bind="Tag" />
</div>
<button class="btn btn-primary" @onclick="AddKeyValuePair2">Add</button>
<table class="table mt-2" name="vol_table">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>Host</th>
<th>Local</th>
<th>Tag</th>
</tr>
</thead>
<tbody>
@foreach (Dictionary<string, string> kvp in ModuleConfig.volumes)
{
<tr>
<td>@kvp["val"]</td>
<td>@kvp["var"]</td>
<td>@kvp["host"]</td>
<td>@kvp["local"]</td>
<td>@kvp["tag"]</td>
</tr>
}
</tbody>
@ -115,6 +121,7 @@
private string Value1 { get; set; }
private string Key2 { get; set; }
private string Value2 { get; set; }
private string Tag { get; set; }
public ModuleConfig ModuleConfig { get; set; } = new ModuleConfig();
@ -135,8 +142,9 @@
{
var vols = new Dictionary<string, string>()
{
{ "var", Key2 },
{ "val", Value2 }
{ "host", Key2 },
{ "local", Value2 },
{ "tag", Tag }
};
ModuleConfig.volumes.Add(vols);
Key2 = "";