savex | 4448e13 | 2018-04-25 15:51:14 +0200 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <title>Cloud Package versions check</title> |
| 6 | <style> |
| 7 | body { |
| 8 | font-family: Verdana, Geneva, Tahoma, sans-serif; |
| 9 | font-size: 90% !important; |
| 10 | } |
| 11 | .dot_green { |
| 12 | float: left; |
| 13 | color: green; |
| 14 | margin-right: 0.5em; |
| 15 | margin-top: 0.2em; |
| 16 | } |
| 17 | .dot_red { |
| 18 | float: left; |
| 19 | color: red; |
| 20 | margin-right: 0.5em; |
| 21 | margin-top: 0.2em; |
| 22 | } |
| 23 | .dot_empty { |
| 24 | float: left; |
| 25 | color: darkgray; |
| 26 | margin-right: 0.5em; |
| 27 | margin-top: 0.2em; |
| 28 | } |
| 29 | /* Style the tab */ |
| 30 | .tab { |
| 31 | float: left; |
| 32 | width: 130px; |
| 33 | border: 1px solid #fff; |
| 34 | background-color: #efe; |
| 35 | } |
| 36 | |
| 37 | /* Style the buttons that are used to open the tab content */ |
| 38 | .tab button { |
| 39 | display: block; |
| 40 | background-color: inherit; |
| 41 | color: Black; |
| 42 | border: none; |
| 43 | outline: none; |
| 44 | font-family: "Lucida Console", Monaco, monospace; |
| 45 | text-align: left; |
| 46 | cursor: pointer; |
| 47 | transition: 0.3s; |
| 48 | font-size: 1.3em; |
| 49 | width: 100%; |
| 50 | padding: 1px; |
| 51 | margin: 1px; |
| 52 | } |
| 53 | |
| 54 | button > div.node_name { |
| 55 | float: left; |
| 56 | font-size: 1.3em; |
| 57 | } |
| 58 | |
| 59 | .smallgreytext { |
| 60 | float: right; |
| 61 | font-size: 0.7em; |
| 62 | color: gray; |
| 63 | } |
| 64 | |
| 65 | /* Change background color of buttons on hover */ |
| 66 | .tab button:hover { |
| 67 | background-color: #7b7; |
| 68 | } |
| 69 | |
| 70 | /* Create an active/current "tab button" class */ |
| 71 | .tab button.active { |
| 72 | background-color: #8c8; |
| 73 | color: white; |
| 74 | } |
| 75 | |
| 76 | /* Style the tab content */ |
| 77 | .tabcontent { |
| 78 | display: none; |
| 79 | position: absolute; |
| 80 | font-size: 1em; |
| 81 | padding: 0.5em; |
| 82 | right: -10%; |
| 83 | top: 0%; |
| 84 | transform: translateX(-12%); |
| 85 | width: calc(100% - 170px); |
| 86 | overflow-x: scroll; |
| 87 | overflow-wrap: break-word; |
| 88 | } |
| 89 | |
| 90 | table { |
| 91 | border: 0 hidden; |
| 92 | width: 100%; |
| 93 | } |
| 94 | tr:nth-child(even) { |
| 95 | background-color: #fff; |
| 96 | } |
| 97 | tr:nth-child(odd) { |
| 98 | background-color: #ddd; |
| 99 | } |
| 100 | .Header { |
| 101 | background-color: #bbb; |
| 102 | color: Black; |
| 103 | width: 30%; |
| 104 | text-align: center; |
| 105 | } |
| 106 | .pkgName { |
| 107 | font-size: 1em; |
| 108 | padding-left: 10px; |
| 109 | } |
| 110 | |
| 111 | .version { |
| 112 | font-size: 1.1em; |
| 113 | text-align: left; |
| 114 | } |
| 115 | |
| 116 | .differ { |
| 117 | background-color: #eaa; |
| 118 | } |
| 119 | /* Tooltip container */ |
| 120 | .tooltip { |
| 121 | position: relative; |
| 122 | display: inline-block; |
| 123 | border-bottom: 1px dotted black; |
| 124 | } |
| 125 | |
| 126 | .tooltip .tooltiptext { |
| 127 | visibility: hidden; |
| 128 | background-color: black; |
| 129 | font-family: "Lucida Console", Monaco, monospace; |
| 130 | font-size: 0.5em; |
| 131 | width: auto; |
| 132 | color: #fff; |
| 133 | border-radius: 6px; |
| 134 | padding: 5px 5px; |
| 135 | |
| 136 | /* Position the tooltip */ |
| 137 | position: absolute; |
| 138 | z-index: 1; |
| 139 | } |
| 140 | |
| 141 | .tooltip:hover .tooltiptext { |
| 142 | visibility: visible; |
| 143 | } |
| 144 | |
| 145 | </style> |
| 146 | <script language="JavaScript"> |
| 147 | function init() { |
| 148 | // Declare all variables |
| 149 | var i, tabcontent, tablinks; |
| 150 | |
| 151 | // Get all elements with class="tabcontent" and hide them |
| 152 | tabcontent = document.getElementsByClassName("tabcontent"); |
| 153 | for (i = 1; i < tabcontent.length; i++) { |
| 154 | tabcontent[i].style.display = "none"; |
| 155 | } |
| 156 | tabcontent[0].style.display = "block"; |
| 157 | |
| 158 | // Get all elements with class="tablinks" and remove the class "active" |
| 159 | tablinks = document.getElementsByClassName("tablinks"); |
| 160 | for (i = 1; i < tablinks.length; i++) { |
| 161 | tablinks[i].className = tablinks[i].className.replace(" active", ""); |
| 162 | } |
| 163 | tablinks[0].className += " active"; |
| 164 | |
| 165 | } |
| 166 | function openTab(evt, tabName) { |
| 167 | // Declare all variables |
| 168 | var i, tabcontent, tablinks; |
| 169 | |
| 170 | // Get all elements with class="tabcontent" and hide them |
| 171 | tabcontent = document.getElementsByClassName("tabcontent"); |
| 172 | for (i = 0; i < tabcontent.length; i++) { |
| 173 | tabcontent[i].style.display = "none"; |
| 174 | } |
| 175 | |
| 176 | // Get all elements with class="tablinks" and remove the class "active" |
| 177 | tablinks = document.getElementsByClassName("tablinks"); |
| 178 | for (i = 0; i < tablinks.length; i++) { |
| 179 | tablinks[i].className = tablinks[i].className.replace(" active", ""); |
| 180 | } |
| 181 | |
| 182 | // Show the current tab, and add an "active" class to the link that opened the tab |
| 183 | document.getElementById(tabName).style.display = "block"; |
| 184 | evt.currentTarget.className += " active"; |
| 185 | } |
| 186 | </script> |
| 187 | </head> |
| 188 | <body onload="init()"> |
| 189 | <div class="tab"> |
| 190 | {% for node_name in nodes.keys() | sort %} |
| 191 | {% if nodes[node_name] | is_active %} |
| 192 | <button class="tablinks" onclick="openTab(event, '{{ node_name | shortname }}')"> |
| 193 | <div class="dot_green">●</div> |
| 194 | <div class="node_name">{{ node_name | shortname }}</div> |
| 195 | <div class="smallgreytext">({{ counters[node_name]['package_diff'] }} / {{ counters[node_name]['packages'] }})</div> |
| 196 | </button> |
| 197 | {% endif %} |
| 198 | {% endfor %} |
| 199 | {% for node_name in nodes.keys() | sort %} |
| 200 | {% if not nodes[node_name] | is_active %} |
| 201 | <button class="tablinks" onclick="openTab(event, '{{ node_name | shortname }}')"> |
| 202 | <div class="dot_empty">○</div> |
| 203 | <div class="node_name">{{ node_name | shortname }}</div> |
| 204 | <div class="smallgreytext">({{ counters[node_name]['package_diff'] }} / {{ counters[node_name]['packages'] }})</div> |
| 205 | </button> |
| 206 | {% endif %} |
| 207 | {% endfor %} |
| 208 | </div> |
| 209 | {% for node_name in nodes.keys() | sort %} |
| 210 | <div id="{{ node_name | shortname }}" class="tabcontent"> |
| 211 | <table class="pkgversions"> |
| 212 | <tbody> |
| 213 | <tr> |
| 214 | <td class="Header">Package name</td> |
| 215 | <td class="Header">Installed</td> |
| 216 | <td class="Header">Candidate</td> |
| 217 | </tr> |
| 218 | <tr><td colspan=3>Package with different versions uniq for this node</td></tr> |
| 219 | {% for package_name in nodes[node_name]['packages'] | sort %} |
| 220 | {% if not nodes[node_name]['packages'][package_name]['is_equal'] %} |
| 221 | {% if nodes[node_name]['packages'][package_name]['fail_uniq'] %} |
| 222 | <tr> |
| 223 | <td class="pkgName">{{ package_name }}</td> |
| 224 | <td class="version differ"> |
| 225 | <div class="tooltip">{{ nodes[node_name]['packages'][package_name]['installed'] }} |
| 226 | <pre class="tooltiptext">{{ nodes[node_name]['packages'][package_name]['raw'] | linebreaks }}</pre> |
| 227 | </div> |
| 228 | </td> |
| 229 | <td class="version">{{ nodes[node_name]['packages'][package_name]['candidate'] }}</td> |
| 230 | </tr> |
| 231 | {% endif %} |
| 232 | {% endif %} |
| 233 | {% endfor %} |
| 234 | <tr><td colspan=3>Packages with different versions on nodes with similar role</td></tr> |
| 235 | {% for package_name in nodes[node_name]['packages'] | sort %} |
| 236 | {% if not nodes[node_name]['packages'][package_name]['is_equal'] %} |
| 237 | {% if not nodes[node_name]['packages'][package_name]['fail_uniq'] %} |
| 238 | <tr> |
| 239 | <td class="pkgName">{{ package_name }}</td> |
| 240 | <td class="version differ"> |
| 241 | <div class="tooltip">{{ nodes[node_name]['packages'][package_name]['installed'] }} |
| 242 | <pre class="tooltiptext">{{ nodes[node_name]['packages'][package_name]['raw'] | linebreaks }}</pre> |
| 243 | </div> |
| 244 | </td> |
| 245 | <td class="version">{{ nodes[node_name]['packages'][package_name]['candidate'] }}</td> |
| 246 | </tr> |
| 247 | {% endif %} |
| 248 | {% endif %} |
| 249 | {% endfor %} |
| 250 | <tr><td colspan=3>Packages with same versions: installed vs candidate</td></tr> |
| 251 | {% for package_name in nodes[node_name]['packages'] | sort %} |
| 252 | {% if nodes[node_name]['packages'][package_name] | is_equal %} |
| 253 | <tr> |
| 254 | <td class="pkgName">{{ package_name }}</td> |
| 255 | <td class="version"> |
| 256 | <div class="tooltip">{{ nodes[node_name]['packages'][package_name]['installed'] }} |
| 257 | <pre class="tooltiptext">{{ nodes[node_name]['packages'][package_name]['raw'] | linebreaks }}</pre> |
| 258 | </div> |
| 259 | </td> |
| 260 | <td class="version">{{ nodes[node_name]['packages'][package_name]['candidate'] }}</td> |
| 261 | </tr> |
| 262 | {% endif %} |
| 263 | {% endfor %} |
| 264 | </tbody> |
| 265 | </table> |
| 266 | </div> |
| 267 | {% endfor %} |
| 268 | </body> |
| 269 | </html> |