Removed cruft from the javascript
diff --git a/static/plugins/machines.js b/static/plugins/machines.js
index 03adf3a..002e9eb 100644
--- a/static/plugins/machines.js
+++ b/static/plugins/machines.js
@@ -1,7 +1,6 @@
let machines_json = null;
async function seed_machines() {
-// machines_json = await (await fetch("/api/machines"));
machines_json = await (await fetch("/api/machines")).json();
}
@@ -18,158 +17,8 @@
async function render_dashboard_machines() {
document.getElementById('page_title').innerText = "Machine Fingerprints";
-// document.getElementById('page_description').innerText = "This page monitors the machine fingerprints of all Apache machines.";
if (!machines_json) await seed_machines();
const outer_chart_area = document.getElementById('chart_area');
outer_chart_area.innerHTML = machines_json['HTML'];
}
-/*
- const filterfield = document.createElement('input');
- filterfield.type = "text";
- filterfield.placeholder = "Type here to filter on hostname...";
- filterfield.style.display = "block";
- filterfield.style.width = "280px";
- filterfield.style.marginLeft = "10px";
- outer_chart_area.appendChild(filterfield);
-
- const source_array = [];
- for (const [host] of Object.entries(machines_json)) {
- const fingerprints = document.createElement('span');
- fingerprints.innerText = machines_json.json();
- }
-}
-*/
-/*
- const uses_asfyaml = data.git_url ? !!data.asfyaml : null;
- if (uses_asfyaml === true) {
- asfyaml.innerText = "Yes";
- } else if (uses_asfyaml === false) {
- asfyaml.innerText = "No";
- asfyaml.className = "text-danger";
- } else if (uses_asfyaml === null) {
- asfyaml.innerText = "N/A";
- asfyaml.className = "text-muted";
- }
-
- const source_url = document.createElement('a');
- // INFRA-24932: Only set .href if we have a URL from somewhere
- if (data.git_url) source_url.href = data.git_url;
- if (data.svn_url) source_url.href = data.svn_url;
- source_url.innerText = (source_url.href && source_url.href.length) ? source_url.href : 'N/A';
- if (data.git_url
- && data.git_url.startsWith('https://gitbox.apache.org/repos/asf/')) {
- source_url.innerText = data.git_url.substr(36);
- }
- else if (data.svn_url) {
- if (data.svn_url.startsWith('https://svn-master.apache.org/repos/asf/'))
- source_url.innerText = data.svn_url.substr(40);
- else if (data.svn_url.startsWith('https://svn-master.apache.org/repos/infra/'))
- source_url.innerText = data.svn_url.substr(42);
- }
-
- const site_url = document.createElement('a');
- site_url.href = `https://${host}`;
- site_url.innerText = host;
- site_url.target = "_blank";
-
- const website = document.createElement('span');
- website.appendChild(site_url);
- if (data.attic) {
- const status = document.createElement('a');
- status.href = 'https://attic.apache.org/';
- status.innerText = 'retired';
- status.className = 'badge text-bg-warning link-underline link-underline-opacity-25 ms-2';
- website.appendChild(status);
- }
-
- const source = document.createElement('span');
- const vcs = document.createElement('b');
- if (data.git_url)
- vcs.innerText = 'git:';
- else if (!data.svn_url)
- vcs.innerText = 'NO URL';
- else if (data.svn_url.startsWith('https://svn-master.apache.org/repos/asf/'))
- vcs.innerText = 'svn/asf:';
- else if (data.svn_url.startsWith('http://svn-master.apache.org/repos/asf/'))
- vcs.innerText = 'svn/asf:';
- else if (data.svn_url.startsWith('https://svn.apache.org/repos/asf/'))
- vcs.innerText = 'svn/asf:'; // chemistry.a.o/javadoc
- else if (data.svn_url.startsWith('https://svn-master.apache.org/repos/infra/'))
- vcs.innerText = 'svn/infra:';
- else
- vcs.innerText = 'UNKNOWN';
- vcs.style.display = 'inline-block';
- vcs.style.width = '5em';
- vcs.className = 'me-2';
- source.appendChild(vcs);
-
- source.appendChild(source_url);
-
- if (data.git_url) {
- const branch = document.createElement('span');
- branch.innerText = '[branch: ' + data.git_branch + ']';
- branch.className = 'ms-2';
- source.appendChild(branch);
-
- if (!uses_asfyaml) {
- const not_asfyaml = document.createElement('span');
- not_asfyaml.innerText = 'not .asf.yaml';
- not_asfyaml.title = "This website repository does not yet use .asf.yaml for publishing. Any repository updates will not be synchronized to the official website until .asf.yaml is set up for publishing."
- not_asfyaml.className = 'badge text-bg-danger ms-2';
- source.appendChild(not_asfyaml);
- }
- }
-
- if (data.svn_url && data.svn_url.startsWith('http:')) {
- const not_https = document.createElement('span');
- not_https.innerText = 'not https';
- not_https.className = 'badge text-bg-warning ms-2';
- source.appendChild(not_https);
- }
-
- // Last check and latest revision
- const dates = document.createElement('span');
- dates.appendChild(document.createTextNode(new Date(data.check_time*1000.0).toISOString()));
-
- const rev_link = document.createElement('a');
- if (data.git_version) {
- const [rev_no, rev_date] = split_once(data.git_version, " ");
- rev_link.href = `${data.git_url.replace(/\/$/, '')}/commit/${rev_no}`; // trim trailing slashes
- rev_link.innerText = rev_no;
- dates.appendChild(document.createTextNode(" ("));
- dates.appendChild(rev_link);
- dates.appendChild(document.createTextNode(") "));
- } else if (data.svn_version) {
- const [rev_no, rev_date] = split_once(data.svn_version, " ");
- rev_link.href = `https://svn.apache.org/viewvc?view=revision&revision=${rev_no}`;
- rev_link.innerText = "r" + rev_no;
- dates.appendChild(document.createTextNode(" ("));
- dates.appendChild(rev_link);
- dates.appendChild(document.createTextNode(") "));
- }
-
- source_array.push([
- website,
- source,
- dates
- ])
- }
-
- const source_table = chart_table_list("ASF project website checker", ["Website", "Source", "Last Checked"], source_array);
- source_table.style.width = "100%";
- outer_chart_area.appendChild(source_table);
-
- filterfield.addEventListener('keyup', () => {
- for (const tr of source_table.getElementsByTagName('tr')) {
- if (tr.firstChild.nodeName === "TH") continue; // Don't hide headers
- if (tr.firstChild.innerText.match(filterfield.value)) {
- tr.style.display = "table-row";
- } else {
- tr.style.display = "none";
- }
- }
-
- }
-*/
-