Commit Graph

103 Commits

Author SHA1 Message Date
D. Berge
e5bc5a0757 Refactor project summaries to use database views 2020-08-26 20:20:53 +02:00
D. Berge
1bf0b67409 Fix Project component name 2020-08-26 20:20:53 +02:00
D. Berge
242d35ec80 Update schema: add project summary tables 2020-08-26 20:14:07 +02:00
D. Berge
b165fc2b2a Rely on Vuex for loading state indications 2020-08-26 17:48:55 +02:00
D. Berge
96d8e0df13 Add loading state indicator to Vuex store.
Every time an API call is made via the store's own `api`
interface, a request counter is incremented. It is
decremented whenever a call completes, whether sucessfully
or not.

If the request counter is at zero, no requests are in
progress. This is exposed to the user via the `loading`
getter.

Calls made other than via the store's `api` interface
will not be registered. The user can choose to increment /
decrement the request counter manually via the relevant
store methods.
2020-08-26 17:42:59 +02:00
D. Berge
cb4846c900 Refactor project DB routines 2020-08-26 17:41:40 +02:00
D. Berge
c7c8f5df8a Sort sequence list by sequence descending by default 2020-08-25 18:31:51 +02:00
D. Berge
da3d273c41 Show expanded sequence information 2020-08-25 18:04:42 +02:00
D. Berge
438f050c2a Add possibility to return associated files if requested.
Pass a trueish value in opts.files to get the list of
raw and final files associated with a sequence. It does
make the query about 30% slower as it stands.
2020-08-25 18:02:28 +02:00
D. Berge
f3e8205adc Update schema: add sequences summary view 2020-08-25 17:59:56 +02:00
D. Berge
a9ad5e1c08 Update schema: add NTBA columns.
NTBA = Not To Be Acquired. We will ignore those lines
and points in our views / queries when considering
missing shots / completion rates.
2020-08-25 17:58:03 +02:00
D. Berge
0c7b3146ae Update label definitions when updating survey config.
It will not delete any labels that have been removed
from the configuration, as those may be used, but it
will add new labels and modify existing ones if they
changed.
2020-08-25 17:52:17 +02:00
D. Berge
c3b0212798 Add more label definitions to example survey config 2020-08-25 17:51:19 +02:00
D. Berge
ab23b6e2e6 Reword text field label 2020-08-25 13:02:56 +02:00
D. Berge
98b35d4b89 Implement sequence list view 2020-08-25 13:02:20 +02:00
D. Berge
f366e99c35 Add Vue debounce plugin 2020-08-25 13:01:38 +02:00
D. Berge
00f1ea20da Allow sequences to be filtered.
Sequences can be filtered by:
* sequence number;
* line number;
* start / end date (of raw acquisition);
* remarks (raw or final).
2020-08-25 12:59:40 +02:00
D. Berge
f486b4835e Instrument alerts for HTTP backend.
An alert is sent whenever an endpoint returns
an error other than an explicit failure (e.g.,
it won't send an alert if a middleware intentionally
returns a {status: XXX} object).
2020-08-25 11:32:13 +02:00
D. Berge
650ed998c6 Read also global config in server backend.
The configuration file etc/config.yaml is exposed to the
server backend under require('configuration').global.

Note that at some point it will probably make sense to
merge the two config files.
2020-08-25 08:48:10 +02:00
D. Berge
9fa76df446 Be explicit about the encoding of JSON config 2020-08-25 08:47:04 +02:00
D. Berge
3ce6f1dce6 Add tasks runner script.
This script runs the deferred imports. It is meant to
be called from a cronjob at regular intervals – every
one or two minutes is probably a good setting.

It checks if another instance is already running before
doing its thing.

If anything goes wrong (any of the called processes exits
with non-zero condition) it will send an alert to GitLab,
provided that the authorisation key is known.
2020-08-24 21:01:47 +02:00
D. Berge
b4b06c8744 Instrument alerts for deferred imports.
In case of errors (or anything else of note), send_alert.py
can be used to push information to a GitLab alerts endpoint.

It is generic enough that it can be used with anything else, though.
2020-08-24 20:02:12 +02:00
D. Berge
bc784989f6 Make P1 imports not fail if called needlessly.
If their respective configuration keys are not
defined in a survey configuration, the import
routines will print an informational message
and exit successfully.
2020-08-24 19:45:59 +02:00
D. Berge
721dae4084 Catch all middleware errors 2020-08-24 13:25:14 +02:00
D. Berge
2ed52f1a54 Add data manipulation functionality to Log component.
It is now possible to add, edit and delete events.
2020-08-22 20:46:15 +02:00
D. Berge
2ff0dfe1fa Add <dougal-event-edit-dialog/> component.
Used to enter new events.
2020-08-22 20:46:15 +02:00
D. Berge
15d5fb8148 Add <dougal-context-menu/> component 2020-08-22 20:46:15 +02:00
D. Berge
b2fc63dc51 Add defaults to Vuex store api action.
It sends Content-Type: application/json by default
and converts the body to string via JSON.stringify
unless it's a string already.
2020-08-22 20:46:15 +02:00
D. Berge
949defd2f6 Add event API endpoints 2020-08-22 20:46:15 +02:00
D. Berge
a55046ed93 Add a meta property to requests.
Using the meta(key, value) middleware factory, the user
can add a property req.meta[key] = value to the request.
2020-08-22 20:46:15 +02:00
D. Berge
0c4d91c603 Implement event DELETE middleware 2020-08-22 20:46:15 +02:00
D. Berge
5349708fb8 Implement event PUT middleware 2020-08-22 20:46:15 +02:00
D. Berge
58694ac1c1 Refactor event POST middleware.
It can now take some parameters from the request URL.
If present, request URL parameters take precedence over
request body values.
2020-08-22 20:45:59 +02:00
D. Berge
ba160c441c Implement db.event.del (delete) 2020-08-22 20:26:03 +02:00
D. Berge
517291d5c9 Implement db.event.put 2020-08-22 20:24:55 +02:00
D. Berge
81e0c40790 Refactor db.event.post 2020-08-22 20:24:10 +02:00
D. Berge
9e1f93d43e Adapt db.events.list to latest schema 2020-08-22 20:23:28 +02:00
D. Berge
1b549655fa Update schema (events).
Some columns have been renamed:

* ts0 → tstamp
* shotNumber → point

The ts1 column from events_timed has been removed.

Labels attached to a sequence / shot without an event
have been removed. All labels are now associated with events.

Changes to event views.
2020-08-22 20:19:39 +02:00
D. Berge
a588bfcb68 Add timed event labels to events view 2020-08-18 10:41:15 +02:00
D. Berge
c3d896a75b Fix typo 2020-08-17 11:22:39 +02:00
D. Berge
218172c821 Fix typo 2020-08-17 11:22:05 +02:00
D. Berge
db4064b806 Add preset event definitions to example survey config 2020-08-17 11:19:41 +02:00
D. Berge
bf1bda0edf Add label definitions to example survey config 2020-08-17 11:19:01 +02:00
D. Berge
4c710a1c62 Modify details of example survey configuration file 2020-08-17 11:17:38 +02:00
D. Berge
d33947e11a Handle empty API responses 2020-08-16 10:51:55 +02:00
D. Berge
c93188a5a7 Add event POST middleware to API 2020-08-16 10:50:58 +02:00
D. Berge
608fd9d3cd Refactor DB interface to use setSurvey() 2020-08-16 10:46:54 +02:00
D. Berge
170312efd6 Remove dead code from DB interface 2020-08-16 10:44:04 +02:00
D. Berge
ecbe4d38ca Add setSurvey() utility function to DB interface.
It sets the current survey and optionally returns a
client connection to use in subsequent queries.
2020-08-16 10:16:08 +02:00
D. Berge
dc1e08b452 Add transaction utility functions to DB interface 2020-08-16 10:15:44 +02:00