mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2025-11-03 18:36:05 +00:00
implemented basic ui
This commit is contained in:
6
app/templates/components/navbar.html
Normal file
6
app/templates/components/navbar.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<header class="navbar navbar-expand-md navbar-green sticky-top bg-dark flex-md-nowrap p-0 shadow">
|
||||
<a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="/-/">FastAPI-DLS {{ VERSION }}</a>
|
||||
<button class="navbar-toggler position-absolute d-lg-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</header>
|
||||
58
app/templates/components/sidebar.html
Normal file
58
app/templates/components/sidebar.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
|
||||
<div class="position-sticky pt-3">
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ 'active' if request.url.path == '/-/dashboard' }}" aria-current="page" href="/-/dashboard">
|
||||
<i class="bi-house-door"></i> Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ 'active' if request.url.path == '/-/dashboard/origins' }}" aria-current="page" href="/-/dashboard/origins">
|
||||
<i class="bi-pc-display-horizontal"></i> Origins
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ 'active' if request.url.path == '/-/dashboard/leases' }}" aria-current="page" href="/-/dashboard/leases">
|
||||
<i class="bi-layers"></i> Leases
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
|
||||
<span>Help</span>
|
||||
</h6>
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link {{ 'active' if request.url.path == '/-/readme' }}" aria-current="page" href="/-/readme">
|
||||
<i class="bi-question-circle"></i> Readme
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" aria-current="page" href="https://git.collinwebdesigns.de/oscar.krause/fastapi-dls" target="_blank">
|
||||
<i class="bi-git"></i> Git Repo
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
|
||||
<span>Integrations</span>
|
||||
</h6>
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" aria-current="page" href="/-/doc" target="_blank">
|
||||
<i class="bi-file-text"></i> Swagger UI
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" aria-current="page" href="/-/redoc" target="_blank">
|
||||
<i class="bi-file-text"></i> Redoc
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" aria-current="page" href="/-/openapi.json" target="_blank">
|
||||
<i class="bi bi-filetype-json"></i> OpenAPI JSON
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
32
app/templates/layouts/base.html
Normal file
32
app/templates/layouts/base.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html lang="en" class="h-100">
|
||||
<head>
|
||||
{% block title %}
|
||||
<title>FastAPI-DLS</title>
|
||||
{% endblock %}
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<link rel="icon" href="{{ url_for('static', path='assets/img/favicons/favicon-32x32.png') }}" sizes="32x32" type="image/png">
|
||||
<link rel="icon" href="{{ url_for('static', path='assets/img/favicons/favicon-16x16.png') }}" sizes="16x16" type="image/png">
|
||||
<link rel="manifest" href="{{ url_for('static', path='assets/img/favicons/manifest.json') }}">
|
||||
<link rel="icon" href="{{ url_for('static', path='assets/img/favicons/favicon.ico') }}">
|
||||
<link rel="apple-touch-icon" href="{{ url_for('static', path='assets/img/favicons/apple-touch-icon.png') }}" sizes="180x180">
|
||||
|
||||
{% block styles %}
|
||||
{% endblock %}
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='assets/css/custom.css') }}">
|
||||
</head>
|
||||
<body class="d-flex flex-column {% block body_class %}{% endblock %}">
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
<script src="{{ url_for('static', path='assets/js/helper.js') }}"></script>
|
||||
|
||||
{% block scripts %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
16
app/templates/layouts/bootstrap-dashboard.html
Normal file
16
app/templates/layouts/bootstrap-dashboard.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends 'layouts/bootstrap.html' %}
|
||||
|
||||
{% block body %}
|
||||
{% include 'components/navbar.html' %}
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
{% include 'components/sidebar.html' %}
|
||||
|
||||
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
14
app/templates/layouts/bootstrap.html
Normal file
14
app/templates/layouts/bootstrap.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends 'layouts/base.html' %}
|
||||
|
||||
{% block styles %}
|
||||
{{ super() }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='assets/css/bootstrap.min.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='assets/css/bootstrap-icons.min.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='assets/css/dashboard.css') }}">
|
||||
|
||||
<script src="{{ url_for('static', path='assets/js/popper.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', path='assets/js/bootstrap.min.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
41
app/templates/views/dashboard.html
Normal file
41
app/templates/views/dashboard.html
Normal file
@@ -0,0 +1,41 @@
|
||||
{% extends 'layouts/bootstrap-dashboard.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>Dashboard</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Dashboard</h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<div class="btn-group me-2">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="downloadClientToken()">
|
||||
<i class="bi bi-download"></i>
|
||||
Client Token
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-5 mb-4 bg-light rounded-3">
|
||||
<div class="container-fluid py-5">
|
||||
<h1 class="display-5 fw-bold">FastAPI-DLS</h1>
|
||||
<p class="col-md-8 fs-4">Minimal Delegated License Service (DLS).</p>
|
||||
|
||||
<a href="https://git.collinwebdesigns.de/oscar.krause/fastapi-dls/-/releases" class="btn btn-primary btn-lg" target="_blank">
|
||||
Releases »
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
<script type="application/javascript">
|
||||
function downloadClientToken() {
|
||||
window.open('/-/client-token', "_blank")
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
32
app/templates/views/dashboard_leases.html
Normal file
32
app/templates/views/dashboard_leases.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{% extends 'layouts/bootstrap-dashboard.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>Origins</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Leases <small>with origin</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<div class="btn-group me-2">
|
||||
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteLease();load();">delete lease</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="leases" class="mt-3"></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
<script type="application/javascript">
|
||||
function load() {
|
||||
const leases = document.getElementById('leases')
|
||||
fetchLeases(leases)
|
||||
}
|
||||
|
||||
load()
|
||||
</script>
|
||||
{% endblock %}
|
||||
28
app/templates/views/dashboard_origins.html
Normal file
28
app/templates/views/dashboard_origins.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends 'layouts/bootstrap-dashboard.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>Origins</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Origins <small>with leases</small></h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<div class="btn-group me-2">
|
||||
<button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteOrigins()">delete all</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="origins" class="mt-3"></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
<script type="application/javascript">
|
||||
const origins = document.getElementById('origins')
|
||||
fetchOriginsWithLeases(origins)
|
||||
</script>
|
||||
{% endblock %}
|
||||
15
app/templates/views/dashboard_readme.html
Normal file
15
app/templates/views/dashboard_readme.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends 'layouts/bootstrap-dashboard.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>Origins</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<div class="overflow-hidden">
|
||||
{{ markdown|safe }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
26
app/templates/views/index.html
Normal file
26
app/templates/views/index.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends 'layouts/bootstrap.html' %}
|
||||
|
||||
{% block title %}
|
||||
<title>Index</title>
|
||||
{% endblock %}
|
||||
|
||||
{% block body_class %}h-100{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<main class="flex-shrink-0">
|
||||
<div class="container">
|
||||
<h1 class="mt-5 text-primary">FastAPI-DLS</h1>
|
||||
<p class="lead">Minimal Delegated License Service (DLS).</p>
|
||||
<p>
|
||||
<a href="/-/dashboard">Dashboard</a>,
|
||||
<a href="/-/readme">Readme</a>
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer mt-auto py-3 bg-light">
|
||||
<div class="container">
|
||||
<span class="text-muted">FastAPI-DLS Version {{ VERSION }}</span>
|
||||
</div>
|
||||
</footer>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user