Browse Source

enhance: add some texts to make it easier to use logseq

Tienson Qin 4 years ago
parent
commit
c89f7be983

+ 11 - 6
src/main/frontend/components/repo.cljs

@@ -40,8 +40,12 @@
       (if (seq repos)
         [:div#graphs
          [:h1.title "All Graphs"]
+         [:p.ml-2.opacity-70
+          (if (state/github-authed?)
+            "A \"graph\" in Logseq could be either a local directory or a git repo."
+            "A \"graph\" in Logseq means a local directory.")]
 
-         [:div.pl-1.content
+         [:div.pl-1.content.mt-3
           [:div.flex.flex-row.my-4
            (when (nfs-handler/supported?)
              [:div.mr-8
@@ -74,11 +78,12 @@
                                               (repo-handler/re-index! nfs-handler/rebuild-index!)
                                               )}
                  "Re-index"]
-                [:a.control.ml-4 {:title "Clone again and re-index the db"
-                                  :on-click (fn []
-                                              (export-handler/export-repo-as-json! (:url repo)))}
-                 "Export as JSON"]
-                [:a.text-gray-400.ml-4 {:on-click (fn []
+                ;; [:a.control.ml-4 {:title "Export as JSON"
+                ;;                   :on-click (fn []
+                ;;                               (export-handler/export-repo-as-json! (:url repo)))}
+                ;;  "Export as JSON"]
+                [:a.text-gray-400.ml-4 {:title "No worries, unlink this graph will clear its cache only, it does not remove your files on the disk."
+                                        :on-click (fn []
                                                     (repo-handler/remove-repo! repo))}
                  "Unlink"]]]))]
 

+ 7 - 2
src/main/frontend/components/widgets.cljs

@@ -92,7 +92,12 @@
          [:div
           [:h1.title "Open a local directory"]
           [:p.text-sm
-           "Your data will be stored only in your device."]
+           "Logseq support both Markdown and Org mode, you can open an existing directory or creating a new directory.
+Logseq will creates 3 sub-directories in the opened directory:
+1. \"journals\" - store your journal pages
+2. \"pages\" - store the other pages
+3. \"logseq\" - store configuration and custom.css.
+Your data will be stored only in your device."]
           (when-not nfs-supported?
             (ui/admonition :warning
                            [:p "It seems that your browser doesn't support the "
@@ -106,7 +111,7 @@
   [state & {:keys [graph-types]
             :or {graph-types [:local :github]}
             :as opts}]
-  (let [github-authed? (:github-authed? (state/get-me))
+  (let [github-authed? (state/github-authed?)
         generate-f (fn [x]
                      (case x
                        :github

+ 4 - 0
src/main/frontend/state.cljs

@@ -828,6 +828,10 @@
   []
   (:me @state))
 
+(defn github-authed?
+  []
+  (:github-authed? (get-me)))
+
 (defn get-name
   []
   (:name (get-me)))