Merge branch 'main' into yaml-fixes
This commit is contained in:
Коммит
3a9a668513
|
@ -505,6 +505,8 @@ Refer to the [Before the hands-on lab setup guide](Before%20the%20Hands-On%20Lab
|
|||
dockerauth
|
||||
```
|
||||
|
||||
> Note: An example of this YAML file can be located in the `./actions` folder of this lab as `deployToAksCluster.yml`.
|
||||
|
||||
3. The workflow will fail on the intial run because it requires some secrets to be setup in the repository. Navigate to the repository in GitHub then select "Settings > Secrets > Actions". Finally use the "New Repository Secret" button to create secrets.
|
||||
|
||||
![Create a new repository secret.](media/github-new-repository-secret.png "New Repository Secret")
|
||||
|
|
|
@ -33,15 +33,74 @@ export class AddHealthCheck extends Component {
|
|||
this.createHealthCheck();
|
||||
}
|
||||
|
||||
handleAddSymptom = () => {
|
||||
this.setState({ symptoms: [...this.state.symptoms, ""] });
|
||||
}
|
||||
|
||||
handleSymptomInput = (index, event) => {
|
||||
const symptoms = [...this.state.symptoms];
|
||||
symptoms[index] = event.target.value;
|
||||
this.setState({ symptoms });
|
||||
}
|
||||
|
||||
handleDeleteSymptom = (index) => {
|
||||
return () => {
|
||||
const symptoms = this.state.symptoms;
|
||||
symptoms.splice(index, 1);
|
||||
this.setState({ symptoms });
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<h4>Submit a HealthCheck:</h4>
|
||||
<form onSubmit={this.handleSubmit}>
|
||||
<input type="hidden" name="id" placeholder="Id" value="id" />
|
||||
<div>
|
||||
<label>
|
||||
Patient ID:
|
||||
<input type="text" name="patientid" placeholder="Patient Id" value={this.state.patientid} onChange={this.handleInput} />
|
||||
<input type="text" name="date" placeholder="Date" value={this.state.date} onChange={this.handleInput} />
|
||||
<input type="text" name="healthstatus" placeholder="Health Status" value={this.state.healthstatus} onChange={this.handleInput} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
Date:
|
||||
<input type="date" name="date" placeholder="Date" value={this.state.date} onChange={this.handleInput} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
Health Status:
|
||||
<input type="text" name="healthstatus" placeholder="Health Status" onChange={this.handleInput} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<table className='table table-striped' aria-labelledby="tabelLabel">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Symptom</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{this.state.symptoms.map((symptom, index) =>
|
||||
<tr key={index}>
|
||||
<td>
|
||||
<input type="text" name="symptom" placeholder="Symptom" value={symptom || ""} onChange={e => this.handleSymptomInput(index, e)} />
|
||||
</td>
|
||||
<td><button className="button delete" type="button" onClick={this.handleDeleteSymptom(index)}>Delete</button></td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td>
|
||||
<button className="button add" type="button" onClick={this.handleAddSymptom}>Add Symptom</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -25,7 +25,7 @@ export class HealthCheck extends Component {
|
|||
<td>{this.state.healthstatus}</td>
|
||||
<td>
|
||||
<ul>
|
||||
{this.state.symptoms.map(symptom, index =>
|
||||
{this.state.symptoms.map((symptom, index) =>
|
||||
<li key={index}>{symptom}</li>
|
||||
)}
|
||||
</ul>
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
"applicationUrl": "https://localhost:7258;http://localhost:5271",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
|
||||
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy",
|
||||
"REACT_APP_API_URL": "https://localhost:5001/HealthCheck",
|
||||
"REACT_APP_API_KEY": "SECRETKEY"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
"dotnetRunMessages": "true",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:5000",
|
||||
"applicationUrl": "http://localhost:5000;https://localhost:5001",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
|
|
@ -33,6 +33,15 @@ namespace Humongous.Healthcare
|
|||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Humongous.Healthcare", Version = "v1" });
|
||||
});
|
||||
services.AddSingleton<ICosmosDbService>(InitializeCosmosClientInstanceAsync(Configuration.GetSection("CosmosDb")).GetAwaiter().GetResult());
|
||||
services.AddCors(options =>
|
||||
{
|
||||
options.AddDefaultPolicy(policy =>
|
||||
{
|
||||
policy.AllowAnyOrigin()
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
@ -47,6 +56,8 @@ namespace Humongous.Healthcare
|
|||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseCors();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
|
|
Загрузка…
Ссылка в новой задаче