diff --git a/netbox/templates/home.html b/netbox/templates/home.html index 76d90bad7..c6c6cb3f6 100644 --- a/netbox/templates/home.html +++ b/netbox/templates/home.html @@ -10,16 +10,20 @@ Organization
-
- {{ stats.site_count }} -

Sites

-

Geographic locations

-
-
- {{ stats.tenant_count }} -

Tenants

-

Customers or departments

-
+ {% if perms.dcim.view_site %} +
+ {{ stats.site_count }} +

Sites

+

Geographic locations

+
+ {% endif %} + {% if perms.tenancy.view_tenant %} +
+ {{ stats.tenant_count }} +

Tenants

+

Customers or departments

+
+ {% endif %}
@@ -27,26 +31,38 @@ DCIM
-
- {{ stats.rack_count }} -

Racks

-

Equipment racks, optionally organized by group

-
-
- {{ stats.device_count }} -

Devices

-

Rack-mounted network equipment, servers, and other devices

-
+ {% if perms.dcim.view_rack %} +
+ {{ stats.rack_count }} +

Racks

+

Equipment racks, optionally organized by group

+
+ {% endif %} + {% if perms.dcim.view_device %} +
+ {{ stats.device_count }} +

Devices

+

Rack-mounted network equipment, servers, and other devices

+
+ {% endif %}

Connections

- {{ stats.cable_count }} -

Cables

- {{ stats.interface_connections_count }} -

Interfaces

- {{ stats.console_connections_count }} -

Console

- {{ stats.power_connections_count }} -

Power

+ {% if perms.dcim.view_cable %} + {{ stats.cable_count }} +

Cables

+ {% endif %} + {% if perms.dcim.view_interface %} + {{ stats.interface_connections_count }} +

Interfaces

+ {% endif %} + {% if perms.dcim.view_consoleport and perms.dcim.view_consoleserverport %} + {{ stats.console_connections_count }} +

Console

+ {% endif %} + {% if perms.dcim.view_powerport and perms.dcim.view_poweroutlet %} + {{ stats.power_connections_count }} +

Power

+ {% endif %}
@@ -55,16 +71,20 @@ Virtualization
-
- {{ stats.cluster_count }} -

Clusters

-

Clusters of physical hosts in which VMs reside

-
-
- {{ stats.virtualmachine_count }} -

Virtual Machines

-

Virtual compute instances running inside clusters

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

Clusters

+

Clusters of physical hosts in which VMs reside

+
+ {% endif %} + {% if perms.virtualization.view_virtualmachine %} +
+ {{ stats.virtualmachine_count }} +

Virtual Machines

+

Virtual compute instances running inside clusters

+
+ {% endif %}
@@ -74,31 +94,41 @@ IPAM
-
- {{ stats.vrf_count }} -

VRFs

-

Virtual routing and forwarding tables

-
-
- {{ stats.aggregate_count }} -

Aggregates

-

Top-level IP allocations

-
-
- {{ stats.prefix_count }} -

Prefixes

-

IPv4 and IPv6 network assignments

-
-
- {{ stats.ipaddress_count }} -

IP Addresses

-

Individual IPv4 and IPv6 addresses

-
-
- {{ stats.vlan_count }} -

VLANs

-

Layer two domains, identified by VLAN ID

-
+ {% if perms.ipam.view_vrf %} +
+ {{ stats.vrf_count }} +

VRFs

+

Virtual routing and forwarding tables

+
+ {% endif %} + {% if perms.ipam.view_aggregate %} +
+ {{ stats.aggregate_count }} +

Aggregates

+

Top-level IP allocations

+
+ {% endif %} + {% if perms.ipam.view_prefix %} +
+ {{ stats.prefix_count }} +

Prefixes

+

IPv4 and IPv6 network assignments

+
+ {% endif %} + {% if perms.ipam.view_ipaddress %} +
+ {{ stats.ipaddress_count }} +

IP Addresses

+

Individual IPv4 and IPv6 addresses

+
+ {% endif %} + {% if perms.ipam.view_vlan %} +
+ {{ stats.vlan_count }} +

VLANs

+

Layer two domains, identified by VLAN ID

+
+ {% endif %}
@@ -106,16 +136,20 @@ Circuits
-
- {{ stats.provider_count }} -

Providers

-

Organizations which provide circuit connectivity

-
-
- {{ stats.circuit_count }} -

Circuits

-

Communication links for Internet transit, peering, and other services

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

Providers

+

Organizations which provide circuit connectivity

+
+ {% endif %} + {% if perms.circuits.view_circuit %} +
+ {{ stats.circuit_count }} +

Circuits

+

Communication links for Internet transit, peering, and other services

+
+ {% endif %}
{% if perms.secrets %} @@ -134,26 +168,28 @@ {% endif %}
-
-
- Global Topology Maps -
- {% if topology_maps %} - - {% for tm in topology_maps %} - - - - - {% endfor %} -
{{ tm }}{{ tm.description }}
- {% else %} -
- None + {% if perms.extras.view_topologymap %} +
+
+ Global Topology Maps
- {% endif %} -
- {% if report_results %} + {% if topology_maps %} + + {% for tm in topology_maps %} + + + + + {% endfor %} +
{{ tm }}{{ tm.description }}
+ {% else %} +
+ None +
+ {% endif %} +
+ {% endif %} + {% if report_results and perms.extras.view_reportresult %}
Reports @@ -168,44 +204,46 @@
{% endif %} -
-
- Changelog + {% if perms.extras.view_objectchange %} +
+
+ Changelog +
+
+ {% for change in changelog %} + {% with action=change.get_action_display|lower %} +
+ {% if action == 'created' %} + + {% elif action == 'updated' %} + + {% elif action == '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' }} + +
+ {% endwith %} + {% if forloop.last %} + + {% endif %} + {% empty %} +
No change history found
+ {% endfor %} +
-
- {% for change in changelog %} - {% with action=change.get_action_display|lower %} -
- {% if action == 'created' %} - - {% elif action == 'updated' %} - - {% elif action == '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' }} - -
- {% endwith %} - {% if forloop.last %} - - {% endif %} - {% empty %} -
No change history found
- {% endfor %} -
-
+ {% endif %}
{% endblock %}