From e91f20e39b097320b64bee35bbbce2ca42251865 Mon Sep 17 00:00:00 2001
From: Benjamin Bertrand <benjamin.bertrand@esss.se>
Date: Fri, 25 Jan 2019 15:52:38 +0100
Subject: [PATCH] Improve Ansible groups list table view

- Restrict the width of the vars column
- Make the children and hosts a list of comma separated words with space
  to allow line break

JIRA INFRA-763
---
 app/static/js/groups.js | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/app/static/js/groups.js b/app/static/js/groups.js
index 6b9e408..d3f690e 100644
--- a/app/static/js/groups.js
+++ b/app/static/js/groups.js
@@ -41,7 +41,8 @@ $(document).ready(function() {
           callback(json);
         });
     },
-    "paging": false,
+    "paging": true,
+    "pagingType": "full_numbers",
     "columns": [
       { data: 'name',
         render: function(data, type, row) {
@@ -58,12 +59,20 @@ $(document).ready(function() {
           if ( data === null ) {
             return "";
           }
-          return '<pre style="white-space: pre-wrap">' + JSON.stringify(data, null, 2) + '</pre>';
+          return '<pre style="max-width:300px;">' + JSON.stringify(data, null, 2) + '</pre>';
         }
       },
       { data: 'type' },
-      { data: 'children' },
-      { data: 'hosts' }
+      { data: 'children',
+        render: function(data, type, row) {
+          return data.join(", ");
+        }
+      },
+      { data: 'hosts',
+        render: function(data, type, row) {
+          return data.join(", ");
+        }
+      }
     ]
   });
 
-- 
GitLab