Skip to content

Commit

Permalink
Embedded resources (#5)
Browse files Browse the repository at this point in the history
* Updated to latest Radzen.Blazor

* Commit launchSettings.json to git

* Run production build in the Docker container.

* Set scheme to https to prevent navigation errors.
  • Loading branch information
akorchev committed Aug 22, 2019
1 parent 6d23c0a commit c582f98
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 48 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Expand Up @@ -52,7 +52,6 @@ BenchmarkDotNet.Artifacts/
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

# StyleCop
StyleCopReport.xml
Expand Down Expand Up @@ -221,7 +220,7 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

Expand Down Expand Up @@ -317,7 +316,7 @@ __pycache__/
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
Expand All @@ -326,7 +325,7 @@ ASALocalRun/
# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
# MFractors (Xamarin productivity tool) working folder
.mfractor/
.DS_Store
.vscode
7 changes: 5 additions & 2 deletions Dockerfile
@@ -1,7 +1,10 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview8
COPY . /app
WORKDIR /app
RUN dotnet publish -c Release -o out
COPY ./northwind.db /app/out

ENV ASPNETCORE_URLS http://*:5000

ENTRYPOINT ["dotnet", "run"]
WORKDIR /app/out

ENTRYPOINT ["dotnet", "LatestBlazor.dll"]
2 changes: 1 addition & 1 deletion LatestBlazor.csproj
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
Expand Down
25 changes: 0 additions & 25 deletions LatestBlazor.sln

This file was deleted.

18 changes: 7 additions & 11 deletions Pages/GetStarted.razor
Expand Up @@ -25,19 +25,15 @@
</RadzenCard>
<h2 class="my-3">3. Include a theme</h2>
<RadzenCard>
<ol>
<li>Download the <a href="https://github.com/akorchev/blazor.radzen.com/raw/master/Radzen.Blazor.Themes.zip">Radzen.Blazor.Themes.zip</a> and unzip it somewhere. It contains two directorires: <code>fonts</code> and <code>css</code>.</li>
<li>Copy those two directories to the <code>wwwroot</code> folder of your Blazor application.</li>
<li>Open the <code>_Host.cshtml</code> file (server-side Blazor) or <code>wwwroot/index.html</code> (client-side Blazor) and include a theme CSS file by adding this snippet <code>&lt;link rel="stylesheet" href="css/default.css"&gt;</code></li>
</ol>
<p>
Open the <code>_Host.cshtml</code> file (server-side Blazor) or <code>wwwroot/index.html</code> (client-side Blazor) and include a theme CSS file by adding this snippet <code>&lt;link rel="stylesheet" href="_content/Radzen.Blazor/css/default.css"&gt;</code>
</p>
</RadzenCard>
<h2 class="my-3">4. Include Radzen.Blazor.js (server-blazor only)</h2>
<h2 class="my-3">4. Include Radzen.Blazor.js</h2>
<RadzenCard>
<ol>
<li>Get the <a href="https://github.com/akorchev/blazor.radzen.com/blob/master/wwwroot/Radzen.Blazor.js">Radzen.Blazor.js</a>.</li>
<li>Copy the file <code>wwwroot</code> folder of your Blazor application.</li>
<li>Open the <code>_Host.cshtml</code> file and include it <code>&lt;script src="Radzen.Blazor.js"&gt;&lt;/script&gt;</code></li>
</ol>
<p>
Open the <code>_Host.cshtml</code> file (server-side Blazor) or <code>wwwroot/index.html</code> (client-side Blazor) and include this snippet <code>&lt;script src="_content/Radzen.Blazor/Radzen.Blazor.js"&gt;&lt;/script&gt;</code>
</p>
</RadzenCard>
<h2 class="my-3">5. Use a component</h2>
<RadzenCard>
Expand Down
2 changes: 1 addition & 1 deletion Pages/_Host.cshtml
Expand Up @@ -24,7 +24,7 @@
</head>
<body>
<app>@(await Html.RenderComponentAsync<App>())</app>
<script src="Radzen.Blazor.js"></script>
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
<script src="_framework/blazor.server.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-73079289-4"></script>
Expand Down
27 changes: 27 additions & 0 deletions Properties/launchSettings.json
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:24219",
"sslPort": 44398
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"LatestBlazor": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -30,9 +30,11 @@ Open the `_Imports.razor` file of your Blazor application and add this line `@us

### Include a theme

Download the [Radzen.Blazor.Themes.zip](https://github.com/akorchev/blazor.radzen.com/raw/master/Radzen.Blazor.Themes.zip) and unzip it somewhere. It contains two directorires: `fonts` and `css`.
Copy those two directories to the `wwwroot` folder of your Blazor application.
Open the `_Host.cshtml` file (server-side Blazor) or `wwwroot/index.html` (client-side Blazor) and include a theme CSS file by adding this snippet `<link rel="stylesheet" href="css/default.css">`
Open the `_Host.cshtml` file (server-side Blazor) or `wwwroot/index.html` (client-side Blazor) and include a theme CSS file by adding this snippet `<link rel="stylesheet" href="_content/Radzen.Blazor/css/default.css">`

### Include Radzen.Blazor.js

Open the `_Host.cshtml` file (server-side Blazor) or `wwwroot/index.html` (client-side Blazor) and include this snippet `<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>`

### Use a component
Use any Radzen Blazor component by typing its tag name in a Blazor page e.g.
Expand Down
Binary file removed Radzen.Blazor.Themes.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion Shared/MainLayout.razor
Expand Up @@ -4,7 +4,8 @@
@inherits LayoutComponentBase
@inject ThemeState ThemeState
@inject IUriHelper UriHelper
<link href="css/@(Theme)" rel="stylesheet" />

<link href="_content/Radzen.Blazor/css/@(Theme)" rel="stylesheet" />
<RadzenDialog />
<RadzenNotification />

Expand Down
2 changes: 2 additions & 0 deletions Startup.cs
Expand Up @@ -52,7 +52,9 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
});
}

/*
app.UseHttpsRedirection();
*/

app.UseStaticFiles();

Expand Down

0 comments on commit c582f98

Please sign in to comment.