~pepe/neil

7b64f08ef95e4b5d9ff0b857b9a4343171c41151 — Josef Pospíšil 1 year, 3 months ago 8c019ce
Fix some more new gp
4 files changed, 9 insertions(+), 8 deletions(-)

M neil/http/stats/init.janet
M neil/http/stats/utils.janet
M neil/http/tasks.janet
M neil/paths.janet
M neil/http/stats/init.janet => neil/http/stats/init.janet +1 -1
@@ 24,7 24,7 @@
  (define-store)
  (def c @[])
  (def [projects clients]
    (retrieve store [:clients (collect c) (in-all :projects) merged]))
    (retrieve store [:clients (collect c) (in-all :projects) (merged)]))
  (def epochs
    (case i
      "today" [(:epoch (today))]

M neil/http/stats/utils.janet => neil/http/stats/utils.janet +1 -0
@@ 2,6 2,7 @@
(import /templates/tracked-intervals/csv-line)
(use /neil/http/utils)

# this was not good idea at all :-)
(defmacro loop-tasks [coll redseqcond clients projects]
  ~(do
     (def ot (os/time))

M neil/http/tasks.janet => neil/http/tasks.janet +2 -2
@@ 187,7 187,7 @@
      (capout
        (line/render-dict
          @{:task (if project
                    (task-for-project task nil)
                    (task-for-project task)
                    (let [project (load store (task :project))]
                      (task-with-project-name (project :name) task)))
            :project-list project


@@ 206,7 206,7 @@
      (capout
        (line/render-dict
          @{:task (if project
                    (task-for-project task nil)
                    (task-for-project task)
                    (let [project (load store (task :project))]
                      (task-with-project-name (project :name) task)))
            :project-list project

M neil/paths.janet => neil/paths.janet +5 -5
@@ 143,7 143,7 @@
  ```
  Path to all projects in one table.
  ```
  [;all-clients (>: :projects) merged])
  [;all-clients (>: :projects) (merged)])

(def all-projects
  ```


@@ 192,7 192,7 @@
  Construsts new table from `task` with computed
  fields from its tracked intervals.
  ```
  [task _]
  [task]
  (def wis (task :tracked-intervals))
  (def ts (task :timestamp))
  (merge task


@@ 216,7 216,7 @@
  [store]
  (def c @[])
  (retrieve store [;all-clients (>: :projects)
                   (<- c merged) flatvals
                   (<- c (merged)) flatvals
                   (>: :tasks) (>Y present?)
                   flatvals sort-by-timestamp
                   (<o> task-with-project-name-view c)]))


@@ 229,7 229,7 @@
  (def c @[])
  (default limt math/inf)
  (retrieve store [;all-clients (>: :projects)
                   (<- c merged) flatvals
                   (<- c (merged)) flatvals
                   (>: :tasks) (>Y present?) flatvals
                   (>Y filtr) sort-by-timestamp (>n limt)
                   (<o> task-with-project-name-view c)]))


@@ 366,7 366,7 @@
  [q]
  (def c @[])
  [;all-clients (>: :projects)
   (<- c merged) flatvals
   (<- c (merged)) flatvals
   (>: :tasks) (>Y present?) flatvals
   (>Y active?) (>Y (name-has-match q)) (match-n-sort q)
   (limit 20) (>: 0) (<o> task-with-project-name-view c)])