inital UI work on AFLOW-40

This commit is contained in:
Sören Oesterwind 2023-07-11 17:00:34 +02:00
parent cd37f096ca
commit ddb484cac9
5 changed files with 102 additions and 3 deletions

View File

@ -81,16 +81,38 @@
</li> -->
</ul>
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
<a href="/projects/" class="nav-link"
>Projects<span class="badge rounded-pill bg-primary" >
Alpha
<span class="visually-hidden">Alpha feature</span>
</span>
</a>
</h6>
<ul class="nav flex-column mb-2">
<li class="nav-item">
<a class="nav-link <%= it.active == 'PROJ_HOME' ? 'active' : ''%>" href="/projects/"><i class="bi bi-kanban"></i> Manage Projects </a>
</li>
<li class="nav-item">
<a class="nav-link <%= it.active == 'PROJ_LIST' ? 'active' : ''%>" href="/projects/lists"><i class="bi bi-card-checklist"></i> Packaging Lists </a>
</li>
<li class="nav-item">
<a class="nav-link <%= it.active == 'PROJ_PEPS' ? 'active' : ''%>" href="/projects/people"><i class="bi bi-people-fill"></i> People </a>
</li>
</ul>
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
<a href="/manage/" class="nav-link"
>Settings
<span class="badge rounded-pill bg-danger invisible">
2
<span class="badge rounded-pill bg-danger invisible" id="notifcationInfo">
1
<span class="visually-hidden">changes or updates</span>
</span>
</a>
</h6>
<ul class="nav flex-column mb-2">
<a class="nav-link <%= it.active == 'SETT_STORE' ? 'active' : ''%>" href="/manage/storages"
><i class="bi bi-box-seam"></i> Manage storages
@ -187,6 +209,11 @@
dataType: 'json',
success: function (data) {
$('#versionInfo').text(`AssetFlow Alpha ${data.version} ${data.commit}`);
if(data.updateAvailable ){
$('#notifcationInfo').show();
} else {
$('#notifcationInfo').hide();
}
},
error: function (data) {
createNewToast('<i class="bi bi-exclamation-triangle-fill"></i> Unable to load version information', "text-bg-danger", 3000, false)

View File

@ -0,0 +1,49 @@
<%~ E.includeFile("../partials/head.eta.html", {"title": "Projects"}) %> <%~ E.includeFile("../partials/controls.eta.html", {"active": "PROJ_HOME"}) %>
<h1>Projectmanager</h1>
<div class="container text-center">
<div class="row">
<a class="card col m-2" href="/manage/categories">
<div class="card-body">
<h1 class="card-title"><i class="bi bi-tag"></i></h1>
<p class="card-text">Manage categories</p>
</div>
</a>
<a class="card col m-2" href="/manage/storages">
<div class="card-body">
<h1 class="card-title"><i class="bi bi-box-seam"></i></h1>
<p class="card-text">Manage storages</p>
</div>
</a>
<a class="card col m-2" href="/manage/import/csv">
<div class="card-body">
<h1 class="card-title"><i class="bi bi-filetype-csv"></i></h1>
<p class="card-text">Import data via CSV</p>
</div>
</a>
<a class="card col m-2" href="/manage/import/json">
<div class="card-body">
<h1 class="card-title"><i class="bi bi-filetype-json"></i></h1>
<p class="card-text">Import data via JSON</p>
</div>
</a>
</div>
</div>
<h2>Recent projects</h2>
<div class="container">
<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Status</th>
<!--<th scope="col">Actions</th>-->
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<%~ E.includeFile("../partials/controlsFoot.eta.html") %> <%~ E.includeFile("../partials/foot.eta.html") %>

View File

@ -7,6 +7,7 @@ import testRoute from './test.js';
import dashboardRoute from './dashboard.js';
import itemsRoute from './items.js';
import manage_routes from './manage/index.js';
import project_routes from './projects/index.js';
// Router base is '/'
const Router = express.Router({ strict: false });
@ -14,11 +15,13 @@ const Router = express.Router({ strict: false });
Router.route('/test').get(testRoute.get);
Router.route('/items').get(itemsRoute.get);
Router.route('/:id(\\w{8})').get(skuRoute.get);
Router.use('/projects', project_routes); // has to be before skuRoute
Router.route('/:id(\\w{8})').get(skuRoute.get); // we should probably deprecate this
Router.route('/s/:id').get(skuRouteDash.get);
Router.use('/manage', manage_routes);
Router.route('/').get(dashboardRoute.get);
export default Router;

View File

@ -0,0 +1,9 @@
import express, { Request, Response } from 'express';
import { prisma, __path, log } from '../../../index.js';
function get(req: Request, res: Response) {
res.render(__path + '/src/frontend/projects/dashboard.eta.html');
}
export default { get };

View File

@ -0,0 +1,11 @@
import express from 'express';
// Route imports
import dashboard from './dashboard.js';
// Router base is '/manage'
const Router = express.Router({ strict: false });
Router.route('/').get(dashboard.get);
export default Router;