- added csv import

- added somewhat real stats to dashboard
- basic search logic
This commit is contained in:
2023-05-02 18:23:47 +02:00
parent e869615ec7
commit d1d717a988
13 changed files with 270 additions and 29 deletions

View File

@ -15,8 +15,8 @@
</div>
<div class="card col m-2">
<div class="card-body">
<h5 class="card-title">10</h5>
<p class="card-text">Uncategorized items</p>
<h5 class="card-title"><%= it.stats.total %></h5>
<p class="card-text">Items in total</p>
</div>
</div>
<div class="card col m-2">
@ -44,27 +44,16 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Samsung 65W USB-C Ladegerät</td>
<td><span class="badge text-bg-success">Normal</span></td>
<td>DB8031E8</td>
<td><a href="#" class="btn btn-primary">Edit</a></td>
</tr>
<tr>
<th scope="row">2</th>
<td>2.5mm Klinken Verlängerung 40mm</td>
<td><span class="badge text-bg-success">Normal</span></td>
<td>25A1E9DE</td>
<td><a href="#" class="btn btn-primary">Edit</a></td>
</tr>
<tr>
<th scope="row">3</th>
<td>Elgato Streamdeck XL</td>
<td><span class="badge text-bg-danger">Stolen</span></td>
<td>9AF2388E</td>
<td><a href="#" class="btn btn-primary">Edit</a></td>
</tr>
<% it.recents.forEach(function(user){ %>
<tr>
<th scope="row"><%= user.id %></th>
<td><%= user.name %></td>
<td><span class="badge text-bg-success"><%= user.status %></span></td>
<td><%= user.SKU %></td>
<td><a href="#" class="btn btn-primary">Edit</a></td>
</tr>
<% }) %>
</tbody>
</table>
</div>

View File

@ -0,0 +1,28 @@
<%~ E.includeFile("../partials/head.eta.html", {"title": "Bootstrap Demo Page" }) %>
<%~ E.includeFile("../partials/controls.eta.html", {"active": "Orders" }) %>
<h1>Import A CSV File</h1>
Upload a CSV file to import into the database. The CSV file must have the following columns:
<ul>
<li> Name</li>
<li> Amount</li>
<li> Manufacturer</li>
<li> Category</li>
</ul>
The following columns are optional:
<ul>
<li> SKU</li>
<li> Comment</li>
<li> StorageLocation (import currently not supported)</li>
</ul>
<form method="post" encType="multipart/form-data">
<label for="formFile" class="form-label">CSV Inventory File Upload</label>
<input class="form-control" type="file" id="formFile" name="formFile"><br>
<input type="submit" value="Run import" class="btn btn-primary">
</form>
<%~ E.includeFile("../partials/controlsFoot.eta.html") %>
<%~ E.includeFile("../partials/foot.eta.html") %>

View File

@ -10,14 +10,13 @@
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<input class="form-control form-control-dark w-100 bg-secondary" type="text" placeholder="Search" aria-label="Search" />
<input class="form-control form-control-dark w-100 bg-secondary" type="text" placeholder="Search" aria-label="Search" id="SearchBox" />
<div class="navbar-nav">
<div class="nav-item text-nowrap">
<a class="nav-link px-3" href="#">Sign out</a>
</div>
</div>
</header>
<div class="container-fluid">
<div class="row">
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">

View File

@ -1,3 +1,4 @@
</main>
</div>
</div>
<script src="/js/searchBox.js"></script>

View File

@ -15,7 +15,7 @@
<script src="/static/jquery/dist/jquery.min.js"></script>
<link href="/static/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
<link href="css/dashboard.css" rel="stylesheet">
<link href="/css/dashboard.css" rel="stylesheet">
</head>
<body>