]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: redirect away if viewed filesystem is removed
authorJohn Spray <john.spray@redhat.com>
Fri, 29 Sep 2017 11:02:21 +0000 (07:02 -0400)
committerJohn Spray <john.spray@redhat.com>
Fri, 29 Sep 2017 11:07:09 +0000 (07:07 -0400)
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 <john.spray@redhat.com>
src/pybind/mgr/dashboard/filesystem.html

index 55bbdb188303bae5123ed9a9f458571fdf36f734..761e5ff42fadfa5cefb80e60fccd1c7c381ce5f9 100644 (file)
                 $.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 }}/";
                 });
             };