wip
This commit is contained in:
parent
2b36992be1
commit
25087d055c
16 changed files with 1394 additions and 816 deletions
|
@ -6,7 +6,7 @@
|
|||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h2 class="page-title">
|
||||
Infrastructure Overview
|
||||
{{ title }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="col-auto ms-auto d-print-none">
|
||||
|
@ -19,16 +19,11 @@
|
|||
<span class="ti ti-plus me-2"></span>
|
||||
New Server
|
||||
</a>
|
||||
<a href="{{ url_for('dashboard.app_new') }}" class="btn btn-primary d-none d-sm-inline-block">
|
||||
<span class="ti ti-plus me-2"></span>
|
||||
New Application
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hierarchical View -->
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
|
@ -36,47 +31,115 @@
|
|||
<h3 class="card-title">Network Infrastructure</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- Subnets -->
|
||||
{% if hierarchy.subnets %}
|
||||
{% for subnet in hierarchy.subnets %}
|
||||
<div class="subnet-container mb-4">
|
||||
<div class="subnet-header d-flex align-items-center p-2 bg-azure-lt rounded">
|
||||
<span class="ti ti-network me-2"></span>
|
||||
<h4 class="m-0">
|
||||
<a href="{{ url_for('ipam.subnet_view', subnet_id=subnet.id) }}" class="text-reset">
|
||||
{{ subnet.cidr }}
|
||||
</a>
|
||||
{% if subnet.location %}
|
||||
<small class="text-muted ms-2">({{ subnet.location }})</small>
|
||||
{% endif %}
|
||||
{% if subnet.description is defined and subnet.description %}
|
||||
<small class="text-muted ms-2">{{ subnet.description }}</small>
|
||||
{% endif %}
|
||||
</h4>
|
||||
<div class="ms-auto">
|
||||
<a href="{{ url_for('dashboard.server_new') }}?subnet_id={{ subnet.id }}"
|
||||
class="btn btn-sm btn-outline-primary">
|
||||
<span class="ti ti-plus me-1"></span> Add Server
|
||||
</a>
|
||||
</div>
|
||||
{% if hierarchy.locations %}
|
||||
{% for location_name, location_data in hierarchy.locations.items() %}
|
||||
<div class="location-container mb-5">
|
||||
<div class="location-header d-flex align-items-center p-2 bg-primary-lt rounded">
|
||||
<span class="ti ti-building me-2"></span>
|
||||
<h3 class="m-0">{{ location_name }}</h3>
|
||||
</div>
|
||||
|
||||
<!-- Servers in this subnet -->
|
||||
{% if subnet.servers %}
|
||||
<div class="ps-4 mt-2">
|
||||
{% for server in subnet.servers %}
|
||||
<div class="server-container mb-3 border-start ps-3">
|
||||
<div class="server-header d-flex align-items-center p-2 bg-light rounded">
|
||||
<!-- Subnets in this location -->
|
||||
{% if location_data.subnets %}
|
||||
<div class="ms-4 mt-3">
|
||||
<h4 class="mb-3">Subnets</h4>
|
||||
{% for subnet in location_data.subnets %}
|
||||
<div class="subnet-container mb-4">
|
||||
<div class="subnet-header d-flex align-items-center p-2 bg-azure-lt rounded">
|
||||
<span class="ti ti-network me-2"></span>
|
||||
<h4 class="m-0">
|
||||
<a href="{{ url_for('ipam.subnet_view', subnet_id=subnet.id) }}" class="text-reset">
|
||||
{{ subnet.cidr }}
|
||||
</a>
|
||||
{% if subnet.description is defined and subnet.description %}
|
||||
<small class="text-muted ms-2">{{ subnet.description }}</small>
|
||||
{% endif %}
|
||||
</h4>
|
||||
<div class="ms-auto">
|
||||
<a href="{{ url_for('dashboard.server_new') }}?subnet_id={{ subnet.id }}"
|
||||
class="btn btn-sm btn-outline-primary">
|
||||
<span class="ti ti-plus me-1"></span> Add Server
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Servers in this subnet -->
|
||||
{% if subnet.servers %}
|
||||
<div class="ms-4 mt-2">
|
||||
{% for server in subnet.servers %}
|
||||
<div class="server-container mb-3">
|
||||
<div class="server-header d-flex align-items-center p-2 bg-light rounded border-start border-3">
|
||||
<span class="ti ti-server me-2"></span>
|
||||
<h5 class="m-0">
|
||||
<a href="{{ url_for('dashboard.server_view', server_id=server.id) }}" class="text-reset">
|
||||
{{ server.hostname }}
|
||||
</a>
|
||||
<small class="text-muted ms-2">{{ server.ip_address }}</small>
|
||||
</h5>
|
||||
<div class="ms-auto">
|
||||
<a href="{{ url_for('dashboard.app_new') }}?server_id={{ server.id }}"
|
||||
class="btn btn-sm btn-outline-secondary">
|
||||
<span class="ti ti-plus me-1"></span> Add App
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Apps on this server -->
|
||||
{% if server.apps %}
|
||||
<div class="ms-4 mt-1">
|
||||
{% for app in server.apps %}
|
||||
<div class="app-container mb-2">
|
||||
<div class="app-header d-flex align-items-center p-2 bg-white rounded border-start border-3">
|
||||
<span class="ti ti-app-window me-2"></span>
|
||||
<h6 class="m-0">
|
||||
<a href="{{ url_for('dashboard.app_view', app_id=app.id) }}" class="text-reset">
|
||||
{{ app.name }}
|
||||
</a>
|
||||
{% if app.ports %}
|
||||
<small class="text-muted ms-2">
|
||||
Ports:
|
||||
{% for port in app.ports %}
|
||||
<span class="badge bg-blue-lt">{{ port.port }}/{{ port.protocol }}</span>
|
||||
{% endfor %}
|
||||
</small>
|
||||
{% endif %}
|
||||
</h6>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="ms-4 mt-2 text-muted">
|
||||
<em>No servers in this subnet</em>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Standalone servers in this location -->
|
||||
{% if location_data.standalone_servers %}
|
||||
<div class="ms-4 mt-3">
|
||||
<h4 class="mb-3">Standalone Servers</h4>
|
||||
{% for server in location_data.standalone_servers %}
|
||||
<div class="server-container mb-3">
|
||||
<div class="server-header d-flex align-items-center p-2 bg-light rounded border-start border-3">
|
||||
<span class="ti ti-server me-2"></span>
|
||||
<h5 class="m-0">
|
||||
<a href="{{ url_for('dashboard.server_view', server_id=server.id) }}" class="text-reset">
|
||||
{{ server.hostname }}
|
||||
</a>
|
||||
<small class="text-muted ms-2">{{ server.ip_address }}</small>
|
||||
<span class="badge bg-purple-lt ms-2">Public IP</span>
|
||||
</h5>
|
||||
<div class="ms-auto">
|
||||
<a href="{{ url_for('dashboard.app_new') }}?server_id={{ server.id }}"
|
||||
class="btn btn-sm btn-outline-primary">
|
||||
class="btn btn-sm btn-outline-secondary">
|
||||
<span class="ti ti-plus me-1"></span> Add App
|
||||
</a>
|
||||
</div>
|
||||
|
@ -84,102 +147,36 @@
|
|||
|
||||
<!-- Apps on this server -->
|
||||
{% if server.apps %}
|
||||
<div class="ps-4 mt-2">
|
||||
<div class="ms-4 mt-1">
|
||||
{% for app in server.apps %}
|
||||
<div class="app-container mb-2 border-start ps-3">
|
||||
<div class="app-header d-flex align-items-center p-2 bg-light-lt rounded">
|
||||
<div class="app-container mb-2">
|
||||
<div class="app-header d-flex align-items-center p-2 bg-white rounded border-start border-3">
|
||||
<span class="ti ti-app-window me-2"></span>
|
||||
<h6 class="m-0">
|
||||
<a href="{{ url_for('dashboard.app_view', app_id=app.id) }}" class="text-reset">
|
||||
{{ app.name }}
|
||||
</a>
|
||||
{% if app.ports %}
|
||||
<small class="text-muted ms-2">
|
||||
Ports:
|
||||
{% for port in app.ports %}
|
||||
<span class="badge bg-blue-lt">{{ port.port }}/{{ port.protocol }}</span>
|
||||
{% endfor %}
|
||||
</small>
|
||||
{% endif %}
|
||||
</h6>
|
||||
<div class="ms-2">
|
||||
{% for port in app.ports %}
|
||||
<span class="badge bg-blue-lt">{{ port.port_number }}/{{ port.protocol }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="ps-4 mt-2">
|
||||
<div class="text-muted fst-italic">No applications</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="ps-4 mt-2">
|
||||
<div class="text-muted fst-italic">No servers in this subnet</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Standalone Servers -->
|
||||
{% if hierarchy.standalone_servers %}
|
||||
<div class="standalone-servers-container mb-4">
|
||||
<div class="subnet-header d-flex align-items-center p-2 bg-yellow-lt rounded">
|
||||
<span class="ti ti-server me-2"></span>
|
||||
<h4 class="m-0">Standalone Servers</h4>
|
||||
</div>
|
||||
|
||||
<div class="ps-4 mt-2">
|
||||
{% for server in hierarchy.standalone_servers %}
|
||||
<div class="server-container mb-3 border-start ps-3">
|
||||
<div class="server-header d-flex align-items-center p-2 bg-light rounded">
|
||||
<span class="ti ti-server me-2"></span>
|
||||
<h5 class="m-0">
|
||||
<a href="{{ url_for('dashboard.server_view', server_id=server.id) }}" class="text-reset">
|
||||
{{ server.hostname }}
|
||||
</a>
|
||||
<small class="text-muted ms-2">{{ server.ip_address }}</small>
|
||||
</h5>
|
||||
<div class="ms-auto">
|
||||
<a href="{{ url_for('dashboard.app_new') }}?server_id={{ server.id }}"
|
||||
class="btn btn-sm btn-outline-primary">
|
||||
<span class="ti ti-plus me-1"></span> Add App
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Apps on this server -->
|
||||
{% if server.apps %}
|
||||
<div class="ps-4 mt-2">
|
||||
{% for app in server.apps %}
|
||||
<div class="app-container mb-2 border-start ps-3">
|
||||
<div class="app-header d-flex align-items-center p-2 bg-light-lt rounded">
|
||||
<span class="ti ti-app-window me-2"></span>
|
||||
<h6 class="m-0">
|
||||
<a href="{{ url_for('dashboard.app_view', app_id=app.id) }}" class="text-reset">
|
||||
{{ app.name }}
|
||||
</a>
|
||||
</h6>
|
||||
<div class="ms-2">
|
||||
{% for port in app.ports %}
|
||||
<span class="badge bg-blue-lt">{{ port.port_number }}/{{ port.protocol }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="ps-4 mt-2">
|
||||
<div class="text-muted fst-italic">No applications</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not hierarchy.subnets and not hierarchy.standalone_servers %}
|
||||
{% else %}
|
||||
<div class="text-center py-4">
|
||||
<div class="empty">
|
||||
<div class="empty-img">
|
||||
|
@ -209,6 +206,7 @@
|
|||
</div>
|
||||
|
||||
<style>
|
||||
.location-container,
|
||||
.subnet-container,
|
||||
.server-container,
|
||||
.app-container {
|
||||
|
@ -224,12 +222,14 @@
|
|||
border-left-color: var(--tblr-primary) !important;
|
||||
}
|
||||
|
||||
.location-header,
|
||||
.subnet-header,
|
||||
.server-header,
|
||||
.app-header {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.location-header:hover,
|
||||
.subnet-header:hover,
|
||||
.server-header:hover,
|
||||
.app-header:hover {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue