|
@@ -393,7 +393,7 @@
|
|
|
:interactive true
|
|
|
:disabled false}
|
|
|
(svg/info))]
|
|
|
- preferred-pasting-file?
|
|
|
+ preferred-pasting-file?
|
|
|
config-handler/toggle-preferred-pasting-file!))
|
|
|
|
|
|
(defn auto-expand-row [t auto-expand-block-refs?]
|
|
@@ -463,14 +463,6 @@
|
|
|
(let [value (not enable-all-pages-public?)]
|
|
|
(config-handler/set-config! :publishing/all-pages-public? value)))))
|
|
|
|
|
|
-;; (defn enable-block-timestamps-row [t enable-block-timestamps?]
|
|
|
-;; (toggle "block timestamps"
|
|
|
-;; (t :settings-page/enable-block-time)
|
|
|
-;; enable-block-timestamps?
|
|
|
-;; (fn []
|
|
|
-;; (let [value (not enable-block-timestamps?)]
|
|
|
-;; (config-handler/set-config! :feature/enable-block-timestamps? value)))))
|
|
|
-
|
|
|
(rum/defc keyboard-shortcuts-row [t]
|
|
|
(row-with-button-action
|
|
|
{:left-label (t :settings-page/customize-shortcuts)
|
|
@@ -668,7 +660,6 @@
|
|
|
(file-format-row t preferred-format)
|
|
|
(date-format-row t preferred-date-format)
|
|
|
(workflow-row t preferred-workflow)
|
|
|
- ;; (enable-block-timestamps-row t enable-block-timestamps?)
|
|
|
(show-brackets-row t show-brackets?)
|
|
|
|
|
|
(when (util/electron?) (switch-spell-check-row t))
|
|
@@ -691,7 +682,7 @@
|
|
|
(ui/admonition
|
|
|
:tip
|
|
|
[:p (t :settings-page/git-tip)])
|
|
|
- [:span.text-sm.opacity-50.my-4
|
|
|
+ [:span.text-sm.opacity-50.my-4
|
|
|
(t :settings-page/git-desc-1)]
|
|
|
[:br][:br]
|
|
|
[:span.text-sm.opacity-50.my-4
|
|
@@ -755,12 +746,12 @@
|
|
|
count-limit (if pro-account? 10 1)
|
|
|
count-percent (js/Math.round (/ count-usage count-limit 0.01))
|
|
|
storage-usage (->> (map :used-gbs graph-usage)
|
|
|
- (reduce + 0))
|
|
|
- storage-usage-formatted (cond
|
|
|
+ (reduce + 0))
|
|
|
+ storage-usage-formatted (cond
|
|
|
(zero? storage-usage) "0.0"
|
|
|
(< storage-usage 0.01) "Less than 0.01"
|
|
|
:else (gstring/format "%.2f" storage-usage))
|
|
|
- ;; TODO: check logic on this. What are the rules around storage limits?
|
|
|
+ ;; TODO: check logic on this. What are the rules around storage limits?
|
|
|
;; do we, and should we be able to, give individual users more storage?
|
|
|
;; should that be on a per graph or per user basis?
|
|
|
default-storage-limit (if pro-account? 10 0.05)
|
|
@@ -774,7 +765,7 @@
|
|
|
[:<>
|
|
|
(gstring/format "%s of %s synced graphs " count-usage count-limit)
|
|
|
[:strong.text-white (gstring/format "(%s%%)" count-percent)]
|
|
|
- ", "])
|
|
|
+ ", "])
|
|
|
(gstring/format "%sGB of %sGB total storage " storage-usage-formatted storage-limit)
|
|
|
[:strong.text-white (gstring/format "(%s%%)" storage-percent-formatted)]]))
|
|
|
; storage-usage-formatted "GB of " storage-limit "GB total storage"
|
|
@@ -786,13 +777,13 @@
|
|
|
[:div.grid.gap-3 {:style {:grid-template-columns (str "repeat(" (count graph-usage) ", 1fr)")}}
|
|
|
(for [{:keys [name used-percent]} graph-usage
|
|
|
:let [color (if (<= 100 used-percent) "bg-red-500" "bg-blue-500")]]
|
|
|
- [:div.rounded-full.w-full.h-2 {:class "bg-black/50"
|
|
|
+ [:div.rounded-full.w-full.h-2 {:class "bg-black/50"
|
|
|
:tooltip name}
|
|
|
[:div.rounded-full.h-2 {:class color
|
|
|
- :style {:width (str used-percent "%")
|
|
|
- :min-width "0.5rem"
|
|
|
+ :style {:width (str used-percent "%")
|
|
|
+ :min-width "0.5rem"
|
|
|
:max-width "100%"}}]])]))
|
|
|
-
|
|
|
+
|
|
|
(rum/defc ^:large-vars/cleanup-todo settings-account < rum/reactive
|
|
|
[]
|
|
|
(let [current-graph-uuid (state/sub-current-file-sync-graph-uuid)
|
|
@@ -812,13 +803,13 @@
|
|
|
logged-in?
|
|
|
[:div.grid.grid-cols-3.gap-8.pt-2
|
|
|
[:div "Current plan"]
|
|
|
- [:div.col-span-2
|
|
|
+ [:div.col-span-2
|
|
|
[:div {:class "w-full bg-gray-500/10 rounded-lg p-4 flex flex-col gap-4"}
|
|
|
[:div.flex.gap-4.items-center
|
|
|
(if pro-account?
|
|
|
[:div.flex-1 "Pro"]
|
|
|
[:div.flex-1 "Free"])
|
|
|
- (cond
|
|
|
+ (cond
|
|
|
has-subscribed?
|
|
|
(ui/button "Manage plan" {:class "p-1 h-8 justify-center"
|
|
|
:disabled true
|
|
@@ -844,26 +835,26 @@
|
|
|
[:<>
|
|
|
[:div "Billing"]
|
|
|
[:div.col-span-2.flex.flex-col.gap-4
|
|
|
- (cond
|
|
|
+ (cond
|
|
|
;; If there is no expiration date, print the renewal date
|
|
|
- (and renewal-date (nil? expiration-date))
|
|
|
- [:div
|
|
|
- [:strong.font-semibold "Next billing date: "
|
|
|
+ (and renewal-date (nil? expiration-date))
|
|
|
+ [:div
|
|
|
+ [:strong.font-semibold "Next billing date: "
|
|
|
(date/get-locale-string renewal-date)]]
|
|
|
;; If the expiration date is in the future, word it as such
|
|
|
- (< (js/Date.) expiration-date)
|
|
|
+ (< (js/Date.) expiration-date)
|
|
|
[:div
|
|
|
- [:strong.font-semibold "Pro plan expires on: "
|
|
|
+ [:strong.font-semibold "Pro plan expires on: "
|
|
|
(date/get-locale-string expiration-date)]]
|
|
|
;; Otherwise, ind
|
|
|
- :else
|
|
|
- [:div
|
|
|
- [:strong.font-semibold "Pro plan expired on: "
|
|
|
+ :else
|
|
|
+ [:div
|
|
|
+ [:strong.font-semibold "Pro plan expired on: "
|
|
|
(date/get-locale-string expiration-date)]])
|
|
|
-
|
|
|
- [:div (ui/button "Open invoices" {:class "w-full h-8 p-1 justify-center"
|
|
|
- :disabled true
|
|
|
- :background "gray"
|
|
|
+
|
|
|
+ [:div (ui/button "Open invoices" {:class "w-full h-8 p-1 justify-center"
|
|
|
+ :disabled true
|
|
|
+ :background "gray"
|
|
|
:icon "receipt"})]]])
|
|
|
[:div "Profile"]
|
|
|
[:div.col-span-2.grid.grid-cols-2.gap-4
|
|
@@ -875,7 +866,7 @@
|
|
|
[:input.rounded.border.px-2.py-1.box-border {:class "border-blue-500 bg-black/25 w-full"}]]
|
|
|
[:div.flex-1.flex.flex-col.gap-2.col-span-2
|
|
|
[:label.text-sm.font-semibold "Username"]
|
|
|
- [:input.rounded.border.px-2.py-1.box-border {:class "border-blue-500 bg-black/25"
|
|
|
+ [:input.rounded.border.px-2.py-1.box-border {:class "border-blue-500 bg-black/25"
|
|
|
:value (user-handler/email)}]]]
|
|
|
[:div "Authentication"]
|
|
|
[:div.col-span-2
|
|
@@ -889,10 +880,10 @@
|
|
|
:background "gray"
|
|
|
:icon "key"
|
|
|
:on-click user-handler/logout})]
|
|
|
- [:div.col-span-2 (ui/button "Delete Account" {:class "p-1 h-8 justify-center w-full"
|
|
|
+ [:div.col-span-2 (ui/button "Delete Account" {:class "p-1 h-8 justify-center w-full"
|
|
|
:disabled true
|
|
|
- :background "red"})]]]]
|
|
|
-
|
|
|
+ :background "red"})]]]]
|
|
|
+
|
|
|
(not logged-in?)
|
|
|
[:div.grid.grid-cols-3.gap-8.pt-2
|
|
|
[:div "Authentication"]
|
|
@@ -902,25 +893,25 @@
|
|
|
:on-click (fn []
|
|
|
(state/close-settings!)
|
|
|
(state/pub-event! [:user/login]))})]
|
|
|
- [:div.flex-1 (ui/button (t :login) {:icon "login"
|
|
|
- :class "h-8 w-full text-center justify-center"
|
|
|
+ [:div.flex-1 (ui/button (t :login) {:icon "login"
|
|
|
+ :class "h-8 w-full text-center justify-center"
|
|
|
:background "gray"
|
|
|
:on-click (fn []
|
|
|
(state/close-settings!)
|
|
|
(state/pub-event! [:user/login]))})]]
|
|
|
[:div.col-span-3.flex.flex-col.gap-4 {:class "bg-black/20 p-4 rounded-lg"}
|
|
|
[:div.flex.w-full.items-center
|
|
|
- [:div {:class "w-1/2 text-lg"}
|
|
|
- "Discover the power of "
|
|
|
+ [:div {:class "w-1/2 text-lg"}
|
|
|
+ "Discover the power of "
|
|
|
[:strong {:class "text-white/80"} "Logseq Sync"]]
|
|
|
- [:div {:class "w-1/2 bg-gradient-to-r from-white/10 to-transparent p-3 rounded-lg flex items-center gap-2 px-5 ml-5"}
|
|
|
+ [:div {:class "w-1/2 bg-gradient-to-r from-white/10 to-transparent p-3 rounded-lg flex items-center gap-2 px-5 ml-5"}
|
|
|
[:div.w-3.h-3.rounded-full.bg-green-500]
|
|
|
"Synced"]]
|
|
|
[:div.flex.w-full.gap-4
|
|
|
[:div {:class "w-1/2 bg-black/50 rounded-lg p-4 pt-10 relative flex flex-col gap-4"}
|
|
|
[:div.absolute.top-0.left-4.bg-gray-700.uppercase.px-2.py-1.rounded-b-lg.font-bold.text-xs "Free"]
|
|
|
[:div
|
|
|
- [:strong.text-white.text-xl.font-normal "$0"]]
|
|
|
+ [:strong.text-white.text-xl.font-normal "$0"]]
|
|
|
[:div.text-white.font-bold {:class "h-[2.5rem] "} "Get started with basic syncing"]
|
|
|
[:ul.text-xs.list-none.m-0.flex.flex-col.gap-0.5
|
|
|
[:li "Unlimited unsynced graphs"]
|
|
@@ -930,7 +921,7 @@
|
|
|
[:div {:class "w-1/2 bg-black/50 rounded-lg p-4 pt-10 relative flex flex-col gap-4"}
|
|
|
[:div.absolute.top-0.left-4.bg-blue-700.uppercase.px-2.py-1.rounded-b-lg.font-bold.text-xs "Pro"]
|
|
|
[:div
|
|
|
- [:strong.text-white.text-xl.font-normal "$10"]
|
|
|
+ [:strong.text-white.text-xl.font-normal "$10"]
|
|
|
[:span.text-xs.font-base {:class "ml-0.5"} "/ month"]]
|
|
|
[:div.text-white.font-bold {:class "h-[2.5rem]"} "Unlock advanced syncing and more"]
|
|
|
[:ul.text-xs.list-none.m-0.flex.flex-col.gap-0.5
|
|
@@ -1010,7 +1001,7 @@
|
|
|
;; {:class (when-not user-handler/alpha-user? "opacity-50 pointer-events-none cursor-not-allowed")}
|
|
|
;; ;; features
|
|
|
;; ]])
|
|
|
-
|
|
|
+
|
|
|
|
|
|
(def DEFAULT-ACTIVE-TAB-STATE (if config/ENABLE-SETTINGS-ACCOUNT-TAB [:account :account] [:general :general]))
|
|
|
|
|
@@ -1027,7 +1018,6 @@
|
|
|
rum/reactive
|
|
|
[state]
|
|
|
(let [current-repo (state/sub :git/current-repo)
|
|
|
- ;; enable-block-timestamps? (state/enable-block-timestamps?)
|
|
|
_installed-plugins (state/sub :plugin/installed-plugins)
|
|
|
plugins-of-settings (and config/lsp-enabled? (seq (plugin-handler/get-enabled-plugins-if-setting-schema)))
|
|
|
*active (::active state)]
|
|
@@ -1082,7 +1072,7 @@
|
|
|
(reset! *active [label label])
|
|
|
nil)
|
|
|
|
|
|
- :account
|
|
|
+ :account
|
|
|
(settings-account)
|
|
|
|
|
|
:general
|