mirror of https://github.com/logseq/logseq
parent
5b50e229e0
commit
9c0bb02dcd
|
@ -144,6 +144,14 @@
|
|||
:on-click #(js/setTimeout (fn [] (ui-handler/toggle-settings-modal!)))
|
||||
:-for "config_edn"}))
|
||||
|
||||
(defn edit-global-config-edn []
|
||||
(row-with-button-action
|
||||
{:left-label (t :settings-page/custom-global-configuration)
|
||||
:button-label (t :settings-page/edit-global-config-edn)
|
||||
:href (rfe/href :file {:path (config/get-global-config-path)})
|
||||
:on-click #(js/setTimeout (fn [] (ui-handler/toggle-settings-modal!)))
|
||||
:-for "global_config_edn"}))
|
||||
|
||||
(defn edit-custom-css []
|
||||
(row-with-button-action
|
||||
{:left-label (t :settings-page/custom-theme)
|
||||
|
@ -538,6 +546,8 @@
|
|||
(version-row t version)
|
||||
(language-row t preferred-language)
|
||||
(theme-modes-row t switch-theme system-theme? dark?)
|
||||
;; TODO: Disable for mobile
|
||||
(edit-global-config-edn)
|
||||
(when current-repo (edit-config-edn))
|
||||
(when current-repo (edit-custom-css))
|
||||
(when current-repo (edit-export-css))
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
[frontend.util :as util]
|
||||
[logseq.graph-parser.config :as gp-config]
|
||||
[logseq.graph-parser.util :as gp-util]
|
||||
[shadow.resource :as rc]))
|
||||
[shadow.resource :as rc]
|
||||
["path" :as path]))
|
||||
|
||||
(goog-define DEV-RELEASE false)
|
||||
(defonce dev-release? DEV-RELEASE)
|
||||
|
@ -375,6 +376,14 @@
|
|||
(when repo
|
||||
(get-file-path repo (str app-name "/" config-file)))))
|
||||
|
||||
(defn get-global-config-dir
|
||||
[]
|
||||
(path/join (state/get-root-dir) "config"))
|
||||
|
||||
(defn get-global-config-path
|
||||
[]
|
||||
(path/join (state/get-root-dir) "config" "config.edn"))
|
||||
|
||||
(defn get-metadata-path
|
||||
([]
|
||||
(get-metadata-path (state/get-current-repo)))
|
||||
|
|
|
@ -152,9 +152,11 @@
|
|||
:settings-page/git-switcher-label "Enable Git auto commit"
|
||||
:settings-page/git-commit-delay "Git auto commit seconds"
|
||||
:settings-page/edit-config-edn "Edit config.edn"
|
||||
:settings-page/edit-global-config-edn "Edit global config.edn"
|
||||
:settings-page/edit-custom-css "Edit custom.css"
|
||||
:settings-page/edit-export-css "Edit export.css"
|
||||
:settings-page/custom-configuration "Custom configuration"
|
||||
:settings-page/custom-global-configuration "Custom global configuration"
|
||||
:settings-page/custom-theme "Custom theme"
|
||||
:settings-page/export-theme "Export theme"
|
||||
:settings-page/show-brackets "Show brackets"
|
||||
|
|
|
@ -595,8 +595,10 @@
|
|||
|
||||
(state/set-state! :plugin/indicator-text "LOADING")
|
||||
|
||||
(-> (p/let [root (get-ls-dotdir-root)
|
||||
(->
|
||||
(p/let [root (get-ls-dotdir-root)
|
||||
_ (.setupPluginCore js/LSPlugin (bean/->js {:localUserConfigRoot root :dotConfigRoot root}))
|
||||
_ (state/set-state! :config/root-dir root)
|
||||
|
||||
clear-commands! (fn [pid]
|
||||
;; commands
|
||||
|
|
|
@ -331,13 +331,27 @@
|
|||
(p/let [handle (when-not electron? (idb/get-item handle-path))]
|
||||
(when (or handle electron? mobile-native?) ; electron doesn't store the file handle
|
||||
(p/let [_ (when handle (nfs/verify-permission repo handle true))
|
||||
files-result (fs/get-files (if nfs? handle
|
||||
local-files-result
|
||||
(fs/get-files (if nfs? handle
|
||||
(config/get-local-dir repo))
|
||||
(fn [path handle]
|
||||
(when nfs?
|
||||
(swap! path-handles assoc path handle))))
|
||||
new-files (-> (->db-files mobile-native? electron? dir-name files-result)
|
||||
global-dir (config/get-global-config-dir)
|
||||
global-dir-exists? (fs/dir-exists? global-dir)
|
||||
;; TODO: Handle nfs?
|
||||
global-files-result (if global-dir-exists?
|
||||
(fs/get-files global-dir
|
||||
(fn [path handle]
|
||||
(when nfs?
|
||||
(swap! path-handles assoc path handle))))
|
||||
[])
|
||||
new-local-files (-> (->db-files mobile-native? electron? dir-name local-files-result)
|
||||
(remove-ignore-files dir-name nfs?))
|
||||
new-global-files (-> (->db-files mobile-native? electron? global-dir global-files-result)
|
||||
(remove-ignore-files global-dir nfs?))
|
||||
new-files (concat new-local-files new-global-files)
|
||||
|
||||
_ (when nfs?
|
||||
(let [file-paths (set (map :file/path new-files))]
|
||||
(swap! path-handles (fn [handles]
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
:document/mode? document-mode?
|
||||
|
||||
:config {}
|
||||
:config/root-dir nil
|
||||
:block/component-editing-mode? false
|
||||
:editor/hidden-editors #{} ;; page names
|
||||
:editor/draw-mode? false
|
||||
|
@ -317,6 +318,10 @@
|
|||
(when-not (mobile-util/native-platform?)
|
||||
"local")))
|
||||
|
||||
(defn get-root-dir
|
||||
[]
|
||||
(:config/root-dir @state))
|
||||
|
||||
(def default-config
|
||||
"Default config for a repo-specific, user config"
|
||||
{:feature/enable-search-remove-accents? true
|
||||
|
|
Loading…
Reference in New Issue