Skip to content

Commit

Permalink
Update Software Report - Advanced DataTables.json
Browse files Browse the repository at this point in the history
Fix "Show all"
  • Loading branch information
ZzBombardierzZ authored Sep 19, 2024
1 parent eab91f9 commit bae8a56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/Software Report - Advanced DataTables.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"template": {
"name": "Software Report - Advanced DataTables",
"template_css": "",
"template_md": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n <meta charset=\"UTF-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n <title>{{ client.name }} | Software Inventory Report</title>\r\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css\">\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/1.13.7/css/jquery.dataTables.min.css\">\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/searchpanes/2.2.0/css/searchPanes.dataTables.min.css\">\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/select/1.7.0/css/select.dataTables.min.css\">\r\n <style>\r\n body {\r\n padding: 20px;\r\n }\r\n \r\n .container-fluid {\r\n max-width: 2500px;\r\n margin: 0 auto;\r\n padding-left: 30px;\r\n padding-right: 30px;\r\n }\r\n \r\n .card {\r\n margin-bottom: 20px;\r\n }\r\n \r\n .card-header {\r\n background-color: #f8f9fa;\r\n padding: 5px 20px;\r\n }\r\n \r\n .card-body {\r\n padding: 20px;\r\n }\r\n \r\n #loading {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n height: 200px;\r\n font-size: 18px;\r\n font-weight: bold;\r\n }\r\n \r\n #softwareTable {\r\n display: none;\r\n }\r\n \r\n div.dtsp-verticalContainer {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n justify-content: flex-start;\r\n align-items: flex-start;\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n }\r\n \r\n div.dtsp-verticalContainer div.dtsp-verticalPanes {\r\n flex-basis: 300px;\r\n flex-shrink: 0;\r\n margin-right: 30px;\r\n }\r\n \r\n div.dtsp-verticalContainer div.container-fluid {\r\n flex-grow: 1;\r\n }\r\n \r\n div.dtsp-panesContainer {\r\n border: 1px solid #ccc;\r\n border-radius: 6px;\r\n padding: 15px;\r\n }\r\n\r\n .dataTables_length select {\r\n width: auto;\r\n padding: 5px;\r\n border-radius: 4px;\r\n border: 1px solid #ccc;\r\n }\r\n\r\n .dataTables_length {\r\n float: left;\r\n margin-left: 20px;\r\n margin-top: 10px;\r\n }\r\n \r\n .dataTables_info {\r\n clear: none;\r\n float: left;\r\n margin-top: 5px;\r\n }\r\n \r\n .dataTables_length select {\r\n width: auto;\r\n padding: 5px;\r\n border-radius: 4px;\r\n border: 1px solid #ccc;\r\n }\r\n </style>\r\n</head>\r\n<body>\r\n <div class=\"container-fluid\">\r\n <div class=\"card\">\r\n <div class=\"card-header\">\r\n <h2 style=\"text-align: center;\">{{ client.name }}'s Software Inventory Report</h2>\r\n <p style=\"text-align: center;\">Below is a list of all software currently installed on computers in your organization. This data was exported on {{datetime.date.today()}} and may not reflect the current status.</p>\r\n </div>\r\n <div class=\"card-body\">\r\n <div class=\"dtsp-verticalContainer\">\r\n <div class=\"dtsp-verticalPanes\"></div>\r\n <div class=\"container-fluid\">\r\n <div id=\"loading\">Loading...</div>\r\n <table id=\"softwareTable\" class=\"display nowrap\" width=\"100%\">\r\n <thead>\r\n <tr>\r\n <th>Hostname</th>\r\n <th>Last User</th>\r\n <th>Site Name</th>\r\n <th>Software Name</th>\r\n <th>Publisher</th>\r\n <th>Install Date</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {% for data in data_sources.agentSoftware %}\r\n {% for software in data.software %}\r\n <tr>\r\n <td>{{ data.agent__hostname }}</td>\r\n <td>{{ data.agent__last_logged_in_user }}</td>\r\n <td>{{ data.agent__site__name }}</td>\r\n <td>{{ software.name }}</td>\r\n <td>{{ software.publisher }}</td>\r\n <td>{{ software.install_date }}</td>\r\n </tr>\r\n {% endfor %}\r\n {% else %}\r\n <tr>\r\n <td colspan=\"6\">No software found.</td>\r\n </tr>\r\n {% endfor %}\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <script type=\"text/javascript\" src=\"https://code.jquery.com/jquery-3.7.0.js\"></script>\r\n <script type=\"text/javascript\" src=\"https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js\"></script>\r\n <script type=\"text/javascript\" src=\"https://cdn.datatables.net/searchpanes/2.2.0/js/dataTables.searchPanes.min.js\"></script>\r\n <script type=\"text/javascript\" src=\"https://cdn.datatables.net/select/1.7.0/js/dataTables.select.min.js\"></script>\r\n\r\n <script>\r\n $(document).ready(function() {\r\n var table = $('#softwareTable').DataTable({\r\n searchPanes: {\r\n layout: 'columns-1'\r\n },\r\n dom: '<\"dtsp-dataTable\"frtilp>',\r\n pageLength: 40,\r\n lengthMenu: [10, 25, 50, 100, 'All'],\r\n language: {\r\n lengthMenu: \"Show _MENU_ entries\",\r\n info: \"Showing _START_ to _END_ of _TOTAL_ entries\"\r\n }\r\n });\r\n table.searchPanes();\r\n $(\"div.dtsp-verticalPanes\").append(table.searchPanes.container());\r\n \r\n // Hide the loading message and show the table\r\n $('#loading').hide();\r\n $('#softwareTable').show();\r\n });\r\n </script>\r\n</body>\r\n</html>",
"template_md": "<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n <meta charset=\"UTF-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n <title>{{ client.name }} | Software Inventory Report</title>\r\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css\">\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/1.13.7/css/jquery.dataTables.min.css\">\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/searchpanes/2.2.0/css/searchPanes.dataTables.min.css\">\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdn.datatables.net/select/1.7.0/css/select.dataTables.min.css\">\r\n <style>\r\n body {\r\n padding: 20px;\r\n }\r\n \r\n .container-fluid {\r\n max-width: 2500px;\r\n margin: 0 auto;\r\n padding-left: 30px;\r\n padding-right: 30px;\r\n }\r\n \r\n .card {\r\n margin-bottom: 20px;\r\n }\r\n \r\n .card-header {\r\n background-color: #f8f9fa;\r\n padding: 5px 20px;\r\n }\r\n \r\n .card-body {\r\n padding: 20px;\r\n }\r\n \r\n #loading {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n height: 200px;\r\n font-size: 18px;\r\n font-weight: bold;\r\n }\r\n \r\n #softwareTable {\r\n display: none;\r\n }\r\n \r\n div.dtsp-verticalContainer {\r\n display: flex;\r\n flex-direction: row;\r\n flex-wrap: nowrap;\r\n justify-content: flex-start;\r\n align-items: flex-start;\r\n padding-left: 10px;\r\n padding-right: 10px;\r\n }\r\n \r\n div.dtsp-verticalContainer div.dtsp-verticalPanes {\r\n flex-basis: 300px;\r\n flex-shrink: 0;\r\n margin-right: 30px;\r\n }\r\n \r\n div.dtsp-verticalContainer div.container-fluid {\r\n flex-grow: 1;\r\n }\r\n \r\n div.dtsp-panesContainer {\r\n border: 1px solid #ccc;\r\n border-radius: 6px;\r\n padding: 15px;\r\n }\r\n\r\n .dataTables_length select {\r\n width: auto;\r\n padding: 5px;\r\n border-radius: 4px;\r\n border: 1px solid #ccc;\r\n }\r\n\r\n .dataTables_length {\r\n float: left;\r\n margin-left: 20px;\r\n margin-top: 10px;\r\n }\r\n \r\n .dataTables_info {\r\n clear: none;\r\n float: left;\r\n margin-top: 5px;\r\n }\r\n \r\n .dataTables_length select {\r\n width: auto;\r\n padding: 5px;\r\n border-radius: 4px;\r\n border: 1px solid #ccc;\r\n }\r\n </style>\r\n</head>\r\n<body>\r\n <div class=\"container-fluid\">\r\n <div class=\"card\">\r\n <div class=\"card-header\">\r\n <h2 style=\"text-align: center;\">{{ client.name }}'s Software Inventory Report</h2>\r\n <p style=\"text-align: center;\">Below is a list of all software currently installed on computers in your organization. This data was exported on {{datetime.date.today()}} and may not reflect the current status.</p>\r\n </div>\r\n <div class=\"card-body\">\r\n <div class=\"dtsp-verticalContainer\">\r\n <div class=\"dtsp-verticalPanes\"></div>\r\n <div class=\"container-fluid\">\r\n <div id=\"loading\">Loading...</div>\r\n <table id=\"softwareTable\" class=\"display nowrap\" width=\"100%\">\r\n <thead>\r\n <tr>\r\n <th>Hostname</th>\r\n <th>Last User</th>\r\n <th>Site Name</th>\r\n <th>Software Name</th>\r\n <th>Publisher</th>\r\n <th>Install Date</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {% for data in data_sources.agentSoftware %}\r\n {% for software in data.software %}\r\n <tr>\r\n <td>{{ data.agent__hostname }}</td>\r\n <td>{{ data.agent__last_logged_in_user }}</td>\r\n <td>{{ data.agent__site__name }}</td>\r\n <td>{{ software.name }}</td>\r\n <td>{{ software.publisher }}</td>\r\n <td>{{ software.install_date }}</td>\r\n </tr>\r\n {% endfor %}\r\n {% else %}\r\n <tr>\r\n <td colspan=\"6\">No software found.</td>\r\n </tr>\r\n {% endfor %}\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <script type=\"text/javascript\" src=\"https://code.jquery.com/jquery-3.7.0.js\"></script>\r\n <script type=\"text/javascript\" src=\"https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js\"></script>\r\n <script type=\"text/javascript\" src=\"https://cdn.datatables.net/searchpanes/2.2.0/js/dataTables.searchPanes.min.js\"></script>\r\n <script type=\"text/javascript\" src=\"https://cdn.datatables.net/select/1.7.0/js/dataTables.select.min.js\"></script>\r\n\r\n <script>\r\n $(document).ready(function() {\r\n var table = $('#softwareTable').DataTable({\r\n searchPanes: {\r\n layout: 'columns-1'\r\n },\r\n dom: '<\"dtsp-dataTable\"frtilp>',\r\n pageLength: 40,\r\n lengthMenu: [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'All']],\r\n language: {\r\n lengthMenu: \"Show _MENU_ entries\",\r\n info: \"Showing _START_ to _END_ of _TOTAL_ entries\"\r\n }\r\n });\r\n table.searchPanes();\r\n $(\"div.dtsp-verticalPanes\").append(table.searchPanes.container());\r\n \r\n // Hide the loading message and show the table\r\n $('#loading').hide();\r\n $('#softwareTable').show();\r\n });\r\n </script>\r\n</body>\r\n</html>",
"type": "html",
"depends_on": [
"client"
],
"template_variables": "data_sources:\r\n agentSoftware:\r\n model: installedsoftware\r\n filter:\r\n agent__site__client__id: \"{{client.id}}\"\r\n only:\r\n - software\r\n - agent__hostname\r\n - agent__site__name\r\n - agent__site__client\r\n - agent__last_logged_in_user"
},
"assets": []
}
}

0 comments on commit bae8a56

Please sign in to comment.