component updates

This commit is contained in:
gaz8860 Gary 2023-05-01 20:24:51 +01:00
parent 82fd03fde8
commit d792b3aec9
2 changed files with 9 additions and 26 deletions

View File

@ -1,18 +0,0 @@
@page "/counter"
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}

View File

@ -13,7 +13,7 @@
<div class="col-12"> <div class="col-12">
<div class="form-group"> <div class="form-group">
<label for="imageName">Image Name</label> <label for="imageName">Image Name</label>
<input type="text" class="form-control" id="imageName" @bind="ModuleConfig.ImageName" /> <input type="text" class="form-control" id="imageName" name="ImageName" @bind="ModuleConfig.ImageName" />
</div> </div>
</div> </div>
</div> </div>
@ -29,14 +29,14 @@
<div class="card-body"> <div class="card-body">
<div class="form-group"> <div class="form-group">
<label for="key1">Key</label> <label for="key1">Key</label>
<input type="text" class="form-control" id="key1" @bind="Key1" /> <input type="text" class="form-control" name="env_key" @bind="Key1" />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="value1">Value</label> <label for="value1">Value</label>
<input type="text" class="form-control" id="value1" @bind="Value1" /> <input type="text" class="form-control" name="env_val" @bind="Value1" />
</div> </div>
<button class="btn btn-primary" @onclick="AddKeyValuePair1">Add</button> <button class="btn btn-primary" @onclick="AddKeyValuePair1">Add</button>
<table class="table mt-2"> <table class="table mt-2" name="env_table">
<thead> <thead>
<tr> <tr>
<th>Key</th> <th>Key</th>
@ -64,14 +64,14 @@
<div class="card-body"> <div class="card-body">
<div class="form-group"> <div class="form-group">
<label for="key2">Key</label> <label for="key2">Key</label>
<input type="text" class="form-control" id="key2" @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">Value</label>
<input type="text" class="form-control" id="value2" @bind="Value2" /> <input type="text" class="form-control" name="vol_val" @bind="Value2" />
</div> </div>
<button class="btn btn-primary" @onclick="AddKeyValuePair2">Add</button> <button class="btn btn-primary" @onclick="AddKeyValuePair2">Add</button>
<table class="table mt-2"> <table class="table mt-2" name="vol_table">
<thead> <thead>
<tr> <tr>
<th>Key</th> <th>Key</th>
@ -106,7 +106,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 ModuleConfig ModuleConfig { get; set; } = new ModuleConfig(); public ModuleConfig ModuleConfig { get; set; } = new ModuleConfig();
@ -128,6 +128,7 @@
{ {
// Log ModuleConfig object to console and send to backend // Log ModuleConfig object to console and send to backend
var config = JsonSerializer.Serialize(ModuleConfig); var config = JsonSerializer.Serialize(ModuleConfig);
Console.WriteLine(config);
await httpService.PostAsync("http://localhost:8080/config_module", config); await httpService.PostAsync("http://localhost:8080/config_module", config);
} }
} }