Pēteris Caune
12114c647e
Fix channel sorting in the "my checks" page to show groups first
2023-10-12 11:43:20 +03:00
Pēteris Caune
51b9bf7ca1
Add testcases for "Add group" and "Edit group" forms
2023-10-07 10:59:57 +03:00
Pēteris Caune
e537a38dd8
Temporarily remove type hints for the view_on_site method
2023-10-06 20:02:00 +03:00
Pēteris Caune
93fcc79926
Improve tests, fix the handling of "no-op" errors
2023-10-06 19:51:08 +03:00
Florian Apolloner
ca10841503
Fix mypy warnings in hc.font.views ( #904 )
2023-10-06 17:39:20 +03:00
Pēteris Caune
fd54bf87bf
Update changelog
2023-10-06 17:08:43 +03:00
Pēteris Caune
4fc6ff5c26
Tweak CSS in the group form, make sure channel's name is preloaded
2023-10-06 17:06:41 +03:00
Florian Apolloner
7057f6d3a5
Notification groups. Fixes #894 ( #901 )
...
* MVP for notification groups.
* Addressed review comments.
* Push notification group to the front.
* Updated icons.
* Reduce code duplication.
* Show groups at the top.
* Add label to group forms.
* Add checkboxes for integration selection.
* CSS for checkboxes.
* Added tests for group notify.
2023-10-06 17:02:41 +03:00
Pēteris Caune
24bad5af52
Tighten type hints in hc.api.admin
2023-10-06 15:33:10 +03:00
Pēteris Caune
fa9db53631
Update admin to use format_html instead of string interpolation
2023-10-06 13:54:15 +03:00
Pēteris Caune
f68b2c01a6
Simplify the counting of updated objects in admin actions
2023-10-06 11:35:32 +03:00
Pēteris Caune
7b1258ceaa
Improve type hints in accounts admin, fix HTML escaping issue
...
In Project admin, when listing project members, for single-member
projects the owner's email address was being displayed
unescaped. This allowed unescaped amperstand and quote characters
to appear in HTML output.
2023-10-05 16:04:21 +03:00
Pēteris Caune
97830deb29
Improve type hints in test_notify_signal
2023-10-05 15:55:41 +03:00
Pēteris Caune
527f361a9a
Upgrade to Django 4.2.6
2023-10-05 12:45:25 +03:00
Pēteris Caune
fd87cad455
Remove unused imports
2023-10-05 12:44:40 +03:00
Pēteris Caune
d8149cbe84
Add django-stubs-ext to requirements
2023-10-04 16:08:08 +03:00
Pēteris Caune
8fb7d16864
Improve type hints, simplify pagination in Ping admin
...
Pagination, filtering, and result counting in Ping admin is tricky
as the pings table can contain millions of rows.
We previously used "select reltuples from pg_class" trick to
estimate the total number of rows. This only works on Postgres,
and does not handle WHERE filters.
This commit removes the search box, and changes the pagination
template to allow pagination between pages 1-9 and nothing more.
2023-10-04 16:00:41 +03:00
Pēteris Caune
e065871056
Update package versions
2023-10-04 13:52:32 +03:00
Pēteris Caune
339586e402
Add Python 3.12 to the testing matrix
2023-10-04 13:48:13 +03:00
Pēteris Caune
633e612b59
Increase bottom margin for modal windows to work around Safari issue
...
cc: #899
2023-10-04 10:22:53 +03:00
Pēteris Caune
5d99c544ee
Increase the precision in hc.lib.date.format_approx_duration
...
Format durations in one of the following forms:
* "{x} days {y} h"
* "{y} h {z} min"
* "{z} min {w} sec"
2023-10-02 12:50:59 +03:00
Pēteris Caune
d40ce1eaac
Rename DowntimeSummary -> DowntimeRecorder
2023-09-28 09:02:13 +03:00
Pēteris Caune
95b92a9b3b
Fix type warning
2023-09-27 17:47:25 +03:00
Pēteris Caune
2a0ae809a7
Add DowntimeRecord.no_data field
2023-09-27 17:43:18 +03:00
Pēteris Caune
58d7c8cc55
Simplify DowntimeSummary
2023-09-27 17:16:16 +03:00
Pēteris Caune
f7af738c76
Add monthly uptime percentage display in Check Details page
...
Fixes : #773
2023-09-27 13:44:35 +03:00
Pēteris Caune
db5d8adeb5
Switch from namedtuple to dataclass for mutability
2023-09-27 11:03:58 +03:00
Pēteris Caune
46dbaff2c3
Update Check.downtimes() to return records in descending datetime order
...
This way we can avoid one sort operation in Check.downtimes()
and one reverse operation in the "details_downtimes.html" template.
2023-09-27 10:42:05 +03:00
Pēteris Caune
f0085933c3
Update Check.downtimes() to return a list of namedtuples
...
This way it should be easier to add extra fields like uptime
to the returned data structure.
2023-09-27 10:18:52 +03:00
Pēteris Caune
e48d361331
Fix time interval formatting in check details - downtime summary
...
In hc.lib.date.format_approx_duration, we were calling
timedeltaobj.total_seconds() and basing all calculations off that.
This method returns float, so the final result was "2.0 hours" or
"3.0 days" and similar. We now convert it to int, to get "2 hours",
"3 days" etc.
2023-09-26 10:30:34 +03:00
Pēteris Caune
507fd840d8
Exclude "body" from the Ping admin form
...
"body" is an obsolete field and kept around for the sake
of very old pings. For all new pings body data goes either
into the "body_raw" binary field (for small bodies)
or in the object storage (for not so small bodies).
So it is not useful to show the body field in the Ping admin.
2023-09-22 09:36:27 +03:00
Git'Fellow
8dbbd5b9d6
Switch to apt-get ( #893 )
...
More suitable and less error prone to use in scripts
2023-09-20 10:02:34 +03:00
Pēteris Caune
aa541e760b
Add Channel.opsgenie property
...
It replaces:
* Channel.opsgenie_key
* Channel.opsgenie_region
Also, add data migration to normalize Opsgenie channel values
to always be JSON maps.
2023-09-11 16:44:38 +03:00
Pēteris Caune
dcf9f327f6
Add Channel.email property
...
It replaces:
* Channel.email_value
* Channel.email_notify_up
* Channel.email_notify_down
2023-09-11 11:45:25 +03:00
Pēteris Caune
ccc8faa953
Fix admin test
...
The test is checking if a Pushbullet channel shows up in the
channels list. It was looking for the string "Pushbullet".
The problem is this string shows up unconditionally on
the right side filters panel. The fix is to look for
"ic-pushbullet" (the pushbullet icon), which should only
appear inside the list view.
2023-09-11 11:41:52 +03:00
Pēteris Caune
cf4498eca2
Add Channel.phone property
...
It has typed fields: value, notify_up, notify_down.
It replaces:
* Channel.phone_number
* Channel.sms_notify_up
* Channel.sms_notify_down
* Channel.whatsapp_notify_up
* Channel.whatsapp_notify_down
* Channel.signal_notify_up
* Channel.signal_notify_down
2023-09-09 11:09:52 +03:00
Pēteris Caune
1881fa1da0
Fix tests
2023-09-08 16:54:13 +03:00
Pēteris Caune
ee40cd8dab
Fix type warnings
2023-09-08 16:47:27 +03:00
Pēteris Caune
f1d1ccd281
Add Channel.shell and Channel.pd properties
2023-09-08 16:33:12 +03:00
Pēteris Caune
e17f555fb1
Replace Channel.telegram_* properties with a Channel.telegram property
...
The Channel.telegram property has typed fields:
id, thread_id, type, name.
Usage sites change from `channel.telegram_id` to `channel.telegram.id`
2023-09-08 16:02:26 +03:00
Pēteris Caune
5746bbb015
Improve type hints in hc.api.models
2023-09-08 15:58:39 +03:00
Pēteris Caune
a6ab647a46
Improve type hints in hc.accounts.models
2023-09-08 15:54:47 +03:00
Pēteris Caune
92bf9773dc
Improve type hints in hc.lib
2023-09-08 13:05:19 +03:00
Pēteris Caune
9173475194
Improve type hints in hc.api.views
2023-09-07 14:38:55 +03:00
Pēteris Caune
a2fa62c7be
Improve function and variable names
2023-09-07 14:05:47 +03:00
Pēteris Caune
18aac7f46c
Update Spec model to handle int -> timedelta conversion
2023-09-07 13:19:21 +03:00
Pēteris Caune
53200a0559
Switch to using None as the sentinel object for absent fields
...
It means we need to have an extra checks for null values
in Spec.check_nulls() but it makes mypy more happy.
2023-09-07 12:56:35 +03:00
Pēteris Caune
370a75373b
Combine the "validate_json" and "authorize" decorators
2023-09-07 11:18:14 +03:00
Pēteris Caune
ee30448c0b
Update hc.api.views to use Pydantic for incoming data validation
2023-09-07 10:31:54 +03:00
Pēteris Caune
05d2d0065e
Remove usage of backports.zoneinfo
2023-09-06 12:54:27 +03:00