This repository has been archived by the owner on Nov 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated proxy config to mix appsettings.config with code config when computing routes and clusters (#20)
- Loading branch information
Showing
40 changed files
with
1,460 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
</Found> | ||
<NotFound> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p>Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.6" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.6" PrivateAssets="all" /> | ||
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@page "/counter" | ||
|
||
<h1>Counter</h1> | ||
|
||
<p>Current count: @currentCount</p> | ||
|
||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button> | ||
|
||
@code { | ||
private int currentCount = 0; | ||
|
||
private void IncrementCount() | ||
{ | ||
currentCount++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@page "/fetchdata" | ||
@inject HttpClient Http | ||
|
||
<h1>Weather forecast</h1> | ||
|
||
<p>This component demonstrates fetching data from the server.</p> | ||
|
||
@if (forecasts == null) | ||
{ | ||
<p><em>Loading...</em></p> | ||
} | ||
else | ||
{ | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Temp. (C)</th> | ||
<th>Temp. (F)</th> | ||
<th>Summary</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var forecast in forecasts) | ||
{ | ||
<tr> | ||
<td>@forecast.Date.ToShortDateString()</td> | ||
<td>@forecast.TemperatureC</td> | ||
<td>@forecast.TemperatureF</td> | ||
<td>@forecast.Summary</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
} | ||
|
||
@code { | ||
private WeatherForecast[] forecasts; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json"); | ||
} | ||
|
||
public class WeatherForecast | ||
{ | ||
public DateTime Date { get; set; } | ||
|
||
public int TemperatureC { get; set; } | ||
|
||
public string Summary { get; set; } | ||
|
||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@page "/" | ||
|
||
<h1>Hello, world!</h1> | ||
|
||
Welcome to your new app. | ||
|
||
<SurveyPrompt Title="How is Blazor working for you?" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace MedEasy.Web | ||
{ | ||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
using System; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
|
||
public class Program | ||
{ | ||
public static async Task Main(string[] args) | ||
{ | ||
WebAssemblyHostBuilder builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
builder.RootComponents.Add<App>("#app"); | ||
|
||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); | ||
|
||
await builder.Build().RunAsync(); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/clients/web/MedEasy.Web/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:20856", | ||
"sslPort": 0 | ||
} | ||
}, | ||
"profiles": { | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"MedEasy.Web": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": "true", | ||
"launchBrowser": true, | ||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", | ||
"applicationUrl": "http://localhost:5000", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@inherits LayoutComponentBase | ||
|
||
<div class="page"> | ||
<div class="sidebar"> | ||
<NavMenu /> | ||
</div> | ||
|
||
<div class="main"> | ||
<div class="top-row px-4"> | ||
<a href="http://blazor.net" target="_blank" class="ml-md-auto">About</a> | ||
</div> | ||
|
||
<div class="content px-4"> | ||
@Body | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
.page { | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.main { | ||
flex: 1; | ||
} | ||
|
||
.sidebar { | ||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); | ||
} | ||
|
||
.top-row { | ||
background-color: #f7f7f7; | ||
border-bottom: 1px solid #d6d5d5; | ||
justify-content: flex-end; | ||
height: 3.5rem; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.top-row ::deep a, .top-row .btn-link { | ||
white-space: nowrap; | ||
margin-left: 1.5rem; | ||
} | ||
|
||
.top-row a:first-child { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
@media (max-width: 640.98px) { | ||
.top-row:not(.auth) { | ||
display: none; | ||
} | ||
|
||
.top-row.auth { | ||
justify-content: space-between; | ||
} | ||
|
||
.top-row a, .top-row .btn-link { | ||
margin-left: 0; | ||
} | ||
} | ||
|
||
@media (min-width: 641px) { | ||
.page { | ||
flex-direction: row; | ||
} | ||
|
||
.sidebar { | ||
width: 250px; | ||
height: 100vh; | ||
position: sticky; | ||
top: 0; | ||
} | ||
|
||
.top-row { | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
|
||
.main > div { | ||
padding-left: 2rem !important; | ||
padding-right: 1.5rem !important; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<div class="top-row pl-4 navbar navbar-dark"> | ||
<a class="navbar-brand" href="">MedEasy.Web</a> | ||
<button class="navbar-toggler" @onclick="ToggleNavMenu"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
</div> | ||
|
||
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu"> | ||
<ul class="nav flex-column"> | ||
<li class="nav-item px-3"> | ||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All"> | ||
<span class="oi oi-home" aria-hidden="true"></span> Home | ||
</NavLink> | ||
</li> | ||
<li class="nav-item px-3"> | ||
<NavLink class="nav-link" href="counter"> | ||
<span class="oi oi-plus" aria-hidden="true"></span> Counter | ||
</NavLink> | ||
</li> | ||
<li class="nav-item px-3"> | ||
<NavLink class="nav-link" href="fetchdata"> | ||
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data | ||
</NavLink> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
@code { | ||
private bool collapseNavMenu = true; | ||
|
||
private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; | ||
|
||
private void ToggleNavMenu() | ||
{ | ||
collapseNavMenu = !collapseNavMenu; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.navbar-toggler { | ||
background-color: rgba(255, 255, 255, 0.1); | ||
} | ||
|
||
.top-row { | ||
height: 3.5rem; | ||
background-color: rgba(0,0,0,0.4); | ||
} | ||
|
||
.navbar-brand { | ||
font-size: 1.1rem; | ||
} | ||
|
||
.oi { | ||
width: 2rem; | ||
font-size: 1.1rem; | ||
vertical-align: text-top; | ||
top: -2px; | ||
} | ||
|
||
.nav-item { | ||
font-size: 0.9rem; | ||
padding-bottom: 0.5rem; | ||
} | ||
|
||
.nav-item:first-of-type { | ||
padding-top: 1rem; | ||
} | ||
|
||
.nav-item:last-of-type { | ||
padding-bottom: 1rem; | ||
} | ||
|
||
.nav-item ::deep a { | ||
color: #d7d7d7; | ||
border-radius: 4px; | ||
height: 3rem; | ||
display: flex; | ||
align-items: center; | ||
line-height: 3rem; | ||
} | ||
|
||
.nav-item ::deep a.active { | ||
background-color: rgba(255,255,255,0.25); | ||
color: white; | ||
} | ||
|
||
.nav-item ::deep a:hover { | ||
background-color: rgba(255,255,255,0.1); | ||
color: white; | ||
} | ||
|
||
@media (min-width: 641px) { | ||
.navbar-toggler { | ||
display: none; | ||
} | ||
|
||
.collapse { | ||
/* Never collapse the sidebar for wide screens */ | ||
display: block; | ||
} | ||
} |
Oops, something went wrong.