Browse Source

enhance: add re-index in the graph switcher dropdown

Tienson Qin 4 years ago
parent
commit
3e92ca04e5
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/main/frontend/components/repo.cljs

+ 5 - 1
src/main/frontend/components/repo.cljs

@@ -232,7 +232,11 @@
                               (t :new-graph)]
                               (t :new-graph)]
                              [:a {:class "block px-4 py-2 text-sm text-gray-700 transition ease-in-out duration-150 cursor menu-link"
                              [:a {:class "block px-4 py-2 text-sm text-gray-700 transition ease-in-out duration-150 cursor menu-link"
                                   :href (rfe/href :repos)}
                                   :href (rfe/href :repos)}
-                              (t :all-graphs)]]}
+                              (t :all-graphs)]
+                             [:a {:class "block px-4 py-2 text-sm text-gray-700 transition ease-in-out duration-150 cursor menu-link"
+                                  :on-click (fn []
+                                              (repo-handler/re-index! nfs-handler/rebuild-index!))}
+                              (t :re-index)]]}
              (seq switch-repos)
              (seq switch-repos)
              (assoc :links-header [:div.font-medium.text-sm.opacity-70.px-4.py-2
              (assoc :links-header [:div.font-medium.text-sm.opacity-70.px-4.py-2
                                    "Switch to:"]))))))))
                                    "Switch to:"]))))))))