From 83800cd7c11e229e291c699ed45bc65c7fcd9357 Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 29 Sep 2017 07:02:21 -0400 Subject: [PATCH] mgr/dashboard: redirect away if viewed filesystem is removed Previously this would sit there with stale data in the browser if you were viewing a filesystem and then deleted it in the background. Signed-off-by: John Spray --- src/pybind/mgr/dashboard/filesystem.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pybind/mgr/dashboard/filesystem.html b/src/pybind/mgr/dashboard/filesystem.html index 55bbdb18830..761e5ff42fa 100644 --- a/src/pybind/mgr/dashboard/filesystem.html +++ b/src/pybind/mgr/dashboard/filesystem.html @@ -11,6 +11,10 @@ $.get("{{ url_prefix }}/filesystem_data/" + content_data.fs_status.filesystem.id + "/", function(data) { _.extend(content_data.fs_status, data); setTimeout(refresh, 5000); + }).fail(function() { + // Perhaps the filesystem we're viewing no longer exists. + // Go back to home. + window.location.href = "{{ url_prefix }}/"; }); }; -- 2.47.3