diff --git a/_layouts/help.html b/_layouts/help.html
index 80b12fc..2c2e475 100644
--- a/_layouts/help.html
+++ b/_layouts/help.html
@@ -12,6 +12,10 @@
{% endif %}
+
+
{% assign help_pages = site.categories["help"] | sort: 'mirrorid' %}
@@ -19,7 +23,7 @@
@@ -30,7 +34,7 @@
diff --git a/static/js/help.es6 b/static/js/help.es6
index 1a9e036..957d559 100644
--- a/static/js/help.es6
+++ b/static/js/help.es6
@@ -35,6 +35,18 @@ $(document).ready(() => {
let help_url = $(ev.target).find("option:selected").data('help-url');
window.location = `${window.location.protocol}//${window.location.host}${help_url}`;
});
+
+ $.getJSON("/static/tunasync.json", (statusData) => {
+ // remove help items for disabled/removed mirrors
+ let availableMirrorIds = new Set(statusData.map(x => x.name));
+ console.log(window.mirrorId);
+ if (!availableMirrorIds.has(window.mirrorId)) {
+ location.href = "/404.html"; // this will break 404 issue submission
+ }
+
+ $('li').filter((_, node) => node.id && node.id.startsWith("toc-") && !availableMirrorIds.has(node.id.slice(4))).remove();
+ $('option').filter((_, node) => node.id && node.id.startsWith("toc-") && !availableMirrorIds.has(node.id.slice(4))).remove();
+ });
});
// vim: ts=2 sts=2 sw=2 noexpandtab