Skip to content

Commit

Permalink
Overview alerts (#313)
Browse files Browse the repository at this point in the history
* `chore: Uncomment bucket creation during initialization`

* refactor: Remove requirement for CUSTOMER_CODE field in CustomMonitoringAlertProvisionModel

* chore: update dependencies in frontend

* refactor: remove CustomerCode check on alert creation dialog

* refactor: update template

* refactor: update template

* refactor: lint

* `chore: Update MINIO_ROOT_PASSWORD in .env.example`

* feat: add incident overview cards

* refactor: update style of incident overview cards

* refactor: update labels of incident overview cards

* precommit fixes

---------

Co-authored-by: Davide Di Modica <webmaster.ddm@gmail.com>
  • Loading branch information
taylorwalton and Linko91 authored Oct 1, 2024
1 parent 57d028f commit ec3fe39
Show file tree
Hide file tree
Showing 63 changed files with 1,439 additions and 1,185 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ MYSQL_PASSWORD=REPLACE_WITH_PASSWORD

MINIO_URL=copilot-minio
MINIO_ROOT_USER=admin
# ! Make the password at least 8 characters long ! #
MINIO_ROOT_PASSWORD=REPLACE_ME
MINIO_SECURE=False

Expand Down
32 changes: 17 additions & 15 deletions backend/app/integrations/monitoring_alert/schema/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from fastapi import HTTPException
from pydantic import BaseModel
from pydantic import Field
from pydantic import root_validator
from pydantic import validator


Expand Down Expand Up @@ -254,17 +253,20 @@ class CustomMonitoringAlertProvisionModel(BaseModel):
example=300000,
)

@root_validator
def check_customer_code(cls, values):
custom_fields = values.get("custom_fields")
if custom_fields is None:
raise HTTPException(
status_code=400,
detail="At least one custom field with name CUSTOMER_CODE is required",
)
if not any(field.name == "CUSTOMER_CODE" for field in custom_fields):
raise HTTPException(
status_code=400,
detail="At least one custom field with name CUSTOMER_CODE is required",
)
return values
# ! I think I can remove the requirement for the CUSTOMER_CODE field.
# ! The new incident management doesnt require the CUSTOMER_CODE to be preset but
# ! rather looks for valid CustomerCodeKeys(Enum) # !
# @root_validator
# def check_customer_code(cls, values):
# custom_fields = values.get("custom_fields")
# if custom_fields is None:
# raise HTTPException(
# status_code=400,
# detail="At least one custom field with name CUSTOMER_CODE is required",
# )
# if not any(field.name == "CUSTOMER_CODE" for field in custom_fields):
# raise HTTPException(
# status_code=400,
# detail="At least one custom field with name CUSTOMER_CODE is required",
# )
# return values
2 changes: 1 addition & 1 deletion backend/copilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
server_ip = os.getenv("SERVER_IP", "localhost")
environment = os.getenv("ENVIRONMENT", "PRODUCTION")

# Not needed for now
# ! Not needed for now maybe revist later ! #
# ssl_keyfile = os.path.join(os.path.dirname(__file__), "../nginx/server.key")
# ssl_certfile = os.path.join(os.path.dirname(__file__), "../nginx/server.crt")

Expand Down
3 changes: 2 additions & 1 deletion frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default antfu({
"vue/html-self-closing": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/comma-dangle": "off",
"vue/quote-props": "off"
"vue/quote-props": "off",
"vue/one-component-per-file": "off"
}
})
5 changes: 1 addition & 4 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta
name="viewport"
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"
/>
<meta name="viewport" content="initial-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="SOCFortress CoPilot" />
Expand Down
Loading

0 comments on commit ec3fe39

Please sign in to comment.