diff --git a/netbox/netbox/views/__init__.py b/netbox/netbox/views/__init__.py index 3991c7e53..bc1a68569 100644 --- a/netbox/netbox/views/__init__.py +++ b/netbox/netbox/views/__init__.py @@ -30,7 +30,7 @@ from virtualization.models import Cluster, VirtualMachine class HomeView(View): - template_name = 'pages/home.html' + template_name = 'home.html' def get(self, request): if settings.LOGIN_REQUIRED and not request.user.is_authenticated: diff --git a/netbox/templates/home.html b/netbox/templates/home.html index 1f9656516..00d2df906 100644 --- a/netbox/templates/home.html +++ b/netbox/templates/home.html @@ -1,309 +1,55 @@ -{% extends 'layout.html' %} {% load helpers %} {% block header %} -{{ block.super }} {% if new_release %} {# new_release is set only if the current user is a superuser or staff member #} - -{% endif %} {% endblock %} {%block title %} Home {% endblock %} -{% block content %} {% include 'search_form.html' %} -
-
-
-
- Organization -
-
-
- {% if perms.dcim.view_site %} - {{ stats.site_count }} -

Sites

- {% else %} - -

Sites

- {% endif %} -

Discrete points of presence

-
-
- {% if perms.dcim.view_location %} - {{ stats.location_count }} -

Locations

- {% else %} - -

Locations

- {% endif %} -

Locations within sites

-
-
- {% if perms.tenancy.view_tenant %} - {{ stats.tenant_count }} -

Tenants

- {% else %} - -

Tenants

- {% endif %} -

Customers or departments

-
-
-
-
- {% if perms.ipam.view_prefix %} - {{ stats.prefix_count }} -

- Prefixes -

- {% else %} - -

Prefixes

- {% endif %} -

- IPv4 and IPv6 network assignments -

-
-
- {% if perms.ipam.view_ipaddress %} - {{ stats.ipaddress_count }} -

- IP Addresses -

- {% else %} - -

IP Addresses

- {% endif %} -

- Individual IPv4 and IPv6 addresses -

-
-
- {% if perms.ipam.view_vlan %} - {{ stats.vlan_count }} -

- VLANs -

- {% else %} - -

VLANs

- {% endif %} -

- Layer two domains, identified by VLAN ID -

-
-
-
-
-
- Circuits -
-
-
- {% if perms.circuits.view_provider %} - {{ stats.provider_count }} -

- Providers -

- {% else %} - -

Providers

- {% endif %} -

- Organizations which provide circuit connectivity -

-
-
- {% if perms.circuits.view_circuit %} - {{ stats.circuit_count }} -

- Circuits -

- {% else %} - -

Circuits

- {% endif %} -

- Communication links for Internet transit, peering, and other - services -

-
-
-
-
-
- Virtualization -
-
-
- {% if perms.virtualization.view_cluster %} - {{ stats.cluster_count }} -

- Clusters -

- {% else %} - -

Clusters

- {% endif %} -

- Clusters of physical hosts in which VMs reside -

-
-
- {% if perms.virtualization.view_virtualmachine %} - {{ stats.virtualmachine_count }} -

- Virtual Machines +
+ {% for section in stats %} +
+
+
{{ section.label }}
+
+
+ {% for item in section.items %} + -

- {% else %} - -

Virtual Machines

- {% endif %} -

- Virtual compute instances running inside clusters -

+
+
+
{{ item.label }}
+ {% if item.description %} + {{ item.description }} + {% endif %} +
+ + {{ item.count }} +
+
+ {% endfor %} +
+
+ {{ item.count }} +
+ {% endfor %} + + + +
+
+
+

Changelog

+
+ {% include 'changelog.html' %} +
+
-
-
-
- Secrets -
-
-
- {% if perms.secrets.view_secret %} - {{ stats.secret_count }} -

- Secrets -

- {% else %} - -

Secrets

- {% endif %} -

- Cryptographically secured secret data -

-
-
-
-
-
- Reports -
- {% if report_results and perms.extras.view_report %} - - {% for result in report_results %} - - - - - {% endfor %} -
- {{ result.name }} - - {% include 'extras/inc/job_label.html' %} -
- {% elif perms.extras.view_report %} -
- None found -
- {% else %} -
- No permission -
- {% endif %} -
-
-
- Change Log -
- {% if changelog and perms.extras.view_objectchange %} -
- {% for change in changelog %} {% with - action=change.get_action_display|lower %} -
- {% if action == 'created' %} - Created - {% elif action == 'updated' %} - Modified - {% elif action == 'deleted' %} - Deleted - {% endif %} {{ change.changed_object_type.name|bettertitle }} {% if - change.changed_object.get_absolute_url %} - {{ change.changed_object }} - {% else %} {{ change.changed_object|default:change.object_repr }} {% - endif %} -
- - {{ change.user|default:change.user_name }} - - {{ change.time|date:'SHORT_DATETIME_FORMAT' }} - -
-
-
- Change Log -
- {% if changelog and perms.extras.view_objectchange %} -
- {% for change in changelog %} - {% with action=change.get_action_display|lower %} -
- {{ change.get_action_display }} - {{ change.changed_object_type.name|bettertitle }} - {% if change.changed_object.get_absolute_url %} - {{ change.changed_object }} - {% else %} - {{ change.changed_object|default:change.object_repr }} - {% endif %} -
- - {{ change.user|default:change.user_name }} - - {{ change.time|date:'SHORT_DATETIME_FORMAT' }} - -
- {% endwith %} - {% if forloop.last %} - - {% endif %} - {% endfor %} -
- {% elif perms.extras.view_objectchange %} -
- No change history found -
- {% else %} -
- No permission -
- {% endif %} -
- {% endif %} {% endfor %} -
- {% elif perms.extras.view_objectchange %} -
- No change history found -
- {% else %} -
- No permission -
- {% endif %} -
-
+ {% endblock %} diff --git a/netbox/templates/pages/home.html b/netbox/templates/pages/home.html deleted file mode 100644 index 6dc87f664..000000000 --- a/netbox/templates/pages/home.html +++ /dev/null @@ -1,55 +0,0 @@ -{% extends 'layout.html' %} {% load helpers %} {%block title %} Home -{%endblock%} {% block content %} - -
-
- {% for section in stats %} -
-
-
{{ section.label }}
-
- -
- {{ item.count }} -
-
-
-
- {% endfor %} -
-
- -
-
-
-

Changelog

-
- {% include '../changelog.html' %} -
-
-
-
- -{% endblock %}