Refactoring; GeneralSettings-Klasse hinzugefügt

This commit is contained in:
BuildTools 2024-02-05 17:58:53 +01:00
parent 531c833e76
commit 6cd0f31ef9
21 changed files with 227 additions and 71 deletions

View File

@ -16,6 +16,7 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Sharer" Version="1.0.0" />
<PackageReference Include="System.IO.Ports" Version="8.0.0" /> <PackageReference Include="System.IO.Ports" Version="8.0.0" />
</ItemGroup> </ItemGroup>

View File

@ -5,6 +5,6 @@
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } = ""; public string Name { get; set; } = "";
public string? ImageURL { get; set; } public string? ImageURL { get; set; }
public List<CocktailFlasche> Cocktailflaschen { get; } = new(); public List<CocktailFlasche> Cocktailflaschen { get; set; } = new();
} }
} }

View File

@ -4,7 +4,6 @@
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } = ""; public string Name { get; set; } = "";
public int? Pos { get; set; }
public Flasche() public Flasche()
{ {

Binary file not shown.

View File

@ -0,0 +1,13 @@
namespace CocktailWeb
{
public class GeneralSettings
{
public int MaxAllowedUploadSizeInMB { get; set; } = 10;
public string ImageUploadDir { get; set; } = "images";
public string SerialPort { get; set; } = "COM5";
public int Baudrate { get; set; } = 115200;
}
}

View File

@ -1,16 +1,46 @@
@page "/cocktails/{CocktailId}" @page "/cocktails/{CocktailId}"
@using CocktailWeb.Data @using CocktailWeb.Data
@using Microsoft.AspNetCore.Components.Sections
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<DbDataContext> DataContextFactory; @inject IDbContextFactory<DbDataContext> DataContextFactory;
@if(SelectedCocktail != null)
{
<h3>@SelectedCocktail.Name</h3>
} else <SectionContent SectionId="TopRow.Title">
<a class="btn btn-primary" href="/cocktails">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-left-circle" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1 8a7 7 0 1 0 14 0A7 7 0 0 0 1 8m15 0A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-4.5-.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5z" />
</svg>
Zurück
</a>
</SectionContent>
@if (SelectedCocktail == null)
{ {
<h3>Cocktail konnte nicht gefunden werden</h3> <h3>Cocktail konnte nicht gefunden werden</h3>
}
else
{
<div class="card mb-3" style="max-width: 540px;">
<div class="row g-0">
<div class="col-md-4">
<img src="@SelectedCocktail.ImageURL" class="img-fluid rounded-start" alt="...">
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">@SelectedCocktail.Name</h5>
<p class="card-text">
<h6>Zutaten:</h6>
<ul>
@foreach (var Zutat in SelectedCocktail.Cocktailflaschen)
{
<li>@Zutat.Flasche?.Name (@Zutat.Menge ml)</li>
}
</ul>
</p>
</div>
</div>
</div>
</div>
} }
@ -28,7 +58,7 @@
_DataContext ??= await DataContextFactory.CreateDbContextAsync(); _DataContext ??= await DataContextFactory.CreateDbContextAsync();
if (_DataContext != null) if (_DataContext != null)
{ {
SelectedCocktail = _DataContext.Cocktails.FirstOrDefault(c => c.Id == id); SelectedCocktail = _DataContext.Cocktails.Include(c => c.Cocktailflaschen).ThenInclude(cf => cf.Flasche).Single(c => c.Id == id);
} }
} }
} }

View File

@ -1,23 +1,14 @@
@page "/cocktails" @page "/"
@using CocktailWeb.Data @using CocktailWeb.Data
@using Microsoft.AspNetCore.Components.Sections @using Microsoft.AspNetCore.Components.Sections
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<DbDataContext> DataContextFactory; @inject IDbContextFactory<DbDataContext> DataContextFactory;
@inject IWebHostEnvironment env; @inject IWebHostEnvironment env;
<!--layout SideScrollLayout-->
<!--<h3>Cocktails</h3>-->
<PageTitle>Cocktails</PageTitle>
<SectionContent SectionId="TopRow.Title"> <SectionContent SectionId="TopRow.Title">
<label>Cocktails</label> <label>Cocktails</label>
</SectionContent> </SectionContent>
<!--
<p>
<a href="/cocktails/add">Cocktail hinzufügen</a>
</p>
-->
<!-- Flex Container für Horizontalen Scroll - klappt aber nicht so richtig->
<!--<div class="container py-2 border border-5 overflow-auto d-inline-block">
<div class="row flex-nowrap">-->
<div class="card-group gap-3 flex-nowrap"> <div class="card-group gap-3 flex-nowrap">
@foreach (Cocktail c in CocktailListe) @foreach (Cocktail c in CocktailListe)
@ -25,14 +16,14 @@
<div class="col"> <div class="col">
<a class="text-decoration-none text-black;" href="/cocktails/@c.Id"> <a class="text-decoration-none text-black;" href="/cocktails/@c.Id">
<div class="card" style="width: 20vw; min-width:15rem; max-height:350px; "> <div class="card" style="width: 20vw; min-width:15rem; max-height:350px; ">
@if (c.ImageURL != null && File.Exists(Path.Join(env.WebRootPath, c.ImageURL))) @if (c.ImageURL != null && File.Exists(Path.Join(env.WebRootPath, c.ImageURL)))
{ {
<img class="card-img-top" style="width:100%; min-height:70vh; object-fit:cover;" src="@($"/{c.ImageURL}")" alt="@c.Name"> <img class="card-img-top" style="width:100%; min-height:70vh; object-fit:cover;" src="@($"/{c.ImageURL}")" alt="@c.Name">
} }
else else
{ {
<img class="card-img-top" style="width:100%; min-height:70vh; object-fit:cover;" src="@($"/img/cocktail-default.jpg")" alt="@c.Name"> <img class="card-img-top" style="width:100%; min-height:70vh; object-fit:cover;" src="@($"/img/cocktail-default.jpg")" alt="@c.Name">
} }
<div class="card-footer"> <div class="card-footer">
@ -46,4 +37,6 @@
</div> </div>
} }
</div> </div>

View File

@ -1,4 +1,4 @@
@page "/" @page "/index"
<PageTitle>Index</PageTitle> <PageTitle>Index</PageTitle>
@ -6,6 +6,8 @@
Welcome to your new app. Welcome to your new app.
<a href="/cocktails">
Cocktails</a>
@code { @code {

View File

@ -1,10 +1,10 @@
@page "/serialtest" @page "/serialtest"
@using System.IO.Ports @using System.IO.Ports
@using Microsoft.Extensions.Options
@inject IOptions<GeneralSettings> Config;
<PageTitle>Serial Test</PageTitle> <PageTitle>Serial Test</PageTitle>
<label for="portname">Port:</label>
<InputText id="portname" @bind-Value="portname"></InputText>
<label for="inputdata">Data:</label> <label for="inputdata">Data:</label>
<InputText id="inputdata" @bind-Value="inputdata"></InputText> <InputText id="inputdata" @bind-Value="inputdata"></InputText>
<button @onclick="SendData">Send</button> <button @onclick="SendData">Send</button>
@ -16,7 +16,6 @@
@code { @code {
SerialPort? port; SerialPort? port;
string? portname = "COM5";
string? receivedText; string? receivedText;
string? inputdata ="LED"; string? inputdata ="LED";
@ -24,15 +23,14 @@
bool Sending = false; bool Sending = false;
bool Receiving = false; bool Receiving = false;
public async Task SendData() public async Task SendData()
{ {
if (Sending) return; // nichts senden, wenn bereits am Senden if (Sending) return; // nichts senden, wenn bereits am Senden
Sending = true; Sending = true;
if (port == null && portname != null) if (port == null && Config.Value.SerialPort != null)
{ {
port = new SerialPort(portname); port = new SerialPort(Config.Value.SerialPort);
port.BaudRate = 115200; //9600 port.BaudRate = Config.Value.Baudrate; //9600
port.DataReceived += port_DataReceived; port.DataReceived += port_DataReceived;
//port.DataBits = 8; //port.DataBits = 8;
//port.StopBits = StopBits.One; //port.StopBits = StopBits.One;

View File

@ -1,10 +1,17 @@
@using Microsoft.EntityFrameworkCore @using Microsoft.AspNetCore.Components.Sections
@using Microsoft.EntityFrameworkCore
@using CocktailWeb.Data @using CocktailWeb.Data
@page "/cocktails/add" @using Microsoft.Extensions.Options
@page "/settings/cocktails/edit"
@page "/settings/cocktails/edit/{id}"
@inject IDbContextFactory<DbDataContext> DataContextFactory; @inject IDbContextFactory<DbDataContext> DataContextFactory;
@inject NavigationManager nav; @inject NavigationManager nav;
@inject IWebHostEnvironment env; @inject IWebHostEnvironment env;
<h3>Cocktail hinzufügen</h3> @inject IOptions<GeneralSettings> Config;
<SectionContent SectionId="TopRow.Title">
<label>Cocktail hinzufügen</label>
</SectionContent>
<div class="d-flex gap-3"> <div class="d-flex gap-3">
@ -69,7 +76,7 @@
</tbody> </tbody>
</table> </table>
<button @onclick="OnSubmit" class="btn btn-primary">Speichern</button> <button @onclick="OnSubmit" class="btn btn-primary">Speichern</button>
<button @onclick="@(() => nav.NavigateTo("/cocktails"))" class="btn btn-secondary">Abbrechen</button> <button @onclick="@(() => nav.NavigateTo("/settings/cocktails"))" class="btn btn-secondary">Abbrechen</button>
</div> </div>
<div class="border border-2 rounded p-3 w-100"> <div class="border border-2 rounded p-3 w-100">

View File

@ -1,28 +1,40 @@
using CocktailWeb; using CocktailWeb.Data;
using CocktailWeb.Data;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace CocktailWeb.Pages namespace CocktailWeb.Pages.Settings
{ {
public partial class CocktailHinzufuegen public partial class CocktailHinzufuegen
{ {
[Parameter]
public string? id { get; set; }
public List<Flasche> FlaschenListe { get; set; } = new(); public List<Flasche> FlaschenListe { get; set; } = new();
public Cocktail EditCocktail = new(); public Cocktail? EditCocktail;
private IBrowserFile? CocktaiLBildDatei; private IBrowserFile? CocktaiLBildDatei;
private DbDataContext? _DataContext; private DbDataContext? _DataContext;
private int MaxAllowedUploadSizeInMB = 10;
private string ImageUploadDir = "cocktails";
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
if (id != null)
{
_DataContext ??= await DataContextFactory.CreateDbContextAsync();
if (_DataContext != null)
{
EditCocktail = _DataContext.Cocktails.Include(c => c.Cocktailflaschen).ThenInclude(cf => cf.Flasche).Single(c => c.Id == Convert.ToInt32(id));
}
}
// Falls keine ID angegeben wurde oder der Cocktail in der Datenbank nicht gefunden wurde, gehen wir davon aus dass ein neuer Cocktail erstellt wird.
if (EditCocktail == null)
{
EditCocktail = new();
}
await FillFlaschenListe(); await FillFlaschenListe();
await InvokeAsync(StateHasChanged);
} }
public async Task FillFlaschenListe() public async Task FillFlaschenListe()
@ -36,13 +48,13 @@ namespace CocktailWeb.Pages
public void FlascheHinzufuegen(MouseEventArgs e, Flasche f) public void FlascheHinzufuegen(MouseEventArgs e, Flasche f)
{ {
EditCocktail.Cocktailflaschen.Add(new CocktailFlasche() { Flasche = f, Reihenfolge = EditCocktail.Cocktailflaschen.Count + 1 }); EditCocktail?.Cocktailflaschen.Add(new CocktailFlasche() { Flasche = f, Reihenfolge = EditCocktail.Cocktailflaschen.Count + 1 });
CocktailFlaschenSortieren(); CocktailFlaschenSortieren();
} }
public void FlascheEntfernen(MouseEventArgs e, CocktailFlasche cf) public void FlascheEntfernen(MouseEventArgs e, CocktailFlasche cf)
{ {
EditCocktail.Cocktailflaschen.Remove(cf); EditCocktail?.Cocktailflaschen.Remove(cf);
CocktailFlaschenSortieren(); CocktailFlaschenSortieren();
} }
@ -85,12 +97,12 @@ namespace CocktailWeb.Pages
try try
{ {
// Bild hochladen // Bild hochladen
var relativeuploadpath = Path.Join(ImageUploadDir, $"{EditCocktail.Id}{Path.GetExtension(CocktaiLBildDatei.Name)}"); var relativeuploadpath = Path.Join(Config.Value.ImageUploadDir, $"{EditCocktail.Id}{Path.GetExtension(CocktaiLBildDatei.Name)}");
var fullpath = Path.Join(env.WebRootPath, relativeuploadpath); var fullpath = Path.Join(env.WebRootPath, relativeuploadpath);
string? folder = Path.GetDirectoryName(fullpath); string? folder = Path.GetDirectoryName(fullpath);
if (folder != null && !Path.Exists(folder)) Directory.CreateDirectory(folder); if (folder != null && !Path.Exists(folder)) Directory.CreateDirectory(folder);
Stream stream = CocktaiLBildDatei.OpenReadStream(maxAllowedSize: MaxAllowedUploadSizeInMB * 1024 * 1024); Stream stream = CocktaiLBildDatei.OpenReadStream(maxAllowedSize: Config.Value.MaxAllowedUploadSizeInMB * 1024 * 1024);
FileStream fs = File.Create(fullpath); FileStream fs = File.Create(fullpath);
await stream.CopyToAsync(fs); await stream.CopyToAsync(fs);
stream.Close(); stream.Close();

View File

@ -0,0 +1,30 @@
@page "/settings/cocktails"
@using CocktailWeb.Data
@using Microsoft.AspNetCore.Components.Sections
@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<DbDataContext> DataContextFactory;
@inject IWebHostEnvironment env;
<!--layout SideScrollLayout-->
<!--<h3>Cocktails</h3>-->
<SectionContent SectionId="TopRow.Title">
<label>Einstellungen - Cocktails</label>
</SectionContent>
<a class="btn btn-primary mb-3" href="/settings/cocktails/edit">Cocktail hinzufügen</a>
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-light border-dark">
<tbody>
@foreach (Cocktail c in CocktailListe)
{
<tr>
<td class="p-0"><img src="@c.ImageURL" style="max-height:40px;" /></td>
<td>@c.Name</td>
<td> <a class="btn btn-primary" href="/settings/cocktails/edit/@c.Id">Bearbeiten</a></td>
</tr>
}
</tbody>
</table>
</div>

View File

@ -0,0 +1,30 @@
using CocktailWeb;
using CocktailWeb.Data;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.EntityFrameworkCore;
namespace CocktailWeb.Pages.Settings
{
public partial class Cocktails
{
private DbDataContext? _DataContext;
private List<Cocktail> CocktailListe { get; set; } = new();
protected override async Task OnInitializedAsync()
{
await ShowCocktails();
}
private async Task ShowCocktails()
{
_DataContext ??= await DataContextFactory.CreateDbContextAsync();
if (_DataContext != null)
{
CocktailListe = await _DataContext.Cocktails.OrderBy(f => f.Name).ToListAsync();
}
}
}
}

View File

@ -1,10 +1,16 @@
@using Microsoft.EntityFrameworkCore @using Microsoft.AspNetCore.Components.Sections
@using Microsoft.EntityFrameworkCore
@using CocktailWeb.Data @using CocktailWeb.Data
@page "/flaschen" @page "/settings/flaschen"
@inject IDbContextFactory<DbDataContext> FlascheDataContextFactory; @inject IDbContextFactory<DbDataContext> FlascheDataContextFactory;
<PageTitle>Flaschen</PageTitle> <PageTitle>Flaschen</PageTitle>
<SectionContent SectionId="TopRow.Title">
<label>Einstellungen - Zutaten</label>
</SectionContent>
@if (CreateFormVisible && FlascheToCreate != null) @if (CreateFormVisible && FlascheToCreate != null)
{ {
<h3>Flasche hinzufügen</h3> <h3>Flasche hinzufügen</h3>
@ -16,7 +22,7 @@
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="offset-4 col-8"> <div class="offset-4 col-8">
<button name="submit" type="submit" class="btn btn-primary" @onclick="CreateNewFlasche">Submit</button> <button name="submit" type="submit" class="btn btn-primary" @onclick="CreateNewFlasche">Hinzufügen</button>
</div> </div>
</div> </div>
} }
@ -29,15 +35,13 @@ else
</div> </div>
} }
<h3>Flaschen</h3>
@if (FlaschenListe != null && FlaschenListe.Count > 0) @if (FlaschenListe != null && FlaschenListe.Count > 0)
{ {
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-light border-dark"> <table class="table table-striped table-hover table-bordered table-light border-dark">
<thead> <thead>
<tr> <tr>
<th scope="col">ID</th> <!--<th scope="col">ID</th>-->
<th scope="col">Name</th> <th scope="col">Name</th>
<th scope="col">Action</th> <th scope="col">Action</th>
</tr> </tr>
@ -48,20 +52,20 @@ else
@if (EditFormVisible && FlascheToUpdate != null && FlascheToUpdate.Id == flasche.Id) @if (EditFormVisible && FlascheToUpdate != null && FlascheToUpdate.Id == flasche.Id)
{ {
<tr> <tr>
<th scope="row">@FlascheToUpdate.Id</th> <!-- <th scope="row">@FlascheToUpdate.Id</th>-->
<td> <input id="Name" name="Name" type="text" class="form-control" @bind="@FlascheToUpdate.Name" /></td> <td> <input id="Name" name="Name" type="text" class="form-control" @bind="@FlascheToUpdate.Name" /></td>
<td><button name="submit" type="submit" class="btn btn-primary" @onclick="() => UpdateEmployee(FlascheToUpdate)">Save</button></td> <td><button name="submit" type="submit" class="btn btn-primary" @onclick="() => UpdateEmployee(FlascheToUpdate)">Speichern</button></td>
</tr> </tr>
} }
else else
{ {
<tr> <tr>
<th scope="row">@flasche.Id</th> <!-- <th scope="row">@flasche.Id</th> -->
<td>@flasche.Name</td> <td>@flasche.Name</td>
<td> <td>
<button name="submit" type="submit" class="btn btn-primary" @onclick="() => ShowEditForm(flasche)">Edit</button> <button name="submit" type="submit" class="btn btn-primary" @onclick="() => ShowEditForm(flasche)">Bearbeiten</button>
<button name="submit" type="submit" class="btn btn-primary" @onclick="() => DeleteFlasche(flasche)">Delete</button> <button name="submit" type="submit" class="btn btn-primary" @onclick="() => DeleteFlasche(flasche)">Löschen</button>
</td> </td>
</tr> </tr>
} }
} }

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using CocktailWeb.Data; using CocktailWeb.Data;
namespace CocktailWeb.Pages namespace CocktailWeb.Pages.Settings
{ {
public partial class Flaschen public partial class Flaschen
{ {

View File

@ -0,0 +1,13 @@
@page "/settings/maschine";
@using Microsoft.EntityFrameworkCore
@using CocktailWeb.Data
@using Microsoft.AspNetCore.Components.Sections
@inject IDbContextFactory<DbDataContext> FlascheDataContextFactory;
<PageTitle>Maschine</PageTitle>
<SectionContent SectionId="TopRow.Title">
<label>Einstellungen - Maschine</label>
</SectionContent>

View File

@ -0,0 +1,6 @@
namespace CocktailWeb.Pages.Settings
{
partial class Maschine
{
}
}

View File

@ -1,3 +1,4 @@
using CocktailWeb;
using CocktailWeb.Data; using CocktailWeb.Data;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
@ -11,6 +12,7 @@ var connectionString = builder.Configuration.GetConnectionString("CocktailDB");
builder.Services.AddRazorPages(); builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor(); builder.Services.AddServerSideBlazor();
builder.Services.AddDbContextFactory<DbDataContext>(options => options.UseSqlite(connectionString)); builder.Services.AddDbContextFactory<DbDataContext>(options => options.UseSqlite(connectionString));
builder.Services.Configure<GeneralSettings>(builder.Configuration.GetSection(nameof(GeneralSettings)));
var app = builder.Build(); var app = builder.Build();

View File

@ -2,9 +2,17 @@
<div class="d-flex fixed-top justify-content-between px-4" style="background-color: #f7f7f7; border-bottom: 1px solid #d6d5d5; height: 56px; align-items: center; top: 0; z-index: 1;"> <div class="d-flex fixed-top justify-content-between px-4" style="background-color: #f7f7f7; border-bottom: 1px solid #d6d5d5; height: 56px; align-items: center; top: 0; z-index: 1;">
<h3> <div class="d-flex gap-3">
<SectionOutlet SectionId="Title" /> <a class="btn btn-primary" href="/">
</h3> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-house" viewBox="0 0 16 16">
<path d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z" />
</svg>
</a>
<h3>
<SectionOutlet SectionId="Title" />
</h3>
</div>
<div class="dropdown show"> <div class="dropdown show">
<a class="btn btn-secondary dropdown-toggle" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false"> <a class="btn btn-secondary dropdown-toggle" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-gear-fill" viewBox="0 0 16 16">
@ -13,8 +21,9 @@
Einstellungen Einstellungen
</a> </a>
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuLink"> <div class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="/flaschen">Zutaten</a> <a class="dropdown-item" href="/settings/maschine">Maschine</a>
<a class="dropdown-item" href="/cocktails">Cocktails</a> <a class="dropdown-item" href="/settings/flaschen">Zutaten</a>
<a class="dropdown-item" href="/settings/cocktails">Cocktails</a>
<a class="dropdown-item" href="/serialtest">Serial Test</a> <a class="dropdown-item" href="/serialtest">Serial Test</a>
</div> </div>
</div> </div>

View File

@ -8,3 +8,4 @@
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using CocktailWeb @using CocktailWeb
@using CocktailWeb.Shared @using CocktailWeb.Shared
@using CocktailWeb.Pages

View File

@ -8,5 +8,11 @@
"ConnectionStrings": { "ConnectionStrings": {
"CocktailDB": "Data Source=Data\\cocktails.db" "CocktailDB": "Data Source=Data\\cocktails.db"
}, },
"AllowedHosts": "*" "AllowedHosts": "*",
"GeneralSettings": {
"MaxAllowedUploadSizeInMB": 10,
"ImageUploadDir": "images",
"SerialPort": "COM5",
"Baudrate": 115200
}
} }