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