From a6ebdaf275841b9c0191e113ba23368b92b21acb Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jun 2016 14:25:30 -0400 Subject: [PATCH 1/5] Documented TopologyMaps --- docs/extras.md | 18 ++++++++++++++++++ docs/getting-started.md | 5 ++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/extras.md b/docs/extras.md index 7144804db..bd47d35d9 100644 --- a/docs/extras.md +++ b/docs/extras.md @@ -56,3 +56,21 @@ NetBox does not generate graphs itself. This feature allows you to embed context * **Name:** The title to display above the graph. * **Source URL:** The source of the image to be embedded. The associated object will be available as a template variable named `obj`. * **Link URL (optional):** A URL to which the graph will be linked. The associated object will be available as a template variable named `obj`. + +# Topology Maps + +NetBox can generate simple topology maps from the physical network connections recorded in its database. First, you'll need to create a topology map definition under the admin UI at Extras > Topology Maps. + +Each topology map is associated with a site. A site can have multiple topology maps, which might each illustrate a different aspect of its infrastructure (for example, production versus backend connectivity). + +To define the scope of a topology map, decide which devices you want to include. The map will only include interface connections with both points terminated on an included device. Specify the devices to include in the **device patterns** field by entering a list of [regular expressions](https://en.wikipedia.org/wiki/Regular_expression) matching device names. For example, if you wanted to include "mgmt-switch1" through "mgmt-switch99", you might use the regex `mgmt-switch\d+`. + +Each line of the **device patterns** field represents a hierarchical layer within the topology map. For example, you might map a traditional network with core, distribution, and access tiers like this: + +``` +core-switch-[abcd] +dist-switch\d +access-switch\d+,oob-switch\d+ +``` + +Note that you can combine multiple regexes onto one line using commas. (Commas can only be used for separating regexes; they will not be processed as part of a regex.) The order in which regexes are listed on a line is significant: devices matching the first regex will be rendered first, and subsequent groups will be rendered to the right of those. diff --git a/docs/getting-started.md b/docs/getting-started.md index 76065c57a..1d657fbf3 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -57,11 +57,14 @@ You can verify that authentication works using the following command: * libxml2-dev * libxslt1-dev * libffi-dev +* graphviz* ``` -# apt-get install python2.7 python-dev git python-pip libxml2-dev libxslt1-dev libffi-dev +# apt-get install python2.7 python-dev git python-pip libxml2-dev libxslt1-dev libffi-dev graphviz ``` +*graphviz is needed to render topology maps. If you have no need for this feature, graphviz is not required. + ## Clone the Git Repository Create the base directory for the NetBox installation. For this guide, we'll use `/opt/netbox`. From 8ec145cb82dd9e2d8d3201e55c96ba26144bcdfe Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jun 2016 14:34:49 -0400 Subject: [PATCH 2/5] Added map icons --- netbox/templates/dcim/site.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index 8c5e8130d..e6425ecb9 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -132,7 +132,7 @@ {% for tm in topology_maps %} - + {% endfor %} From 3938b4a27b450ad5ad711851ec31def12ac04a4e Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jun 2016 14:37:48 -0400 Subject: [PATCH 3/5] Added link to extras --- netbox/templates/docs.html | 1 + 1 file changed, 1 insertion(+) diff --git a/netbox/templates/docs.html b/netbox/templates/docs.html index 6360ee482..9875232d4 100644 --- a/netbox/templates/docs.html +++ b/netbox/templates/docs.html @@ -18,6 +18,7 @@ IPAM Circuits Secrets + Extras From a575a73a4f6e8b536a5b382026753a6eb342f2ff Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jun 2016 14:43:14 -0400 Subject: [PATCH 4/5] Added icons to footer --- netbox/templates/_base.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netbox/templates/_base.html b/netbox/templates/_base.html index 252b88948..1513b302b 100644 --- a/netbox/templates/_base.html +++ b/netbox/templates/_base.html @@ -244,9 +244,9 @@

- Docs · - API · - Code + Docs · + API · + Code

From 5bffa4893bf2add8d6045be6c509c0befee9c767 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jun 2016 15:41:14 -0400 Subject: [PATCH 5/5] Fixed bug where checkboxes were being shown on tables regardless of user permissions --- netbox/utilities/tables.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/netbox/utilities/tables.py b/netbox/utilities/tables.py index 8f494d609..724e96056 100644 --- a/netbox/utilities/tables.py +++ b/netbox/utilities/tables.py @@ -19,8 +19,11 @@ class BaseTable(tables.Table): class ToggleColumn(tables.CheckBoxColumn): - default = '' - visible = False + + def __init__(self, *args, **kwargs): + default = kwargs.pop('default', '') + visible = kwargs.pop('visible', False) + super(ToggleColumn, self).__init__(*args, default=default, visible=visible, **kwargs) @property def header(self):
{{ tm }} {{ tm }} {{ tm.description }}