From b3fe84ea0648dfe8c86f647cd3d186cca43fc755 Mon Sep 17 00:00:00 2001 From: Jeff Kaufman Date: Sat, 6 Feb 2021 23:11:23 +0000 Subject: [PATCH] make recordings a tab --- html/demo.js | 2 +- html/index.html | 21 +++++++++++++++++++-- server.py | 4 ---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/html/demo.js b/html/demo.js index 088b3cf..953a1eb 100644 --- a/html/demo.js +++ b/html/demo.js @@ -1166,7 +1166,7 @@ function update_active_users( } // Don't update the mixing console and we are not looking at that screen. - if (window.debugSettings.style.display == "none") { + if (window.advancedSettings.style.display == "none") { return; } if (mic_volume_inputs.length == 0) { diff --git a/html/index.html b/html/index.html index 75745ec..308c595 100644 --- a/html/index.html +++ b/html/index.html @@ -555,8 +555,6 @@

Bucket Brigade

- Recent Recordings - Source Code Report a problem @@ -572,6 +570,7 @@

Bucket Brigade

Home Advanced + Recordings Debug Reserve About @@ -728,6 +727,10 @@

Debug Info

+
+
+
+
@@ -1241,6 +1244,7 @@

Then refresh the page and try again.

"Debug": window.debugInfo, "Reserve": window.booktime, "About": window.about, + "Recordings": window.recordings, "AdvancedSettings": window.advancedSettings, "UnsupportedBrowser": window.noAudioWorklet, "UnsupportedDevice": window.isMobile, @@ -1252,6 +1256,7 @@

Then refresh the page and try again.

"Reserve": window.booktimeTab, "About": window.aboutTab, "AdvancedSettings": window.advancedSettingsTab, + "Recordings": window.recordingsTab, }; for (const [paneName, paneTab] of Object.entries(tabs)) { @@ -1267,6 +1272,14 @@

Then refresh the page and try again.

}); } + async function updateRecordings() { + window.recordingsGoHere.innerHTML = ""; + const response = await fetch("recordings/"); + const html = await response.text(); + window.recordingsGoHere.innerHTML = + html.replace(/href='/g, "target=_blank href='recordings/"); + } + function showPane(paneName) { for (const [otherPaneName, otherPaneDiv] of Object.entries(middlePanes)) { otherPaneDiv.style.display = "none"; @@ -1279,6 +1292,10 @@

Then refresh the page and try again.

tabs[paneName].classList.add("activeTab"); } window.location.hash = (paneName === "Main" ? "" : paneName); + + if (paneName == "Recordings") { + updateRecordings(); + } } if (window.location.hash && !showingWarningPane) { diff --git a/server.py b/server.py index c060967..c380117 100755 --- a/server.py +++ b/server.py @@ -271,9 +271,6 @@ def update_directory_listing_(self): def w(s): outf.write(s) outf.write("\n") - w("") - w("Recordings") - w("

Recordings

") w("All times (and dates!) are in UTC.") w("
    ") for fname in reversed(sorted(os.listdir(RECORDINGS_DIR))): @@ -286,7 +283,6 @@ def w(s): w("
") w("Because these files are large we only keep the most recent %s" % RECORDING_N_TO_KEEP) - w("") def cleanup_(self): recordings = os.listdir(RECORDINGS_DIR)