From 55b40830fa10ba3d14cf28d0d11374a21c5f01d4 Mon Sep 17 00:00:00 2001 From: cziryaka Date: Wed, 7 Jun 2017 11:57:17 -0400 Subject: [PATCH] Add inverse_link option --- README.md | 1 + src/ansiblecmdb/data/tpl/html_fancy.tpl | 1 + src/ansiblecmdb/data/tpl/html_fancy_defs.html | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index fc859cc..4c2ba49 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,7 @@ It takes optional parameters: * `collapsed=0|1`: Controls whether host information is collapsed by default or not. A value of `1` will collapse all host information by defaultcontrols whether host information is collapsed by default or not. A value of `1` will collapse all host information by default. (default='0') * `host_details=0|1`: Render host details or not. (default=`1`) * `skip_empty=0|1`: Skip hosts for which no facts were gathered (unreachable, etc). (default=`0`). +* `inverse_link=0|1`: Generate link to direct URL with the regex for the *inverse* of the current search query when typing in the search box (`1`) instead of just generating a direct URL for the current search (`0`). (default=`0`) **sql**: diff --git a/src/ansiblecmdb/data/tpl/html_fancy.tpl b/src/ansiblecmdb/data/tpl/html_fancy.tpl index cb0caf1..fcfc775 100644 --- a/src/ansiblecmdb/data/tpl/html_fancy.tpl +++ b/src/ansiblecmdb/data/tpl/html_fancy.tpl @@ -8,6 +8,7 @@ local_js = to_bool(context.get('local_js', '0')) collapsed = to_bool(context.get('collapsed', '0')) host_details = to_bool(context.get('host_details', '1')) skip_empty = to_bool(context.get('skip_empty', '0')) +inverse_link = to_bool(context.get('inverse_link', '0')) # Get column definitions from html_fancy_defs.html cols = var_cols(columns) diff --git a/src/ansiblecmdb/data/tpl/html_fancy_defs.html b/src/ansiblecmdb/data/tpl/html_fancy_defs.html index 5f00009..d587199 100644 --- a/src/ansiblecmdb/data/tpl/html_fancy_defs.html +++ b/src/ansiblecmdb/data/tpl/html_fancy_defs.html @@ -386,7 +386,11 @@

   '); + % else: + $('#host_overview_tbl_filter label').after('   '); + % endif } } );