Skip to content

Commit

Permalink
fix(UX): help links and relative URLs
Browse files Browse the repository at this point in the history
also closes #23020
  • Loading branch information
ankush committed Apr 22, 2024
1 parent 4f406d7 commit d40b2a2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ frappe.ui.form.on("System Health Report", {
socketio_transport_mode: (val) => val != "websocket",
onsite_backups: (val) => val == 0,
failed_logins: (val) => val > frm.doc.total_users,
total_errors: (val) => val > 100,
total_errors: (val) => val > 50,
// 5% excluding very small numbers
unhandled_emails: (val) =>
val > 3 && frm.doc.handled_emails > 3 && val / frm.doc.handled_emails > 0.05,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"options": "System Health Report Workers"
},
{
"documentation_url": "/app/rq-worker",
"fieldname": "total_background_workers",
"fieldtype": "Int",
"label": "Total Background Workers"
Expand All @@ -83,6 +84,7 @@
"label": "Background Jobs"
},
{
"documentation_url": "/app/rq-job",
"fieldname": "scheduler_status",
"fieldtype": "Data",
"label": "Scheduler Status"
Expand Down Expand Up @@ -133,6 +135,7 @@
"label": "Outgoing Emails (Last 7 days)"
},
{
"documentation_url": "/app/email-queue?status=Error",
"fieldname": "failed_emails",
"fieldtype": "Int",
"label": "Failed Emails"
Expand All @@ -143,6 +146,7 @@
"label": "Total Outgoing Emails"
},
{
"documentation_url": "/app/email-queue?status=Not+Sent",
"fieldname": "pending_emails",
"fieldtype": "Int",
"label": "Pending Emails"
Expand All @@ -153,11 +157,13 @@
"label": "Incoming Emails (Last 7 days)"
},
{
"documentation_url": "/app/unhandled-email",
"fieldname": "unhandled_emails",
"fieldtype": "Int",
"label": "Unhandled Emails"
},
{
"documentation_url": "/app/communication?communication_type=Communication&sent_or_received=Received",
"fieldname": "handled_emails",
"fieldtype": "Int",
"label": "Handled Emails"
Expand All @@ -168,6 +174,7 @@
"label": "Errors generated in last 1 day"
},
{
"documentation_url": "/app/error-log",
"fieldname": "total_errors",
"fieldtype": "Int",
"label": "Total Errors"
Expand All @@ -192,8 +199,10 @@
"fieldtype": "Column Break"
},
{
"documentation_url": "/app/query-report/Database Storage Usage By Tables",
"fieldname": "top_db_tables",
"fieldtype": "Table",
"label": "Storage Usage By Table",
"options": "System Health Report Tables"
},
{
Expand Down Expand Up @@ -250,11 +259,13 @@
"fieldtype": "Column Break"
},
{
"documentation_url": "/app/backups",
"fieldname": "onsite_backups",
"fieldtype": "Int",
"label": "Number of onsite backups"
},
{
"documentation_url": "/app/user",
"fieldname": "total_users",
"fieldtype": "Int",
"label": "Total Users"
Expand All @@ -269,6 +280,7 @@
"label": "New Users (Last 30 days)"
},
{
"documentation_url": "/app/activity-log?status=Failed&operation=Login",
"fieldname": "failed_logins",
"fieldtype": "Int",
"label": "Failed Logins (Last 30 days)"
Expand Down Expand Up @@ -339,6 +351,7 @@
"fieldtype": "Column Break"
},
{
"documentation_url": "/app/rq-job",
"fieldname": "background_jobs_check",
"fieldtype": "Data",
"label": "Background Jobs Check"
Expand All @@ -355,7 +368,7 @@
"is_virtual": 1,
"issingle": 1,
"links": [],
"modified": "2024-04-19 15:48:13.172247",
"modified": "2024-04-19 16:36:01.698178",
"modified_by": "Administrator",
"module": "Desk",
"name": "System Health Report",
Expand Down
2 changes: 1 addition & 1 deletion frappe/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def validate_url(
valid_schemes: if provided checks the given URL's scheme against this
"""
url = urlparse(txt)
is_valid = bool(url.netloc)
is_valid = bool(url.netloc) or (txt and txt.startswith("/"))

# Handle scheme validation
if isinstance(valid_schemes, str):
Expand Down

0 comments on commit d40b2a2

Please sign in to comment.