This commit is contained in:
Takeus committed 2025-02-03 19:49:58 +01:00
1 parent f11aa2d6c6
commit 85969350bc
13 files changed
+146 -29

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@
<link rel="icon" type="image/png" href="{{ url_for('static',filename='img/logo.png') }}" />
<link rel="stylesheet" href="{{ url_for('static',filename='css/custom.css') }}"/>
<link rel="stylesheet" href="{{ url_for('static',filename='css/bootstrap.min.css') }}"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="{{ url_for('static',filename='css/bootstrap-icons.min.css') }}"/>
</head>
<body>
{% block content %}{% endblock %}
+12
View File
@@ -0,0 +1,12 @@
<!-- Flash message -->
{% with errors = get_flashed_messages(with_categories=true,category_filter=["success","warning","danger","error"]) %}
{% if errors %}
{% for category, message in errors %}
<div class="alert alert-dismissible alert-{{ category }} m-0" style="position:fixed;top:5%;left:38%;z-index:10;min-width:25%;">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<p class="mb-0"><b>{{ message }}</b></a></p>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<!-- END|Flash message -->
+15 -19
View File
@@ -7,30 +7,26 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link {% if is_dash %}active{% endif %}" href="{{ url_for('base.dashboard') }}">Dashboard</a>
<a class="nav-link {% if is_dash %}active{% endif %}" href="{{ url_for('base.dashboard') }}"><i class="bi bi-house-door-fill"></i> Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link {% if is_networks %}active{% endif %}" href="{{ url_for('base.networks') }}"><i class="bi bi-globe"></i> Network(s)</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">Network</a>
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-archive-fill"></i> Inventory</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Subnets</a></li>
<li><a class="dropdown-item" href="#">Attributions</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-pc-display"></i> Computers</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-server"></i> Servers</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-server"></i> Virtual Machines</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-ethernet"></i> Networks Devices</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-collection"></i> Others</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-archive-fill"></i> Inventory</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#"><i class="bi bi-pc-display"></i> Computers</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-server"></i> Servers</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-server"></i> Virtual Machines</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-ethernet"></i> Networks Devices</a></li>
<li><a class="dropdown-item" href="#"><i class="bi bi-collection"></i> Others</a></li>
</ul>
</li>
{% if current_user.admin %}
<li class="nav-item">
<a class="nav-link active" href="">Admin</a>
</li>
{% endif %}
{% if current_user.admin %}
<li class="nav-item">
<a class="nav-link active" href="">Admin</a>
</li>
{% endif %}
</ul>
<form class="d-flex" role="search">
<a class="btn btn-outline-warning" type="submit" href="{{ url_for('auth.logout') }}">logout</a>
+61
View File
@@ -0,0 +1,61 @@
{% extends 'panel/_base.html' %}
{% block content %}
{% include 'panel/_nav.html' %}
{% include 'panel/_flash.html' %}
<div class="container" style="margin-top:5vh;">
<div class="row">
<!-- PREFIXES TABLE -->
<div class="col-9">
<table class="table table-striped table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Subnet</th>
<th scope="col">Prefix</th>
<th scope="col">Usage</th>
<th scope="col">Description</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
{% for network in prefixes %}
<tr>
<th scope="row">{{network.id}}</th>
<td>{{network.network_address}}</td>
<td>{{network.prefix}}</td>
<td>X / {{network.hosts}} </td>
<td>{{network.description}}</td>
<td>
<button class="btn btn-sm btn-outline-info" style="padding-top:1px;padding-bottom:1px">calculate</button>
<button class="btn btn-sm btn-outline-danger"style="padding-top:1px;padding-bottom:1px">delete</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- PREFIX FORM -->
<div class="col-3">
<div class="card p-4 shadow rounded-3">
<h2 class="text-center mb-4">Add Network</h2>
<form method="POST">
{{ form.csrf_token }}
<div class="mb-3">
<label for="subnet" class="form-label">Subnet</label>
{{ form.subnet(class="form-control", placeholder="192.168.0.0") }}
</div>
<div class="mb-3">
<label for="prefix" class="form-label">Prefix</label>
{{ form.prefix(class="form-control", placeholder="24") }}
</div>
<div class="mb-3">
<label for="description" class="form-label">Description</label>
{{ form.description(class="form-control", placeholder="local area network...") }}
</div>
<button type="submit" class="btn btn-secondary w-100">Submit</button>
</form>
</div>
</div>
</div>
</div>
{% endblock %}