Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
"download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Agent%20Specs.json"
},
{
"name": "Agent Uptime_By Client (html) v1.4",
"download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Agent%20Uptime_By%20Client%20%28html%29%20v1.4.json"
"name": "Agent TRMM Install date_descending v1.3",
"download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Agent%20TRMM%20Install%20date_descending%20v1.3.json"
},
{
"name": "Agent Uptime_By Client (html) v1.5",
"download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Agent%20Uptime_By%20Client%20%28html%29%20v1.5.json"
},
{
"name": "Agent_ListClientThenSite (csv)",
Expand Down Expand Up @@ -144,8 +148,8 @@
"download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Antivirus%20Report.json"
},
{
"name": "Antivirus Report (csv)",
"download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Antivirus%20Report%20%28csv%29.json"
"name": "Antivirus Report v1.1",
"download_url": "https://raw.githubusercontent.com/amidaware/reporting-templates/master/templates/Antivirus%20Report%20v1.1.json"
},
{
"name": "Audit Logs (csv)",
Expand Down
15 changes: 15 additions & 0 deletions templates/Agent TRMM Install date_descending v1.3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"base_template": {
"name": "TRMM_Base v1",
"html": "<html>\n\n<head>\n <style>\n /* —— PDF page settings —— */\n @page {\n margin: 0.5in;\n }\n\n /* —— Color palette (theme) —— */\n :root {\n --header-bg: #2c3e50;\n --header-text: #ffffff;\n --border-color: #dddddd;\n --table-header-bg: #f2f2f2;\n --status-ready-bg: #eaf7ec;\n --status-ready-badge: #28a745;\n --status-not-ready-bg: #fbebee;\n --status-not-ready-badge: #dc3545;\n --status-unknown-bg: #fff9e6;\n --status-unknown-badge: #ffc107;\n --badge-already-bg: #17a2b8;\n }\n\n /* —— Typography & utilities (structure) —— */\n body {\n font-family: sans-serif;\n color: #333;\n }\n\n .section {\n margin-top: 20px;\n }\n\n .text-danger {\n color: var(--status-not-ready-badge);\n font-weight: bold;\n }\n\n /* —— Header layout (structure) —— */\n .report-header {\n background-color: var(--header-bg);\n color: var(--header-text);\n padding: 20px;\n border-radius: 8px;\n display: flex;\n align-items: center;\n }\n\n .header-logo {\n width: 80px;\n margin-right: 25px;\n flex-shrink: 0;\n }\n\n .header-date {\n margin-left: auto;\n text-align: right;\n white-space: nowrap;\n }\n\n .report-header h1 {\n font-size: 24px;\n margin: 0 0 5px;\n }\n\n .report-header h2 {\n font-size: 16px;\n margin: 0;\n opacity: 0.9;\n }\n\n /* —— Table basics (structure) —— */\n .report-table {\n border-collapse: collapse;\n width: 100%;\n font-size: 12px;\n }\n\n .report-table th,\n .report-table td {\n border: 1px solid var(--border-color);\n padding: 8px 12px;\n text-align: left;\n vertical-align: middle;\n }\n\n .report-table thead th {\n background-color: var(--table-header-bg);\n font-weight: bold;\n }\n\n /* —— Badge shape (structure) —— */\n .status-badge {\n display: inline-block;\n padding: 4px 10px;\n border-radius: 12px;\n color: #fff;\n font-weight: bold;\n font-size: 11px;\n text-align: center;\n white-space: nowrap;\n }\n\n /* —— Stub classes for per‑report overrides —— */\n .status-ready {}\n\n .status-not-ready {}\n\n .status-unknown {}\n\n .badge-ready {}\n\n .badge-not-ready {}\n\n .badge-unknown {}\n\n .badge-already {}\n </style>\n</head>\n\n<body>\n {% block content %}{% endblock %}\n</body>\n\n</html>"
},
"template": {
"name": "Agent TRMM Install date_descending v1.3",
"template_css": "",
"template_md": "{% block content %}\r\n<style>\r\n @page {\r\n margin: 0.5in;\r\n size: letter landscape;\r\n /* or A4 landscape */\r\n }\r\n\r\n /* Style for the filter dropdowns inside the table headers */\r\n .report-table thead th select {\r\n width: 100%;\r\n margin-top: 5px;\r\n padding: 4px;\r\n border-radius: 4px;\r\n border: 1px solid #ccc;\r\n font-weight: normal; /* Keep dropdown text normal weight */\r\n }\r\n</style>\r\n\r\n<div class=\"report-header\">\r\n <div class=\"header-logo\">\r\n <img src=\"https://github.com/amidaware/reporting-templates/blob/master/assets/gbtnavy%20(256).png?raw=true\" alt=\"Amidaware Logo\" style=\"width: 80px; height: auto;\">\r\n </div>\r\n <div class=\"header-titles\">\r\n <h1>TRMM Agents Installation Report</h1>\r\n <h2 id=\"report-subtitle\">Client: All | Site: All</h2>\r\n </div>\r\n <div class=\"header-date\">\r\n <h2>Report Date:<br>{{ report_run_timestamp.strftime('%B %d, %Y') }}</h2>\r\n </div>\r\n</div>\r\n\r\n{% set clients = [] %}\r\n{% set sites = [] %}\r\n{% for item in data_sources.agents %}\r\n {% if item.site__client__name not in clients %}\r\n {% set _ = clients.append(item.site__client__name) %}\r\n {% endif %}\r\n {% if item.site__name not in sites %}\r\n {% set _ = sites.append(item.site__name) %}\r\n {% endif %}\r\n{% endfor %}\r\n\r\n<div class=\"section\">\r\n <table class=\"report-table\">\r\n <thead>\r\n <tr>\r\n <th>\r\n Client\r\n <select id=\"client-filter\">\r\n <option value=\"all\">All Clients</option>\r\n {% for client in clients | sort %}\r\n <option value=\"{{ client }}\">{{ client }}</option>\r\n {% endfor %}\r\n </select>\r\n </th>\r\n <th>\r\n Site\r\n <select id=\"site-filter\">\r\n <option value=\"all\">All Sites</option>\r\n {% for site in sites | sort %}\r\n <option value=\"{{ site }}\">{{ site }}</option>\r\n {% endfor %}\r\n </select>\r\n </th>\r\n <th>Agent</th>\r\n <th>User</th>\r\n <th>Installation Date</th>\r\n </tr>\r\n </thead>\r\n <tbody id=\"report-table-body\">\r\n {% for item in data_sources.agents %}\r\n <tr>\r\n <td>{{ item.site__client__name }}</td>\r\n <td>{{ item.site__name }}</td>\r\n <td>{{ item.hostname }}</td>\r\n <td>{{ item.last_logged_in_user }}</td>\r\n <td>{% if item.created_time %}{{ item.created_time.strftime('%Y-%m-%d %H:%M') }}{% else %}N/A{% endif %}</td>\r\n </tr>\r\n {% endfor %}\r\n </tbody>\r\n </table>\r\n</div>\r\n\r\n<script>\r\n // This script runs after the report is loaded in the browser\r\n document.addEventListener(\"DOMContentLoaded\", function () {\r\n const clientFilter = document.getElementById(\"client-filter\");\r\n const siteFilter = document.getElementById(\"site-filter\");\r\n const tableBody = document.getElementById(\"report-table-body\");\r\n const reportSubtitle = document.getElementById(\"report-subtitle\");\r\n const tableRows = tableBody.getElementsByTagName(\"tr\");\r\n\r\n function applyFilters() {\r\n const selectedClient = clientFilter.value;\r\n const selectedSite = siteFilter.value;\r\n\r\n // Update the report subtitle to reflect the current filters\r\n let subtitle = `Client: ${selectedClient === 'all' ? 'All' : selectedClient}`;\r\n subtitle += ` | Site: ${selectedSite === 'all' ? 'All' : selectedSite}`;\r\n reportSubtitle.textContent = subtitle;\r\n\r\n // Loop through all rows in the table and hide/show them based on selections\r\n for (let i = 0; i < tableRows.length; i++) {\r\n const row = tableRows[i];\r\n const clientCell = row.cells[0].textContent.trim();\r\n const siteCell = row.cells[1].textContent.trim();\r\n\r\n const clientMatch = (selectedClient === \"all\") || (clientCell === selectedClient);\r\n const siteMatch = (selectedSite === \"all\") || (siteCell === selectedSite);\r\n\r\n if (clientMatch && siteMatch) {\r\n row.style.display = \"\"; // Show the row\r\n } else {\r\n row.style.display = \"none\"; // Hide the row\r\n }\r\n }\r\n }\r\n\r\n // Add event listeners to run the filter function whenever a dropdown is changed\r\n clientFilter.addEventListener(\"change\", applyFilters);\r\n siteFilter.addEventListener(\"change\", applyFilters);\r\n });\r\n</script>\r\n{% endblock %}",
"type": "html",
"depends_on": [],
"template_variables": "data_sources:\r\n agents:\r\n model: agent\r\n select_related:\r\n - site\r\n - site__client\r\n only:\r\n - hostname\r\n - last_logged_in_user\r\n - created_time\r\n - site__name\r\n - site__client__name\r\n order_by:\r\n - -created_time\r\nreport_run_timestamp: !now"
},
"assets": []
}
17 changes: 0 additions & 17 deletions templates/Agent Uptime_By Client (html) v1.4.json

This file was deleted.

Loading