Commit Graph

1551 Commits

Author SHA1 Message Date
D. Berge
63f4b45a42 Add robots.txt 2020-08-14 17:30:45 +02:00
D. Berge
2ee9b0cac8 Add midnight shot synthetic event.
It inserts `LDSP` and `FDSP` labels, if those exist
in the `labels` table, on the last and first shotpoints
of the day when a sequence is shot through midnight.

The server timezone is always set to UTC so the midnight
shot implicitly refers to UTC through this.
2020-08-13 23:44:25 +02:00
D. Berge
3a1ec467c9 Update client home page.
Still a work in progress. The recently viewed projects
list is meant to show the last three or so projects that
the user has visited on this computer, probably using localStorage.
2020-08-12 18:23:10 +02:00
D. Berge
f2373a0454 Use environment variables for DB connection if possible 2020-08-12 18:18:47 +02:00
D. Berge
3dcb55393a Navigate to events log from calendar.
* When clicking on a date, shows events for that date.

* When clicking on a sequence, shows that sequence's events.
2020-08-12 15:18:32 +02:00
D. Berge
4de0684919 Implement event logs component.
It can show:

 - all events (this could get slow);
 - a single sequence;
 - a set of sequences;
 - a single date;
 - a range between two dates.

It does not (yet) do pagination and filtering is local only.
2020-08-12 15:15:44 +02:00
D. Berge
6fa39eb3c7 Autogenerate JWT secret if not in production mode 2020-08-12 15:13:53 +02:00
D. Berge
9453d14ee5 Make API config search path consistent with backend.
The API configuration now accepts the same DOUGAL_ROOT
environment variable as the backend and uses the same
path algorithm.
2020-08-12 15:11:54 +02:00
D. Berge
d66e3dd661 Prefer environment variables to connect to DB 2020-08-12 14:39:33 +02:00
D. Berge
b1a088da36 Prefer environment variables to connect to DB 2020-08-12 14:38:31 +02:00
D. Berge
8ea220d09e Add info on etc/db files 2020-08-12 14:24:10 +02:00
D. Berge
d4f91aea3b Add script to update template schema from database 2020-08-12 14:23:34 +02:00
D. Berge
c7b6f259cb Add btree_gist extension to database template 2020-08-12 14:02:40 +02:00
D. Berge
a73376572b API: Add label querying endpoint.
Labels can be associated with events and can have
display properties such as a description and colour,
this is why we need an endpoint for the client to
retrieve them.
2020-08-12 11:41:28 +02:00
D. Berge
d52f8f8bc2 API: Add event querying endpoint.
Events may be filtered by sequence(s):
   …/event?sequence=1
   …/event?sequence=1;3;7

Events may be filtered by date:
   …/event?date0=1970-01-01

Events may be filtered by a date interval:
   …/event?date0=1970-01-01&date1=1980-01-01

Events may also be paginated.
2020-08-12 11:35:57 +02:00
D. Berge
9871aebde6 Add event tables and views.
Events can be associated either with a timestamp *or* with a
sequence + shotpoint (but not both, for data integrity reasons).

Events and shotpoints can also have “labels” associated with them.
The difference between a comment and a label is that the former
is free text while the latter is predefined and has associated
properties (currently only for display, but could also have QC
related properties such as ensuring that there is only one “FSP”
label per sequence and so on).

The `events` view puts everything together into a coherent view.
Note that this view may produce multiple rows for the same
timestamp or shotpoint, for instance when the event has both
a text comment and one or more labels.
2020-08-12 11:24:52 +02:00
D. Berge
d53105ef7a Fix map loading indicator 2020-08-11 20:57:29 +02:00
D. Berge
656f5a2c6d Remove debugging statements 2020-08-11 20:57:05 +02:00
D. Berge
b2b6a88c19 Autofocus on last calendar event on load 2020-08-11 20:43:13 +02:00
D. Berge
91f6fc3763 Remove debugging statement 2020-08-11 20:21:19 +02:00
D. Berge
ab6298cd42 GIS raw: avoid returning nulls 2020-08-11 20:19:58 +02:00
D. Berge
f1b2671d90 Project summary: paginate results 2020-08-11 19:35:13 +02:00
D. Berge
09e05388ac Remove dead code 2020-08-11 19:34:55 +02:00
D. Berge
bf1d94b730 Project summary: return count of final (not raw) shots 2020-08-11 19:33:17 +02:00
D. Berge
7b14041ac0 Project summary: return count of source preplots only 2020-08-11 19:32:11 +02:00
D. Berge
730b06afe1 Add visual loading indicator 2020-08-11 17:16:54 +02:00
D. Berge
efbdb713df Toggle loading property while (re)loading layers 2020-08-11 17:16:20 +02:00
D. Berge
5341db7026 Use proper API calling method 2020-08-11 17:15:23 +02:00
D. Berge
d55197937c Let map cope with non-features being returned by GIS.
Specifically, the raw positioning error vectors
introduced in commit 099cf909c1
2020-08-11 17:13:29 +02:00
D. Berge
099cf909c1 GIS raw: return “stalks” showing the positioning error 2020-08-11 17:11:40 +02:00
D. Berge
ba253eae8d GIS final: return multiple features.
Rather than a single massive FeatureCollection.
2020-08-11 17:10:05 +02:00
D. Berge
ca508980f9 Add kateconfig file to frontend source 2020-08-11 17:09:10 +02:00
D. Berge
b076197122 Add browserslistrc file to frontend source 2020-08-11 17:08:15 +02:00
D. Berge
cae40c976e Show raw sequence info on map 2020-08-11 16:03:37 +02:00
D. Berge
380d39dd62 Truncate sequence durations to second in the GIS calls 2020-08-11 16:02:34 +02:00
D. Berge
9fa2b92d36 Remove debugging statement 2020-08-11 15:41:34 +02:00
D. Berge
cc156ab563 Remove commented out code 2020-08-11 15:41:12 +02:00
D. Berge
c661a7849a Return full line summary info for raw lines GIS endpoint 2020-08-11 15:38:39 +02:00
D. Berge
e4c512f3a2 Add raw data summary views.
The raw_lines_summary and raw_lines_summary_geometry
views are analogous to final_lines_summary and
final_lines_summary_geometry respectively.

One difference of note is that the final_ version
may report negative missing shots, while the raw_
versions assume that the user is not interested in
anything outside the preplot.
2020-08-11 15:35:39 +02:00
D. Berge
40f25287cb Adapt API GIS functions to latest database schema 2020-08-10 23:02:58 +02:00
D. Berge
9c58ec30b5 Add function to import final P1/11.
Based on the analogous import_final_p190.py code.
2020-08-10 22:58:31 +02:00
D. Berge
3755564414 Add function to import raw P1/11.
Based on the analogous import_raw_p190.py code.
2020-08-10 22:58:31 +02:00
D. Berge
4c54b7002a Add DB functions to save raw and final data from P1/11 2020-08-10 22:58:31 +02:00
D. Berge
b36c8b97d1 Add P1/11 parsing Python library.
This is a super-simple library that does the minimum required
to get things going for the specific operations where this
code is foreseen to be used in the immediate future. It is not
and it does not aim to be a complete, generic or universal P1/11
parsing solution.
2020-08-10 22:50:07 +02:00
D. Berge
09e5d9048a Update SQL schema.
- The raw_shots and final_shots tables contain *shots*,
  as the name says, and nothing else.

- The objref is made an integer. This is consistent with
  P1/11 usage and for anything else a relation can be used.

- Raw and final shot tables also include the corresponding
  preplot line as well as the shot number. The preplot line
  is explicit in the P1/11s that we have seen and can otherwise
  be derived from the source geometry in the P1/11 or P1/90
  headers (provided those headers are correct). It is the
  import process' business to figure out what the preplot
  lines are if those are not explicitly given in the data.

- As a result of the above, some of the views have been
  re-written, hopefully in a simpler way.

- The shot_count view has been removed as it was neither used
  nor useful.
2020-08-10 22:43:07 +02:00
D. Berge
a0faa51602 Fix PREFIX usage 2020-08-10 22:41:37 +02:00
D. Berge
ba9b2e66c7 Add client dist/ final location to .gitignore 2020-08-09 16:47:56 +02:00
D. Berge
ed6b051669 Add DOUGAL_ROOT environment variable support.
When searching for configuration files, we look in the
following places:

1. $DOUGAL_ROOT/etc/
2. $HOME/software/etc/
3. ./software/etc/
2020-08-09 16:43:51 +02:00
D. Berge
36596da46b Add __pycache__/ to .gitignore 2020-08-09 16:43:51 +02:00
D. Berge
a766a4dc6c Let API run with default settings in dev mode.
If the configuration file is not found, either at its
default place ($HOME/etc/www/config.json) or wherever
indicated by the DOUGAL_API_CONFIG environment variable,
create a temporary default config and try to run with it.

On the other hand, if we are in production (NODE_ENV == production)
we exit with non-zero in the absence of a real configuration file.
2020-08-09 10:50:53 +02:00