Compare commits
11 Commits
86678c7b37
...
v0.0.1-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 4121a98ffd | |||
| d5b56efdd7 | |||
| 4c9c001d62 | |||
| d0d9fcc304 | |||
| 1a25de254f | |||
| 7eaf8e88d8 | |||
| a6e3f78f43 | |||
| 059c0603d4 | |||
| 1fab4a4d7c | |||
| 3086f71b62 | |||
| 216937c6ad |
@@ -1,5 +1,9 @@
|
|||||||
@page "/AdminSettings"
|
@page "/AdminSettings"
|
||||||
|
|
||||||
|
@using Microsoft.AspNetCore.Authorization
|
||||||
|
|
||||||
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
|
|
||||||
<h3>Index</h3>
|
<h3>Index</h3>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
@using Microsoft.AspNetCore.Identity
|
@using Microsoft.AspNetCore.Identity
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using Microsoft.AspNetCore.Components.QuickGrid
|
@using Microsoft.AspNetCore.Components.QuickGrid
|
||||||
|
@using Microsoft.AspNetCore.Authorization
|
||||||
|
|
||||||
@inject ApplicationDbContext CouchLogDB
|
@inject ApplicationDbContext CouchLogDB
|
||||||
@inject UserManager<ApplicationUser> UserManager
|
@inject UserManager<ApplicationUser> UserManager
|
||||||
@@ -12,6 +13,8 @@
|
|||||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
|
|
||||||
<div class="d-flex align-items-center justify-content-between">
|
<div class="d-flex align-items-center justify-content-between">
|
||||||
<h3 class="mb-0">UserManagement</h3>
|
<h3 class="mb-0">UserManagement</h3>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
@inherits LayoutComponentBase
|
@using Microsoft.AspNetCore.Authorization
|
||||||
|
|
||||||
|
@inherits LayoutComponentBase
|
||||||
@layout CouchLog.Components.Layout.MainLayout
|
@layout CouchLog.Components.Layout.MainLayout
|
||||||
|
|
||||||
|
@attribute [Authorize(Roles = "Admin")]
|
||||||
|
|
||||||
<h1>Manage CouchLog</h1>
|
<h1>Manage CouchLog</h1>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
<div name="Enity-Container-Image" class="">
|
<div name="Enity-Container-Image" class="">
|
||||||
<a href="javascript:void(0)" class="Entity-Container-Image">
|
<a href="javascript:void(0)" class="Entity-Container-Image">
|
||||||
<img src="@Entity.PicturePath" alt="" class="Entity-Container-Image" />
|
<img src="/@Entity.PicturePath" alt="" class="Entity-Container-Image" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div name="Entity-Container-Data" class="">
|
<div name="Entity-Container-Data" class="">
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Save Picture and Name it
|
//Save Picture and Name it
|
||||||
string NewFileName = $"{GlobalEntity.Title.Replace(" ", "_")}_{Guid.NewGuid()}{Path.GetExtension(Picture.Name)}";
|
string NewFileName = $"{GlobalEntity.Title.Replace(" ", "-")}-{Guid.NewGuid()}{Path.GetExtension(Picture.Name)}";
|
||||||
string PicturePath = Path.Combine("wwwroot", "Pictures", NewFileName);
|
string PicturePath = Path.Combine("wwwroot", "Pictures", NewFileName);
|
||||||
using FileStream FileStream = File.Create(PicturePath);
|
using FileStream FileStream = File.Create(PicturePath);
|
||||||
await Picture.OpenReadStream().CopyToAsync(FileStream);
|
await Picture.OpenReadStream().CopyToAsync(FileStream);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="col-auto img-wrapper">
|
<div class="col-auto img-wrapper">
|
||||||
@if (!string.IsNullOrEmpty(Entity.GlobalEntity?.PicturePath))
|
@if (!string.IsNullOrEmpty(Entity.GlobalEntity?.PicturePath))
|
||||||
{
|
{
|
||||||
<img src="@Entity.GlobalEntity.PicturePath"
|
<img src="/@Entity.GlobalEntity.PicturePath"
|
||||||
class="entity-img"
|
class="entity-img"
|
||||||
alt="@Entity.GlobalEntity.Title">
|
alt="@Entity.GlobalEntity.Title">
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ else
|
|||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
|
app.UseStaticFiles();
|
||||||
|
|
||||||
app.UseAntiforgery();
|
app.UseAntiforgery();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"CouchLogDB": "Data Source=Data\\CouchLog.db"
|
"CouchLogDB": "Data Source=Data/CouchLog.db"
|
||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
|
|||||||
Reference in New Issue
Block a user