Skip to content

Commit ae2a4c8

Browse files
- Added export buttons to management interface
- Some small fixes
1 parent ce39b11 commit ae2a4c8

File tree

7 files changed

+29
-10
lines changed

7 files changed

+29
-10
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ COPY . /src
2424
WORKDIR /src/Nesteo.Server
2525

2626
# Restore packages
27-
RUN npm install --with-dev
27+
RUN npm install
2828

2929
# Run build task
3030
RUN npx grunt default

Nesteo.Server/Controllers/Api/NestingBoxesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public IAsyncEnumerable<InspectionPreview> GetInspectionPreviewsByNestingBoxIdAs
204204
/// </summary>
205205
[HttpGet("csv")]
206206
[ProducesResponseType(StatusCodes.Status200OK)]
207-
public Task<IActionResult> ExportNestingBoxAsync()
207+
public Task<IActionResult> ExportNestingBoxesAsync()
208208
{
209209
string fileDownloadName = $"nesting-boxes-export-{DateTime.Now}.csv";
210210
IAsyncEnumerable<string> records = _nestingBoxService.ExportAllRowsAsync();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@page "/data"
2+
@model DataModel
3+
@{
4+
ViewData["Title"] = "Data";
5+
}
6+
7+
<p>Use the buttons below to download all nesting boxes or inspections as CSV file for use with other tools.</p>
8+
9+
<a class="btn btn-primary" asp-controller="NestingBoxes" asp-action="ExportNestingBoxesAsync">Download nesting boxes</a>
10+
<a class="btn btn-primary" asp-controller="Inspections" asp-action="ExportInspectionsAsync">Download inspections</a>
11+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using Microsoft.AspNetCore.Mvc.RazorPages;
2+
3+
namespace Nesteo.Server.Pages.Management
4+
{
5+
public class DataModel : PageModel { }
6+
}

Nesteo.Server/Pages/Management/Profile/_Layout.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
}
44

55
<div class="row">
6-
<div class="col-md-3">
6+
<div class="col-md-3 mb-4">
77
<partial name="_ProfileNav"/>
88
</div>
99
<div class="col-md-9">

Nesteo.Server/Pages/Management/Users.cshtml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
@foreach (UserEntity user in Model.Users)
2828
{
2929
<tr>
30-
<th scope="row">@user.UserName</th>
31-
<td>@user.FirstName</td>
32-
<td>@user.LastName</td>
33-
<td>@(user.Email ?? "-")</td>
34-
<td>@(user.PhoneNumber ?? "-")</td>
35-
<td>ACTIONS</td>
30+
<th class="align-middle" scope="row">@user.UserName</th>
31+
<td class="align-middle">@user.FirstName</td>
32+
<td class="align-middle">@user.LastName</td>
33+
<td class="align-middle">@(user.Email ?? "-")</td>
34+
<td class="align-middle">@(user.PhoneNumber ?? "-")</td>
35+
<td class="align-middle">
36+
<a class="btn btn-primary btn-sm" asp-page="/Management/EditUser" asp-route-userName="@user.UserName">Edit</a>
37+
</td>
3638
</tr>
3739
}
3840
<tr>

Nesteo.Server/Pages/Management/_Layout.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<a class="nav-link" asp-page="/Management/Users">Users</a>
2121
</li>
2222
<li class="nav-item">
23-
<a class="nav-link" asp-page="">Data</a>
23+
<a class="nav-link" asp-page="/Management/Data">Data</a>
2424
</li>
2525
</ul>
2626
<ul class="navbar-nav">

0 commit comments

Comments
 (0)