mirror of
https://github.com/logseq/logseq.git
synced 2026-05-05 11:26:26 +00:00
Feat: sync progress for electron (#6662)
* fix: state shouldn't be returned in ipc * feat: download && upload processing * enhance(ui): interaction of show password checkbox * feat: time left * feat: download progress * Set download batch size to 100 * improve(ui): progress pane of file sync indicator * improve(ui): progress pie of each file state * improve(ui): progress pie of each file state * improve(ui): progress pie of each downloading file * fix: add last changed time * enhance: time left * fix: total needs to be larger than finished * fix: wait for update-graphs-txid! * enhance: show in-progress files first * chore: ui polish * improve(ui): persist stauts of sync files list toggle switch * fix(ui): visibility of sync now button on mobile * chore: remove ios static out after sync * fix: debounce clicking on sync icon * fix: repos not refreshed after unlink or delete * enhance: automatically save page-metadata.edn to avoid sync when restart * improve(ui): sync now shortcut for file sync progress pane * enhance: data transfer icons * fix: stop sync if switched to another graph * fix: can't switch * enhance: sort files first before uploading or downloading * fix: clear current graph uuid when sync stops * fix: separate progress by graphs * fix: check files only in the current progress * fix: prevent multiple sync managers for the same graph * fix: remove redundant files watchers * enhance(sync): re-exec remote->local-full-sync when exception re-exec remote->local-full-sync when <update-local-files return exceptions * enhance(sync): re-exec remote->local-full-sync when exception re-exec remote->local-full-sync when <update-local-files return exceptions * fix(sync): set-progress-callback, update rsapi * fix(sync): uploading progress bar Co-authored-by: Tienson Qin <tiensonqin@gmail.com> Co-authored-by: charlie <xyhp915@qq.com> Co-authored-by: rcmerci <rcmerci@gmail.com>
This commit is contained in:
@@ -143,44 +143,59 @@
|
||||
|
||||
(rum/defc menu-link
|
||||
[options child shortcut]
|
||||
[:a.flex.justify-between.px-4.py-2.text-sm.transition.ease-in-out.duration-150.cursor.menu-link
|
||||
options
|
||||
[:span child]
|
||||
(when shortcut
|
||||
[:span.ml-1 (render-keyboard-shortcut shortcut)])])
|
||||
(if (:only-child? options)
|
||||
[:div.menu-link
|
||||
(dissoc options :only-child?) child]
|
||||
[:a.flex.justify-between.px-4.py-2.text-sm.transition.ease-in-out.duration-150.cursor.menu-link
|
||||
options
|
||||
[:span child]
|
||||
(when shortcut
|
||||
[:span.ml-1 (render-keyboard-shortcut shortcut)])]))
|
||||
|
||||
(rum/defc dropdown-with-links
|
||||
[content-fn links {:keys [links-header links-footer] :as opts}]
|
||||
[content-fn links
|
||||
{:keys [outer-header outer-footer links-header links-footer] :as opts}]
|
||||
|
||||
(dropdown
|
||||
content-fn
|
||||
(fn [{:keys [close-fn]}]
|
||||
[:.menu-links-wrapper
|
||||
(when links-header links-header)
|
||||
(let [links-children
|
||||
(let [links (if (fn? links) (links) links)
|
||||
links (remove nil? links)]
|
||||
(for [{:keys [options title icon key hr hover-detail item _as-link?]} links]
|
||||
(let [new-options
|
||||
(merge options
|
||||
(cond->
|
||||
{:title hover-detail
|
||||
:on-click (fn [e]
|
||||
(when-not (false? (when-let [on-click-fn (:on-click options)]
|
||||
(on-click-fn e)))
|
||||
(close-fn)))}
|
||||
key
|
||||
(assoc :key key)))
|
||||
child (if hr
|
||||
nil
|
||||
(or item
|
||||
[:div.flex.items-center
|
||||
(when icon icon)
|
||||
[:div.title-wrap {:style {:margin-right "8px"
|
||||
:margin-left "4px"}} title]]))]
|
||||
(if hr
|
||||
[:hr.menu-separator {:key "dropdown-hr"}]
|
||||
(rum/with-key
|
||||
(menu-link new-options child nil)
|
||||
title)))))
|
||||
|
||||
(for [{:keys [options title icon key hr hover-detail item _as-link?]} (if (fn? links) (links) links)]
|
||||
(let [new-options
|
||||
(merge options
|
||||
(cond->
|
||||
{:title hover-detail
|
||||
:on-click (fn [e]
|
||||
(when-not (false? (when-let [on-click-fn (:on-click options)]
|
||||
(on-click-fn e)))
|
||||
(close-fn)))}
|
||||
key
|
||||
(assoc :key key)))
|
||||
child (if hr
|
||||
nil
|
||||
(or item
|
||||
[:div.flex.items-center
|
||||
(when icon icon)
|
||||
[:div {:style {:margin-right "8px"
|
||||
:margin-left "4px"}} title]]))]
|
||||
(if hr
|
||||
[:hr.menu-separator {:key "dropdown-hr"}]
|
||||
(rum/with-key
|
||||
(menu-link new-options child nil)
|
||||
title))))
|
||||
(when links-footer links-footer)])
|
||||
wrapper-children
|
||||
[:.menu-links-wrapper
|
||||
(when links-header links-header)
|
||||
links-children
|
||||
(when links-footer links-footer)]]
|
||||
|
||||
(if (or outer-header outer-footer)
|
||||
[:.menu-links-outer
|
||||
outer-header wrapper-children outer-footer]
|
||||
wrapper-children)))
|
||||
opts))
|
||||
|
||||
(defn button
|
||||
|
||||
Reference in New Issue
Block a user