From 05eab16f9e034d99bf74a224eb55b5856a4e7e15 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 22 Oct 2024 16:30:17 +0000 Subject: Add GN2 Fallback link to index page and and error page/text Also removed the error callback from the menu AJAX call since it seems to just duplicate the error message (which is also handled by the statusCode function) --- gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gn2/wqflask/static/new/javascript') diff --git a/gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js b/gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js index 2875eabd..1a738e2d 100644 --- a/gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js +++ b/gn2/wqflask/static/new/javascript/dataset_select_menu_orig.js @@ -14,9 +14,14 @@ range = function(size, startAt=0) { indicate_error = function (jqXHR, textStatus, errorThrown) { errorElement = document.createElement("span"); errorElement.setAttribute("class", "alert-danger"); + fallbackLink = document.createElement('a'); + fallbackLink.href = "https://fallback.genenetwork.org"; + fallbackLink.title = "GN2 Fallback"; + fallbackLink.appendChild(document.createTextNode("GN2 Fallback Server.")); errorText = document.createTextNode( - "There was an error retrieving and setting the menu. Try again later."); + "There was an error retrieving and setting the menu. Try visiting the "); errorElement.appendChild(errorText); + errorElement.appendChild(fallbackLink); if (document.getElementById("search")){ form = document.getElementById("search").getElementsByTagName("form")[0]; form.prepend(errorElement); @@ -41,7 +46,6 @@ if (typeof gn_server_url === 'undefined'){ $.ajax(gn_server_url +'/menu/generate/json', { dataType: 'json', success: process_json, - error: indicate_error, statusCode: { ...defaultStatusCodeFunctions, } -- cgit v1.2.3