-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement subscriptions app (#49)
Co-authored-by: dnikolay-ebc <dnikolay-ebc@users.noreply.github.com>
- Loading branch information
1 parent
1ef4850
commit 55e5bf8
Showing
54 changed files
with
1,423 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,49 @@ | ||
# Application Load | ||
ENTITIES_LOAD=True | ||
DEVICES_LOAD=True | ||
NOTIFICATIONS_LOAD=True | ||
|
||
# Django | ||
DJANGO_SECRET_KEY= | ||
DJANGO_DEBUG=False | ||
ALLOWED_HOSTS=["localhost","127.0.0.1"] | ||
LANGUAGE_CODE=en-us | ||
TIME_ZONE=Europe/Berlin | ||
|
||
# JS/SCSS compression | ||
COMPRESS_ENABLED=True | ||
|
||
# LOGGING | ||
LOKI_HOST=localhost | ||
LOKI_LEVEL=DEBUG | ||
LOKI_PORT=3100 | ||
LOKI_TIMEOUT=0.5 | ||
LOKI_PROTOCOL=http | ||
LOKI_SRC_HOST=entirety | ||
LOKI_TIMEZONE=Europe/Berlin | ||
|
||
# Static files location | ||
STATIC_ROOT=/var/entirety/static/ | ||
MEDIA_ROOT=/var/entirety/media/ | ||
|
||
# OIDC | ||
LOGIN_URL=/oidc/authenticate | ||
LOGIN_REDIRECT_URL=/oidc/callback/ | ||
LOGOUT_REDIRECT_URL=/ | ||
OIDC_OP_AUTHORIZATION_ENDPOINT= | ||
OIDC_OP_JWKS_ENDPOINT= | ||
OIDC_OP_TOKEN_ENDPOINT= | ||
OIDC_OP_USER_ENDPOINT= | ||
OIDC_RP_CLIENT_ID= | ||
OIDC_RP_CLIENT_SECRET= | ||
OIDC_SUPER_ADMIN_ROLE=super_admin | ||
OIDC_SERVER_ADMIN_ROLE=server_admin | ||
OIDC_PROJECT_ADMIN_ROLE=project_admin | ||
OIDC_USER_ROLE=user | ||
OIDC_TOKEN_ROLE_FIELD=roles | ||
|
||
WEB_URL=localhost | ||
# Application Load | ||
ENTITIES_LOAD=True | ||
DEVICES_LOAD=True | ||
NOTIFICATIONS_LOAD=True | ||
|
||
# Django | ||
DJANGO_SECRET_KEY= | ||
DJANGO_DEBUG=False | ||
ALLOWED_HOSTS=["localhost","127.0.0.1"] | ||
LANGUAGE_CODE=en-us | ||
TIME_ZONE=Europe/Berlin | ||
|
||
# JS/SCSS compression | ||
COMPRESS_ENABLED=True | ||
|
||
# LOGGING | ||
LOKI_HOST=localhost | ||
LOKI_LEVEL=DEBUG | ||
LOKI_PORT=3100 | ||
LOKI_TIMEOUT=0.5 | ||
LOKI_PROTOCOL=http | ||
LOKI_SRC_HOST=entirety | ||
LOKI_TIMEZONE=Europe/Berlin | ||
|
||
# Static files location | ||
STATIC_ROOT=/var/entirety/static/ | ||
MEDIA_ROOT=/var/entirety/media/ | ||
|
||
# OIDC | ||
LOGIN_URL=/oidc/authenticate | ||
LOGIN_REDIRECT_URL=/oidc/callback/ | ||
LOGOUT_REDIRECT_URL=/ | ||
OIDC_OP_AUTHORIZATION_ENDPOINT= | ||
OIDC_OP_JWKS_ENDPOINT= | ||
OIDC_OP_TOKEN_ENDPOINT= | ||
OIDC_OP_USER_ENDPOINT= | ||
OIDC_RP_CLIENT_ID= | ||
OIDC_RP_CLIENT_SECRET= | ||
OIDC_SUPER_ADMIN_ROLE=super_admin | ||
OIDC_SERVER_ADMIN_ROLE=server_admin | ||
OIDC_PROJECT_ADMIN_ROLE=project_admin | ||
OIDC_USER_ROLE=user | ||
OIDC_TOKEN_ROLE_FIELD=roles | ||
|
||
# FIWARE | ||
CB_URL=http://localhost:1026 | ||
MQTT_BASE_TOPIC=/Entirety | ||
|
||
WEB_URL=localhost |
This file was deleted.
Oops, something went wrong.
Empty file.
9 changes: 0 additions & 9 deletions
9
app/Entirety/alarming/templates/alarming/subscription_list.html
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from django.core.validators import URLValidator | ||
from django.forms import MultiValueField, ChoiceField, CharField, URLField | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from entirety.widgets import SelectTextInputWidget | ||
from entirety.validators import CustomURLValidator | ||
|
||
|
||
class MQTTURLField(URLField): | ||
"""URL Field that accepts URLs that start with mqtt:// only""" | ||
|
||
default_validators = [CustomURLValidator(schemes=["mqtt"])] | ||
default_error_messages = { | ||
"invalid": _("Enter a valid MQTT URL."), | ||
} | ||
|
||
|
||
class HTTPURLField(URLField): | ||
"""URL Field that accepts URLs that start with http(s):// only""" | ||
|
||
default_validators = [CustomURLValidator(schemes=["http", "https"])] | ||
default_error_messages = { | ||
"invalid": _("Enter a valid URL."), | ||
} | ||
|
||
|
||
class SelectTextMultiField(MultiValueField): | ||
def __init__(self, choices, *, require_all_fields=True, **kwargs): | ||
self.widget = SelectTextInputWidget(choices) | ||
fields = ( | ||
ChoiceField( | ||
choices=choices, | ||
), | ||
CharField(), | ||
) | ||
super(SelectTextMultiField, self).__init__( | ||
fields=fields, require_all_fields=require_all_fields, **kwargs | ||
) | ||
|
||
def compress(self, data_list): | ||
if data_list: | ||
return "|".join(data_list) | ||
|
||
return "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import re | ||
|
||
from django.core.validators import URLValidator | ||
from django.utils.regex_helper import _lazy_re_compile | ||
|
||
|
||
class CustomURLValidator(URLValidator): | ||
def __init__(self, schemes=None, **kwargs): | ||
super().__init__(schemes, **kwargs) | ||
self.host_re = ( | ||
"(" | ||
+ self.hostname_re | ||
+ "(?:" | ||
+ self.domain_re | ||
+ self.tld_re | ||
+ ")?|localhost)" | ||
) | ||
self.regex = _lazy_re_compile( | ||
r"^(?:[a-z0-9.+-]*)://" # scheme is validated separately | ||
r"(?:[^\s:@/]+(?::[^\s:@/]*)?@)?" # user:pass authentication | ||
r"(?:" + self.ipv4_re + "|" + self.ipv6_re + "|" + self.host_re + ")" | ||
r"(?::\d{1,5})?" # port | ||
r"(?:[/?#][^\s]*)?" # resource path | ||
r"\Z", | ||
re.IGNORECASE, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.