General UI cleanup

This commit is contained in:
jeremystretch 2021-07-21 11:20:35 -04:00
parent d42138384f
commit 19eafef41e
28 changed files with 677 additions and 648 deletions

View File

@ -304,8 +304,8 @@ OTHER_MENU = Menu(
MenuGroup(
label="Miscellaneous",
items=(
MenuItem(label="Config Contexts",
url="extras:configcontext_list", add_url=None, import_url=None),
MenuItem(label="Config Contexts", url="extras:configcontext_list",
add_url="extras:configcontext_add", import_url=None),
MenuItem(label="Reports", url="extras:report_list",
add_url=None, import_url=None),
MenuItem(label="Scripts", url="extras:script_list",

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
@use 'sass:map';
:root {
--nbx-sidebar-bg: #{$gray-100};
--nbx-sidebar-bg: #{$gray-200};
--nbx-sidebar-link-color: #{$gray-800};
--nbx-sidebar-link-hover-bg: #{$blue-100};
--nbx-sidebar-title-color: #{$text-muted};
@ -23,7 +23,7 @@
--nbx-color-mode-toggle-color: #{$primary};
body[data-netbox-color-mode='dark'] {
--nbx-sidebar-bg: #{$gray-900};
--nbx-sidebar-bg: #{$gray-800};
--nbx-sidebar-link-color: #{$gray-200};
--nbx-sidebar-link-hover-bg: #{rgba($blue-300, 0.15)};
--nbx-sidebar-title-color: #{$gray-600};
@ -300,6 +300,11 @@ body {
vertical-align: bottom;
}
}
&.attr-table {
th {
width: 25%;
}
}
}
}
@ -605,6 +610,7 @@ span.color-label {
height: 1rem;
display: block;
box-shadow: $box-shadow-sm;
border: 1px solid #303030;
border-radius: $border-radius;
padding: $badge-padding-y $badge-padding-x;
}

View File

@ -30,6 +30,12 @@
<th scope="row">Type</th>
<td><a href="{{ object.type.get_absolute_url }}">{{ object.type }}</a></td>
</tr>
<tr>
<th scope="row">Status</th>
<td>
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<td>
@ -43,12 +49,6 @@
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Status</th>
<td>
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<th scope="row">Install Date</th>
<td>{{ object.install_date|annotated_date|placeholder }}</td>

View File

@ -19,7 +19,7 @@
</tr>
<tr>
<th scope="row">Name</th>
<th scope="row">{{ object.name }}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Label</th>

View File

@ -6,10 +6,6 @@
{% load plugins %}
{% block content %}
<div class="row">
<div class="col col-md-12">
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="details">
<div class="row">
<div class="col col-md-6">
<div class="card">
@ -356,8 +352,4 @@
{% plugin_full_width_page object %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -21,24 +21,6 @@
</h5>
<div class="card-body">
<table class="table table-hover">
<tr>
<td colspan="2">
{% if object.enabled %}
<span class="badge bg-success">Enabled</span>
{% else %}
<span class="badge bg-danger">Disabled</span>
{% endif %}
</td>
</tr>
<tr>
<td colspan="2">
{% if object.mgmt_only %}
<span class="badge bg-success">Management Only</span>
{% else %}
<span class="badge bg-danger">Not Management Only</span>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Device</th>
<td>
@ -57,6 +39,36 @@
<th scope="row">Type</th>
<td>{{ object.get_type_display }}</td>
</tr>
<tr>
<th scope="row">Enabled</th>
<td>
{% if object.enabled %}
<i class="mdi mdi-check-bold text-success" title="Yes"></i>
{% else %}
<i class="mdi mdi-close-thick text-danger" title="No"></i>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Management Only</th>
<td>
{% if object.mgmt_only %}
<i class="mdi mdi-check-bold text-success" title="Yes"></i>
{% else %}
<i class="mdi mdi-close-thick text-danger" title="No"></i>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Parent</th>
<td>
{% if object.parent %}
<a href="{{ object.parent.get_absolute_url }}">{{ object.parent }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">LAG</th>
<td>
@ -81,7 +93,7 @@
</tr>
<tr>
<th scope="row">802.1Q Mode</th>
<td>{{ object.get_mode_display }}</td>
<td>{{ object.get_mode_display|placeholder }}</td>
</tr>
</table>
</div>

View File

@ -39,7 +39,7 @@
</tr>
<tr>
<th scope="row">Feed Leg</th>
<td>{{ object.get_feed_leg_display }}</td>
<td>{{ object.get_feed_leg_display|placeholder }}</td>
</tr>
</table>
</div>

View File

@ -27,7 +27,7 @@
</tr>
<tr>
<th scope="row">Type</th>
<td>{{ object.get_type_display }}</td>
<td>{{ object.get_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Description</th>

View File

@ -31,8 +31,8 @@
{% endblock %}
{% block content %}
<div class="row">
<div class="col col-12 col-xl-6">
<div class="row">
<div class="col col-12 col-xl-5">
<div class="card">
<h5 class="card-header">
Rack
@ -60,19 +60,6 @@
<span class="text-muted">None</span>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Group</th>
<td>
{% if object.group %}
{% for group in object.group.get_ancestors %}
<a href="{{ group.get_absolute_url }}">{{ group }}</a> /
{% endfor %}
<a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Facility ID</th>
@ -109,7 +96,7 @@
</tr>
<tr>
<th scope="row">Serial Number</th>
<td><code>{{ object.serial|placeholder }}</code></td>
<td>{{ object.serial|placeholder }}</td>
</tr>
<tr>
<th scope="row">Asset Tag</th>
@ -309,7 +296,7 @@
</div>
{% plugin_left_page object %}
</div>
<div class="col col-12 col-xl-6">
<div class="col col-12 col-xl-7">
<div class="row" style="margin-bottom: 20px">
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">
@ -370,10 +357,10 @@
</div>
{% plugin_right_page object %}
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="col col-md-12">
{% plugin_full_width_page object %}
</div>
</div>
</div>
{% endblock %}

View File

@ -12,7 +12,7 @@
{% block content %}
<div class="row mb-3">
<div class="col col-md-6">
<div class="col col-12 col-xl-5">
<div class="card">
<h5 class="card-header">
Rack
@ -30,10 +30,10 @@
</td>
</tr>
<tr>
<th scope="row">Group</th>
<th scope="row">Location</th>
<td>
{% if rack.group %}
<a href="{{ rack.group.get_absolute_url }}">{{ rack.group }}</a>
{% if rack.location %}
<a href="{{ rack.location.get_absolute_url }}">{{ rack.location }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
@ -87,7 +87,7 @@
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='dcim:rackreservation_list' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="col col-12 col-xl-7">
<div class="row" style="margin-bottom: 20px">
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
<div style="margin-left: 30px">

View File

@ -27,12 +27,6 @@
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<td colspan="2">
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<th scope="row">Region</th>
<td>
@ -46,6 +40,25 @@
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Group</th>
<td>
{% if object.group %}
{% for group in object.group.get_ancestors %}
<a href="{{ group.get_absolute_url }}">{{ group }}</a> /
{% endfor %}
<a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a>
{% else %}
<span class="text-muted">None</span>
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Status</th>
<td>
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<td>

View File

@ -60,7 +60,7 @@
<td>
<a href="{{ vc_member.get_absolute_url }}">{{ vc_member }}</a>
</td>
<td><span class="badge badge-default">{{ vc_member.vc_position }}</span></td>
<td><span class="badge bg-secondary">{{ vc_member.vc_position }}</span></td>
<td>{% if object.master == vc_member %}<i class="mdi mdi-check-bold text-success"></i>{% endif %}</td>
<td>{{ vc_member.vc_priority|placeholder }}</td>
</tr>

View File

@ -4,7 +4,7 @@
{% block content %}
<div class="row mb-3">
<div class="col col-md-6">
<div class="col col-md-5">
<div class="card">
<h5 class="card-header">
Custom Link
@ -46,7 +46,7 @@
</div>
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="col col-md-7">
<div class="card">
<h5 class="card-header">
Link Text

View File

@ -9,7 +9,7 @@
{% block content %}
<div class="row mb-3">
<div class="col col-md-6">
<div class="col col-md-5">
<div class="card">
<h5 class="card-header">
Export Template
@ -51,7 +51,7 @@
</div>
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
<div class="col col-md-7">
<div class="card">
<h5 class="card-header">
Template

View File

@ -3,7 +3,7 @@
{% load plugins %}
{% block content %}
<div class="row">
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
@ -18,15 +18,9 @@
</td>
</tr>
<tr>
<th scope="row">Slug</th>
<th scope="row">Description</th>
<td>
{{ object.slug }}
</td>
</tr>
<tr>
<th scope="row">Tagged Items</th>
<td>
{{ items_count }}
{{ object.description|placeholder }}
</td>
</tr>
<tr>
@ -36,9 +30,9 @@
</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">Tagged Items</th>
<td>
{{ object.description|placeholder }}
{{ taggeditem_table.rows|length }}
</td>
</tr>
</table>
@ -46,9 +40,35 @@
</div>
</div>
<div class="col col-md-6">
{% include 'inc/panel_table.html' with table=items_table heading='Tagged Objects' %}
{% include 'inc/paginator.html' with paginator=items_table.paginator page=items_table.page %}
<div class="card">
<h5 class="card-header">
Tagged Item Types
</h5>
<div class="card-body">
<table class="table table-hover panel-body attr-table">
{% for object_type in object_types %}
<tr>
<td>{{ object_type.content_type.name|bettertitle }}</td>
<td>
{% with viewname=object_type.content_type.model_class|validated_viewname:"list" %}
{% if viewname %}
<a href="{% url viewname %}?tag={{ object.slug }}">{{ object_type.item_count }}</a>
{% else %}
{{ object_type.item_count }}
{% endif %}
{% endwith %}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% plugin_full_width_page object %}
</div>
</div>
<div class="row">
<div class="col">
{% include 'inc/panel_table.html' with table=taggeditem_table heading='Tagged Objects' %}
{% include 'inc/paginator.html' with paginator=taggeditem_table.paginator page=items_table.page %}
</div>
</div>
{% plugin_full_width_page object %}
{% endblock %}

View File

@ -116,9 +116,9 @@
{% include 'inc/panel_table.html' with table=parent_prefixes_table heading='Parent Prefixes' %}
{% if duplicate_ips_table.rows %}
{# Custom version of panel_table.html #}
<div class="card bg-danger">
<div class="card border-danger">
<h5 class="card-header">
Duplicate IP Addresses
<span class="text-danger">Duplicate IP Addresses</span>
{% if more_duplicate_ips %}
<div class="float-end">
<a type="button" class="btn btn-primary btn-sm"
@ -137,7 +137,7 @@
</div>
{% endif %}
<div class="my-3">
{% include 'utilities/obj_table.html' with table=related_ips_table heading='Related IP Addresses' %}
{% include 'inc/panel_table.html' with table=related_ips_table heading='Related IP Addresses' %}
</div>
{% plugin_right_page object %}
</div>

View File

@ -4,7 +4,7 @@
{% block content %}
<div class="row">
<div class="col col-md-5">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Prefix
@ -74,6 +74,12 @@
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Status</th>
<td>
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<th scope="row">Role</th>
<td>
@ -85,10 +91,8 @@
</td>
</tr>
<tr>
<th scope="row">Status</th>
<td>
<span class="label label-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
<th scope="row">Description</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Is a pool</th>
@ -100,10 +104,6 @@
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Description</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Utilization</th>
<td>
@ -118,24 +118,20 @@
</table>
</div>
</div>
{% include 'inc/custom_fields_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-7">
{% if duplicate_prefix_table.rows %}
{% include 'inc/panel_table.html' with table=duplicate_prefix_table heading='Duplicate Prefixes' %}
{% endif %}
{% include 'inc/panel_table.html' with table=parent_prefix_table heading='Parent Prefixes' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row my-3">
<div class="col col-md-5">
<div class="col col-md-6">
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:prefix_list' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">
<div class="col col-md-12">
{% if duplicate_prefix_table.rows %}
{% include 'inc/panel_table.html' with table=duplicate_prefix_table heading='Duplicate Prefixes' %}
{% endif %}
{% include 'inc/panel_table.html' with table=parent_prefix_table heading='Parent Prefixes' %}
{% plugin_full_width_page object %}
</div>
</div>

View File

@ -32,7 +32,8 @@
</table>
</div>
</div>
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:routetarget_list' %}
{% include 'inc/custom_fields_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
@ -43,14 +44,6 @@
{% plugin_right_page object %}
</div>
</div>
<div class="row my-3">
<div class="col col-md-6">
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:routetarget_list' %}
</div>
<div class="col col-md-6">
{% include 'inc/custom_fields_panel.html' %}
</div>
</div>
<div class="row">
<div class="col col-md-12">
{% plugin_full_width_page object %}

View File

@ -57,11 +57,11 @@
</table>
</div>
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:service_list' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:service_list' %}
{% plugin_right_page object %}
</div>
</div>

View File

@ -4,18 +4,13 @@
{% block content %}
<div class="row">
<div class="col col-md-4">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
VLAN
</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<td colspan="2">
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<th scope="row">Site</th>
<td>
@ -60,6 +55,12 @@
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Status</th>
<td>
<span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
</td>
</tr>
<tr>
<th scope="row">Role</th>
<td>
@ -77,11 +78,16 @@
</table>
</div>
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:vlan_list' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-8">
<div class="col col-md-6">
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:vlan_list' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">
Prefixes
@ -98,11 +104,6 @@
</div>
{% endif %}
</div>
{% plugin_right_page object %}
</div>
</div>
<div class="row">
<div class="col col-md-12">
{% plugin_full_width_page object %}
</div>
</div>

View File

@ -16,7 +16,7 @@
<table class="table table-hover attr-table">
<tr>
<th scope="row">Route Distinguisher</th>
<td><code>{{ object.rd }}</code></td>
<td>{{ object.rd|placeholder }}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
@ -57,16 +57,22 @@
</table>
</div>
</div>
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:vrf_list' %}
{% include 'inc/custom_fields_panel.html' %}
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
{% include 'inc/panel_table.html' with table=import_targets_table heading="Import Route Targets" %}
{% include 'inc/panel_table.html' with table=export_targets_table heading="Export Route Targets" %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='ipam:vrf_list' %}
{% include 'inc/custom_fields_panel.html' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">
<div class="col col-md-6">
{% include 'inc/panel_table.html' with table=import_targets_table heading="Import Route Targets" %}
</div>
<div class="col col-md-6">
{% include 'inc/panel_table.html' with table=export_targets_table heading="Export Route Targets" %}
</div>
</div>
<div class="row">
<div class="col col-md-12">
{% plugin_full_width_page object %}

View File

@ -4,7 +4,7 @@
{% block content %}
<div class="row">
<div class="col-sm-3 col-md-2 col-md-offset-1 border-end">
<div class="col-sm-3 col-md-2 border-end">
<nav class="nav nav-pills nav-justified flex-column">
<a class="nav-item nav-link text-start{% if active_tab == 'profile' %} active{% endif %}" href="{% url 'user:profile' %}">Profile</a>
<a class="nav-link nav-item text-start{% if active_tab == 'preferences' %} active{% endif %}" href="{% url 'user:preferences' %}">Preferences</a>
@ -14,7 +14,7 @@
<a class="nav-link nav-item text-start{% if active_tab == 'api-tokens' %} active{% endif %}" href="{% url 'user:token_list' %}">API Tokens</a>
</nav>
</div>
<div class="col-sm-9 col-md-8 px-4">
<div class="col-sm-9 col-md-10 px-4">
{% block usercontent %}{% endblock %}
</div>
</div>

View File

@ -4,7 +4,7 @@
{% block content %}
<div class="row">
<div class="col col-md-5">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">
Cluster
@ -56,8 +56,6 @@
</table>
</div>
</div>
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='virtualization:cluster_list' %}
<div class="card">
<h5 class="card-header">
Comments
@ -72,6 +70,11 @@
</div>
{% plugin_left_page object %}
</div>
<div class="col col-md-6">
{% include 'inc/custom_fields_panel.html' %}
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='virtualization:cluster_list' %}
{% plugin_right_page object %}
</div>
</div>
<div class="row">
<div class="col col-md-12">

View File

@ -61,7 +61,7 @@
</tr>
<tr>
<th scope="row">802.1Q Mode</th>
<td>{{ object.get_mode_display }}</td>
<td>{{ object.get_mode_display|placeholder }}</td>
</tr>
</table>
</div>