diff options
author | 2019-12-19 02:07:58 +1100 | |
---|---|---|
committer | 2019-12-19 02:07:58 +1100 | |
commit | c10ef269c5c2ce6ca15818be441bca985ed2f2a0 (patch) | |
tree | f75e29242132f7e6c69667c43e03cbcdfc1f1a3c /scripts/minimaws/lib/htmltmpl.py | |
parent | f9d27d2104aa8ea064e8c1ddd560c9647af23f67 (diff) |
minimaws updates:
* reduce network operations when initially loading a machine page
* add rudimentary software lists to machine pages
Diffstat (limited to 'scripts/minimaws/lib/htmltmpl.py')
-rw-r--r-- | scripts/minimaws/lib/htmltmpl.py | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/scripts/minimaws/lib/htmltmpl.py b/scripts/minimaws/lib/htmltmpl.py index 185771af6ee..6a16f305d8d 100644 --- a/scripts/minimaws/lib/htmltmpl.py +++ b/scripts/minimaws/lib/htmltmpl.py @@ -70,6 +70,45 @@ MACHINE_CLONES_ROW = string.Template( ' <td>${manufacturer}</td>\n' \ ' </tr>\n') +MACHINE_SOFTWARELISTS_TABLE_PROLOGUE = string.Template( + '<h2 id="heading-softwarelists">Software Lists</h2>\n' \ + '<table id="tbl-softwarelists">\n' \ + ' <thead>\n' \ + ' <tr>\n' \ + ' <th>Short name</th>\n' \ + ' <th>Description</th>\n' \ + ' <th>Status</th>\n' \ + ' <th class="numeric">Total</th>\n' \ + ' <th class="numeric">Supported</th>\n' \ + ' <th class="numeric">Partially supported</th>\n' \ + ' <th class="numeric">Unsupported</th>\n' \ + ' </tr>\n' \ + ' </thead>\n' \ + ' <tbody>\n') + +MACHINE_SOFTWARELISTS_TABLE_ROW = string.Template( + ' <tr>\n' \ + ' <td><a href="${href}">${shortname}</a></td>\n' \ + ' <td><a href="${href}">${description}</a></td>\n' \ + ' <td>${status}</td>\n' \ + ' <td style="text-align: right">${total}</td>\n' \ + ' <td style="text-align: right">${supported}</td>\n' \ + ' <td style="text-align: right">${partiallysupported}</td>\n' \ + ' <td style="text-align: right">${unsupported}</td>\n' \ + ' </tr>\n') + +MACHINE_SOFTWARELISTS_TABLE_EPILOGUE = string.Template( + ' </tbody>\n' \ + '</table>\n' \ + '<script>\n' \ + ' make_table_sortable(document.getElementById("tbl-softwarelists"));\n' \ + ' if (!document.getElementById("tbl-softwarelists").tBodies[0].rows.length)\n' \ + ' {\n' \ + ' document.getElementById("heading-softwarelists").style.display = "none";\n' \ + ' document.getElementById("tbl-softwarelists").style.display = "none";\n' \ + ' }\n' \ + '</script>\n') + MACHINE_OPTIONS_HEADING = string.Template( '<h2>Options</h2>\n' \ '<p>\n' \ @@ -92,10 +131,14 @@ MACHINE_RAM_PROLOGUE = string.Template( MACHINE_RAM_OPTION = string.Template( ' <option value="${name}" data-isdefault="${isdefault}">${name} (${size})</option>\n') -MACHINE_SLOTS_PLACEHOLDER = string.Template( +MACHINE_SLOTS_PLACEHOLDER_PROLOGUE = string.Template( '<h3>Slots</h3>\n' \ '<p id="para-slots-placeholder">Loading slot information…<p>\n' \ - '<script>fetch_slots("${machine}");</script>\n') + '<script>\n') + +MACHINE_SLOTS_PLACEHOLDER_EPILOGUE = string.Template( + ' populate_slots(${machine});\n' + '</script>\n') MACHINE_ROW = string.Template( ' <tr>\n' \ |