improve(plugin): plugin perf tips for initial loader

This commit is contained in:
charlie
2022-08-24 15:51:48 +08:00
committed by Tienson Qin
parent 62c091840a
commit 04e04e4005
9 changed files with 99 additions and 7 deletions

View File

@@ -996,6 +996,34 @@
[current-repo db-restoring? nfs-granted?])
nil)
(rum/defc perf-tip-content
[pid name url]
[:div
[:span.block.whitespace-normal
"The plugin "
[:strong.text-red-500 "#" name]
" takes too long to load, which affects the
application startup time, as well as potentially
causing other plugins to fail to load."]
[:path.opacity-50
[:small [:span.pr-1 (ui/icon "folder")] url]]
[:p
(ui/button "Disable now"
:small? true
:on-click
(fn []
(-> (js/LSPluginCore.disable pid)
(p/then #(do
(notification/clear! pid)
(notification/show!
[:span "The plugin "
[:strong.text-red-500 "#" name]
" is disabled."] :success
true nil 3000)))
(p/catch #(js/console.error %)))))]])
(defn open-plugins-modal!
[]
(state/set-modal!