Fix admin route access and backend configuration
- Added /admin redirect to login page in nginx config - Fixed backend server.js route ordering for proper admin handling - Updated authentication middleware and routes - Added user management routes - Configured PostgreSQL integration - Updated environment configuration
This commit is contained in:
43
Sky_Art_shop/Views/AdminPages/Index.cshtml
Normal file
43
Sky_Art_shop/Views/AdminPages/Index.cshtml
Normal file
@@ -0,0 +1,43 @@
|
||||
@model List<SkyArtShop.Models.Page>
|
||||
@{
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
ViewData["Title"] = "Pages";
|
||||
}
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Pages</h5>
|
||||
<a class="btn btn-primary" href="/admin/pages/create">Create Page</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Slug</th>
|
||||
<th>Active</th>
|
||||
<th>Updated</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var p in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@p.PageName</td>
|
||||
<td>@p.PageSlug</td>
|
||||
<td>@(p.IsActive ? "Yes" : "No")</td>
|
||||
<td>@p.UpdatedAt.ToString("MMM dd, yyyy")</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-secondary" href="/admin/pages/edit/@p.Id">Edit</a>
|
||||
<form method="post" action="/admin/pages/delete/@p.Id" class="d-inline" onsubmit="return confirm('Delete this page?');">
|
||||
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user