Compare commits
64 commits
main
...
fix-table-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fdaeeedec | ||
|
|
65d83e91c5 | ||
|
|
df67acc78f | ||
|
|
e5997c662f | ||
|
|
9ae88e62fd | ||
|
|
e73bd5fef5 | ||
|
|
93dc49bf41 | ||
|
|
c2a3853bd9 | ||
|
|
5cca953a16 | ||
|
|
9367c977ca | ||
|
|
30dba23530 | ||
|
|
21c30af4f0 | ||
|
|
da617747dc | ||
|
|
ac2d12d95f | ||
|
|
aa7b3fd617 | ||
|
|
94b541c758 | ||
|
|
45ef98b163 | ||
|
|
35eb7d4152 | ||
|
|
7c23521cb8 | ||
|
|
8a8df0a8cb | ||
|
|
e54f62a0e6 | ||
|
|
0bdb416594 | ||
|
|
3484da2f60 | ||
|
|
2f164708e7 | ||
|
|
c66296a050 | ||
|
|
a1cf508cb3 | ||
|
|
38594319f0 | ||
|
|
c963ec5e91 | ||
|
|
c04090a778 | ||
|
|
fc48ba4149 | ||
|
|
04db322e54 | ||
|
|
c9ea3651db | ||
|
|
1dc63bf88b | ||
|
|
2fb7b3d542 | ||
|
|
57a21eb31d | ||
|
|
e9a1a8c4eb | ||
|
|
14191c1de4 | ||
|
|
7e52c97d62 | ||
|
|
1cdb9bd06d | ||
|
|
e7ad4c8bd0 | ||
|
|
29d69e5b24 | ||
|
|
2e5517509b | ||
|
|
c95a4f6770 | ||
|
|
8af7d1a263 | ||
|
|
332cbb3516 | ||
|
|
1b564f53d5 | ||
|
|
1aa3b4b4e5 | ||
|
|
d531b5da7e | ||
|
|
e173591d88 | ||
|
|
359ecc85af | ||
|
|
f0e8100283 | ||
|
|
251d727375 | ||
|
|
b00a90484e | ||
|
|
ce0686eec3 | ||
|
|
34232ed23c | ||
|
|
954bfbf8f7 | ||
|
|
c0197cdfeb | ||
|
|
12ab110e0e | ||
|
|
f48808f42e | ||
|
|
b080a98764 | ||
|
|
dd885c65ac | ||
|
|
0ad2836650 | ||
|
|
20b76a0ed9 | ||
|
|
884f3499ef |
107 changed files with 2300 additions and 1223 deletions
1
.github/workflows/patch-build.yaml
vendored
1
.github/workflows/patch-build.yaml
vendored
|
|
@ -83,6 +83,7 @@ jobs:
|
||||||
[ -d $MSAAS_REPO_FOLDER ] || {
|
[ -d $MSAAS_REPO_FOLDER ] || {
|
||||||
git clone -b dev --recursive https://x-access-token:$MSAAS_REPO_CLONE_TOKEN@$MSAAS_REPO_URL $MSAAS_REPO_FOLDER
|
git clone -b dev --recursive https://x-access-token:$MSAAS_REPO_CLONE_TOKEN@$MSAAS_REPO_URL $MSAAS_REPO_FOLDER
|
||||||
cd $MSAAS_REPO_FOLDER
|
cd $MSAAS_REPO_FOLDER
|
||||||
|
git log -1
|
||||||
cd openreplay && git fetch origin && git checkout main # This have to be changed to specific tag
|
cd openreplay && git fetch origin && git checkout main # This have to be changed to specific tag
|
||||||
git log -1
|
git log -1
|
||||||
cd $MSAAS_REPO_FOLDER
|
cd $MSAAS_REPO_FOLDER
|
||||||
|
|
|
||||||
|
|
@ -457,12 +457,6 @@ def set_password_invitation(user_id, new_password):
|
||||||
user = update(tenant_id=-1, user_id=user_id, changes=changes)
|
user = update(tenant_id=-1, user_id=user_id, changes=changes)
|
||||||
r = authenticate(user['email'], new_password)
|
r = authenticate(user['email'], new_password)
|
||||||
|
|
||||||
tenant_id = r.pop("tenantId")
|
|
||||||
r["limits"] = {
|
|
||||||
"teamMember": -1,
|
|
||||||
"projects": -1,
|
|
||||||
"metadata": metadata.get_remaining_metadata_with_count(tenant_id)}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"jwt": r.pop("jwt"),
|
"jwt": r.pop("jwt"),
|
||||||
"refreshToken": r.pop("refreshToken"),
|
"refreshToken": r.pop("refreshToken"),
|
||||||
|
|
@ -470,10 +464,7 @@ def set_password_invitation(user_id, new_password):
|
||||||
"spotJwt": r.pop("spotJwt"),
|
"spotJwt": r.pop("spotJwt"),
|
||||||
"spotRefreshToken": r.pop("spotRefreshToken"),
|
"spotRefreshToken": r.pop("spotRefreshToken"),
|
||||||
"spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"),
|
"spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"),
|
||||||
'data': {
|
**r
|
||||||
"scopeState": scope.get_scope(-1),
|
|
||||||
"user": r
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,13 +129,13 @@ def add_edit(tenant_id, data: schemas.WebhookSchema, replace_none=None):
|
||||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"name already exists.")
|
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"name already exists.")
|
||||||
if data.webhook_id is not None:
|
if data.webhook_id is not None:
|
||||||
return update(tenant_id=tenant_id, webhook_id=data.webhook_id,
|
return update(tenant_id=tenant_id, webhook_id=data.webhook_id,
|
||||||
changes={"endpoint": data.endpoint.unicode_string(),
|
changes={"endpoint": data.endpoint,
|
||||||
"authHeader": data.auth_header,
|
"authHeader": data.auth_header,
|
||||||
"name": data.name},
|
"name": data.name},
|
||||||
replace_none=replace_none)
|
replace_none=replace_none)
|
||||||
else:
|
else:
|
||||||
return add(tenant_id=tenant_id,
|
return add(tenant_id=tenant_id,
|
||||||
endpoint=data.endpoint.unicode_string(),
|
endpoint=data.endpoint,
|
||||||
auth_header=data.auth_header,
|
auth_header=data.auth_header,
|
||||||
name=data.name,
|
name=data.name,
|
||||||
replace_none=replace_none)
|
replace_none=replace_none)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
export TZ=UTC
|
||||||
|
|
||||||
uvicorn app:app --host 0.0.0.0 --port $LISTEN_PORT --proxy-headers --log-level ${S_LOGLEVEL:-warning}
|
uvicorn app:app --host 0.0.0.0 --port $LISTEN_PORT --proxy-headers --log-level ${S_LOGLEVEL:-warning}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
export TZ=UTC
|
||||||
export ASSIST_KEY=ignore
|
export ASSIST_KEY=ignore
|
||||||
uvicorn app:app --host 0.0.0.0 --port 8888 --log-level ${S_LOGLEVEL:-warning}
|
uvicorn app:app --host 0.0.0.0 --port 8888 --log-level ${S_LOGLEVEL:-warning}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
export TZ=UTC
|
||||||
|
|
||||||
uvicorn app_alerts:app --reload --port 8888 --log-level ${S_LOGLEVEL:-warning}
|
uvicorn app_alerts:app --reload --port 8888 --log-level ${S_LOGLEVEL:-warning}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
export TZ=UTC
|
||||||
|
|
||||||
uvicorn app:app --reload --log-level ${S_LOGLEVEL:-warning}
|
uvicorn app:app --reload --log-level ${S_LOGLEVEL:-warning}
|
||||||
|
|
@ -211,7 +211,8 @@ class IssueTrackingJiraSchema(IssueTrackingIntegration):
|
||||||
|
|
||||||
class WebhookSchema(BaseModel):
|
class WebhookSchema(BaseModel):
|
||||||
webhook_id: Optional[int] = Field(default=None)
|
webhook_id: Optional[int] = Field(default=None)
|
||||||
endpoint: AnyHttpUrl = Field(...)
|
processed_endpoint: AnyHttpUrl = Field(..., alias="endpoint")
|
||||||
|
endpoint: Optional[str] = Field(default=None, doc_hidden=True)
|
||||||
auth_header: Optional[str] = Field(default=None)
|
auth_header: Optional[str] = Field(default=None)
|
||||||
name: str = Field(default="", max_length=100, pattern=NAME_PATTERN)
|
name: str = Field(default="", max_length=100, pattern=NAME_PATTERN)
|
||||||
|
|
||||||
|
|
@ -754,6 +755,8 @@ class SessionsSearchPayloadSchema(_TimedSchema, _PaginatedSchema):
|
||||||
for f in values.get("filters", []):
|
for f in values.get("filters", []):
|
||||||
vals = []
|
vals = []
|
||||||
for v in f.get("value", []):
|
for v in f.get("value", []):
|
||||||
|
if f.get("type", "") == FilterType.DURATION.value and v is None:
|
||||||
|
v = 0
|
||||||
if v is not None and (f.get("type", "") != FilterType.DURATION.value
|
if v is not None and (f.get("type", "") != FilterType.DURATION.value
|
||||||
or str(v).isnumeric()):
|
or str(v).isnumeric()):
|
||||||
vals.append(v)
|
vals.append(v)
|
||||||
|
|
@ -1020,33 +1023,51 @@ class CardSessionsSchema(_TimedSchema, _PaginatedSchema):
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
# We don't need this as the UI is expecting filters to override the full series' filters
|
||||||
|
# @model_validator(mode="after")
|
||||||
|
# def __merge_out_filters_with_series(self):
|
||||||
|
# for f in self.filters:
|
||||||
|
# for s in self.series:
|
||||||
|
# found = False
|
||||||
|
#
|
||||||
|
# if f.is_event:
|
||||||
|
# sub = s.filter.events
|
||||||
|
# else:
|
||||||
|
# sub = s.filter.filters
|
||||||
|
#
|
||||||
|
# for e in sub:
|
||||||
|
# if f.type == e.type and f.operator == e.operator:
|
||||||
|
# found = True
|
||||||
|
# if f.is_event:
|
||||||
|
# # If extra event: append value
|
||||||
|
# for v in f.value:
|
||||||
|
# if v not in e.value:
|
||||||
|
# e.value.append(v)
|
||||||
|
# else:
|
||||||
|
# # If extra filter: override value
|
||||||
|
# e.value = f.value
|
||||||
|
# if not found:
|
||||||
|
# sub.append(f)
|
||||||
|
#
|
||||||
|
# self.filters = []
|
||||||
|
#
|
||||||
|
# return self
|
||||||
|
|
||||||
|
# UI is expecting filters to override the full series' filters
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def __merge_out_filters_with_series(self):
|
def __override_series_filters_with_outer_filters(self):
|
||||||
for f in self.filters:
|
if len(self.filters) > 0:
|
||||||
for s in self.series:
|
events = []
|
||||||
found = False
|
filters = []
|
||||||
|
for f in self.filters:
|
||||||
if f.is_event:
|
if f.is_event:
|
||||||
sub = s.filter.events
|
events.append(f)
|
||||||
else:
|
else:
|
||||||
sub = s.filter.filters
|
filters.append(f)
|
||||||
|
for s in self.series:
|
||||||
for e in sub:
|
s.filter.events = events
|
||||||
if f.type == e.type and f.operator == e.operator:
|
s.filter.filters = filters
|
||||||
found = True
|
|
||||||
if f.is_event:
|
|
||||||
# If extra event: append value
|
|
||||||
for v in f.value:
|
|
||||||
if v not in e.value:
|
|
||||||
e.value.append(v)
|
|
||||||
else:
|
|
||||||
# If extra filter: override value
|
|
||||||
e.value = f.value
|
|
||||||
if not found:
|
|
||||||
sub.append(f)
|
|
||||||
|
|
||||||
self.filters = []
|
self.filters = []
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1357,6 +1378,7 @@ class LiveFilterType(str, Enum):
|
||||||
USER_BROWSER = FilterType.USER_BROWSER.value
|
USER_BROWSER = FilterType.USER_BROWSER.value
|
||||||
USER_DEVICE = FilterType.USER_DEVICE.value
|
USER_DEVICE = FilterType.USER_DEVICE.value
|
||||||
USER_COUNTRY = FilterType.USER_COUNTRY.value
|
USER_COUNTRY = FilterType.USER_COUNTRY.value
|
||||||
|
USER_CITY = FilterType.USER_CITY.value
|
||||||
USER_STATE = FilterType.USER_STATE.value
|
USER_STATE = FilterType.USER_STATE.value
|
||||||
USER_ID = FilterType.USER_ID.value
|
USER_ID = FilterType.USER_ID.value
|
||||||
USER_ANONYMOUS_ID = FilterType.USER_ANONYMOUS_ID.value
|
USER_ANONYMOUS_ID = FilterType.USER_ANONYMOUS_ID.value
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,12 @@ func (s *sentryClient) FetchSessionData(credentials interface{}, sessionID uint6
|
||||||
cfg.Token = val
|
cfg.Token = val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
requestUrl := fmt.Sprintf("https://sentry.io/api/0/projects/%s/%s/events/", cfg.OrganizationSlug, cfg.ProjectSlug)
|
requestUrl := fmt.Sprintf("https://sentry.io/api/0/projects/%s/%s/issues/", cfg.OrganizationSlug, cfg.ProjectSlug)
|
||||||
|
|
||||||
testCallLimit := 1
|
testCallLimit := 1
|
||||||
params := url.Values{}
|
params := url.Values{}
|
||||||
if sessionID != 0 {
|
if sessionID != 0 {
|
||||||
params.Add("query", fmt.Sprintf("openReplaySession.id=%d", sessionID))
|
params.Add("query", fmt.Sprintf("openReplaySession.id:%d", sessionID))
|
||||||
} else {
|
} else {
|
||||||
params.Add("per_page", fmt.Sprintf("%d", testCallLimit))
|
params.Add("per_page", fmt.Sprintf("%d", testCallLimit))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -182,3 +182,20 @@ def delete(tenant_id, user_id, role_id):
|
||||||
{"tenant_id": tenant_id, "role_id": role_id})
|
{"tenant_id": tenant_id, "role_id": role_id})
|
||||||
cur.execute(query=query)
|
cur.execute(query=query)
|
||||||
return get_roles(tenant_id=tenant_id)
|
return get_roles(tenant_id=tenant_id)
|
||||||
|
|
||||||
|
|
||||||
|
def get_role(tenant_id, role_id):
|
||||||
|
with pg_client.PostgresClient() as cur:
|
||||||
|
query = cur.mogrify("""SELECT roles.*
|
||||||
|
FROM public.roles
|
||||||
|
WHERE tenant_id =%(tenant_id)s
|
||||||
|
AND deleted_at IS NULL
|
||||||
|
AND not service_role
|
||||||
|
AND role_id = %(role_id)s
|
||||||
|
LIMIT 1;""",
|
||||||
|
{"tenant_id": tenant_id, "role_id": role_id})
|
||||||
|
cur.execute(query=query)
|
||||||
|
row = cur.fetchone()
|
||||||
|
if row is not None:
|
||||||
|
row["created_at"] = TimeUTC.datetime_to_timestamp(row["created_at"])
|
||||||
|
return helper.dict_to_camel_case(row)
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,12 @@ def create_member(tenant_id, user_id, data: schemas.CreateMemberSchema, backgrou
|
||||||
role_id = data.roleId
|
role_id = data.roleId
|
||||||
if role_id is None:
|
if role_id is None:
|
||||||
role_id = roles.get_role_by_name(tenant_id=tenant_id, name="member").get("roleId")
|
role_id = roles.get_role_by_name(tenant_id=tenant_id, name="member").get("roleId")
|
||||||
|
else:
|
||||||
|
role = roles.get_role(tenant_id=tenant_id, role_id=role_id)
|
||||||
|
if role is None:
|
||||||
|
return {"errors": ["role not found"]}
|
||||||
|
if role["name"].lower() == "owner" and role["protected"]:
|
||||||
|
return {"errors": ["invalid role"]}
|
||||||
invitation_token = __generate_invitation_token()
|
invitation_token = __generate_invitation_token()
|
||||||
user = get_deleted_user_by_email(email=data.email)
|
user = get_deleted_user_by_email(email=data.email)
|
||||||
if user is not None and user["tenantId"] == tenant_id:
|
if user is not None and user["tenantId"] == tenant_id:
|
||||||
|
|
@ -333,7 +339,7 @@ def edit_member(user_id_to_update, tenant_id, changes: schemas.EditMemberSchema,
|
||||||
if editor_id != user_id_to_update:
|
if editor_id != user_id_to_update:
|
||||||
admin = get_user_role(tenant_id=tenant_id, user_id=editor_id)
|
admin = get_user_role(tenant_id=tenant_id, user_id=editor_id)
|
||||||
if not admin["superAdmin"] and not admin["admin"]:
|
if not admin["superAdmin"] and not admin["admin"]:
|
||||||
return {"errors": ["unauthorized"]}
|
return {"errors": ["unauthorized, you must have admin privileges"]}
|
||||||
if admin["admin"] and user["superAdmin"]:
|
if admin["admin"] and user["superAdmin"]:
|
||||||
return {"errors": ["only the owner can edit his own details"]}
|
return {"errors": ["only the owner can edit his own details"]}
|
||||||
else:
|
else:
|
||||||
|
|
@ -343,10 +349,10 @@ def edit_member(user_id_to_update, tenant_id, changes: schemas.EditMemberSchema,
|
||||||
return {"errors": ["cannot change your own admin privileges"]}
|
return {"errors": ["cannot change your own admin privileges"]}
|
||||||
if changes.roleId:
|
if changes.roleId:
|
||||||
if user["superAdmin"] and changes.roleId != user["roleId"]:
|
if user["superAdmin"] and changes.roleId != user["roleId"]:
|
||||||
changes.roleId = None
|
|
||||||
return {"errors": ["owner's role cannot be changed"]}
|
return {"errors": ["owner's role cannot be changed"]}
|
||||||
|
elif user["superAdmin"]:
|
||||||
if changes.roleId != user["roleId"]:
|
changes.roleId = None
|
||||||
|
elif changes.roleId != user["roleId"]:
|
||||||
return {"errors": ["cannot change your own role"]}
|
return {"errors": ["cannot change your own role"]}
|
||||||
|
|
||||||
if changes.name and len(changes.name) > 0:
|
if changes.name and len(changes.name) > 0:
|
||||||
|
|
@ -357,6 +363,12 @@ def edit_member(user_id_to_update, tenant_id, changes: schemas.EditMemberSchema,
|
||||||
|
|
||||||
if changes.roleId is not None:
|
if changes.roleId is not None:
|
||||||
_changes["roleId"] = changes.roleId
|
_changes["roleId"] = changes.roleId
|
||||||
|
role = roles.get_role(tenant_id=tenant_id, role_id=changes.roleId)
|
||||||
|
if role is None:
|
||||||
|
return {"errors": ["role not found"]}
|
||||||
|
else:
|
||||||
|
if role["name"].lower() == "owner" and role["protected"]:
|
||||||
|
return {"errors": ["invalid role"]}
|
||||||
|
|
||||||
if len(_changes.keys()) > 0:
|
if len(_changes.keys()) > 0:
|
||||||
update(tenant_id=tenant_id, user_id=user_id_to_update, changes=_changes, output=False)
|
update(tenant_id=tenant_id, user_id=user_id_to_update, changes=_changes, output=False)
|
||||||
|
|
@ -540,12 +552,6 @@ def set_password_invitation(tenant_id, user_id, new_password):
|
||||||
user = update(tenant_id=tenant_id, user_id=user_id, changes=changes)
|
user = update(tenant_id=tenant_id, user_id=user_id, changes=changes)
|
||||||
r = authenticate(user['email'], new_password)
|
r = authenticate(user['email'], new_password)
|
||||||
|
|
||||||
tenant_id = r.pop("tenantId")
|
|
||||||
r["limits"] = {
|
|
||||||
"teamMember": -1,
|
|
||||||
"projects": -1,
|
|
||||||
"metadata": metadata.get_remaining_metadata_with_count(tenant_id)}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"jwt": r.pop("jwt"),
|
"jwt": r.pop("jwt"),
|
||||||
"refreshToken": r.pop("refreshToken"),
|
"refreshToken": r.pop("refreshToken"),
|
||||||
|
|
@ -554,10 +560,7 @@ def set_password_invitation(tenant_id, user_id, new_password):
|
||||||
"spotRefreshToken": r.pop("spotRefreshToken"),
|
"spotRefreshToken": r.pop("spotRefreshToken"),
|
||||||
"spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"),
|
"spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"),
|
||||||
"tenantId": tenant_id,
|
"tenantId": tenant_id,
|
||||||
'data': {
|
**r
|
||||||
"scopeState": scope.get_scope(tenant_id),
|
|
||||||
"user": r
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,13 +136,13 @@ def add_edit(tenant_id, data: schemas.WebhookSchema, replace_none=None):
|
||||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"name already exists.")
|
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"name already exists.")
|
||||||
if data.webhook_id is not None:
|
if data.webhook_id is not None:
|
||||||
return update(tenant_id=tenant_id, webhook_id=data.webhook_id,
|
return update(tenant_id=tenant_id, webhook_id=data.webhook_id,
|
||||||
changes={"endpoint": data.endpoint.unicode_string(),
|
changes={"endpoint": data.endpoint,
|
||||||
"authHeader": data.auth_header,
|
"authHeader": data.auth_header,
|
||||||
"name": data.name},
|
"name": data.name},
|
||||||
replace_none=replace_none)
|
replace_none=replace_none)
|
||||||
else:
|
else:
|
||||||
return add(tenant_id=tenant_id,
|
return add(tenant_id=tenant_id,
|
||||||
endpoint=data.endpoint.unicode_string(),
|
endpoint=data.endpoint,
|
||||||
auth_header=data.auth_header,
|
auth_header=data.auth_header,
|
||||||
name=data.name,
|
name=data.name,
|
||||||
replace_none=replace_none)
|
replace_none=replace_none)
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ def get_event_type(event_type: Union[schemas.EventType, schemas.PerformanceEvent
|
||||||
schemas.EventType.REQUEST: "REQUEST",
|
schemas.EventType.REQUEST: "REQUEST",
|
||||||
schemas.EventType.REQUEST_DETAILS: "REQUEST",
|
schemas.EventType.REQUEST_DETAILS: "REQUEST",
|
||||||
schemas.PerformanceEventType.FETCH_FAILED: "REQUEST",
|
schemas.PerformanceEventType.FETCH_FAILED: "REQUEST",
|
||||||
|
schemas.GraphqlFilterType.GRAPHQL_NAME: "GRAPHQL",
|
||||||
schemas.EventType.STATE_ACTION: "STATEACTION",
|
schemas.EventType.STATE_ACTION: "STATEACTION",
|
||||||
schemas.EventType.ERROR: "ERROR",
|
schemas.EventType.ERROR: "ERROR",
|
||||||
schemas.PerformanceEventType.LOCATION_AVG_CPU_LOAD: 'PERFORMANCE',
|
schemas.PerformanceEventType.LOCATION_AVG_CPU_LOAD: 'PERFORMANCE',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
export TZ=UTC
|
||||||
sh env_vars.sh
|
sh env_vars.sh
|
||||||
source /tmp/.env.override
|
source /tmp/.env.override
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
export TZ=UTC
|
||||||
export ASSIST_KEY=ignore
|
export ASSIST_KEY=ignore
|
||||||
sh env_vars.sh
|
sh env_vars.sh
|
||||||
source /tmp/.env.override
|
source /tmp/.env.override
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
export TZ=UTC
|
||||||
export ASSIST_KEY=ignore
|
export ASSIST_KEY=ignore
|
||||||
sh env_vars.sh
|
sh env_vars.sh
|
||||||
source /tmp/.env.override
|
source /tmp/.env.override
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,11 @@ export default class APIClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
return fetch(edp + _path, init).then((response) => {
|
return fetch(edp + _path, init).then((response) => {
|
||||||
|
if (response.status === 403) {
|
||||||
|
console.warn('API returned 403. Clearing JWT token.');
|
||||||
|
this.onUpdateJwt({ jwt: undefined }); // Clear the token
|
||||||
|
}
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
return response;
|
return response;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,10 @@ import React from 'react';
|
||||||
import LiveSessionList from 'Shared/LiveSessionList';
|
import LiveSessionList from 'Shared/LiveSessionList';
|
||||||
import LiveSessionSearch from 'Shared/LiveSessionSearch';
|
import LiveSessionSearch from 'Shared/LiveSessionSearch';
|
||||||
import AssistSearchField from './AssistSearchField';
|
import AssistSearchField from './AssistSearchField';
|
||||||
|
import usePageTitle from '@/hooks/usePageTitle';
|
||||||
|
|
||||||
function AssistView() {
|
function AssistView() {
|
||||||
|
usePageTitle('Co-Browse - OpenReplay');
|
||||||
return (
|
return (
|
||||||
<div className="w-full mx-auto" style={{ maxWidth: '1360px'}}>
|
<div className="w-full mx-auto" style={{ maxWidth: '1360px'}}>
|
||||||
<AssistSearchField />
|
<AssistSearchField />
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ function UserForm() {
|
||||||
const isSaving = userStore.saving;
|
const isSaving = userStore.saving;
|
||||||
const user: any = userStore.instance || userStore.initUser();
|
const user: any = userStore.instance || userStore.initUser();
|
||||||
const roles = roleStore.list
|
const roles = roleStore.list
|
||||||
.filter((r) => (r.isProtected ? user.isSuperAdmin : true))
|
.filter((r) => (r.protected ? user.isSuperAdmin : true))
|
||||||
.map((r) => ({ label: r.name, value: r.roleId }));
|
.map((r) => ({ label: r.name, value: r.roleId }));
|
||||||
|
|
||||||
const onChangeCheckbox = (e: any) => {
|
const onChangeCheckbox = (e: any) => {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ interface Props {
|
||||||
function SessionsBy(props: Props) {
|
function SessionsBy(props: Props) {
|
||||||
const { metric = {}, data = { values: [] }, onClick = () => null, isTemplate } = props;
|
const { metric = {}, data = { values: [] }, onClick = () => null, isTemplate } = props;
|
||||||
const [selected, setSelected] = React.useState<any>(null);
|
const [selected, setSelected] = React.useState<any>(null);
|
||||||
const total = data.count;
|
const total = data.total;
|
||||||
const { openModal, closeModal } = useModal();
|
const { openModal, closeModal } = useModal();
|
||||||
const modalMetric = React.useMemo(() => Object.assign(new Widget(), metric), [metric]);
|
const modalMetric = React.useMemo(() => Object.assign(new Widget(), metric), [metric]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import {
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import ExCard from './ExCard';
|
import ExCard from './ExCard';
|
||||||
import { size } from '@floating-ui/react-dom-interactions';
|
|
||||||
|
|
||||||
const TYPES = {
|
const TYPES = {
|
||||||
Frustrations: 'frustrations',
|
Frustrations: 'frustrations',
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ function ExcludeFilters(props: Props) {
|
||||||
onRemoveFilter={() => onRemoveFilter(index)}
|
onRemoveFilter={() => onRemoveFilter(index)}
|
||||||
// saveRequestPayloads={saveRequestPayloads}
|
// saveRequestPayloads={saveRequestPayloads}
|
||||||
disableDelete={false}
|
disableDelete={false}
|
||||||
|
allowedFilterKeys={[FilterKey.LOCATION, FilterKey.CLICK, FilterKey.INPUT, FilterKey.CUSTOM]}
|
||||||
// excludeFilterKeys={excludeFilterKeys}
|
// excludeFilterKeys={excludeFilterKeys}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
|
||||||
|
|
@ -136,9 +136,10 @@ function FilterSeries(props: Props) {
|
||||||
toggleExpand={() => setExpanded(!expanded)}/>
|
toggleExpand={() => setExpanded(!expanded)}/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{expandable && (
|
{expandable && !expanded && (
|
||||||
<Space className="justify-between w-full px-5 py-2 cursor-pointer" onClick={() => setExpanded(!expanded)}>
|
<Space className="justify-between w-full px-5 py-2 cursor-pointer" onClick={() => setExpanded(!expanded)}>
|
||||||
<div>{!expanded && <FilterCountLabels filters={series.filter.filters} toggleExpand={() => setExpanded(!expanded)}/>}</div>
|
<FilterCountLabels filters={series.filter.filters} toggleExpand={() => setExpanded(!expanded)}/>
|
||||||
|
{/*<div>{!expanded && <FilterCountLabels filters={series.filter.filters} toggleExpand={() => setExpanded(!expanded)}/>}</div>*/}
|
||||||
<Button size="small"
|
<Button size="small"
|
||||||
icon={expanded ? <ChevronUp size={16}/> : <ChevronDown size={16}/>}/>
|
icon={expanded ? <ChevronUp size={16}/> : <ChevronDown size={16}/>}/>
|
||||||
</Space>
|
</Space>
|
||||||
|
|
@ -156,13 +157,13 @@ function FilterSeries(props: Props) {
|
||||||
supportsEmpty={supportsEmpty}
|
supportsEmpty={supportsEmpty}
|
||||||
onFilterMove={onFilterMove}
|
onFilterMove={onFilterMove}
|
||||||
excludeFilterKeys={excludeFilterKeys}
|
excludeFilterKeys={excludeFilterKeys}
|
||||||
// actions={[
|
actions={[
|
||||||
// expandable && (
|
expandable && (
|
||||||
// <Button onClick={() => setExpanded(!expanded)}
|
<Button onClick={() => setExpanded(!expanded)}
|
||||||
// size="small"
|
size="small"
|
||||||
// icon={expanded ? <ChevronUp size={16}/> : <ChevronDown size={16}/>}/>
|
icon={expanded ? <ChevronUp size={16}/> : <ChevronDown size={16}/>}/>
|
||||||
// )
|
)
|
||||||
// ]}
|
]}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="color-gray-medium">{emptyMessage}</div>
|
<div className="color-gray-medium">{emptyMessage}</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
// import Select from 'Shared/Select';
|
|
||||||
import { Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
|
|
||||||
const sortOptions = [
|
const sortOptions = [
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ const FilterSection = observer(({ metric, excludeFilterKeys }: any) => {
|
||||||
const eventsLength = metric.series[0].filter.filters.filter((i: any) => i && i.isEvent).length;
|
const eventsLength = metric.series[0].filter.filters.filter((i: any) => i && i.isEvent).length;
|
||||||
// const cannotSaveFunnel = isFunnel && (!metric.series[0] || eventsLength <= 1);
|
// const cannotSaveFunnel = isFunnel && (!metric.series[0] || eventsLength <= 1);
|
||||||
|
|
||||||
const isSingleSeries = isTable || isFunnel || isClickMap || isInsights || isRetention;
|
const isSingleSeries = isTable || isFunnel || isClickMap || isInsights || isRetention || isPathAnalysis;
|
||||||
|
|
||||||
// const onAddFilter = (filter: any) => {
|
// const onAddFilter = (filter: any) => {
|
||||||
// metric.series[0].filter.addFilter(filter);
|
// metric.series[0].filter.addFilter(filter);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { numberWithCommas } from 'App/utils';
|
import { numberWithCommas } from 'App/utils';
|
||||||
import withPageTitle from 'HOCs/withPageTitle';
|
|
||||||
import withPermissions from 'HOCs/withPermissions';
|
import withPermissions from 'HOCs/withPermissions';
|
||||||
import FFlagsListHeader from 'Components/FFlags/FFlagsListHeader';
|
import FFlagsListHeader from 'Components/FFlags/FFlagsListHeader';
|
||||||
import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
|
import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
|
||||||
|
|
@ -9,8 +8,10 @@ import FFlagItem from './FFlagItem';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import Select from 'Shared/Select';
|
import Select from 'Shared/Select';
|
||||||
|
import usePageTitle from '@/hooks/usePageTitle';
|
||||||
|
|
||||||
function FFlagsList({ siteId }: { siteId: string }) {
|
function FFlagsList({ siteId }: { siteId: string }) {
|
||||||
|
usePageTitle('Feature Flags - OpenReplay');
|
||||||
const { featureFlagsStore, userStore } = useStore();
|
const { featureFlagsStore, userStore } = useStore();
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
|
@ -31,7 +32,7 @@ function FFlagsList({ siteId }: { siteId: string }) {
|
||||||
options={[
|
options={[
|
||||||
{ label: 'All', value: '0' as const },
|
{ label: 'All', value: '0' as const },
|
||||||
{ label: 'Enabled', value: '1' as const },
|
{ label: 'Enabled', value: '1' as const },
|
||||||
{ label: 'Disabled', value: '2' as const },
|
{ label: 'Disabled', value: '2' as const }
|
||||||
]}
|
]}
|
||||||
defaultValue={featureFlagsStore.activity}
|
defaultValue={featureFlagsStore.activity}
|
||||||
plain
|
plain
|
||||||
|
|
@ -45,7 +46,7 @@ function FFlagsList({ siteId }: { siteId: string }) {
|
||||||
<Select
|
<Select
|
||||||
options={[
|
options={[
|
||||||
{ label: 'Newest', value: 'DESC' },
|
{ label: 'Newest', value: 'DESC' },
|
||||||
{ label: 'Oldest', value: 'ASC' },
|
{ label: 'Oldest', value: 'ASC' }
|
||||||
]}
|
]}
|
||||||
defaultValue={featureFlagsStore.sort.order}
|
defaultValue={featureFlagsStore.sort.order}
|
||||||
plain
|
plain
|
||||||
|
|
@ -65,7 +66,7 @@ function FFlagsList({ siteId }: { siteId: string }) {
|
||||||
<AnimatedSVG name={ICONS.NO_FFLAGS} size={60} />
|
<AnimatedSVG name={ICONS.NO_FFLAGS} size={60} />
|
||||||
<div className="text-center mt-4 text-lg font-medium">
|
<div className="text-center mt-4 text-lg font-medium">
|
||||||
{featureFlagsStore.sort.query === ''
|
{featureFlagsStore.sort.query === ''
|
||||||
? "You haven't created any feature flags yet"
|
? 'You haven\'t created any feature flags yet'
|
||||||
: 'No matching results'}
|
: 'No matching results'}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -121,6 +122,4 @@ function FFlagsList({ siteId }: { siteId: string }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withPageTitle('Feature Flags')(
|
export default withPermissions(['FEATURE_FLAGS'])(observer(FFlagsList));
|
||||||
withPermissions(['FEATURE_FLAGS'])(observer(FFlagsList))
|
|
||||||
);
|
|
||||||
|
|
|
||||||
|
|
@ -1,163 +1,187 @@
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import Widget from 'App/mstore/types/widget';
|
import Widget from 'App/mstore/types/widget';
|
||||||
import Funnelbar, { UxTFunnelBar } from "./FunnelBar";
|
import Funnelbar, { UxTFunnelBar } from './FunnelBar';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import stl from './FunnelWidget.module.css';
|
import stl from './FunnelWidget.module.css';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { NoContent, Icon } from 'UI';
|
import { NoContent, Icon } from 'UI';
|
||||||
import { Tag, Tooltip } from 'antd';
|
import { Tag, Tooltip } from 'antd';
|
||||||
import { useModal } from 'App/components/Modal';
|
import { useModal } from 'App/components/Modal';
|
||||||
|
import { useStore } from '@/mstore';
|
||||||
|
import Filter from '@/mstore/types/filter';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
metric?: Widget;
|
metric?: Widget;
|
||||||
isWidget?: boolean;
|
isWidget?: boolean;
|
||||||
data: any;
|
data: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
function FunnelWidget(props: Props) {
|
function FunnelWidget(props: Props) {
|
||||||
const [focusedFilter, setFocusedFilter] = React.useState<number | null>(null);
|
const { dashboardStore, searchStore } = useStore();
|
||||||
const { isWidget = false, data, metric } = props;
|
const [focusedFilter, setFocusedFilter] = React.useState<number | null>(null);
|
||||||
const funnel = data.funnel || { stages: [] };
|
const { isWidget = false, data, metric } = props;
|
||||||
const totalSteps = funnel.stages.length;
|
const funnel = data.funnel || { stages: [] };
|
||||||
const stages = isWidget ? [...funnel.stages.slice(0, 1), funnel.stages[funnel.stages.length - 1]] : funnel.stages;
|
const totalSteps = funnel.stages.length;
|
||||||
const hasMoreSteps = funnel.stages.length > 2;
|
const stages = isWidget ? [...funnel.stages.slice(0, 1), funnel.stages[funnel.stages.length - 1]] : funnel.stages;
|
||||||
const lastStage = funnel.stages[funnel.stages.length - 1];
|
const hasMoreSteps = funnel.stages.length > 2;
|
||||||
const remainingSteps = totalSteps - 2;
|
const lastStage = funnel.stages[funnel.stages.length - 1];
|
||||||
const { hideModal } = useModal();
|
const remainingSteps = totalSteps - 2;
|
||||||
const metricLabel = metric?.metricFormat == 'userCount' ? 'Users' : 'Sessions';
|
const { hideModal } = useModal();
|
||||||
|
const metricLabel = metric?.metricFormat == 'userCount' ? 'Users' : 'Sessions';
|
||||||
|
const drillDownFilter = dashboardStore.drillDownFilter;
|
||||||
|
const drillDownPeriod = dashboardStore.drillDownPeriod;
|
||||||
|
const metricFilters = metric?.series[0]?.filter.filters || [];
|
||||||
|
|
||||||
useEffect(() => {
|
const applyDrillDown = (index: number) => {
|
||||||
return () => {
|
const filter = new Filter().fromData({ filters: metricFilters.slice(0, index + 1) });
|
||||||
if (isWidget) return;
|
const periodTimestamps = drillDownPeriod.toTimestamps();
|
||||||
hideModal();
|
drillDownFilter.merge({
|
||||||
|
filters: filter.toJson().filters,
|
||||||
|
startTimestamp: periodTimestamps.startTimestamp,
|
||||||
|
endTimestamp: periodTimestamps.endTimestamp
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
if (isWidget) return;
|
||||||
|
hideModal();
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const focusStage = (index: number) => {
|
||||||
|
funnel.stages.forEach((s, i) => {
|
||||||
|
// turning on all filters if one was focused already
|
||||||
|
if (focusedFilter === index) {
|
||||||
|
s.updateKey('isActive', true);
|
||||||
|
setFocusedFilter(null);
|
||||||
|
} else {
|
||||||
|
setFocusedFilter(index);
|
||||||
|
if (i === index) {
|
||||||
|
s.updateKey('isActive', true);
|
||||||
|
} else {
|
||||||
|
s.updateKey('isActive', false);
|
||||||
}
|
}
|
||||||
}, []);
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const focusStage = (index: number) => {
|
applyDrillDown(focusedFilter === index ? -1 : index);
|
||||||
funnel.stages.forEach((s, i) => {
|
};
|
||||||
// turning on all filters if one was focused already
|
|
||||||
if (focusedFilter === index) {
|
|
||||||
s.updateKey('isActive', true)
|
|
||||||
setFocusedFilter(null)
|
|
||||||
} else {
|
|
||||||
setFocusedFilter(index)
|
|
||||||
if (i === index) {
|
|
||||||
s.updateKey('isActive', true)
|
|
||||||
} else {
|
|
||||||
s.updateKey('isActive', false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NoContent
|
<NoContent
|
||||||
style={{ minHeight: 220 }}
|
style={{ minHeight: 220 }}
|
||||||
title={
|
title={
|
||||||
<div className="flex items-center text-lg">
|
<div className="flex items-center text-lg">
|
||||||
<Icon name="info-circle" className="mr-2" size="18" />
|
<Icon name="info-circle" className="mr-2" size="18" />
|
||||||
No data available for the selected period.
|
No data available for the selected period.
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
show={!stages || stages.length === 0}
|
show={!stages || stages.length === 0}
|
||||||
>
|
>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
{ !isWidget && (
|
{!isWidget && (
|
||||||
stages.map((filter: any, index: any) => (
|
stages.map((filter: any, index: any) => (
|
||||||
<Stage
|
<Stage
|
||||||
key={index}
|
key={index}
|
||||||
index={index + 1}
|
index={index + 1}
|
||||||
isWidget={isWidget}
|
isWidget={isWidget}
|
||||||
stage={filter}
|
stage={filter}
|
||||||
focusStage={focusStage}
|
focusStage={focusStage}
|
||||||
focusedFilter={focusedFilter}
|
focusedFilter={focusedFilter}
|
||||||
metricLabel={metricLabel}
|
metricLabel={metricLabel}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{ isWidget && (
|
{isWidget && (
|
||||||
<>
|
<>
|
||||||
<Stage index={1} isWidget={isWidget} stage={stages[0]} />
|
<Stage index={1} isWidget={isWidget} stage={stages[0]} />
|
||||||
|
|
||||||
{ hasMoreSteps && (
|
{hasMoreSteps && (
|
||||||
<>
|
<>
|
||||||
<EmptyStage total={remainingSteps} />
|
<EmptyStage total={remainingSteps} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{funnel.stages.length > 1 && (
|
{funnel.stages.length > 1 && (
|
||||||
<Stage index={totalSteps} isWidget={isWidget} stage={lastStage} />
|
<Stage index={totalSteps} isWidget={isWidget} stage={lastStage} />
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center pb-4">
|
<div className="flex items-center pb-4">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<span className="text-base font-medium mr-2">Lost conversion</span>
|
<span className="text-base font-medium mr-2">Lost conversion</span>
|
||||||
<Tooltip title={`${funnel.lostConversions} Sessions ${funnel.lostConversionsPercentage}%`}>
|
<Tooltip title={`${funnel.lostConversions} Sessions ${funnel.lostConversionsPercentage}%`}>
|
||||||
<Tag bordered={false} color="red" className='text-lg font-medium rounded-lg'>
|
<Tag bordered={false} color="red" className="text-lg font-medium rounded-lg">
|
||||||
{funnel.lostConversions}
|
{funnel.lostConversions}
|
||||||
</Tag>
|
</Tag>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div className="mx-3" />
|
<div className="mx-3" />
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<span className="text-base font-medium mr-2">Total conversion</span>
|
<span className="text-base font-medium mr-2">Total conversion</span>
|
||||||
<Tooltip title={`${funnel.totalConversions} Sessions ${funnel.totalConversionsPercentage}%`}>
|
<Tooltip title={`${funnel.totalConversions} Sessions ${funnel.totalConversionsPercentage}%`}>
|
||||||
<Tag bordered={false} color="green" className='text-lg font-medium rounded-lg'>
|
<Tag bordered={false} color="green" className="text-lg font-medium rounded-lg">
|
||||||
{funnel.totalConversions}
|
{funnel.totalConversions}
|
||||||
</Tag>
|
</Tag>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{funnel.totalDropDueToIssues > 0 && <div className="flex items-center mb-2"><Icon name="magic" /> <span className="ml-2">{funnel.totalDropDueToIssues} sessions dropped due to issues.</span></div>}
|
{funnel.totalDropDueToIssues > 0 && <div className="flex items-center mb-2"><Icon name="magic" /> <span
|
||||||
</NoContent>
|
className="ml-2">{funnel.totalDropDueToIssues} sessions dropped due to issues.</span></div>}
|
||||||
);
|
</NoContent>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EmptyStage = observer(({ total }: any) => {
|
export const EmptyStage = observer(({ total }: any) => {
|
||||||
return (
|
return (
|
||||||
<div className={cn("flex items-center mb-4 pb-3", stl.step)}>
|
<div className={cn('flex items-center mb-4 pb-3', stl.step)}>
|
||||||
<IndexNumber index={0} />
|
<IndexNumber index={0} />
|
||||||
<div className="w-fit px-2 border border-teal py-1 text-center justify-center bg-teal-lightest flex items-center rounded-full color-teal" style={{ width: '100px'}}>
|
<div
|
||||||
{`+${total} ${total > 1 ? 'steps' : 'step'}`}
|
className="w-fit px-2 border border-teal py-1 text-center justify-center bg-teal-lightest flex items-center rounded-full color-teal"
|
||||||
</div>
|
style={{ width: '100px' }}>
|
||||||
<div className="border-b w-full border-dashed"></div>
|
{`+${total} ${total > 1 ? 'steps' : 'step'}`}
|
||||||
</div>
|
</div>
|
||||||
)
|
<div className="border-b w-full border-dashed"></div>
|
||||||
})
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
export const Stage = observer(({ metricLabel, stage, index, isWidget, uxt, focusStage, focusedFilter }: any) => {
|
export const Stage = observer(({ metricLabel, stage, index, isWidget, uxt, focusStage, focusedFilter }: any) => {
|
||||||
return stage ? (
|
return stage ? (
|
||||||
<div
|
<div
|
||||||
className={cn('flex items-start', stl.step, { [stl['step-disabled']]: !stage.isActive })}
|
className={cn('flex items-start', stl.step, { [stl['step-disabled']]: !stage.isActive })}
|
||||||
>
|
>
|
||||||
<IndexNumber index={index} />
|
<IndexNumber index={index} />
|
||||||
{!uxt ? <Funnelbar metricLabel={metricLabel} index={index} filter={stage} focusStage={focusStage} focusedFilter={focusedFilter} /> : <UxTFunnelBar filter={stage} />}
|
{!uxt ? <Funnelbar metricLabel={metricLabel} index={index} filter={stage} focusStage={focusStage}
|
||||||
{/*{!isWidget && !uxt && <BarActions bar={stage} />}*/}
|
focusedFilter={focusedFilter} /> : <UxTFunnelBar filter={stage} />}
|
||||||
</div>
|
{/*{!isWidget && !uxt && <BarActions bar={stage} />}*/}
|
||||||
) : (
|
</div>
|
||||||
<></>
|
) : (
|
||||||
)
|
<></>
|
||||||
})
|
);
|
||||||
|
});
|
||||||
|
|
||||||
export const IndexNumber = observer(({ index }: any) => {
|
export const IndexNumber = observer(({ index }: any) => {
|
||||||
return (
|
return (
|
||||||
<div className="z-10 w-6 h-6 border shrink-0 mr-4 text-sm rounded-full bg-gray-lightest flex items-center justify-center leading-3">
|
<div
|
||||||
{index === 0 ? <Icon size="14" color="gray-dark" name="list" /> : index}
|
className="z-10 w-6 h-6 border shrink-0 mr-4 text-sm rounded-full bg-gray-lightest flex items-center justify-center leading-3">
|
||||||
</div>
|
{index === 0 ? <Icon size="14" color="gray-dark" name="list" /> : index}
|
||||||
);
|
</div>
|
||||||
})
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
const BarActions = observer(({ bar }: any) => {
|
const BarActions = observer(({ bar }: any) => {
|
||||||
return (
|
return (
|
||||||
<div className="self-end flex items-center justify-center ml-4" style={{ marginBottom: '49px'}}>
|
<div className="self-end flex items-center justify-center ml-4" style={{ marginBottom: '49px' }}>
|
||||||
<button onClick={() => bar.updateKey('isActive', !bar.isActive)}>
|
<button onClick={() => bar.updateKey('isActive', !bar.isActive)}>
|
||||||
<Icon name="eye-slash-fill" color={bar.isActive ? "gray-light" : "gray-darkest"} size="22" />
|
<Icon name="eye-slash-fill" color={bar.isActive ? 'gray-light' : 'gray-darkest'} size="22" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
})
|
});
|
||||||
|
|
||||||
export default observer(FunnelWidget);
|
export default observer(FunnelWidget);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
import React, { useEffect } from 'react';
|
import React from 'react';
|
||||||
import withPageTitle from 'HOCs/withPageTitle';
|
import withPageTitle from 'HOCs/withPageTitle';
|
||||||
import NoSessionsMessage from 'Shared/NoSessionsMessage';
|
|
||||||
import MainSearchBar from 'Shared/MainSearchBar';
|
|
||||||
import SessionSearch from 'Shared/SessionSearch';
|
|
||||||
import SessionsTabOverview from 'Shared/SessionsTabOverview/SessionsTabOverview';
|
import SessionsTabOverview from 'Shared/SessionsTabOverview/SessionsTabOverview';
|
||||||
import FFlagsList from 'Components/FFlags';
|
import FFlagsList from 'Components/FFlags';
|
||||||
import NewFFlag from 'Components/FFlags/NewFFlag';
|
import NewFFlag from 'Components/FFlags/NewFFlag';
|
||||||
|
|
@ -12,6 +9,8 @@ import { withRouter, RouteComponentProps, useLocation } from 'react-router-dom';
|
||||||
import FlagView from 'Components/FFlags/FlagView/FlagView';
|
import FlagView from 'Components/FFlags/FlagView/FlagView';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { useStore } from '@/mstore';
|
import { useStore } from '@/mstore';
|
||||||
|
import NotesList from 'Shared/SessionsTabOverview/components/Notes/NoteList';
|
||||||
|
import Bookmarks from 'Shared/SessionsTabOverview/components/Bookmarks/Bookmarks';
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
interface IProps extends RouteComponentProps {
|
interface IProps extends RouteComponentProps {
|
||||||
|
|
@ -36,15 +35,22 @@ function Overview({ match: { params } }: IProps) {
|
||||||
return (
|
return (
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact strict
|
<Route exact strict
|
||||||
path={[withSiteId(sessions(), siteId), withSiteId(notes(), siteId), withSiteId(bookmarks(), siteId)]}>
|
path={withSiteId(sessions(), siteId)}>
|
||||||
<div className="mb-5 w-full mx-auto" style={{ maxWidth: '1360px' }}>
|
<div className="mb-5 w-full mx-auto" style={{ maxWidth: '1360px' }}>
|
||||||
<NoSessionsMessage siteId={siteId} />
|
|
||||||
<MainSearchBar />
|
|
||||||
<SessionSearch />
|
|
||||||
<div className="my-4" />
|
|
||||||
<SessionsTabOverview />
|
<SessionsTabOverview />
|
||||||
</div>
|
</div>
|
||||||
</Route>
|
</Route>
|
||||||
|
<Route exact strict
|
||||||
|
path={withSiteId(bookmarks(), siteId)}>
|
||||||
|
<div className="mb-5 w-full mx-auto" style={{ maxWidth: '1360px' }}>
|
||||||
|
<Bookmarks />
|
||||||
|
</div>
|
||||||
|
</Route>
|
||||||
|
<Route exact strict path={withSiteId(notes(), siteId)}>
|
||||||
|
<div className="mb-5 w-full mx-auto" style={{ maxWidth: '1360px' }}>
|
||||||
|
<NotesList />
|
||||||
|
</div>
|
||||||
|
</Route>
|
||||||
<Route exact strict path={withSiteId(fflags(), siteId)}>
|
<Route exact strict path={withSiteId(fflags(), siteId)}>
|
||||||
<FFlagsList siteId={siteId} />
|
<FFlagsList siteId={siteId} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import {
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
import { session as sessionRoute, withSiteId } from 'App/routes';
|
import { session as sessionRoute, withSiteId } from 'App/routes';
|
||||||
import { SummaryButton } from 'Components/Session_/Player/Controls/Controls';
|
import { SummaryButton } from 'Components/Session_/Player/Controls/Controls';
|
||||||
|
import { MobEventsList, WebEventsList } from "../../../Session_/Player/Controls/EventsList";
|
||||||
import useShortcuts from '../ReplayPlayer/useShortcuts';
|
import useShortcuts from '../ReplayPlayer/useShortcuts';
|
||||||
|
|
||||||
export const SKIP_INTERVALS = {
|
export const SKIP_INTERVALS = {
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ function PlayerBlockHeader(props: any) {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="relative border-l border-l-gray-lighter" style={{ minWidth: '270px' }}>
|
<div className="px-2 relative border-l border-l-gray-lighter" style={{ minWidth: '270px' }}>
|
||||||
<Tabs
|
<Tabs
|
||||||
tabs={TABS}
|
tabs={TABS}
|
||||||
active={activeTab}
|
active={activeTab}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { Segmented } from 'antd';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { VList, VListHandle } from 'virtua';
|
import { VList, VListHandle } from 'virtua';
|
||||||
import { PlayerContext } from "App/components/Session/playerContext";
|
import { PlayerContext } from 'App/components/Session/playerContext';
|
||||||
import { processLog, UnifiedLog } from './utils';
|
import { processLog, UnifiedLog } from './utils';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
|
|
@ -12,13 +11,12 @@ import {
|
||||||
} from 'App/components/Client/Integrations/apiMethods';
|
} from 'App/components/Client/Integrations/apiMethods';
|
||||||
import BottomBlock from 'App/components/shared/DevTools/BottomBlock';
|
import BottomBlock from 'App/components/shared/DevTools/BottomBlock';
|
||||||
import { capitalize } from 'App/utils';
|
import { capitalize } from 'App/utils';
|
||||||
import { Icon, Input } from 'UI';
|
import { Icon } from 'UI';
|
||||||
|
import { Segmented, Input, Tooltip } from 'antd';
|
||||||
|
import { SearchOutlined } from '@ant-design/icons';
|
||||||
import { client } from 'App/mstore';
|
import { client } from 'App/mstore';
|
||||||
import { FailedFetch, LoadingFetch } from "./StatusMessages";
|
import { FailedFetch, LoadingFetch } from './StatusMessages';
|
||||||
import {
|
import { TableHeader, LogRow } from './Table';
|
||||||
TableHeader,
|
|
||||||
LogRow
|
|
||||||
} from './Table'
|
|
||||||
|
|
||||||
async function fetchLogs(
|
async function fetchLogs(
|
||||||
tab: string,
|
tab: string,
|
||||||
|
|
@ -30,23 +28,24 @@ async function fetchLogs(
|
||||||
);
|
);
|
||||||
const json = await data.json();
|
const json = await data.json();
|
||||||
try {
|
try {
|
||||||
const logsResp = await fetch(json.url)
|
const logsResp = await fetch(json.url);
|
||||||
if (logsResp.ok) {
|
if (logsResp.ok) {
|
||||||
const logJson = await logsResp.json()
|
const logJson = await logsResp.json();
|
||||||
if (logJson.length === 0) return []
|
if (logJson.length === 0) return [];
|
||||||
return processLog(logJson)
|
return processLog(logJson);
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Failed to fetch logs')
|
throw new Error('Failed to fetch logs');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e);
|
||||||
throw e
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function BackendLogsPanel() {
|
function BackendLogsPanel() {
|
||||||
const { projectsStore, sessionStore, integrationsStore } = useStore();
|
const { projectsStore, sessionStore, integrationsStore } = useStore();
|
||||||
const integratedServices = integrationsStore.integrations.backendLogIntegrations;
|
const integratedServices =
|
||||||
|
integrationsStore.integrations.backendLogIntegrations;
|
||||||
const defaultTab = integratedServices[0]!.name;
|
const defaultTab = integratedServices[0]!.name;
|
||||||
const sessionId = sessionStore.currentId;
|
const sessionId = sessionStore.currentId;
|
||||||
const projectId = projectsStore.siteId!;
|
const projectId = projectsStore.siteId!;
|
||||||
|
|
@ -82,40 +81,59 @@ function BackendLogsPanel() {
|
||||||
return (
|
return (
|
||||||
<BottomBlock style={{ height: '100%' }}>
|
<BottomBlock style={{ height: '100%' }}>
|
||||||
<BottomBlock.Header>
|
<BottomBlock.Header>
|
||||||
<div className={'flex gap-2 items-center w-full'}>
|
<div className="flex items-center justify-between w-full">
|
||||||
<div className={'font-semibold'}>Traces</div>
|
<div className={'flex gap-2 items-center'}>
|
||||||
{tabs.length && tab ? (
|
<div className={'font-semibold'}>Traces</div>
|
||||||
<div>
|
{tabs.length && tab ? (
|
||||||
<Segmented options={tabs} value={tab} onChange={setTab} />
|
<div>
|
||||||
</div>
|
<Segmented
|
||||||
) : null}
|
options={tabs}
|
||||||
|
value={tab}
|
||||||
|
onChange={setTab}
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={'ml-auto'} />
|
<div className="flex items-center gap-2">
|
||||||
<Input
|
<Segmented
|
||||||
className="input-small h-8"
|
options={[
|
||||||
placeholder="Filter by keyword"
|
{ label: 'All Tabs', value: 'all' },
|
||||||
icon="search"
|
{
|
||||||
name="filter"
|
label: (
|
||||||
height={28}
|
<Tooltip title="Backend logs are fetched for all tabs combined.">
|
||||||
onChange={onFilterChange}
|
<span>Current Tab</span>
|
||||||
value={filter}
|
</Tooltip>
|
||||||
/>
|
),
|
||||||
|
value: 'current',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
defaultValue="all"
|
||||||
|
size="small"
|
||||||
|
className="rounded-full font-medium"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Input
|
||||||
|
className="rounded-lg"
|
||||||
|
placeholder="Filter by keyword"
|
||||||
|
name="filter"
|
||||||
|
onChange={onFilterChange}
|
||||||
|
value={filter}
|
||||||
|
size="small"
|
||||||
|
prefix={<SearchOutlined className="text-neutral-400" />}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</BottomBlock.Header>
|
</BottomBlock.Header>
|
||||||
|
|
||||||
<BottomBlock.Content className="overflow-y-auto">
|
<BottomBlock.Content className="overflow-y-auto">
|
||||||
{isPending ? (
|
{isPending ? <LoadingFetch provider={capitalize(tab)} /> : null}
|
||||||
<LoadingFetch provider={capitalize(tab)} />
|
|
||||||
) : null}
|
|
||||||
{isError ? (
|
{isError ? (
|
||||||
<FailedFetch
|
<FailedFetch provider={capitalize(tab)} onRetry={refetch} />
|
||||||
provider={capitalize(tab)}
|
|
||||||
onRetry={refetch}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{isSuccess ? (
|
|
||||||
<LogsTable data={data} />
|
|
||||||
) : null}
|
) : null}
|
||||||
|
{isSuccess ? <LogsTable data={data} /> : null}
|
||||||
</BottomBlock.Content>
|
</BottomBlock.Content>
|
||||||
</BottomBlock>
|
</BottomBlock>
|
||||||
);
|
);
|
||||||
|
|
@ -128,8 +146,10 @@ const LogsTable = observer(({ data }: { data: UnifiedLog[] }) => {
|
||||||
const _list = React.useRef<VListHandle>(null);
|
const _list = React.useRef<VListHandle>(null);
|
||||||
const activeIndex = React.useMemo(() => {
|
const activeIndex = React.useMemo(() => {
|
||||||
const currTs = time + sessionStart;
|
const currTs = time + sessionStart;
|
||||||
const index = data.findIndex(
|
const index = data.findIndex((log) =>
|
||||||
(log) => log.timestamp !== 'N/A' ? new Date(log.timestamp).getTime() >= currTs : false
|
log.timestamp !== 'N/A'
|
||||||
|
? new Date(log.timestamp).getTime() >= currTs
|
||||||
|
: false
|
||||||
);
|
);
|
||||||
return index === -1 ? data.length - 1 : index;
|
return index === -1 ? data.length - 1 : index;
|
||||||
}, [time, data.length]);
|
}, [time, data.length]);
|
||||||
|
|
@ -141,17 +161,22 @@ const LogsTable = observer(({ data }: { data: UnifiedLog[] }) => {
|
||||||
|
|
||||||
const onJump = (ts: number) => {
|
const onJump = (ts: number) => {
|
||||||
player.jump(ts - sessionStart);
|
player.jump(ts - sessionStart);
|
||||||
}
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TableHeader size={data.length} />
|
<TableHeader size={data.length} />
|
||||||
<VList ref={_list} count={data.length}>
|
<VList ref={_list} count={data.length}>
|
||||||
{data.map((log, index) => (
|
{data.map((log, index) => (
|
||||||
<LogRow key={index} isActive={index === activeIndex} log={log} onJump={onJump} />
|
<LogRow
|
||||||
|
key={index}
|
||||||
|
isActive={index === activeIndex}
|
||||||
|
log={log}
|
||||||
|
onJump={onJump}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</VList>
|
</VList>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
export default observer(BackendLogsPanel);
|
export default observer(BackendLogsPanel);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export function LoadingFetch({ provider }: { provider: string }) {
|
||||||
'w-full h-full flex items-center justify-center flex-col gap-2'
|
'w-full h-full flex items-center justify-center flex-col gap-2'
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<LoadingOutlined style={{ fontSize: 32 }} />
|
<LoadingOutlined size={32} />
|
||||||
<div>Fetching logs from {provider}...</div>
|
<div>Fetching logs from {provider}...</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -33,16 +33,23 @@ export function FailedFetch({
|
||||||
'w-full h-full flex flex-col items-center justify-center gap-2'
|
'w-full h-full flex flex-col items-center justify-center gap-2'
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Icon name={'exclamation-circle'} size={32} />
|
|
||||||
<div className={'flex items-center gap-1'}>
|
<div className={'flex items-center gap-1 font-medium'}>
|
||||||
|
<Icon name={'exclamation-circle'} size={14} />
|
||||||
<span>Failed to fetch logs from {provider}. </span>
|
<span>Failed to fetch logs from {provider}. </span>
|
||||||
<div className={'link'} onClick={onRetry}>
|
</div>
|
||||||
|
|
||||||
|
<div className='flex items-center gap-3'>
|
||||||
|
|
||||||
|
<Button type='text' size='small' onClick={onRetry}>
|
||||||
Retry
|
Retry
|
||||||
</div>
|
</Button>
|
||||||
</div>
|
|
||||||
<div className={'link'} onClick={() => history.push(intPath)}>
|
<Button type='text' size='small' onClick={() => history.push(intPath)}>
|
||||||
Check Configuration
|
Check Configuration
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export function processLog(log: any): UnifiedLog[] {
|
||||||
} else if (isDynatraceLog(log)) {
|
} else if (isDynatraceLog(log)) {
|
||||||
return log.map(processDynatraceLog);
|
return log.map(processDynatraceLog);
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Unknown log format");
|
console.error("Unknown log format");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ function isElasticLog(log: any): boolean {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSentryLog(log: any): boolean {
|
function isSentryLog(log: any): boolean {
|
||||||
return log && log[0].id && log[0].message && log[0].title;
|
return log && 'id' in log[0] && 'message' in log[0] && 'title' in log[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
function processDynatraceLog(log: any): UnifiedLog {
|
function processDynatraceLog(log: any): UnifiedLog {
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,51 @@ import { useStore } from 'App/mstore';
|
||||||
import SaveModal from 'Components/Session/Player/TagWatch/SaveModal';
|
import SaveModal from 'Components/Session/Player/TagWatch/SaveModal';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { PlayerContext } from 'Components/Session/playerContext';
|
import { PlayerContext } from 'Components/Session/playerContext';
|
||||||
import { Button, Input } from 'antd';
|
import { Button, Input, Tooltip } from 'antd';
|
||||||
import { CopyButton } from 'UI';
|
import { CopyOutlined } from '@ant-design/icons';
|
||||||
import { SearchOutlined, ZoomInOutlined } from '@ant-design/icons';
|
import { ZoomInOutlined } from '@ant-design/icons';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { useModal } from 'App/components/Modal';
|
import { useModal } from 'App/components/Modal';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
import { FilterKey } from "App/types/filter/filterType";
|
import { FilterKey } from 'App/types/filter/filterType';
|
||||||
import { addOptionsToFilter } from "App/types/filter/newFilter";
|
import { addOptionsToFilter } from 'App/types/filter/newFilter';
|
||||||
|
|
||||||
|
interface CopyableTextAreaProps {
|
||||||
|
selector: string;
|
||||||
|
setSelector: (value: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CopyableTextArea: React.FC<CopyableTextAreaProps> = ({ selector, setSelector }) => {
|
||||||
|
const handleCopy = () => {
|
||||||
|
navigator.clipboard.writeText(selector);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full relative">
|
||||||
|
<Input.TextArea
|
||||||
|
value={selector}
|
||||||
|
onChange={(e) => setSelector(e.target.value)}
|
||||||
|
className="rounded-lg font-mono text-sm placeholder:font-sans placeholder:text-base placeholder:text-gray-400"
|
||||||
|
rows={4}
|
||||||
|
style={{ paddingRight: '40px' }}
|
||||||
|
placeholder='Enter selector to tag elements. E.g. .btn-primary'
|
||||||
|
/>
|
||||||
|
<Tooltip title="Copy">
|
||||||
|
<Button
|
||||||
|
type="text"
|
||||||
|
icon={<CopyOutlined />}
|
||||||
|
onClick={handleCopy}
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: '8px',
|
||||||
|
right: '8px',
|
||||||
|
zIndex: 1,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
function TagWatch() {
|
function TagWatch() {
|
||||||
const { tagWatchStore, searchStore } = useStore();
|
const { tagWatchStore, searchStore } = useStore();
|
||||||
|
|
@ -50,7 +87,7 @@ function TagWatch() {
|
||||||
ignoreClickRage: ignoreClRage,
|
ignoreClickRage: ignoreClRage,
|
||||||
ignoreDeadClick: ignoreDeadCl,
|
ignoreDeadClick: ignoreDeadCl,
|
||||||
});
|
});
|
||||||
const tags = await tagWatchStore.getTags()
|
const tags = await tagWatchStore.getTags();
|
||||||
if (tags) {
|
if (tags) {
|
||||||
addOptionsToFilter(
|
addOptionsToFilter(
|
||||||
FilterKey.TAGGED_ELEMENT,
|
FilterKey.TAGGED_ELEMENT,
|
||||||
|
|
@ -58,42 +95,41 @@ function TagWatch() {
|
||||||
);
|
);
|
||||||
searchStore.refreshFilterOptions();
|
searchStore.refreshFilterOptions();
|
||||||
}
|
}
|
||||||
// @ts-ignore
|
|
||||||
toast.success('Tag created');
|
toast.success('Tag created');
|
||||||
setSelector('');
|
setSelector('');
|
||||||
return tag
|
return tag;
|
||||||
} catch {
|
} catch {
|
||||||
// @ts-ignore
|
|
||||||
toast.error('Failed to create tag');
|
toast.error('Failed to create tag');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const openSaveModal = () => {
|
const openSaveModal = () => {
|
||||||
if (selector === '') {
|
if (selector === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showModal(<SaveModal onSave={onSave} hideModal={hideModal} />, { right: true, width: 400 });
|
showModal(<SaveModal onSave={onSave} hideModal={hideModal} />, { right: true, width: 400 });
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'w-full h-full p-2 flex flex-col gap-2'}>
|
<div className="w-full h-full p-4 flex flex-col gap-2">
|
||||||
<div className={'flex items-center justify-between'}>
|
<div className="flex flex-col items-center justify-between">
|
||||||
<div className={'font-semibold text-xl'}>Element Selector</div>
|
<p>Select elements in the session play area to tag by class selector and filter sessions to verify their rendering.</p>
|
||||||
<CopyButton content={selector} />
|
|
||||||
</div>
|
</div>
|
||||||
<Input.TextArea value={selector} onChange={(e) => setSelector(e.target.value)} />
|
|
||||||
|
<CopyableTextArea selector={selector} setSelector={setSelector} />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
onClick={openSaveModal}
|
onClick={openSaveModal}
|
||||||
type={'primary'}
|
type="primary"
|
||||||
ghost
|
ghost
|
||||||
icon={<ZoomInOutlined />}
|
icon={<ZoomInOutlined />}
|
||||||
disabled={selector === ''}
|
disabled={selector === ''}
|
||||||
>
|
>
|
||||||
Tag Element
|
Tag Element
|
||||||
</Button>
|
</Button>
|
||||||
<div className={'text-disabled-text text-sm'}>
|
|
||||||
Create and filter sessions by ‘watch elements’ to determine if they rendered or not.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default observer(TagWatch);
|
export default observer(TagWatch);
|
||||||
|
|
@ -18,7 +18,7 @@ function RightBlock({
|
||||||
switch (activeTab) {
|
switch (activeTab) {
|
||||||
case 'EVENTS':
|
case 'EVENTS':
|
||||||
return (
|
return (
|
||||||
<div className={cn('flex flex-col bg-white border-l', stl.panel)}>
|
<div className={cn('flex flex-col border-l', stl.panel)}>
|
||||||
<EventsBlock setActiveTab={setActiveTab} />
|
<EventsBlock setActiveTab={setActiveTab} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ const Tabs = ({ tabs, active, onClick, border = true, className }: Props) => {
|
||||||
return (
|
return (
|
||||||
<div className={cn(stl.tabs, className, { [stl.bordered]: border })} role="tablist">
|
<div className={cn(stl.tabs, className, { [stl.bordered]: border })} role="tablist">
|
||||||
<Segmented
|
<Segmented
|
||||||
|
size="small"
|
||||||
value={active}
|
value={active}
|
||||||
options={tabs.map(({ key, text, hidden = false, disabled = false, iconComp = null }) => ({
|
options={tabs.map(({ key, text, hidden = false, disabled = false, iconComp = null }) => ({
|
||||||
label: (
|
label: (
|
||||||
|
|
@ -29,14 +30,14 @@ const Tabs = ({ tabs, active, onClick, border = true, className }: Props) => {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onClick(key);
|
onClick(key);
|
||||||
}}
|
}}
|
||||||
className={'font-semibold flex gap-1 items-center'}
|
className={'font-medium flex gap-1 items-center hover:text-teal rounded-lg'}
|
||||||
>
|
>
|
||||||
{iconComp ? iconComp : <Icon size={16} color={'black'} name={iconMap[key as keyof typeof iconMap]} />}
|
{iconComp ? iconComp : <Icon size={14} color="currentColor" style={{ fill: 'currentColor', strokeWidth:'0' }} name={iconMap[key as keyof typeof iconMap]} />}
|
||||||
<span>{text}</span>
|
<span>{text}</span>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
value: key,
|
value: key,
|
||||||
disabled: disabled,
|
disabled: disabled,
|
||||||
}))}
|
}))}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ const Event: React.FC<Props> = ({
|
||||||
>
|
>
|
||||||
<div className={cn(cls.main, 'flex flex-col w-full')}>
|
<div className={cn(cls.main, 'flex flex-col w-full')}>
|
||||||
<div
|
<div
|
||||||
className={cn('flex items-center w-full', { 'px-4': isLocation })}
|
className={cn('flex items-start w-full', { 'px-4': isLocation })}
|
||||||
>
|
>
|
||||||
<div style={{ minWidth: '16px' }}>
|
<div style={{ minWidth: '16px' }}>
|
||||||
{event.type && iconName ? (
|
{event.type && iconName ? (
|
||||||
|
|
@ -169,20 +169,18 @@ const Event: React.FC<Props> = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="ml-3 w-full">
|
<div className="ml-3 w-full">
|
||||||
<div className="flex w-full items-first justify-between">
|
<div className="flex w-full items-start">
|
||||||
<div
|
<div
|
||||||
className="flex items-center w-full"
|
className="flex flex-col justify-center items-start w-full"
|
||||||
style={{ minWidth: '0' }}
|
style={{ minWidth: '0' }}
|
||||||
>
|
>
|
||||||
<span
|
<span className={cn(cls.title, 'font-medium')}>
|
||||||
className={cn(cls.title, { 'font-medium': isLocation })}
|
|
||||||
>
|
|
||||||
{title}
|
{title}
|
||||||
</span>
|
</span>
|
||||||
{body && !isLocation && (
|
{body && !isLocation && (
|
||||||
<TextEllipsis
|
<TextEllipsis
|
||||||
maxWidth="60%"
|
maxWidth="80%"
|
||||||
className="w-full ml-2 text-sm color-gray-medium"
|
className="w-full text-sm color-gray-medium"
|
||||||
text={body}
|
text={body}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
@ -202,8 +200,7 @@ const Event: React.FC<Props> = ({
|
||||||
{isLocation && (
|
{isLocation && (
|
||||||
<div className="pt-1 px-4">
|
<div className="pt-1 px-4">
|
||||||
<TextEllipsis
|
<TextEllipsis
|
||||||
maxWidth="80%"
|
className="text-sm ms-8 font-normal color-gray-medium"
|
||||||
className="text-sm font-normal color-gray-medium"
|
|
||||||
text={body}
|
text={body}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import { Icon, TextEllipsis } from 'UI';
|
||||||
import Event from './Event';
|
import Event from './Event';
|
||||||
import NoteEvent from './NoteEvent';
|
import NoteEvent from './NoteEvent';
|
||||||
import stl from './eventGroupWrapper.module.css';
|
import stl from './eventGroupWrapper.module.css';
|
||||||
|
import cn from 'classnames'
|
||||||
|
|
||||||
function EventGroupWrapper(props) {
|
function EventGroupWrapper(props) {
|
||||||
const { userStore } = useStore();
|
const { userStore } = useStore();
|
||||||
|
|
@ -132,7 +133,7 @@ function EventGroupWrapper(props) {
|
||||||
{isFirst && isLocation && event.referrer && (
|
{isFirst && isLocation && event.referrer && (
|
||||||
<TextEllipsis>
|
<TextEllipsis>
|
||||||
<div className={stl.referrer}>
|
<div className={stl.referrer}>
|
||||||
Referrer: <span className={stl.url}>{safeRef}</span>
|
Referrer: <span className={cn(stl.url, '!font-normal')}>{safeRef}</span>
|
||||||
</div>
|
</div>
|
||||||
</TextEllipsis>
|
</TextEllipsis>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Input, Button } from 'UI';
|
import {Input, Button, Tooltip} from 'antd';
|
||||||
|
import {CloseOutlined, SearchOutlined} from '@ant-design/icons';
|
||||||
import { PlayerContext } from 'App/components/Session/playerContext';
|
import { PlayerContext } from 'App/components/Session/playerContext';
|
||||||
|
|
||||||
function EventSearch(props) {
|
function EventSearch(props) {
|
||||||
const { player } = React.useContext(PlayerContext);
|
const { player } = React.useContext(PlayerContext);
|
||||||
|
|
||||||
const { onChange, value, header, setActiveTab } = props;
|
const { onChange, value, header, setActiveTab, eventsText } = props;
|
||||||
|
|
||||||
const toggleEvents = () => player.toggleEvents();
|
const toggleEvents = () => player.toggleEvents();
|
||||||
|
|
||||||
|
|
@ -16,25 +17,25 @@ function EventSearch(props) {
|
||||||
<Input
|
<Input
|
||||||
autoFocus
|
autoFocus
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Filter"
|
placeholder={`Filter ${eventsText}`}
|
||||||
className="inset-0 w-full"
|
className="w-full rounded-lg"
|
||||||
name="query"
|
name="query"
|
||||||
value={value}
|
value={value}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
wrapperClassName="w-full"
|
prefix={<SearchOutlined />}
|
||||||
style={{ height: '32px' }}
|
|
||||||
autoComplete="off chromebugfix"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button
|
<Tooltip title="Close Panel" placement='bottom' >
|
||||||
className="ml-2"
|
<Button
|
||||||
icon="close"
|
className="ml-2"
|
||||||
variant="text"
|
type='text'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setActiveTab('');
|
setActiveTab('');
|
||||||
toggleEvents();
|
toggleEvents();
|
||||||
}}
|
}}
|
||||||
/>
|
icon={<CloseOutlined />}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ function EventsBlock(props: IProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={cn(styles.header, 'p-4')}>
|
<div className={cn(styles.header, 'py-4 px-2 bg-gradient-to-t from-transparent to-neutral-50 h-[57px]' )}>
|
||||||
{uxtestingStore.isUxt() ? (
|
{uxtestingStore.isUxt() ? (
|
||||||
<div style={{ width: 240, height: 130 }} className={'relative'}>
|
<div style={{ width: 240, height: 130 }} className={'relative'}>
|
||||||
<video
|
<video
|
||||||
|
|
@ -219,14 +219,14 @@ function EventsBlock(props: IProps) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<div className={cn(styles.hAndProgress, 'mt-3')}>
|
<div className={cn(styles.hAndProgress, 'mt-0')}>
|
||||||
<EventSearch
|
<EventSearch
|
||||||
onChange={write}
|
onChange={write}
|
||||||
setActiveTab={setActiveTab}
|
setActiveTab={setActiveTab}
|
||||||
value={query}
|
value={query}
|
||||||
|
eventsText={usedEvents.length ? `${usedEvents.length} Events` : '0 Events'}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-1 color-gray-medium">{eventsText}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={cn('flex-1 pb-4', styles.eventsList)}
|
className={cn('flex-1 pb-4', styles.eventsList)}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { Segmented } from 'antd';
|
import { Segmented } from 'antd';
|
||||||
|
import {InfoCircleOutlined} from '@ant-design/icons'
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
|
@ -12,6 +13,7 @@ import SummaryBlock from 'Components/Session/Player/ReplayPlayer/SummaryBlock';
|
||||||
import { SummaryButton } from 'Components/Session_/Player/Controls/Controls';
|
import { SummaryButton } from 'Components/Session_/Player/Controls/Controls';
|
||||||
import TimelineZoomButton from 'Components/Session_/Player/Controls/components/TimelineZoomButton';
|
import TimelineZoomButton from 'Components/Session_/Player/Controls/components/TimelineZoomButton';
|
||||||
import { Icon, NoContent } from 'UI';
|
import { Icon, NoContent } from 'UI';
|
||||||
|
import TabSelector from "../../shared/DevTools/TabSelector";
|
||||||
|
|
||||||
import BottomBlock from '../BottomBlock';
|
import BottomBlock from '../BottomBlock';
|
||||||
import EventRow from './components/EventRow';
|
import EventRow from './components/EventRow';
|
||||||
|
|
@ -136,14 +138,60 @@ function WebOverviewPanelCont() {
|
||||||
|
|
||||||
const { endTime, currentTab, tabStates } = store.get();
|
const { endTime, currentTab, tabStates } = store.get();
|
||||||
|
|
||||||
const stackEventList = tabStates[currentTab]?.stackList || [];
|
const tabValues = Object.values(tabStates);
|
||||||
const frustrationsList = tabStates[currentTab]?.frustrationsList || [];
|
const dataSource = uiPlayerStore.dataSource;
|
||||||
const exceptionsList = tabStates[currentTab]?.exceptionsList || [];
|
const showSingleTab = dataSource === 'current';
|
||||||
const resourceListUnmap = tabStates[currentTab]?.resourceList || [];
|
|
||||||
const fetchList = tabStates[currentTab]?.fetchList || [];
|
const {
|
||||||
const graphqlList = tabStates[currentTab]?.graphqlList || [];
|
stackEventList = [],
|
||||||
const performanceChartData =
|
frustrationsList = [],
|
||||||
tabStates[currentTab]?.performanceChartData || [];
|
exceptionsList = [],
|
||||||
|
resourceListUnmap = [],
|
||||||
|
fetchList = [],
|
||||||
|
graphqlList = [],
|
||||||
|
performanceChartData = [],
|
||||||
|
} = React.useMemo(() => {
|
||||||
|
if (showSingleTab) {
|
||||||
|
const stackEventList = tabStates[currentTab].stackList;
|
||||||
|
const frustrationsList = tabStates[currentTab].frustrationsList;
|
||||||
|
const exceptionsList = tabStates[currentTab].exceptionsList;
|
||||||
|
const resourceListUnmap = tabStates[currentTab].resourceList;
|
||||||
|
const fetchList = tabStates[currentTab].fetchList;
|
||||||
|
const graphqlList = tabStates[currentTab].graphqlList;
|
||||||
|
const performanceChartData =
|
||||||
|
tabStates[currentTab].performanceChartData;
|
||||||
|
|
||||||
|
return {
|
||||||
|
stackEventList,
|
||||||
|
frustrationsList,
|
||||||
|
exceptionsList,
|
||||||
|
resourceListUnmap,
|
||||||
|
fetchList,
|
||||||
|
graphqlList,
|
||||||
|
performanceChartData,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const stackEventList = tabValues.flatMap((tab) => tab.stackList);
|
||||||
|
// these two are global
|
||||||
|
const frustrationsList = tabValues[0].frustrationsList;
|
||||||
|
const exceptionsList = tabValues[0].exceptionsList;
|
||||||
|
// we can't compute global chart data because some tabs coexist
|
||||||
|
const performanceChartData: any = [];
|
||||||
|
const resourceListUnmap = tabValues.flatMap((tab) => tab.resourceList);
|
||||||
|
const fetchList = tabValues.flatMap((tab) => tab.fetchList);
|
||||||
|
const graphqlList = tabValues.flatMap((tab) => tab.graphqlList);
|
||||||
|
|
||||||
|
return {
|
||||||
|
stackEventList,
|
||||||
|
frustrationsList,
|
||||||
|
exceptionsList,
|
||||||
|
resourceListUnmap,
|
||||||
|
fetchList,
|
||||||
|
graphqlList,
|
||||||
|
performanceChartData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [tabStates, currentTab, dataSource, tabValues]);
|
||||||
|
|
||||||
const fetchPresented = fetchList.length > 0;
|
const fetchPresented = fetchList.length > 0;
|
||||||
const resourceList = resourceListUnmap
|
const resourceList = resourceListUnmap
|
||||||
|
|
@ -168,7 +216,18 @@ function WebOverviewPanelCont() {
|
||||||
PERFORMANCE: checkInZoomRange(performanceChartData),
|
PERFORMANCE: checkInZoomRange(performanceChartData),
|
||||||
FRUSTRATIONS: checkInZoomRange(frustrationsList),
|
FRUSTRATIONS: checkInZoomRange(frustrationsList),
|
||||||
};
|
};
|
||||||
}, [tabStates, currentTab, zoomEnabled, zoomStartTs, zoomEndTs]);
|
}, [
|
||||||
|
tabStates,
|
||||||
|
currentTab,
|
||||||
|
zoomEnabled,
|
||||||
|
zoomStartTs,
|
||||||
|
zoomEndTs,
|
||||||
|
resourceList.length,
|
||||||
|
exceptionsList.length,
|
||||||
|
stackEventList.length,
|
||||||
|
performanceChartData.length,
|
||||||
|
frustrationsList.length,
|
||||||
|
]);
|
||||||
|
|
||||||
const originStr = window.env.ORIGIN || window.location.origin;
|
const originStr = window.env.ORIGIN || window.location.origin;
|
||||||
const isSaas = /app\.openreplay\.com/.test(originStr);
|
const isSaas = /app\.openreplay\.com/.test(originStr);
|
||||||
|
|
@ -187,6 +246,7 @@ function WebOverviewPanelCont() {
|
||||||
sessionId={sessionId}
|
sessionId={sessionId}
|
||||||
setZoomTab={setZoomTab}
|
setZoomTab={setZoomTab}
|
||||||
zoomTab={zoomTab}
|
zoomTab={zoomTab}
|
||||||
|
showSingleTab={showSingleTab}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -238,6 +298,7 @@ function PanelComponent({
|
||||||
spotTime,
|
spotTime,
|
||||||
spotEndTime,
|
spotEndTime,
|
||||||
onClose,
|
onClose,
|
||||||
|
showSingleTab,
|
||||||
}: any) {
|
}: any) {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
|
@ -280,12 +341,13 @@ function PanelComponent({
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{isSpot ? null : (
|
{isSpot ? null : (
|
||||||
<div className="flex items-center h-20 mr-4 gap-2">
|
<div className="flex items-center h-20 mr-4 gap-3">
|
||||||
<TimelineZoomButton />
|
|
||||||
<FeatureSelection
|
<FeatureSelection
|
||||||
list={selectedFeatures}
|
list={selectedFeatures}
|
||||||
updateList={setSelectedFeatures}
|
updateList={setSelectedFeatures}
|
||||||
/>
|
/>
|
||||||
|
{!isMobile ? <TabSelector /> : null}
|
||||||
|
<TimelineZoomButton />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</BottomBlock.Header>
|
</BottomBlock.Header>
|
||||||
|
|
@ -302,12 +364,19 @@ function PanelComponent({
|
||||||
style={{ height: '60px', minHeight: 'unset', padding: 0 }}
|
style={{ height: '60px', minHeight: 'unset', padding: 0 }}
|
||||||
title={
|
title={
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<Icon name="info-circle" className="mr-2" size="18" />
|
<InfoCircleOutlined size={18} />
|
||||||
Select a debug option to visualize on timeline.
|
Select a debug option to visualize on timeline.
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{isSpot ? <VerticalPointerLineComp time={spotTime} endTime={spotEndTime} /> : <VerticalPointerLine />}
|
{isSpot ? (
|
||||||
|
<VerticalPointerLineComp
|
||||||
|
time={spotTime}
|
||||||
|
endTime={spotEndTime}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<VerticalPointerLine />
|
||||||
|
)}
|
||||||
{selectedFeatures.map((feature: any, index: number) => (
|
{selectedFeatures.map((feature: any, index: number) => (
|
||||||
<div
|
<div
|
||||||
key={feature}
|
key={feature}
|
||||||
|
|
@ -318,6 +387,7 @@ function PanelComponent({
|
||||||
<EventRow
|
<EventRow
|
||||||
isGraph={feature === 'PERFORMANCE'}
|
isGraph={feature === 'PERFORMANCE'}
|
||||||
title={feature}
|
title={feature}
|
||||||
|
disabled={!isMobile && !showSingleTab}
|
||||||
list={resources[feature]}
|
list={resources[feature]}
|
||||||
renderElement={(pointer: any[], isGrouped: boolean) => (
|
renderElement={(pointer: any[], isGrouped: boolean) => (
|
||||||
<TimelinePointer
|
<TimelinePointer
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import { getTimelinePosition } from 'App/utils';
|
import { getTimelinePosition } from 'App/utils';
|
||||||
import { Icon, Tooltip } from 'UI';
|
import { Icon } from 'UI';
|
||||||
|
import { InfoCircleOutlined} from '@ant-design/icons'
|
||||||
|
import {Tooltip} from 'antd';
|
||||||
import PerformanceGraph from '../PerformanceGraph';
|
import PerformanceGraph from '../PerformanceGraph';
|
||||||
interface Props {
|
interface Props {
|
||||||
list?: any[];
|
list?: any[];
|
||||||
|
|
@ -13,9 +15,10 @@ interface Props {
|
||||||
isGraph?: boolean;
|
isGraph?: boolean;
|
||||||
zIndex?: number;
|
zIndex?: number;
|
||||||
noMargin?: boolean;
|
noMargin?: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
const EventRow = React.memo((props: Props) => {
|
const EventRow = React.memo((props: Props) => {
|
||||||
const { title, className, list = [], endTime = 0, isGraph = false, message = '' } = props;
|
const { title, className, list = [], endTime = 0, isGraph = false, message = '', disabled } = props;
|
||||||
const scale = 100 / endTime;
|
const scale = 100 / endTime;
|
||||||
const _list =
|
const _list =
|
||||||
isGraph ? [] :
|
isGraph ? [] :
|
||||||
|
|
@ -82,7 +85,7 @@ const EventRow = React.memo((props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return groupedItems;
|
return groupedItems;
|
||||||
}, [list]);
|
}, [list.length]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
@ -91,21 +94,24 @@ const EventRow = React.memo((props: Props) => {
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'uppercase text-sm flex items-center py-1',
|
'uppercase text-sm flex items-center py-1 gap-1',
|
||||||
props.noMargin ? '' : 'ml-2'
|
props.noMargin ? '' : 'ml-2'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{ zIndex: props.zIndex ? props.zIndex : undefined }}
|
style={{ zIndex: props.zIndex ? props.zIndex : undefined }}
|
||||||
className="mr-2 leading-none"
|
className="leading-none mt-0.5"
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
</div>
|
</div>
|
||||||
{message ? <RowInfo message={message} /> : null}
|
|
||||||
|
<Tooltip title={message} placement='left'>
|
||||||
|
<InfoCircleOutlined className='text-neutral-400' />
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div className="relative w-full" style={{ zIndex: props.zIndex ? props.zIndex : undefined }}>
|
<div className="relative w-full" style={{ zIndex: props.zIndex ? props.zIndex : undefined }}>
|
||||||
{isGraph ? (
|
{isGraph ? (
|
||||||
<PerformanceGraph list={list} />
|
<PerformanceGraph disabled={disabled} list={list} />
|
||||||
) : _list.length > 0 ? (
|
) : _list.length > 0 ? (
|
||||||
_list.map((item: { items: any[], left: number, isGrouped: boolean }, index: number) => {
|
_list.map((item: { items: any[], left: number, isGrouped: boolean }, index: number) => {
|
||||||
const left = item.left
|
const left = item.left
|
||||||
|
|
@ -123,7 +129,7 @@ const EventRow = React.memo((props: Props) => {
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
) : (
|
) : (
|
||||||
<div className={cn('color-gray-medium text-sm', props.noMargin ? '' : 'ml-4')}>
|
<div className={cn('color-gray-medium text-xs', props.noMargin ? '' : 'ml-2')}>
|
||||||
None captured.
|
None captured.
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -133,11 +139,3 @@ const EventRow = React.memo((props: Props) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
export default EventRow;
|
export default EventRow;
|
||||||
|
|
||||||
function RowInfo({ message }: any) {
|
|
||||||
return (
|
|
||||||
<Tooltip title={message} delay={0}>
|
|
||||||
<Icon name="info-circle" color="gray-medium" />
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Popover, Checkbox } from 'antd';
|
import { Popover, Checkbox, Button } from 'antd';
|
||||||
|
import {EyeInvisibleOutlined} from '@ant-design/icons';
|
||||||
import { Icon } from 'UI'
|
import { Icon } from 'UI'
|
||||||
|
import Funnel from '@/types/funnel';
|
||||||
|
|
||||||
const NETWORK = 'NETWORK';
|
const NETWORK = 'NETWORK';
|
||||||
const ERRORS = 'ERRORS';
|
const ERRORS = 'ERRORS';
|
||||||
|
|
@ -59,7 +61,7 @@ function FeatureSelection(props: Props) {
|
||||||
<Popover
|
<Popover
|
||||||
trigger="click"
|
trigger="click"
|
||||||
content={
|
content={
|
||||||
<div>
|
<div className='flex flex-col gap-3'>
|
||||||
<div
|
<div
|
||||||
className={'flex items-center gap-2 cursor-pointer'}
|
className={'flex items-center gap-2 cursor-pointer'}
|
||||||
onClick={() => toggleAllFeatures()}
|
onClick={() => toggleAllFeatures()}
|
||||||
|
|
@ -81,10 +83,9 @@ function FeatureSelection(props: Props) {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className={'font-semibold flex items-center gap-2 text-main cursor-pointer'}>
|
<Button color='primary' size='small' type='text' className={'font-medium'} icon={<EyeInvisibleOutlined size={12} />} >
|
||||||
<Icon size={16} name={'funnel'} color={'main'} />
|
Hide / Show
|
||||||
<div>X-Ray Events</div>
|
</Button>
|
||||||
</div>
|
|
||||||
</Popover>
|
</Popover>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,82 +1,107 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { AreaChart, Area, ResponsiveContainer } from 'recharts';
|
import { AreaChart, Area, ResponsiveContainer } from 'recharts';
|
||||||
|
import {InfoCircleOutlined} from '@ant-design/icons'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
list: any;
|
list: any;
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
const PerformanceGraph = React.memo((props: Props) => {
|
const PerformanceGraph = React.memo((props: Props) => {
|
||||||
const { list } = props;
|
const { list, disabled } = props;
|
||||||
|
|
||||||
const finalValues = React.useMemo(() => {
|
const finalValues = React.useMemo(() => {
|
||||||
const cpuMax = list.reduce((acc: number, item: any) => {
|
const cpuMax = list.reduce((acc: number, item: any) => {
|
||||||
return Math.max(acc, item.cpu);
|
return Math.max(acc, item.cpu);
|
||||||
}, 0);
|
}, 0);
|
||||||
const cpuMin = list.reduce((acc: number, item: any) => {
|
const cpuMin = list.reduce((acc: number, item: any) => {
|
||||||
return Math.min(acc, item.cpu);
|
return Math.min(acc, item.cpu);
|
||||||
}, Infinity);
|
}, Infinity);
|
||||||
|
|
||||||
const memoryMin = list.reduce((acc: number, item: any) => {
|
const memoryMin = list.reduce((acc: number, item: any) => {
|
||||||
return Math.min(acc, item.usedHeap);
|
return Math.min(acc, item.usedHeap);
|
||||||
}, Infinity);
|
}, Infinity);
|
||||||
const memoryMax = list.reduce((acc: number, item: any) => {
|
const memoryMax = list.reduce((acc: number, item: any) => {
|
||||||
return Math.max(acc, item.usedHeap);
|
return Math.max(acc, item.usedHeap);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
const convertToPercentage = (val: number, max: number, min: number) => {
|
const convertToPercentage = (val: number, max: number, min: number) => {
|
||||||
return ((val - min) / (max - min)) * 100;
|
return ((val - min) / (max - min)) * 100;
|
||||||
};
|
};
|
||||||
const cpuValues = list.map((item: any) => convertToPercentage(item.cpu, cpuMax, cpuMin));
|
const cpuValues = list.map((item: any) =>
|
||||||
const memoryValues = list.map((item: any) => convertToPercentage(item.usedHeap, memoryMax, memoryMin));
|
convertToPercentage(item.cpu, cpuMax, cpuMin)
|
||||||
const mergeArraysWithMaxNumber = (arr1: any[], arr2: any[]) => {
|
|
||||||
const maxLength = Math.max(arr1.length, arr2.length);
|
|
||||||
const result = [];
|
|
||||||
for (let i = 0; i < maxLength; i++) {
|
|
||||||
const num = Math.round(Math.max(arr1[i] || 0, arr2[i] || 0));
|
|
||||||
result.push(num > 60 ? num : 1);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
const finalValues = mergeArraysWithMaxNumber(cpuValues, memoryValues);
|
|
||||||
return finalValues;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const data = list.map((item: any, index: number) => {
|
|
||||||
return {
|
|
||||||
time: item.time,
|
|
||||||
cpu: finalValues[index],
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ResponsiveContainer height={35}>
|
|
||||||
<AreaChart
|
|
||||||
data={data}
|
|
||||||
margin={{
|
|
||||||
top: 0,
|
|
||||||
right: 0,
|
|
||||||
left: 0,
|
|
||||||
bottom: 0,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<defs>
|
|
||||||
<linearGradient id="cpuGradientTimeline" x1="0" y1="0" x2="0" y2="1">
|
|
||||||
<stop offset="30%" stopColor="#CC0000" stopOpacity={0.5} />
|
|
||||||
<stop offset="95%" stopColor="#3EAAAF" stopOpacity={0.8} />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
{/* <Tooltip filterNull={false} /> */}
|
|
||||||
<Area
|
|
||||||
dataKey="cpu"
|
|
||||||
baseValue={5}
|
|
||||||
type="monotone"
|
|
||||||
stroke="none"
|
|
||||||
activeDot={false}
|
|
||||||
fill="url(#cpuGradientTimeline)"
|
|
||||||
isAnimationActive={false}
|
|
||||||
/>
|
|
||||||
</AreaChart>
|
|
||||||
</ResponsiveContainer>
|
|
||||||
);
|
);
|
||||||
|
const memoryValues = list.map((item: any) =>
|
||||||
|
convertToPercentage(item.usedHeap, memoryMax, memoryMin)
|
||||||
|
);
|
||||||
|
const mergeArraysWithMaxNumber = (arr1: any[], arr2: any[]) => {
|
||||||
|
const maxLength = Math.max(arr1.length, arr2.length);
|
||||||
|
const result = [];
|
||||||
|
for (let i = 0; i < maxLength; i++) {
|
||||||
|
const num = Math.round(Math.max(arr1[i] || 0, arr2[i] || 0));
|
||||||
|
result.push(num > 60 ? num : 1);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
const finalValues = mergeArraysWithMaxNumber(cpuValues, memoryValues);
|
||||||
|
return finalValues;
|
||||||
|
}, [list.length]);
|
||||||
|
|
||||||
|
const data = list.map((item: any, index: number) => {
|
||||||
|
return {
|
||||||
|
time: item.time,
|
||||||
|
cpu: finalValues[index],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={'relative'}>
|
||||||
|
{disabled ? (
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
'flex justify-center'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className={'text-xs text-neutral-400 ps-2'}>
|
||||||
|
Multi-tab performance overview is not available.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
<ResponsiveContainer height={35}>
|
||||||
|
<AreaChart
|
||||||
|
data={data}
|
||||||
|
margin={{
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
left: 0,
|
||||||
|
bottom: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<defs>
|
||||||
|
<linearGradient
|
||||||
|
id="cpuGradientTimeline"
|
||||||
|
x1="0"
|
||||||
|
y1="0"
|
||||||
|
x2="0"
|
||||||
|
y2="1"
|
||||||
|
>
|
||||||
|
<stop offset="30%" stopColor="#CC0000" stopOpacity={0.5} />
|
||||||
|
<stop offset="95%" stopColor="#3EAAAF" stopOpacity={0.8} />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
{/* <Tooltip filterNull={false} /> */}
|
||||||
|
<Area
|
||||||
|
dataKey="cpu"
|
||||||
|
baseValue={5}
|
||||||
|
type="monotone"
|
||||||
|
stroke="none"
|
||||||
|
activeDot={false}
|
||||||
|
fill="url(#cpuGradientTimeline)"
|
||||||
|
isAnimationActive={false}
|
||||||
|
/>
|
||||||
|
</AreaChart>
|
||||||
|
</ResponsiveContainer>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
export default PerformanceGraph;
|
export default PerformanceGraph;
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ export function FrustrationElement({ item, createEventClickHandler }: CommonProp
|
||||||
const elData = getFrustration(item);
|
const elData = getFrustration(item);
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
placement={'right'}
|
placement={'top'}
|
||||||
title={
|
title={
|
||||||
<div className="">
|
<div className="">
|
||||||
<b>{elData.name}</b>
|
<b>{elData.name}</b>
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ function GroupedIssue({
|
||||||
<div
|
<div
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
className={
|
className={
|
||||||
'h-5 w-5 cursor-pointer rounded-full bg-red text-white font-bold flex items-center justify-center text-sm'
|
'h-5 w-5 cursor-pointer rounded-full bg-red text-white font-bold flex items-center justify-center text-xs'
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{items.length}
|
{items.length}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Loader, Icon } from 'UI';
|
import { Loader } from 'UI';
|
||||||
|
import {Button, Tooltip} from 'antd';
|
||||||
|
import {CloseOutlined} from '@ant-design/icons';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
import SelectorsList from './components/SelectorsList/SelectorsList';
|
import SelectorsList from './components/SelectorsList/SelectorsList';
|
||||||
import { PlayerContext } from 'App/components/Session/playerContext';
|
import { PlayerContext } from 'App/components/Session/playerContext';
|
||||||
import { compareJsonObjects } from 'App/utils';
|
import { compareJsonObjects } from 'App/utils';
|
||||||
|
|
||||||
import Select from 'Shared/Select';
|
import {Select, Form} from 'antd';
|
||||||
|
|
||||||
const JUMP_OFFSET = 1000;
|
const JUMP_OFFSET = 1000;
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
@ -58,34 +60,29 @@ function PageInsightsPanel({ setActiveTab }: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-4 bg-white">
|
<div className="p-2 py-4 bg-white">
|
||||||
<div className="pb-3 flex items-center" style={{ maxWidth: '241px', paddingTop: '5px' }}>
|
<div className="flex items-center gap-2 mb-3 overflow-hidden">
|
||||||
<div className="flex items-center">
|
<div className="flex-shrink-0 font-medium">Page</div>
|
||||||
<span className="mr-1 text-xl">Clicks</span>
|
<Form.Item name="url" className='mb-0 w-[176px]'>
|
||||||
</div>
|
<Select
|
||||||
<div
|
showSearch
|
||||||
onClick={() => {
|
placeholder="change"
|
||||||
setActiveTab('');
|
options={urlOptions}
|
||||||
}}
|
defaultValue={defaultValue}
|
||||||
className="ml-auto flex items-center justify-center bg-white cursor-pointer"
|
onChange={onPageSelect}
|
||||||
>
|
id="change-dropdown"
|
||||||
<Icon name="close" size="18" />
|
className="w-full rounded-lg max-w-[270px]"
|
||||||
</div>
|
dropdownStyle={{ }}
|
||||||
</div>
|
/>
|
||||||
<div className="mb-4 flex items-center">
|
</Form.Item>
|
||||||
<div className="mr-2 flex-shrink-0">In Page</div>
|
<Tooltip title="Close Panel" placement='bottomRight'>
|
||||||
<Select
|
<Button
|
||||||
isSearchable={true}
|
className="ml-2"
|
||||||
right
|
type='text'
|
||||||
placeholder="change"
|
onClick={() => { setActiveTab(''); }}
|
||||||
options={urlOptions}
|
icon={<CloseOutlined />}
|
||||||
name="url"
|
|
||||||
defaultValue={defaultValue}
|
|
||||||
onChange={onPageSelect}
|
|
||||||
id="change-dropdown"
|
|
||||||
className="w-full"
|
|
||||||
style={{ width: '100%' }}
|
|
||||||
/>
|
/>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<Loader loading={loading}>
|
<Loader loading={loading}>
|
||||||
<SelectorsList />
|
<SelectorsList />
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
.wrapper {
|
.wrapper {
|
||||||
padding: 10px;
|
padding: 1rem;
|
||||||
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
|
|
||||||
border-radius: 3px;
|
|
||||||
background-color: $gray-lightest;
|
background-color: $gray-lightest;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
|
||||||
|
|
@ -18,8 +16,6 @@
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background-color: $tealx;
|
background-color: $tealx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
border: solid thin white;
|
|
||||||
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
|
|
@ -17,20 +17,20 @@ export default function SelectorCard({ index = 1, target, showContent }: Props)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// @ts-ignore TODO for Alex
|
// @ts-ignore TODO for Alex
|
||||||
<div className={cn(stl.wrapper, { [stl.active]: showContent })} onClick={() => activeTarget(index)}>
|
<div className={cn(stl.wrapper, 'rounded-xl', { [stl.active]: showContent })} onClick={() => activeTarget(index)}>
|
||||||
<div className={stl.top}>
|
<div className={stl.top}>
|
||||||
{/* @ts-ignore */}
|
{/* @ts-ignore */}
|
||||||
<Tooltip position="top" title="Rank of the most clicked element">
|
<Tooltip position="top" title="Rank of the most clicked element">
|
||||||
<div className={stl.index}>{index + 1}</div>
|
<div className={stl.index}>{index + 1}</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<div className="truncate">{target.selector}</div>
|
<div className="truncate font-mono">{target.selector}</div>
|
||||||
</div>
|
</div>
|
||||||
{showContent && (
|
{showContent && (
|
||||||
<div className={stl.counts}>
|
<div className={stl.counts}>
|
||||||
<div>
|
<div>
|
||||||
{target.count} Clicks - {target.percent}%
|
{target.count} Click{target.count > 1 ? 's' : ''} - {target.percent}%
|
||||||
</div>
|
</div>
|
||||||
<div className="color-gray-medium">TOTAL CLICKS</div>
|
<div className="text-neutral-400">TOTAL CLICKS</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,14 @@ import {
|
||||||
} from 'recharts';
|
} from 'recharts';
|
||||||
import { durationFromMsFormatted } from 'App/date';
|
import { durationFromMsFormatted } from 'App/date';
|
||||||
import { formatBytes } from 'App/utils';
|
import { formatBytes } from 'App/utils';
|
||||||
|
import {Tooltip as TooltipANT} from 'antd';
|
||||||
|
|
||||||
import stl from './performance.module.css';
|
import stl from './performance.module.css';
|
||||||
|
|
||||||
import BottomBlock from '../BottomBlock';
|
import BottomBlock from '../BottomBlock';
|
||||||
import InfoLine from '../BottomBlock/InfoLine';
|
import InfoLine from '../BottomBlock/InfoLine';
|
||||||
import { useStore } from 'App/mstore'
|
import { useStore } from 'App/mstore'
|
||||||
|
import { Segmented } from 'antd'
|
||||||
|
|
||||||
const CPU_VISUAL_OFFSET = 10;
|
const CPU_VISUAL_OFFSET = 10;
|
||||||
|
|
||||||
|
|
@ -457,15 +459,33 @@ function Performance() {
|
||||||
return (
|
return (
|
||||||
<BottomBlock>
|
<BottomBlock>
|
||||||
<BottomBlock.Header>
|
<BottomBlock.Header>
|
||||||
<div className="flex items-center w-full">
|
<div className="flex items-center justify-between w-full">
|
||||||
<div className="font-semibold color-gray-medium mr-auto">Performance</div>
|
<div className="flex gap-3 items-center">
|
||||||
<InfoLine>
|
<div className="font-semibold color-gray-medium mr-auto">Performance</div>
|
||||||
<InfoLine.Point
|
<InfoLine>
|
||||||
label="Device Heap Size"
|
<InfoLine.Point
|
||||||
value={formatBytes(userDeviceHeapSize)}
|
label="Device Heap Size"
|
||||||
display={true}
|
value={formatBytes(userDeviceHeapSize)}
|
||||||
/>
|
display={true}
|
||||||
</InfoLine>
|
/>
|
||||||
|
</InfoLine>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={'flex items-center gap-3'}>
|
||||||
|
<Segmented
|
||||||
|
options={[
|
||||||
|
{ label: (
|
||||||
|
<TooltipANT title="Performance overview isn't supported across tabs.">
|
||||||
|
<span>All Tabs</span>
|
||||||
|
</TooltipANT>
|
||||||
|
), value: 'all', disabled: true, },
|
||||||
|
{ label: 'Current Tab', value: 'current' },
|
||||||
|
]}
|
||||||
|
defaultValue="current"
|
||||||
|
size="small"
|
||||||
|
className="rounded-full font-medium"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</BottomBlock.Header>
|
</BottomBlock.Header>
|
||||||
<BottomBlock.Content>
|
<BottomBlock.Content>
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import { Icon } from 'UI';
|
||||||
import LogsButton from 'App/components/Session/Player/SharedComponents/BackendLogs/LogsButton';
|
import LogsButton from 'App/components/Session/Player/SharedComponents/BackendLogs/LogsButton';
|
||||||
|
|
||||||
import ControlButton from './ControlButton';
|
import ControlButton from './ControlButton';
|
||||||
|
import { WebEventsList } from "./EventsList";
|
||||||
import Timeline from './Timeline';
|
import Timeline from './Timeline';
|
||||||
import PlayerControls from './components/PlayerControls';
|
import PlayerControls from './components/PlayerControls';
|
||||||
import styles from './controls.module.css';
|
import styles from './controls.module.css';
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,12 @@ import { PlayerContext, MobilePlayerContext } from 'Components/Session/playerCon
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { getTimelinePosition } from './getTimelinePosition'
|
import { getTimelinePosition } from './getTimelinePosition'
|
||||||
|
|
||||||
function EventsList({ scale }: { scale: number }) {
|
function EventsList() {
|
||||||
const { store } = useContext(PlayerContext);
|
const { store } = useContext(PlayerContext);
|
||||||
|
|
||||||
const { tabStates, eventCount } = store.get();
|
const { eventCount, endTime } = store.get();
|
||||||
|
const tabStates = store.get().tabStates;
|
||||||
|
const scale = 100 / endTime;
|
||||||
const events = React.useMemo(() => {
|
const events = React.useMemo(() => {
|
||||||
return Object.values(tabStates)[0]?.eventList.filter(e => e.time) || [];
|
return Object.values(tabStates)[0]?.eventList.filter(e => e.time) || [];
|
||||||
}, [eventCount]);
|
}, [eventCount]);
|
||||||
|
|
@ -34,11 +36,12 @@ function EventsList({ scale }: { scale: number }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function MobileEventsList({ scale }: { scale: number }) {
|
function MobileEventsList() {
|
||||||
const { store } = useContext(MobilePlayerContext);
|
const { store } = useContext(MobilePlayerContext);
|
||||||
const { eventList } = store.get();
|
const { eventList, endTime } = store.get();
|
||||||
const events = eventList.filter(e => e.type !== 'SWIPE')
|
const events = eventList.filter(e => e.type !== 'SWIPE')
|
||||||
|
|
||||||
|
const scale = 100/endTime;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{events.map((e) => (
|
{events.map((e) => (
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,7 @@ import NotesList from './NotesList';
|
||||||
import SkipIntervalsList from './SkipIntervalsList';
|
import SkipIntervalsList from './SkipIntervalsList';
|
||||||
import TimelineTracker from 'Components/Session_/Player/Controls/TimelineTracker';
|
import TimelineTracker from 'Components/Session_/Player/Controls/TimelineTracker';
|
||||||
|
|
||||||
interface IProps {
|
function Timeline({ isMobile }: { isMobile: boolean }) {
|
||||||
isMobile?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
function Timeline(props: IProps) {
|
|
||||||
const { player, store } = useContext(PlayerContext);
|
const { player, store } = useContext(PlayerContext);
|
||||||
const [wasPlaying, setWasPlaying] = useState(false);
|
const [wasPlaying, setWasPlaying] = useState(false);
|
||||||
const [maxWidth, setMaxWidth] = useState(0);
|
const [maxWidth, setMaxWidth] = useState(0);
|
||||||
|
|
@ -158,7 +154,7 @@ function Timeline(props: IProps) {
|
||||||
{devtoolsLoading || domLoading || !ready ? <div className={stl.stripes} /> : null}
|
{devtoolsLoading || domLoading || !ready ? <div className={stl.stripes} /> : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{props.isMobile ? <MobEventsList scale={scale} /> : <WebEventsList scale={scale} />}
|
{isMobile ? <MobEventsList /> : <WebEventsList />}
|
||||||
<NotesList scale={scale} />
|
<NotesList scale={scale} />
|
||||||
<SkipIntervalsList scale={scale} />
|
<SkipIntervalsList scale={scale} />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ function TimelineZoomButton() {
|
||||||
}, [])
|
}, [])
|
||||||
return (
|
return (
|
||||||
<Tooltip title="Select a portion of the timeline to view the x-ray and activity for that specific selection." placement='top'>
|
<Tooltip title="Select a portion of the timeline to view the x-ray and activity for that specific selection." placement='top'>
|
||||||
<Button onClick={onClickHandler} size={'small'} className={'flex items-center font-semibold'}>
|
<Button onClick={onClickHandler} size={'small'} className={'flex items-center font-medium'}>
|
||||||
Focus Mode: {enabled ? 'On' : 'Off'}
|
Focus Mode: {enabled ? 'On' : 'Off'}
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,24 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useStore } from 'App/mstore'
|
import { useStore } from 'App/mstore';
|
||||||
import { PlayerContext } from 'App/components/Session/playerContext';
|
import { PlayerContext } from 'App/components/Session/playerContext';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { JSONTree, NoContent, Tooltip } from 'UI';
|
import { JSONTree, NoContent, Tooltip } from 'UI';
|
||||||
import { formatMs } from 'App/date';
|
import { formatMs } from 'App/date';
|
||||||
import diff from 'microdiff'
|
import diff from 'microdiff';
|
||||||
import { STORAGE_TYPES, selectStorageList, selectStorageListNow, selectStorageType } from 'Player';
|
import {
|
||||||
|
STORAGE_TYPES,
|
||||||
|
selectStorageList,
|
||||||
|
selectStorageListNow,
|
||||||
|
selectStorageType,
|
||||||
|
} from 'Player';
|
||||||
import Autoscroll from '../Autoscroll';
|
import Autoscroll from '../Autoscroll';
|
||||||
import BottomBlock from '../BottomBlock/index';
|
import BottomBlock from '../BottomBlock/index';
|
||||||
import DiffRow from './DiffRow';
|
import DiffRow from './DiffRow';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import stl from './storage.module.css';
|
import stl from './storage.module.css';
|
||||||
import logger from "App/logger";
|
import logger from 'App/logger';
|
||||||
import ReduxViewer from './ReduxViewer'
|
import ReduxViewer from './ReduxViewer';
|
||||||
|
import { Segmented } from 'antd'
|
||||||
|
|
||||||
function getActionsName(type: string) {
|
function getActionsName(type: string) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
@ -31,7 +37,7 @@ const storageDecodeKeys = {
|
||||||
[STORAGE_TYPES.ZUSTAND]: ['state', 'mutation'],
|
[STORAGE_TYPES.ZUSTAND]: ['state', 'mutation'],
|
||||||
[STORAGE_TYPES.MOBX]: ['payload'],
|
[STORAGE_TYPES.MOBX]: ['payload'],
|
||||||
[STORAGE_TYPES.NONE]: ['state, action', 'payload', 'mutation'],
|
[STORAGE_TYPES.NONE]: ['state, action', 'payload', 'mutation'],
|
||||||
}
|
};
|
||||||
|
|
||||||
function Storage() {
|
function Storage() {
|
||||||
const { uiPlayerStore } = useStore();
|
const { uiPlayerStore } = useStore();
|
||||||
|
|
@ -42,49 +48,48 @@ function Storage() {
|
||||||
const [stateObject, setState] = React.useState({});
|
const [stateObject, setState] = React.useState({});
|
||||||
|
|
||||||
const { player, store } = React.useContext(PlayerContext);
|
const { player, store } = React.useContext(PlayerContext);
|
||||||
const { tabStates, currentTab } = store.get()
|
const { tabStates, currentTab } = store.get();
|
||||||
const state = tabStates[currentTab] || {}
|
const state = tabStates[currentTab] || {};
|
||||||
|
|
||||||
const listNow = selectStorageListNow(state) || [];
|
const listNow = selectStorageListNow(state) || [];
|
||||||
const list = selectStorageList(state) || [];
|
const list = selectStorageList(state) || [];
|
||||||
const type = selectStorageType(state) || STORAGE_TYPES.NONE
|
const type = selectStorageType(state) || STORAGE_TYPES.NONE;
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
let currentState;
|
let currentState;
|
||||||
if (listNow.length === 0) {
|
if (listNow.length === 0) {
|
||||||
currentState = decodeMessage(list[0])
|
currentState = decodeMessage(list[0]);
|
||||||
} else {
|
} else {
|
||||||
currentState = decodeMessage(listNow[listNow.length - 1])
|
currentState = decodeMessage(listNow[listNow.length - 1]);
|
||||||
}
|
}
|
||||||
const stateObj = currentState?.state || currentState?.payload?.state || {}
|
const stateObj = currentState?.state || currentState?.payload?.state || {};
|
||||||
const newState = Object.assign(stateObject, stateObj);
|
const newState = Object.assign(stateObject, stateObj);
|
||||||
setState(newState);
|
setState(newState);
|
||||||
|
|
||||||
}, [listNow.length]);
|
}, [listNow.length]);
|
||||||
|
|
||||||
const decodeMessage = (msg: any) => {
|
const decodeMessage = (msg: any) => {
|
||||||
const decoded = {};
|
const decoded = {};
|
||||||
const pureMSG = { ...msg }
|
const pureMSG = { ...msg };
|
||||||
const keys = storageDecodeKeys[type];
|
const keys = storageDecodeKeys[type];
|
||||||
try {
|
try {
|
||||||
keys.forEach(key => {
|
keys.forEach((key) => {
|
||||||
if (pureMSG[key]) {
|
if (pureMSG[key]) {
|
||||||
// @ts-ignore TODO: types for decoder
|
// @ts-ignore TODO: types for decoder
|
||||||
decoded[key] = player.decodeMessage(pureMSG[key]);
|
decoded[key] = player.decodeMessage(pureMSG[key]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("Error on message decoding: ", e, pureMSG);
|
logger.error('Error on message decoding: ', e, pureMSG);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return { ...pureMSG, ...decoded };
|
return { ...pureMSG, ...decoded };
|
||||||
}
|
};
|
||||||
|
|
||||||
const decodedList = React.useMemo(() => {
|
const decodedList = React.useMemo(() => {
|
||||||
return listNow.map(msg => {
|
return listNow.map((msg) => {
|
||||||
return decodeMessage(msg)
|
return decodeMessage(msg);
|
||||||
})
|
});
|
||||||
}, [listNow.length])
|
}, [listNow.length]);
|
||||||
|
|
||||||
const focusNextButton = () => {
|
const focusNextButton = () => {
|
||||||
if (lastBtnRef.current) {
|
if (lastBtnRef.current) {
|
||||||
|
|
@ -99,7 +104,10 @@ function Storage() {
|
||||||
focusNextButton();
|
focusNextButton();
|
||||||
}, [listNow]);
|
}, [listNow]);
|
||||||
|
|
||||||
const renderDiff = (item: Record<string, any>, prevItem?: Record<string, any>) => {
|
const renderDiff = (
|
||||||
|
item: Record<string, any>,
|
||||||
|
prevItem?: Record<string, any>
|
||||||
|
) => {
|
||||||
if (!showDiffs) {
|
if (!showDiffs) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -113,7 +121,10 @@ function Storage() {
|
||||||
|
|
||||||
if (!stateDiff) {
|
if (!stateDiff) {
|
||||||
return (
|
return (
|
||||||
<div style={{ flex: 3 }} className="flex flex-col p-2 pr-0 font-mono text-disabled-text">
|
<div
|
||||||
|
style={{ flex: 3 }}
|
||||||
|
className="flex flex-col p-2 pr-0 font-mono text-disabled-text"
|
||||||
|
>
|
||||||
No diff
|
No diff
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -121,13 +132,15 @@ function Storage() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ flex: 3 }} className="flex flex-col p-1 font-mono">
|
<div style={{ flex: 3 }} className="flex flex-col p-1 font-mono">
|
||||||
{stateDiff.map((d: Record<string, any>, i: number) => renderDiffs(d, i))}
|
{stateDiff.map((d: Record<string, any>, i: number) =>
|
||||||
|
renderDiffs(d, i)
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderDiffs = (diff: Record<string, any>, i: number) => {
|
const renderDiffs = (diff: Record<string, any>, i: number) => {
|
||||||
const path = diff.path.join('.')
|
const path = diff.path.join('.');
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={i}>
|
<React.Fragment key={i}>
|
||||||
<DiffRow path={path} diff={diff} />
|
<DiffRow path={path} diff={diff} />
|
||||||
|
|
@ -145,12 +158,16 @@ function Storage() {
|
||||||
player.jump(list[listNow.length].time);
|
player.jump(list[listNow.length].time);
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderItem = (item: Record<string, any>, i: number, prevItem?: Record<string, any>) => {
|
const renderItem = (
|
||||||
|
item: Record<string, any>,
|
||||||
|
i: number,
|
||||||
|
prevItem?: Record<string, any>
|
||||||
|
) => {
|
||||||
let src;
|
let src;
|
||||||
let name;
|
let name;
|
||||||
|
|
||||||
const itemD = item
|
const itemD = item;
|
||||||
const prevItemD = prevItem ? prevItem : undefined
|
const prevItemD = prevItem ? prevItem : undefined;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case STORAGE_TYPES.REDUX:
|
case STORAGE_TYPES.REDUX:
|
||||||
|
|
@ -177,7 +194,10 @@ function Storage() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn('flex justify-between items-start', src !== null ? 'border-b' : '')}
|
className={cn(
|
||||||
|
'flex justify-between items-start',
|
||||||
|
src !== null ? 'border-b' : ''
|
||||||
|
)}
|
||||||
key={`store-${i}`}
|
key={`store-${i}`}
|
||||||
>
|
>
|
||||||
{src === null ? (
|
{src === null ? (
|
||||||
|
|
@ -187,7 +207,10 @@ function Storage() {
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{renderDiff(itemD, prevItemD)}
|
{renderDiff(itemD, prevItemD)}
|
||||||
<div style={{ flex: 2 }} className={cn("flex pt-2", showDiffs && 'pl-10')}>
|
<div
|
||||||
|
style={{ flex: 2 }}
|
||||||
|
className={cn('flex pt-2', showDiffs && 'pl-10')}
|
||||||
|
>
|
||||||
<JSONTree
|
<JSONTree
|
||||||
name={ensureString(name)}
|
name={ensureString(name)}
|
||||||
src={src}
|
src={src}
|
||||||
|
|
@ -202,11 +225,16 @@ function Storage() {
|
||||||
className="flex-1 flex gap-2 pt-2 items-center justify-end self-start"
|
className="flex-1 flex gap-2 pt-2 items-center justify-end self-start"
|
||||||
>
|
>
|
||||||
{typeof item?.duration === 'number' && (
|
{typeof item?.duration === 'number' && (
|
||||||
<div className="font-size-12 color-gray-medium">{formatMs(itemD.duration)}</div>
|
<div className="font-size-12 color-gray-medium">
|
||||||
|
{formatMs(itemD.duration)}
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="w-12">
|
<div className="w-12">
|
||||||
{i + 1 < listNow.length && (
|
{i + 1 < listNow.length && (
|
||||||
<button className={stl.button} onClick={() => player.jump(item.time)}>
|
<button
|
||||||
|
className={stl.button}
|
||||||
|
onClick={() => player.jump(item.time)}
|
||||||
|
>
|
||||||
{'JUMP'}
|
{'JUMP'}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
@ -222,31 +250,36 @@ function Storage() {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type === STORAGE_TYPES.REDUX) {
|
if (type === STORAGE_TYPES.REDUX) {
|
||||||
return <ReduxViewer />
|
return <ReduxViewer />;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<BottomBlock>
|
<BottomBlock>
|
||||||
{/*@ts-ignore*/}
|
{/*@ts-ignore*/}
|
||||||
<>
|
<>
|
||||||
<BottomBlock.Header>
|
<BottomBlock.Header>
|
||||||
{list.length > 0 && (
|
<div className="flex w-full items-center">
|
||||||
<div className="flex w-full">
|
<div
|
||||||
<h3 style={{ width: '25%', marginRight: 20 }} className="font-semibold">
|
style={{ width: '25%', marginRight: 20 }}
|
||||||
{'STATE'}
|
className="font-semibold flex items-center gap-2"
|
||||||
</h3>
|
>
|
||||||
{showDiffs ? (
|
<h3>{'STATE'}</h3>
|
||||||
<h3 style={{ width: '39%' }} className="font-semibold">
|
|
||||||
DIFFS
|
|
||||||
</h3>
|
|
||||||
) : null}
|
|
||||||
<h3 style={{ width: '30%' }} className="font-semibold">
|
|
||||||
{getActionsName(type)}
|
|
||||||
</h3>
|
|
||||||
<h3 style={{ paddingRight: 30, marginLeft: 'auto' }} className="font-semibold">
|
|
||||||
<Tooltip title="Time to execute">TTE</Tooltip>
|
|
||||||
</h3>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
{showDiffs ? (
|
||||||
|
<h3 style={{ width: '39%' }} className="font-semibold">
|
||||||
|
DIFFS
|
||||||
|
</h3>
|
||||||
|
) : null}
|
||||||
|
<h3 style={{ width: '30%' }} className="font-semibold">
|
||||||
|
{getActionsName(type)}
|
||||||
|
</h3>
|
||||||
|
<h3
|
||||||
|
style={{ paddingRight: 30, marginLeft: 'auto' }}
|
||||||
|
className="font-semibold"
|
||||||
|
>
|
||||||
|
<Tooltip title="Time to execute">TTE</Tooltip>
|
||||||
|
</h3>
|
||||||
|
<Segmented options={[{ label: 'Current Tab', value: 'all' }]} />
|
||||||
|
</div>
|
||||||
</BottomBlock.Header>
|
</BottomBlock.Header>
|
||||||
<BottomBlock.Content className="flex">
|
<BottomBlock.Content className="flex">
|
||||||
<NoContent
|
<NoContent
|
||||||
|
|
@ -307,7 +340,10 @@ function Storage() {
|
||||||
.
|
.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<button className="color-teal" onClick={() => hideHint('storage')}>
|
<button
|
||||||
|
className="color-teal"
|
||||||
|
onClick={() => hideHint('storage')}
|
||||||
|
>
|
||||||
Got It!
|
Got It!
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
|
|
@ -322,8 +358,7 @@ function Storage() {
|
||||||
{'Empty state.'}
|
{'Empty state.'}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<JSONTree collapsed={2} src={stateObject}
|
<JSONTree collapsed={2} src={stateObject} />
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex" style={{ width: '75%' }}>
|
<div className="flex" style={{ width: '75%' }}>
|
||||||
|
|
@ -342,7 +377,6 @@ function Storage() {
|
||||||
|
|
||||||
export default observer(Storage);
|
export default observer(Storage);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: compute diff and only decode the required parts
|
* TODO: compute diff and only decode the required parts
|
||||||
* WIP example
|
* WIP example
|
||||||
|
|
@ -384,4 +418,4 @@ export default observer(Storage);
|
||||||
* }, [list.length])
|
* }, [list.length])
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ function SpotConsole({ onClose }: { onClose: () => void }) {
|
||||||
jump={jump}
|
jump={jump}
|
||||||
iconProps={getIconProps(log.level)}
|
iconProps={getIconProps(log.level)}
|
||||||
renderWithNL={renderWithNL}
|
renderWithNL={renderWithNL}
|
||||||
|
showSingleTab
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</VList>
|
</VList>
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ function SpotPlayerHeader({
|
||||||
{browserVersion && (
|
{browserVersion && (
|
||||||
<>
|
<>
|
||||||
<div>·</div>
|
<div>·</div>
|
||||||
<div className="capitalize">Chrome v{browserVersion}</div>
|
<div>Chromium v{browserVersion}</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{resolution && (
|
{resolution && (
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,15 @@ import cn from 'classnames';
|
||||||
import cls from './infoLine.module.css';
|
import cls from './infoLine.module.css';
|
||||||
|
|
||||||
const InfoLine = ({ children }) => (
|
const InfoLine = ({ children }) => (
|
||||||
<div className={ cls.info }>
|
<div className={ cn(cls.info, 'text-sm')}>
|
||||||
{ children }
|
{ children }
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
const Point = ({ label = '', value = '', display=true, color, dotColor }) => display
|
const Point = ({ label = '', value = '', display=true, color, dotColor }) => display
|
||||||
? <div className={ cls.infoPoint } style={{ color }}>
|
? <div className={ cn(cls.infoPoint, 'text-sm') } style={{ color }}>
|
||||||
{ dotColor != null && <div className={ cn(cls.dot, `bg-${dotColor}`) } /> }
|
{ dotColor != null && <div className={ cn(cls.dot, `bg-${dotColor}`) } /> }
|
||||||
<span className={cls.label}>{ `${label}` }</span> { value }
|
<span className={cn(cls.label, 'text-sm')}>{ `${label}` }</span> { value }
|
||||||
</div>
|
</div>
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import React, { useEffect, useRef, useState, useMemo } from 'react';
|
import React, { useEffect, useRef, useState, useMemo } from 'react';
|
||||||
import { LogLevel, ILog } from 'Player';
|
import { LogLevel, ILog } from 'Player';
|
||||||
import BottomBlock from '../BottomBlock';
|
import BottomBlock from '../BottomBlock';
|
||||||
import { Tabs, Input, Icon, NoContent } from 'UI';
|
import { Tabs, Icon, NoContent } from 'UI';
|
||||||
|
import {Input} from 'antd';
|
||||||
|
import {SearchOutlined, InfoCircleOutlined} from '@ant-design/icons';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import ConsoleRow from '../ConsoleRow';
|
import ConsoleRow from '../ConsoleRow';
|
||||||
import { PlayerContext } from 'App/components/Session/playerContext';
|
import { PlayerContext } from 'App/components/Session/playerContext';
|
||||||
|
|
@ -9,6 +11,7 @@ import { observer } from 'mobx-react-lite';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
import ErrorDetailsModal from 'App/components/Dashboard/components/Errors/ErrorDetailsModal';
|
import ErrorDetailsModal from 'App/components/Dashboard/components/Errors/ErrorDetailsModal';
|
||||||
import { useModal } from 'App/components/Modal';
|
import { useModal } from 'App/components/Modal';
|
||||||
|
import TabSelector from "../TabSelector";
|
||||||
import useAutoscroll, { getLastItemTime } from '../useAutoscroll';
|
import useAutoscroll, { getLastItemTime } from '../useAutoscroll';
|
||||||
import { useRegExListFilterMemo, useTabListFilterMemo } from '../useListFilter';
|
import { useRegExListFilterMemo, useTabListFilterMemo } from '../useListFilter';
|
||||||
import { VList, VListHandle } from "virtua";
|
import { VList, VListHandle } from "virtua";
|
||||||
|
|
@ -93,6 +96,7 @@ function ConsolePanel({
|
||||||
sessionStore: { devTools },
|
sessionStore: { devTools },
|
||||||
uiPlayerStore,
|
uiPlayerStore,
|
||||||
} = useStore();
|
} = useStore();
|
||||||
|
|
||||||
const zoomEnabled = uiPlayerStore.timelineZoom.enabled;
|
const zoomEnabled = uiPlayerStore.timelineZoom.enabled;
|
||||||
const zoomStartTs = uiPlayerStore.timelineZoom.startTs;
|
const zoomStartTs = uiPlayerStore.timelineZoom.startTs;
|
||||||
const zoomEndTs = uiPlayerStore.timelineZoom.endTs;
|
const zoomEndTs = uiPlayerStore.timelineZoom.endTs;
|
||||||
|
|
@ -109,29 +113,34 @@ function ConsolePanel({
|
||||||
const jump = (t: number) => player.jump(t);
|
const jump = (t: number) => player.jump(t);
|
||||||
|
|
||||||
const { currentTab, tabStates } = store.get();
|
const { currentTab, tabStates } = store.get();
|
||||||
const {
|
const tabsArr = Object.keys(tabStates);
|
||||||
logList = [],
|
const tabValues = Object.values(tabStates);
|
||||||
exceptionsList = [],
|
const dataSource = uiPlayerStore.dataSource;
|
||||||
logListNow = [],
|
const showSingleTab = dataSource === 'current';
|
||||||
exceptionsListNow = [],
|
const { logList = [], exceptionsList = [], logListNow = [], exceptionsListNow = [] } = React.useMemo(() => {
|
||||||
} = tabStates[currentTab] ?? {};
|
if (showSingleTab) {
|
||||||
|
return tabStates[currentTab] ?? {};
|
||||||
|
} else {
|
||||||
|
const logList = tabValues.flatMap(tab => tab.logList);
|
||||||
|
const exceptionsList = tabValues.flatMap(tab => tab.exceptionsList);
|
||||||
|
const logListNow = isLive ? tabValues.flatMap(tab => tab.logListNow) : [];
|
||||||
|
const exceptionsListNow = isLive ? tabValues.flatMap(tab => tab.exceptionsListNow) : [];
|
||||||
|
return { logList, exceptionsList, logListNow, exceptionsListNow }
|
||||||
|
}
|
||||||
|
}, [currentTab, tabStates, dataSource, tabValues, isLive])
|
||||||
|
const getTabNum = (tab: string) => (tabsArr.findIndex((t) => t === tab) + 1);
|
||||||
|
|
||||||
const list = isLive
|
const list = useMemo(() => {
|
||||||
? (useMemo(
|
if (isLive) {
|
||||||
() => logListNow.concat(exceptionsListNow).sort((a, b) => a.time - b.time),
|
return logListNow.concat(exceptionsListNow).sort((a, b) => a.time - b.time)
|
||||||
[logListNow.length, exceptionsListNow.length]
|
} else {
|
||||||
) as ILog[])
|
const logs = logList.concat(exceptionsList).sort((a, b) => a.time - b.time)
|
||||||
: (useMemo(
|
return zoomEnabled ? logs.filter(l => l.time >= zoomStartTs && l.time <= zoomEndTs) : logs
|
||||||
() => logList.concat(exceptionsList).sort((a, b) => a.time - b.time),
|
}
|
||||||
[logList.length, exceptionsList.length]
|
}, [isLive, logList.length, exceptionsList.length, logListNow.length, exceptionsListNow.length, zoomEnabled, zoomStartTs, zoomEndTs])
|
||||||
).filter((l) =>
|
|
||||||
zoomEnabled ? l.time >= zoomStartTs && l.time <= zoomEndTs : true
|
|
||||||
) as ILog[]);
|
|
||||||
let filteredList = useRegExListFilterMemo(list, (l) => l.value, filter);
|
let filteredList = useRegExListFilterMemo(list, (l) => l.value, filter);
|
||||||
filteredList = useTabListFilterMemo(filteredList, (l) => LEVEL_TAB[l.level], ALL, activeTab);
|
filteredList = useTabListFilterMemo(filteredList, (l) => LEVEL_TAB[l.level], ALL, activeTab);
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
}, [activeTab, filter]);
|
|
||||||
const onTabClick = (activeTab: any) => devTools.update(INDEX_KEY, { activeTab });
|
const onTabClick = (activeTab: any) => devTools.update(INDEX_KEY, { activeTab });
|
||||||
const onFilterChange = ({ target: { value } }: any) =>
|
const onFilterChange = ({ target: { value } }: any) =>
|
||||||
devTools.update(INDEX_KEY, { filter: value });
|
devTools.update(INDEX_KEY, { filter: value });
|
||||||
|
|
@ -180,23 +189,26 @@ function ConsolePanel({
|
||||||
<span className="font-semibold color-gray-medium mr-4">Console</span>
|
<span className="font-semibold color-gray-medium mr-4">Console</span>
|
||||||
<Tabs tabs={TABS} active={activeTab} onClick={onTabClick} border={false} />
|
<Tabs tabs={TABS} active={activeTab} onClick={onTabClick} border={false} />
|
||||||
</div>
|
</div>
|
||||||
<Input
|
<div className={'flex items-center gap-2'}>
|
||||||
className="input-small h-8"
|
<TabSelector />
|
||||||
placeholder="Filter by keyword"
|
<Input
|
||||||
icon="search"
|
className="rounded-lg"
|
||||||
name="filter"
|
placeholder="Filter by keyword"
|
||||||
height={28}
|
name="filter"
|
||||||
onChange={onFilterChange}
|
onChange={onFilterChange}
|
||||||
value={filter}
|
value={filter}
|
||||||
/>
|
size='small'
|
||||||
|
prefix={<SearchOutlined className='text-neutral-400' />}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
{/* @ts-ignore */}
|
{/* @ts-ignore */}
|
||||||
</BottomBlock.Header>
|
</BottomBlock.Header>
|
||||||
{/* @ts-ignore */}
|
{/* @ts-ignore */}
|
||||||
<BottomBlock.Content className="overflow-y-auto">
|
<BottomBlock.Content className="overflow-y-auto">
|
||||||
<NoContent
|
<NoContent
|
||||||
title={
|
title={
|
||||||
<div className="capitalize flex items-center mt-16">
|
<div className="capitalize flex items-center mt-16 gap-2">
|
||||||
<Icon name="info-circle" className="mr-2" size="18" />
|
<InfoCircleOutlined size={18} />
|
||||||
No Data
|
No Data
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -211,6 +223,8 @@ function ConsolePanel({
|
||||||
iconProps={getIconProps(log.level)}
|
iconProps={getIconProps(log.level)}
|
||||||
renderWithNL={renderWithNL}
|
renderWithNL={renderWithNL}
|
||||||
onClick={() => showDetails(log)}
|
onClick={() => showDetails(log)}
|
||||||
|
showSingleTab={showSingleTab}
|
||||||
|
getTabNum={getTabNum}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</VList>
|
</VList>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { LogLevel, ILog } from 'Player';
|
import { LogLevel, ILog } from 'Player';
|
||||||
import BottomBlock from '../BottomBlock';
|
import BottomBlock from '../BottomBlock';
|
||||||
import { Tabs, Input, Icon, NoContent } from 'UI';
|
import { Tabs, Input, NoContent } from 'UI';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import ConsoleRow from '../ConsoleRow';
|
import ConsoleRow from '../ConsoleRow';
|
||||||
import { IOSPlayerContext, MobilePlayerContext } from 'App/components/Session/playerContext';
|
import {
|
||||||
|
IOSPlayerContext,
|
||||||
|
MobilePlayerContext,
|
||||||
|
} from 'App/components/Session/playerContext';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { VList, VListHandle } from 'virtua';
|
import { VList, VListHandle } from 'virtua';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
|
|
@ -12,6 +15,7 @@ import ErrorDetailsModal from 'App/components/Dashboard/components/Errors/ErrorD
|
||||||
import { useModal } from 'App/components/Modal';
|
import { useModal } from 'App/components/Modal';
|
||||||
import useAutoscroll, { getLastItemTime } from '../useAutoscroll';
|
import useAutoscroll, { getLastItemTime } from '../useAutoscroll';
|
||||||
import { useRegExListFilterMemo, useTabListFilterMemo } from '../useListFilter';
|
import { useRegExListFilterMemo, useTabListFilterMemo } from '../useListFilter';
|
||||||
|
import { InfoCircleOutlined, SearchOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
const ALL = 'ALL';
|
const ALL = 'ALL';
|
||||||
const INFO = 'INFO';
|
const INFO = 'INFO';
|
||||||
|
|
@ -26,7 +30,10 @@ const LEVEL_TAB = {
|
||||||
[LogLevel.EXCEPTION]: ERRORS,
|
[LogLevel.EXCEPTION]: ERRORS,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const TABS = [ALL, ERRORS, WARNINGS, INFO].map((tab) => ({ text: tab, key: tab }));
|
const TABS = [ALL, ERRORS, WARNINGS, INFO].map((tab) => ({
|
||||||
|
text: tab,
|
||||||
|
key: tab,
|
||||||
|
}));
|
||||||
|
|
||||||
function renderWithNL(s: string | null = '') {
|
function renderWithNL(s: string | null = '') {
|
||||||
if (typeof s !== 'string') return '';
|
if (typeof s !== 'string') return '';
|
||||||
|
|
@ -73,20 +80,23 @@ function MobileConsolePanel() {
|
||||||
const [isDetailsModalActive, setIsDetailsModalActive] = useState(false);
|
const [isDetailsModalActive, setIsDetailsModalActive] = useState(false);
|
||||||
const { showModal } = useModal();
|
const { showModal } = useModal();
|
||||||
|
|
||||||
const { player, store } = React.useContext<IOSPlayerContext>(MobilePlayerContext);
|
const { player, store } =
|
||||||
|
React.useContext<IOSPlayerContext>(MobilePlayerContext);
|
||||||
const jump = (t: number) => player.jump(t);
|
const jump = (t: number) => player.jump(t);
|
||||||
|
|
||||||
const {
|
const { logList, logListNow, exceptionsListNow } = store.get();
|
||||||
logList,
|
|
||||||
logListNow,
|
|
||||||
exceptionsListNow,
|
|
||||||
} = store.get();
|
|
||||||
|
|
||||||
const list = logList as ILog[];
|
const list = logList as ILog[];
|
||||||
let filteredList = useRegExListFilterMemo(list, (l) => l.value, filter);
|
let filteredList = useRegExListFilterMemo(list, (l) => l.value, filter);
|
||||||
filteredList = useTabListFilterMemo(filteredList, (l) => LEVEL_TAB[l.level], ALL, activeTab);
|
filteredList = useTabListFilterMemo(
|
||||||
|
filteredList,
|
||||||
|
(l) => LEVEL_TAB[l.level],
|
||||||
|
ALL,
|
||||||
|
activeTab
|
||||||
|
);
|
||||||
|
|
||||||
const onTabClick = (activeTab: any) => devTools.update(INDEX_KEY, { activeTab });
|
const onTabClick = (activeTab: any) =>
|
||||||
|
devTools.update(INDEX_KEY, { activeTab });
|
||||||
const onFilterChange = ({ target: { value } }: any) =>
|
const onFilterChange = ({ target: { value } }: any) =>
|
||||||
devTools.update(INDEX_KEY, { filter: value });
|
devTools.update(INDEX_KEY, { filter: value });
|
||||||
|
|
||||||
|
|
@ -136,34 +146,35 @@ function MobileConsolePanel() {
|
||||||
<BottomBlock.Header>
|
<BottomBlock.Header>
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<span className="font-semibold color-gray-medium mr-4">Console</span>
|
<span className="font-semibold color-gray-medium mr-4">Console</span>
|
||||||
<Tabs tabs={TABS} active={activeTab} onClick={onTabClick} border={false} />
|
<Tabs
|
||||||
|
tabs={TABS}
|
||||||
|
active={activeTab}
|
||||||
|
onClick={onTabClick}
|
||||||
|
border={false}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Input
|
<Input
|
||||||
className="input-small h-8"
|
className="rounded-lg"
|
||||||
placeholder="Filter by keyword"
|
placeholder="Filter by keyword"
|
||||||
icon="search"
|
|
||||||
name="filter"
|
name="filter"
|
||||||
height={28}
|
|
||||||
onChange={onFilterChange}
|
onChange={onFilterChange}
|
||||||
value={filter}
|
value={filter}
|
||||||
|
size="small"
|
||||||
|
prefix={<SearchOutlined className="text-neutral-400" />}
|
||||||
/>
|
/>
|
||||||
</BottomBlock.Header>
|
</BottomBlock.Header>
|
||||||
<BottomBlock.Content className="overflow-y-auto">
|
<BottomBlock.Content className="overflow-y-auto">
|
||||||
<NoContent
|
<NoContent
|
||||||
title={
|
title={
|
||||||
<div className="capitalize flex items-center mt-16">
|
<div className="capitalize flex items-center mt-16 gap-2">
|
||||||
<Icon name="info-circle" className="mr-2" size="18" />
|
<InfoCircleOutlined size={18} />
|
||||||
No Data
|
No Data
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
size="small"
|
size="small"
|
||||||
show={filteredList.length === 0}
|
show={filteredList.length === 0}
|
||||||
>
|
>
|
||||||
<VList
|
<VList ref={_list} itemSize={25} count={filteredList.length || 1}>
|
||||||
ref={_list}
|
|
||||||
itemSize={25}
|
|
||||||
count={filteredList.length || 1}
|
|
||||||
>
|
|
||||||
{filteredList.map((log, index) => (
|
{filteredList.map((log, index) => (
|
||||||
<ConsoleRow
|
<ConsoleRow
|
||||||
key={log.time + index}
|
key={log.time + index}
|
||||||
|
|
@ -172,6 +183,7 @@ function MobileConsolePanel() {
|
||||||
iconProps={getIconProps(log.level)}
|
iconProps={getIconProps(log.level)}
|
||||||
renderWithNL={renderWithNL}
|
renderWithNL={renderWithNL}
|
||||||
onClick={() => showDetails(log)}
|
onClick={() => showDetails(log)}
|
||||||
|
showSingleTab
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</VList>
|
</VList>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ import React, { useState } from 'react';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import { Icon } from 'UI';
|
import { Icon } from 'UI';
|
||||||
import JumpButton from 'Shared/DevTools/JumpButton';
|
import JumpButton from 'Shared/DevTools/JumpButton';
|
||||||
|
import { Tag } from 'antd';
|
||||||
|
import TabTag from "../TabTag";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
log: any;
|
log: any;
|
||||||
|
|
@ -10,6 +12,8 @@ interface Props {
|
||||||
renderWithNL?: any;
|
renderWithNL?: any;
|
||||||
style?: any;
|
style?: any;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
|
getTabNum?: (tab: string) => number;
|
||||||
|
showSingleTab: boolean;
|
||||||
}
|
}
|
||||||
function ConsoleRow(props: Props) {
|
function ConsoleRow(props: Props) {
|
||||||
const { log, iconProps, jump, renderWithNL, style } = props;
|
const { log, iconProps, jump, renderWithNL, style } = props;
|
||||||
|
|
@ -41,11 +45,13 @@ function ConsoleRow(props: Props) {
|
||||||
|
|
||||||
const titleLine = lines[0];
|
const titleLine = lines[0];
|
||||||
const restLines = lines.slice(1);
|
const restLines = lines.slice(1);
|
||||||
|
const logSource = props.showSingleTab ? -1 : props.getTabNum?.(log.tabId);
|
||||||
|
const logTabId = log.tabId
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={style}
|
style={style}
|
||||||
className={cn(
|
className={cn(
|
||||||
'border-b flex items-start py-1 px-4 pe-8 overflow-hidden group relative',
|
'border-b border-neutral-950/5 flex items-start gap-2 py-1 px-4 pe-8 overflow-hidden group relative',
|
||||||
{
|
{
|
||||||
info: !log.isYellow && !log.isRed,
|
info: !log.isYellow && !log.isRed,
|
||||||
warn: log.isYellow,
|
warn: log.isYellow,
|
||||||
|
|
@ -55,11 +61,10 @@ function ConsoleRow(props: Props) {
|
||||||
)}
|
)}
|
||||||
onClick={clickable ? () => (!!log.errorId ? props.onClick?.() : toggleExpand()) : undefined}
|
onClick={clickable ? () => (!!log.errorId ? props.onClick?.() : toggleExpand()) : undefined}
|
||||||
>
|
>
|
||||||
<div className="mr-2">
|
{logSource !== -1 && <TabTag logSource={logSource} logTabId={logTabId} />}
|
||||||
<Icon size="14" {...iconProps} />
|
<Icon size="14" {...iconProps} className='mt-0.5' />
|
||||||
</div>
|
|
||||||
<div key={log.key} data-scroll-item={log.isRed}>
|
<div key={log.key} data-scroll-item={log.isRed}>
|
||||||
<div className="flex items-start text-sm ">
|
<div className="flex items-start text-sm">
|
||||||
<div className={cn('flex items-start', { 'cursor-pointer underline decoration-dotted decoration-gray-400': !!log.errorId })}>
|
<div className={cn('flex items-start', { 'cursor-pointer underline decoration-dotted decoration-gray-400': !!log.errorId })}>
|
||||||
{canExpand && (
|
{canExpand && (
|
||||||
<Icon name={expanded ? 'caret-down-fill' : 'caret-right-fill'} className="mr-2" />
|
<Icon name={expanded ? 'caret-down-fill' : 'caret-right-fill'} className="mr-2" />
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Icon, Tooltip } from 'UI';
|
import { Tooltip } from 'UI';
|
||||||
import { shortDurationFromMs } from "App/date";
|
import { CaretRightOutlined } from '@ant-design/icons';
|
||||||
|
import { Button } from 'antd';
|
||||||
|
import { shortDurationFromMs } from 'App/date';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
onClick: any;
|
onClick: any;
|
||||||
|
|
@ -12,19 +14,24 @@ function JumpButton(props: Props) {
|
||||||
return (
|
return (
|
||||||
<div className="absolute right-2 top-0 bottom-0 my-auto flex items-center">
|
<div className="absolute right-2 top-0 bottom-0 my-auto flex items-center">
|
||||||
<Tooltip title={tooltip} disabled={!tooltip}>
|
<Tooltip title={tooltip} disabled={!tooltip}>
|
||||||
<div
|
<Button
|
||||||
className="border cursor-pointer hidden group-hover:flex rounded bg-white text-xs items-center px-2 py-1 color-teal hover:shadow h-6"
|
type="default"
|
||||||
|
size="small"
|
||||||
|
className="hidden group-hover:flex rounded-lg text-xs p-1 py-0 gap-0 h-6"
|
||||||
|
iconPosition="end"
|
||||||
onClick={(e: any) => {
|
onClick={(e: any) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
props.onClick();
|
props.onClick();
|
||||||
}}
|
}}
|
||||||
|
icon={<CaretRightOutlined />}
|
||||||
>
|
>
|
||||||
<Icon name="caret-right-fill" size="12" color="teal" />
|
JUMP
|
||||||
<span>JUMP</span>
|
</Button>
|
||||||
</div>
|
{props.time ? (
|
||||||
{props.time ? <div className={'block group-hover:hidden mr-2'}>
|
<div className={'block group-hover:hidden mr-2 text-sm'}>
|
||||||
{shortDurationFromMs(props.time)}
|
{shortDurationFromMs(props.time)}
|
||||||
</div> : null}
|
</div>
|
||||||
|
) : null}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { ResourceType, Timed } from 'Player';
|
import { ResourceType, Timed } from 'Player';
|
||||||
import MobilePlayer from 'Player/mobile/IOSPlayer';
|
import MobilePlayer from 'Player/mobile/IOSPlayer';
|
||||||
import WebPlayer from 'Player/web/WebPlayer';
|
import WebPlayer from 'Player/web/WebPlayer';
|
||||||
import { Duration } from 'luxon';
|
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import React, { useMemo, useState } from 'react';
|
import React, { useMemo, useState } from 'react';
|
||||||
|
|
||||||
|
|
@ -13,17 +12,19 @@ import {
|
||||||
import { formatMs } from 'App/date';
|
import { formatMs } from 'App/date';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
import { formatBytes } from 'App/utils';
|
import { formatBytes } from 'App/utils';
|
||||||
import { Icon, Input, NoContent, Tabs, Toggler, Tooltip } from 'UI';
|
import { Icon, NoContent, Tabs } from 'UI';
|
||||||
|
import { Tooltip, Input, Switch, Form } from 'antd';
|
||||||
|
import { SearchOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import FetchDetailsModal from 'Shared/FetchDetailsModal';
|
import FetchDetailsModal from 'Shared/FetchDetailsModal';
|
||||||
import { WsChannel } from "App/player/web/messages";
|
import { WsChannel } from 'App/player/web/messages';
|
||||||
|
|
||||||
import BottomBlock from '../BottomBlock';
|
import BottomBlock from '../BottomBlock';
|
||||||
import InfoLine from '../BottomBlock/InfoLine';
|
import InfoLine from '../BottomBlock/InfoLine';
|
||||||
|
import TabSelector from '../TabSelector';
|
||||||
import TimeTable from '../TimeTable';
|
import TimeTable from '../TimeTable';
|
||||||
import useAutoscroll, { getLastItemTime } from '../useAutoscroll';
|
import useAutoscroll, { getLastItemTime } from '../useAutoscroll';
|
||||||
import { useRegExListFilterMemo, useTabListFilterMemo } from '../useListFilter';
|
import { useRegExListFilterMemo, useTabListFilterMemo } from '../useListFilter';
|
||||||
import WSModal from './WSModal';
|
|
||||||
import WSPanel from './WSPanel';
|
import WSPanel from './WSPanel';
|
||||||
|
|
||||||
const INDEX_KEY = 'network';
|
const INDEX_KEY = 'network';
|
||||||
|
|
@ -57,12 +58,6 @@ export const NETWORK_TABS = TAP_KEYS.map((tab) => ({
|
||||||
const DOM_LOADED_TIME_COLOR = 'teal';
|
const DOM_LOADED_TIME_COLOR = 'teal';
|
||||||
const LOAD_TIME_COLOR = 'red';
|
const LOAD_TIME_COLOR = 'red';
|
||||||
|
|
||||||
function compare(a: any, b: any, key: string) {
|
|
||||||
if (a[key] > b[key]) return 1;
|
|
||||||
if (a[key] < b[key]) return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function renderType(r: any) {
|
export function renderType(r: any) {
|
||||||
return (
|
return (
|
||||||
<Tooltip style={{ width: '100%' }} title={<div>{r.type}</div>}>
|
<Tooltip style={{ width: '100%' }} title={<div>{r.type}</div>}>
|
||||||
|
|
@ -79,14 +74,6 @@ export function renderName(r: any) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderStart(r: any) {
|
|
||||||
return (
|
|
||||||
<div className="flex justify-between items-center grow-0 w-full">
|
|
||||||
<span>{Duration.fromMillis(r.time).toFormat('mm:ss.SSS')}</span>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderSize(r: any) {
|
function renderSize(r: any) {
|
||||||
if (r.responseBodySize) return formatBytes(r.responseBodySize);
|
if (r.responseBodySize) return formatBytes(r.responseBodySize);
|
||||||
let triggerText;
|
let triggerText;
|
||||||
|
|
@ -125,13 +112,10 @@ export function renderDuration(r: any) {
|
||||||
if (!r.isRed && !r.isYellow) return text;
|
if (!r.isRed && !r.isYellow) return text;
|
||||||
|
|
||||||
let tooltipText;
|
let tooltipText;
|
||||||
let className = 'w-full h-full flex items-center ';
|
|
||||||
if (r.isYellow) {
|
if (r.isYellow) {
|
||||||
tooltipText = 'Slower than average';
|
tooltipText = 'Slower than average';
|
||||||
className += 'warn color-orange';
|
|
||||||
} else {
|
} else {
|
||||||
tooltipText = 'Much slower than average';
|
tooltipText = 'Much slower than average';
|
||||||
className += 'error color-red';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -151,7 +135,7 @@ function renderStatus({
|
||||||
error?: string;
|
error?: string;
|
||||||
}) {
|
}) {
|
||||||
const displayedStatus = error ? (
|
const displayedStatus = error ? (
|
||||||
<Tooltip delay={0} title={error}>
|
<Tooltip title={error}>
|
||||||
<div
|
<div
|
||||||
style={{ width: 90 }}
|
style={{ width: 90 }}
|
||||||
className={'overflow-hidden overflow-ellipsis'}
|
className={'overflow-hidden overflow-ellipsis'}
|
||||||
|
|
@ -165,7 +149,7 @@ function renderStatus({
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{cached ? (
|
{cached ? (
|
||||||
<Tooltip title={'Served from cache'}>
|
<Tooltip title={'Served from cache'} placement="top">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<span className="mr-1">{displayedStatus}</span>
|
<span className="mr-1">{displayedStatus}</span>
|
||||||
<Icon name="wifi" size={16} />
|
<Icon name="wifi" size={16} />
|
||||||
|
|
@ -178,13 +162,10 @@ function renderStatus({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function NetworkPanelCont({
|
function NetworkPanelCont({ panelHeight }: { panelHeight: number }) {
|
||||||
panelHeight,
|
|
||||||
}: {
|
|
||||||
panelHeight: number;
|
|
||||||
}) {
|
|
||||||
const { player, store } = React.useContext(PlayerContext);
|
const { player, store } = React.useContext(PlayerContext);
|
||||||
const { sessionStore } = useStore();
|
const { sessionStore, uiPlayerStore } = useStore();
|
||||||
|
|
||||||
const startedAt = sessionStore.current.startedAt;
|
const startedAt = sessionStore.current.startedAt;
|
||||||
const {
|
const {
|
||||||
domContentLoadedTime,
|
domContentLoadedTime,
|
||||||
|
|
@ -192,7 +173,12 @@ function NetworkPanelCont({
|
||||||
domBuildingTime,
|
domBuildingTime,
|
||||||
tabStates,
|
tabStates,
|
||||||
currentTab,
|
currentTab,
|
||||||
|
tabNames,
|
||||||
} = store.get();
|
} = store.get();
|
||||||
|
const tabsArr = Object.keys(tabStates);
|
||||||
|
const tabValues = Object.values(tabStates);
|
||||||
|
const dataSource = uiPlayerStore.dataSource;
|
||||||
|
const showSingleTab = dataSource === 'current';
|
||||||
const {
|
const {
|
||||||
fetchList = [],
|
fetchList = [],
|
||||||
resourceList = [],
|
resourceList = [],
|
||||||
|
|
@ -200,8 +186,34 @@ function NetworkPanelCont({
|
||||||
resourceListNow = [],
|
resourceListNow = [],
|
||||||
websocketList = [],
|
websocketList = [],
|
||||||
websocketListNow = [],
|
websocketListNow = [],
|
||||||
} = tabStates[currentTab];
|
} = React.useMemo(() => {
|
||||||
|
if (showSingleTab) {
|
||||||
|
return tabStates[currentTab] ?? {};
|
||||||
|
} else {
|
||||||
|
const fetchList = tabValues.flatMap((tab) => tab.fetchList);
|
||||||
|
const resourceList = tabValues.flatMap((tab) => tab.resourceList);
|
||||||
|
const fetchListNow = tabValues
|
||||||
|
.flatMap((tab) => tab.fetchListNow)
|
||||||
|
.filter(Boolean);
|
||||||
|
const resourceListNow = tabValues
|
||||||
|
.flatMap((tab) => tab.resourceListNow)
|
||||||
|
.filter(Boolean);
|
||||||
|
const websocketList = tabValues.flatMap((tab) => tab.websocketList);
|
||||||
|
const websocketListNow = tabValues
|
||||||
|
.flatMap((tab) => tab.websocketListNow)
|
||||||
|
.filter(Boolean);
|
||||||
|
return {
|
||||||
|
fetchList,
|
||||||
|
resourceList,
|
||||||
|
fetchListNow,
|
||||||
|
resourceListNow,
|
||||||
|
websocketList,
|
||||||
|
websocketListNow,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, [currentTab, tabStates, dataSource, tabValues]);
|
||||||
|
const getTabNum = (tab: string) => tabsArr.findIndex((t) => t === tab) + 1;
|
||||||
|
const getTabName = (tabId: string) => tabNames[tabId]
|
||||||
return (
|
return (
|
||||||
<NetworkPanelComp
|
<NetworkPanelComp
|
||||||
loadTime={loadTime}
|
loadTime={loadTime}
|
||||||
|
|
@ -216,15 +228,14 @@ function NetworkPanelCont({
|
||||||
startedAt={startedAt}
|
startedAt={startedAt}
|
||||||
websocketList={websocketList as WSMessage[]}
|
websocketList={websocketList as WSMessage[]}
|
||||||
websocketListNow={websocketListNow as WSMessage[]}
|
websocketListNow={websocketListNow as WSMessage[]}
|
||||||
|
getTabNum={getTabNum}
|
||||||
|
getTabName={getTabName}
|
||||||
|
showSingleTab={showSingleTab}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function MobileNetworkPanelCont({
|
function MobileNetworkPanelCont({ panelHeight }: { panelHeight: number }) {
|
||||||
panelHeight,
|
|
||||||
}: {
|
|
||||||
panelHeight: number;
|
|
||||||
}) {
|
|
||||||
const { player, store } = React.useContext(MobilePlayerContext);
|
const { player, store } = React.useContext(MobilePlayerContext);
|
||||||
const { uiPlayerStore, sessionStore } = useStore();
|
const { uiPlayerStore, sessionStore } = useStore();
|
||||||
const startedAt = sessionStore.current.startedAt;
|
const startedAt = sessionStore.current.startedAt;
|
||||||
|
|
@ -301,6 +312,9 @@ interface Props {
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
activeOutsideIndex?: number;
|
activeOutsideIndex?: number;
|
||||||
isSpot?: boolean;
|
isSpot?: boolean;
|
||||||
|
getTabNum?: (tab: string) => number;
|
||||||
|
getTabName?: (tabId: string) => string;
|
||||||
|
showSingleTab?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NetworkPanelComp = observer(
|
export const NetworkPanelComp = observer(
|
||||||
|
|
@ -323,8 +337,13 @@ export const NetworkPanelComp = observer(
|
||||||
onClose,
|
onClose,
|
||||||
activeOutsideIndex,
|
activeOutsideIndex,
|
||||||
isSpot,
|
isSpot,
|
||||||
|
getTabNum,
|
||||||
|
showSingleTab,
|
||||||
|
getTabName,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const [selectedWsChannel, setSelectedWsChannel] = React.useState<WsChannel[] | null>(null)
|
const [selectedWsChannel, setSelectedWsChannel] = React.useState<
|
||||||
|
WsChannel[] | null
|
||||||
|
>(null);
|
||||||
const { showModal } = useModal();
|
const { showModal } = useModal();
|
||||||
const [showOnlyErrors, setShowOnlyErrors] = useState(false);
|
const [showOnlyErrors, setShowOnlyErrors] = useState(false);
|
||||||
|
|
||||||
|
|
@ -480,10 +499,10 @@ export const NetworkPanelComp = observer(
|
||||||
const showDetailsModal = (item: any) => {
|
const showDetailsModal = (item: any) => {
|
||||||
if (item.type === 'websocket') {
|
if (item.type === 'websocket') {
|
||||||
const socketMsgList = websocketList.filter(
|
const socketMsgList = websocketList.filter(
|
||||||
(ws) => ws.channelName === item.channelName
|
(ws) => ws.channelName === item.channelName
|
||||||
);
|
);
|
||||||
|
|
||||||
return setSelectedWsChannel(socketMsgList)
|
return setSelectedWsChannel(socketMsgList);
|
||||||
}
|
}
|
||||||
setIsDetailsModalActive(true);
|
setIsDetailsModalActive(true);
|
||||||
showModal(
|
showModal(
|
||||||
|
|
@ -507,6 +526,61 @@ export const NetworkPanelComp = observer(
|
||||||
stopAutoscroll();
|
stopAutoscroll();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const tableCols = React.useMemo(() => {
|
||||||
|
const cols: any[] = [
|
||||||
|
{
|
||||||
|
label: 'Status',
|
||||||
|
dataKey: 'status',
|
||||||
|
width: 90,
|
||||||
|
render: renderStatus,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Type',
|
||||||
|
dataKey: 'type',
|
||||||
|
width: 90,
|
||||||
|
render: renderType,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Method',
|
||||||
|
width: 80,
|
||||||
|
dataKey: 'method',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Name',
|
||||||
|
width: 240,
|
||||||
|
dataKey: 'name',
|
||||||
|
render: renderName,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Size',
|
||||||
|
width: 80,
|
||||||
|
dataKey: 'decodedBodySize',
|
||||||
|
render: renderSize,
|
||||||
|
hidden: activeTab === XHR,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Duration',
|
||||||
|
width: 80,
|
||||||
|
dataKey: 'duration',
|
||||||
|
render: renderDuration,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
if (!showSingleTab && !isSpot) {
|
||||||
|
cols.unshift({
|
||||||
|
label: 'Source',
|
||||||
|
width: 64,
|
||||||
|
render: (r: Record<string, any>) => (
|
||||||
|
<Tooltip title={`${getTabName?.(r.tabId) ?? `Tab ${getTabNum?.(r.tabId) ?? 0}`}`} placement="left">
|
||||||
|
<div className="bg-gray-light rounded-full min-w-5 min-h-5 w-5 h-5 flex items-center justify-center text-xs cursor-default">
|
||||||
|
{getTabNum?.(r.tabId) ?? 0}
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return cols;
|
||||||
|
}, [showSingleTab]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BottomBlock
|
<BottomBlock
|
||||||
style={{ height: '100%' }}
|
style={{ height: '100%' }}
|
||||||
|
|
@ -529,26 +603,39 @@ export const NetworkPanelComp = observer(
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Input
|
<div className={'flex items-center gap-2'}>
|
||||||
className="input-small"
|
{!isMobile && !isSpot ? <TabSelector /> : null}
|
||||||
placeholder="Filter by name, type, method or value"
|
<Input
|
||||||
icon="search"
|
className="rounded-lg"
|
||||||
name="filter"
|
placeholder="Filter by name, type, method or value"
|
||||||
onChange={onFilterChange}
|
name="filter"
|
||||||
height={28}
|
onChange={onFilterChange}
|
||||||
width={280}
|
width={280}
|
||||||
value={filter}
|
value={filter}
|
||||||
/>
|
size="small"
|
||||||
|
prefix={<SearchOutlined className="text-neutral-400" />}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</BottomBlock.Header>
|
</BottomBlock.Header>
|
||||||
<BottomBlock.Content>
|
<BottomBlock.Content>
|
||||||
<div className="flex items-center justify-between px-4 border-b bg-teal/5 h-8">
|
<div className="flex items-center justify-between px-4 border-b bg-teal/5 h-8">
|
||||||
<div>
|
<div>
|
||||||
<Toggler
|
<Form.Item name="show-errors-only" className="mb-0">
|
||||||
checked={showOnlyErrors}
|
<label
|
||||||
name="show-errors-only"
|
style={{
|
||||||
onChange={() => setShowOnlyErrors(!showOnlyErrors)}
|
display: 'flex',
|
||||||
label="4xx-5xx Only"
|
alignItems: 'center',
|
||||||
/>
|
cursor: 'pointer',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Switch
|
||||||
|
checked={showOnlyErrors}
|
||||||
|
onChange={() => setShowOnlyErrors(!showOnlyErrors)}
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
<span className="text-sm ms-2">4xx-5xx Only</span>
|
||||||
|
</label>
|
||||||
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
<InfoLine>
|
<InfoLine>
|
||||||
<InfoLine.Point
|
<InfoLine.Point
|
||||||
|
|
@ -588,8 +675,8 @@ export const NetworkPanelComp = observer(
|
||||||
</div>
|
</div>
|
||||||
<NoContent
|
<NoContent
|
||||||
title={
|
title={
|
||||||
<div className="capitalize flex items-center">
|
<div className="capitalize flex items-center gap-2">
|
||||||
<Icon name="info-circle" className="mr-2" size="18" />
|
<InfoCircleOutlined size={18} />
|
||||||
No Data
|
No Data
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -613,52 +700,13 @@ export const NetworkPanelComp = observer(
|
||||||
}}
|
}}
|
||||||
activeIndex={activeIndex}
|
activeIndex={activeIndex}
|
||||||
>
|
>
|
||||||
{[
|
{tableCols}
|
||||||
// {
|
|
||||||
// label: 'Start',
|
|
||||||
// width: 120,
|
|
||||||
// render: renderStart,
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
label: 'Status',
|
|
||||||
dataKey: 'status',
|
|
||||||
width: 90,
|
|
||||||
render: renderStatus,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Type',
|
|
||||||
dataKey: 'type',
|
|
||||||
width: 90,
|
|
||||||
render: renderType,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Method',
|
|
||||||
width: 80,
|
|
||||||
dataKey: 'method',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Name',
|
|
||||||
width: 240,
|
|
||||||
dataKey: 'name',
|
|
||||||
render: renderName,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Size',
|
|
||||||
width: 80,
|
|
||||||
dataKey: 'decodedBodySize',
|
|
||||||
render: renderSize,
|
|
||||||
hidden: activeTab === XHR,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Duration',
|
|
||||||
width: 80,
|
|
||||||
dataKey: 'duration',
|
|
||||||
render: renderDuration,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
</TimeTable>
|
</TimeTable>
|
||||||
{selectedWsChannel ? (
|
{selectedWsChannel ? (
|
||||||
<WSPanel socketMsgList={selectedWsChannel} onClose={() => setSelectedWsChannel(null)} />
|
<WSPanel
|
||||||
|
socketMsgList={selectedWsChannel}
|
||||||
|
onClose={() => setSelectedWsChannel(null)}
|
||||||
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</NoContent>
|
</NoContent>
|
||||||
</BottomBlock.Content>
|
</BottomBlock.Content>
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@ const lineLength = 40;
|
||||||
function WSPanel({ socketMsgList, onClose }: Props) {
|
function WSPanel({ socketMsgList, onClose }: Props) {
|
||||||
const [query, setQuery] = React.useState('');
|
const [query, setQuery] = React.useState('');
|
||||||
const [list, setList] = React.useState(socketMsgList);
|
const [list, setList] = React.useState(socketMsgList);
|
||||||
const [selectedRow, setSelectedRow] = React.useState<SocketMsg | null>(null);
|
const [selectedRow, setSelectedRow] = React.useState<{ msg: SocketMsg, id: number } | null>(null);
|
||||||
|
|
||||||
const onQueryChange = (e) => {
|
const onQueryChange = (e: any) => {
|
||||||
setQuery(e.target.value);
|
setQuery(e.target.value);
|
||||||
const newList = filterList(socketMsgList, e.target.value, [
|
const newList = filterList(socketMsgList, e.target.value, [
|
||||||
'data',
|
'data',
|
||||||
|
|
@ -69,15 +69,16 @@ function WSPanel({ socketMsgList, onClose }: Props) {
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{list.map((msg) => (
|
{list.map((msg, i) => (
|
||||||
<Row
|
<Row
|
||||||
msg={msg}
|
msg={msg}
|
||||||
key={msg.timestamp}
|
key={msg.timestamp}
|
||||||
onSelect={() => setSelectedRow(msg)}
|
onSelect={() => setSelectedRow({ msg, id: i })}
|
||||||
|
isSelected={selectedRow ? selectedRow.id === i : false}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
{selectedRow ? (
|
{selectedRow ? (
|
||||||
<SelectedRow msg={selectedRow} onClose={() => setSelectedRow(null)} />
|
<SelectedRow msg={selectedRow.msg} onClose={() => setSelectedRow(null)} />
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -127,7 +128,7 @@ function MsgDirection({ dir }: { dir: 'up' | 'down' }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Row({ msg, onSelect }: { msg: SocketMsg; onSelect: () => void }) {
|
function Row({ msg, onSelect, isSelected }: { msg: SocketMsg; isSelected: boolean; onSelect: () => void }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|
@ -149,7 +150,7 @@ function Row({ msg, onSelect }: { msg: SocketMsg; onSelect: () => void }) {
|
||||||
'rounded-full font-bold text-xl p-2 bg-white w-6 h-6 flex items-center justify-center'
|
'rounded-full font-bold text-xl p-2 bg-white w-6 h-6 flex items-center justify-center'
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<span>{isOpen ? '-' : '+'}</span>
|
<span>{isSelected ? '-' : '+'}</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
import { Timed } from 'Player';
|
import { Timed } from 'Player';
|
||||||
import React, { useEffect, useMemo, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { Tabs, Input, NoContent, Icon } from 'UI';
|
import { Tabs, NoContent, Icon } from 'UI';
|
||||||
import { PlayerContext, MobilePlayerContext } from 'App/components/Session/playerContext';
|
import { Input } from 'antd';
|
||||||
|
import { SearchOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
||||||
|
import {
|
||||||
|
PlayerContext,
|
||||||
|
MobilePlayerContext,
|
||||||
|
} from 'App/components/Session/playerContext';
|
||||||
import BottomBlock from '../BottomBlock';
|
import BottomBlock from '../BottomBlock';
|
||||||
import { useModal } from 'App/components/Modal';
|
import { useModal } from 'App/components/Modal';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
|
|
@ -10,6 +15,7 @@ import { typeList } from 'Types/session/stackEvent';
|
||||||
import StackEventRow from 'Shared/DevTools/StackEventRow';
|
import StackEventRow from 'Shared/DevTools/StackEventRow';
|
||||||
|
|
||||||
import StackEventModal from '../StackEventModal';
|
import StackEventModal from '../StackEventModal';
|
||||||
|
import { Segmented, Tooltip } from 'antd';
|
||||||
import useAutoscroll, { getLastItemTime } from '../useAutoscroll';
|
import useAutoscroll, { getLastItemTime } from '../useAutoscroll';
|
||||||
import { useRegExListFilterMemo, useTabListFilterMemo } from '../useListFilter';
|
import { useRegExListFilterMemo, useTabListFilterMemo } from '../useListFilter';
|
||||||
import { VList, VListHandle } from 'virtua';
|
import { VList, VListHandle } from 'virtua';
|
||||||
|
|
@ -24,198 +30,247 @@ const ALL = 'ALL';
|
||||||
const TAB_KEYS = [ALL, ...typeList] as const;
|
const TAB_KEYS = [ALL, ...typeList] as const;
|
||||||
const TABS = TAB_KEYS.map((tab) => ({ text: tab, key: tab }));
|
const TABS = TAB_KEYS.map((tab) => ({ text: tab, key: tab }));
|
||||||
|
|
||||||
type EventsList = Array<Timed & { name: string; source: string; key: string; payload?: string[] }>;
|
type EventsList = Array<
|
||||||
|
Timed & { name: string; source: string; key: string; payload?: string[] }
|
||||||
|
>;
|
||||||
|
|
||||||
const WebStackEventPanelComp = observer(
|
const WebStackEventPanelComp = observer(() => {
|
||||||
() => {
|
const { uiPlayerStore } = useStore();
|
||||||
const { uiPlayerStore } = useStore();
|
const zoomEnabled = uiPlayerStore.timelineZoom.enabled;
|
||||||
const zoomEnabled = uiPlayerStore.timelineZoom.enabled;
|
const zoomStartTs = uiPlayerStore.timelineZoom.startTs;
|
||||||
const zoomStartTs = uiPlayerStore.timelineZoom.startTs;
|
const zoomEndTs = uiPlayerStore.timelineZoom.endTs;
|
||||||
const zoomEndTs = uiPlayerStore.timelineZoom.endTs;
|
const { player, store } = React.useContext(PlayerContext);
|
||||||
const { player, store } = React.useContext(PlayerContext);
|
const jump = (t: number) => player.jump(t);
|
||||||
const jump = (t: number) => player.jump(t);
|
const { currentTab, tabStates } = store.get();
|
||||||
const { currentTab, tabStates } = store.get();
|
|
||||||
|
|
||||||
const { stackList: list = [], stackListNow: listNow = [] } = tabStates[currentTab];
|
const { stackList: list = [], stackListNow: listNow = [] } =
|
||||||
|
tabStates[currentTab];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EventsPanel
|
<EventsPanel
|
||||||
list={list as EventsList}
|
list={list as EventsList}
|
||||||
listNow={listNow as EventsList}
|
listNow={listNow as EventsList}
|
||||||
jump={jump}
|
jump={jump}
|
||||||
zoomEnabled={zoomEnabled}
|
zoomEnabled={zoomEnabled}
|
||||||
zoomStartTs={zoomStartTs}
|
zoomStartTs={zoomStartTs}
|
||||||
zoomEndTs={zoomEndTs}
|
zoomEndTs={zoomEndTs}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
export const WebStackEventPanel = WebStackEventPanelComp;
|
export const WebStackEventPanel = WebStackEventPanelComp;
|
||||||
|
|
||||||
const MobileStackEventPanelComp = observer(
|
const MobileStackEventPanelComp = observer(() => {
|
||||||
() => {
|
const { uiPlayerStore } = useStore();
|
||||||
const { uiPlayerStore } = useStore();
|
const zoomEnabled = uiPlayerStore.timelineZoom.enabled;
|
||||||
const zoomEnabled = uiPlayerStore.timelineZoom.enabled;
|
const zoomStartTs = uiPlayerStore.timelineZoom.startTs;
|
||||||
const zoomStartTs = uiPlayerStore.timelineZoom.startTs;
|
const zoomEndTs = uiPlayerStore.timelineZoom.endTs;
|
||||||
const zoomEndTs = uiPlayerStore.timelineZoom.endTs;
|
const { player, store } = React.useContext(MobilePlayerContext);
|
||||||
const { player, store } = React.useContext(MobilePlayerContext);
|
const jump = (t: number) => player.jump(t);
|
||||||
const jump = (t: number) => player.jump(t);
|
const { eventList: list = [], eventListNow: listNow = [] } = store.get();
|
||||||
const { eventList: list = [], eventListNow: listNow = [] } = store.get();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EventsPanel
|
<EventsPanel
|
||||||
list={list as EventsList}
|
list={list as EventsList}
|
||||||
listNow={listNow as EventsList}
|
listNow={listNow as EventsList}
|
||||||
jump={jump}
|
jump={jump}
|
||||||
zoomEnabled={zoomEnabled}
|
isMobile
|
||||||
zoomStartTs={zoomStartTs}
|
zoomEnabled={zoomEnabled}
|
||||||
zoomEndTs={zoomEndTs}
|
zoomStartTs={zoomStartTs}
|
||||||
/>
|
zoomEndTs={zoomEndTs}
|
||||||
);
|
/>
|
||||||
}
|
);
|
||||||
);
|
});
|
||||||
|
|
||||||
export const MobileStackEventPanel = MobileStackEventPanelComp;
|
export const MobileStackEventPanel = MobileStackEventPanelComp;
|
||||||
|
|
||||||
const EventsPanel = observer(({
|
const EventsPanel = observer(
|
||||||
list,
|
({
|
||||||
listNow,
|
list,
|
||||||
jump,
|
listNow,
|
||||||
zoomEnabled,
|
jump,
|
||||||
zoomStartTs,
|
zoomEnabled,
|
||||||
zoomEndTs,
|
zoomStartTs,
|
||||||
}: {
|
zoomEndTs,
|
||||||
list: EventsList;
|
isMobile,
|
||||||
listNow: EventsList;
|
}: {
|
||||||
jump: (t: number) => void;
|
list: EventsList;
|
||||||
zoomEnabled: boolean;
|
listNow: EventsList;
|
||||||
zoomStartTs: number;
|
jump: (t: number) => void;
|
||||||
zoomEndTs: number;
|
zoomEnabled: boolean;
|
||||||
}) => {
|
zoomStartTs: number;
|
||||||
const {
|
zoomEndTs: number;
|
||||||
sessionStore: { devTools },
|
isMobile?: boolean;
|
||||||
} = useStore();
|
}) => {
|
||||||
const { showModal } = useModal();
|
const {
|
||||||
const [isDetailsModalActive, setIsDetailsModalActive] = useState(false); // TODO:embed that into useModal
|
sessionStore: { devTools },
|
||||||
const filter = devTools[INDEX_KEY].filter;
|
} = useStore();
|
||||||
const activeTab = devTools[INDEX_KEY].activeTab;
|
const { showModal } = useModal();
|
||||||
const activeIndex = devTools[INDEX_KEY].index;
|
const [isDetailsModalActive, setIsDetailsModalActive] = useState(false); // TODO:embed that into useModal
|
||||||
|
const filter = devTools[INDEX_KEY].filter;
|
||||||
|
const activeTab = devTools[INDEX_KEY].activeTab;
|
||||||
|
const activeIndex = devTools[INDEX_KEY].index;
|
||||||
|
|
||||||
const inZoomRangeList = list.filter(({ time }) =>
|
const inZoomRangeList = list.filter(({ time }) =>
|
||||||
zoomEnabled ? zoomStartTs <= time && time <= zoomEndTs : true
|
zoomEnabled ? zoomStartTs <= time && time <= zoomEndTs : true
|
||||||
);
|
);
|
||||||
const inZoomRangeListNow = listNow.filter(({ time }) =>
|
const inZoomRangeListNow = listNow.filter(({ time }) =>
|
||||||
zoomEnabled ? zoomStartTs <= time && time <= zoomEndTs : true
|
zoomEnabled ? zoomStartTs <= time && time <= zoomEndTs : true
|
||||||
);
|
);
|
||||||
|
|
||||||
let filteredList = useRegExListFilterMemo(inZoomRangeList, (it) => {
|
let filteredList = useRegExListFilterMemo(
|
||||||
const searchBy = [it.name]
|
inZoomRangeList,
|
||||||
if (it.payload) {
|
(it) => {
|
||||||
const payload = Array.isArray(it.payload) ? it.payload.join(',') : JSON.stringify(it.payload);
|
const searchBy = [it.name];
|
||||||
searchBy.push(payload);
|
if (it.payload) {
|
||||||
}
|
const payload = Array.isArray(it.payload)
|
||||||
return searchBy
|
? it.payload.join(',')
|
||||||
}, filter);
|
: JSON.stringify(it.payload);
|
||||||
filteredList = useTabListFilterMemo(filteredList, (it) => it.source, ALL, activeTab);
|
searchBy.push(payload);
|
||||||
|
}
|
||||||
const onTabClick = (activeTab: (typeof TAB_KEYS)[number]) =>
|
return searchBy;
|
||||||
devTools.update(INDEX_KEY, { activeTab });
|
|
||||||
const onFilterChange = ({ target: { value } }: React.ChangeEvent<HTMLInputElement>) => devTools.update(INDEX_KEY, { filter: value });
|
|
||||||
const tabs = useMemo(
|
|
||||||
() => TABS.filter(({ key }) => key === ALL || inZoomRangeList.some(({ source }) => key === source)),
|
|
||||||
[inZoomRangeList.length]
|
|
||||||
);
|
|
||||||
|
|
||||||
const [timeoutStartAutoscroll, stopAutoscroll] = useAutoscroll(
|
|
||||||
filteredList,
|
|
||||||
getLastItemTime(inZoomRangeListNow),
|
|
||||||
activeIndex,
|
|
||||||
(index) => devTools.update(INDEX_KEY, { index })
|
|
||||||
);
|
|
||||||
const onMouseEnter = stopAutoscroll;
|
|
||||||
const onMouseLeave = () => {
|
|
||||||
if (isDetailsModalActive) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
timeoutStartAutoscroll();
|
|
||||||
};
|
|
||||||
|
|
||||||
const showDetails = (item: any) => {
|
|
||||||
setIsDetailsModalActive(true);
|
|
||||||
showModal(<StackEventModal event={item} />, {
|
|
||||||
right: true,
|
|
||||||
width: 500,
|
|
||||||
onClose: () => {
|
|
||||||
setIsDetailsModalActive(false);
|
|
||||||
timeoutStartAutoscroll();
|
|
||||||
},
|
},
|
||||||
});
|
filter
|
||||||
devTools.update(INDEX_KEY, { index: filteredList.indexOf(item) });
|
);
|
||||||
stopAutoscroll();
|
filteredList = useTabListFilterMemo(
|
||||||
};
|
filteredList,
|
||||||
|
(it) => it.source,
|
||||||
|
ALL,
|
||||||
|
activeTab
|
||||||
|
);
|
||||||
|
|
||||||
const _list = React.useRef<VListHandle>(null);
|
const onTabClick = (activeTab: (typeof TAB_KEYS)[number]) =>
|
||||||
useEffect(() => {
|
devTools.update(INDEX_KEY, { activeTab });
|
||||||
if (_list.current) {
|
const onFilterChange = ({
|
||||||
_list.current.scrollToIndex(activeIndex);
|
target: { value },
|
||||||
}
|
}: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
}, [activeIndex]);
|
devTools.update(INDEX_KEY, { filter: value });
|
||||||
|
const tabs = useMemo(
|
||||||
|
() =>
|
||||||
|
TABS.filter(
|
||||||
|
({ key }) =>
|
||||||
|
key === ALL || inZoomRangeList.some(({ source }) => key === source)
|
||||||
|
),
|
||||||
|
[inZoomRangeList.length]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
const [timeoutStartAutoscroll, stopAutoscroll] = useAutoscroll(
|
||||||
<BottomBlock style={{ height: '100%' }} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
|
filteredList,
|
||||||
<BottomBlock.Header>
|
getLastItemTime(inZoomRangeListNow),
|
||||||
<div className="flex items-center">
|
activeIndex,
|
||||||
<span className="font-semibold color-gray-medium mr-4">Stack Events</span>
|
(index) => devTools.update(INDEX_KEY, { index })
|
||||||
<Tabs
|
);
|
||||||
renameTab={mapNames}
|
const onMouseEnter = stopAutoscroll;
|
||||||
tabs={tabs}
|
const onMouseLeave = () => {
|
||||||
active={activeTab}
|
if (isDetailsModalActive) {
|
||||||
onClick={onTabClick}
|
return;
|
||||||
border={false}
|
}
|
||||||
/>
|
timeoutStartAutoscroll();
|
||||||
</div>
|
};
|
||||||
<Input
|
|
||||||
className="input-small h-8"
|
const showDetails = (item: any) => {
|
||||||
placeholder="Filter by keyword"
|
setIsDetailsModalActive(true);
|
||||||
icon="search"
|
showModal(<StackEventModal event={item} />, {
|
||||||
name="filter"
|
right: true,
|
||||||
height={28}
|
width: 500,
|
||||||
onChange={onFilterChange}
|
onClose: () => {
|
||||||
value={filter}
|
setIsDetailsModalActive(false);
|
||||||
/>
|
timeoutStartAutoscroll();
|
||||||
</BottomBlock.Header>
|
},
|
||||||
<BottomBlock.Content className="overflow-y-auto">
|
});
|
||||||
<NoContent
|
devTools.update(INDEX_KEY, { index: filteredList.indexOf(item) });
|
||||||
title={
|
stopAutoscroll();
|
||||||
<div className="capitalize flex items-center mt-16">
|
};
|
||||||
<Icon name="info-circle" className="mr-2" size="18" />
|
|
||||||
No Data
|
const _list = React.useRef<VListHandle>(null);
|
||||||
</div>
|
useEffect(() => {
|
||||||
}
|
if (_list.current) {
|
||||||
size="small"
|
_list.current.scrollToIndex(activeIndex);
|
||||||
show={filteredList.length === 0}
|
}
|
||||||
>
|
}, [activeIndex]);
|
||||||
<VList
|
|
||||||
ref={_list}
|
return (
|
||||||
count={filteredList.length || 1}
|
<BottomBlock
|
||||||
>
|
style={{ height: '100%' }}
|
||||||
{filteredList.map((item, index) => (
|
onMouseEnter={onMouseEnter}
|
||||||
<StackEventRow
|
onMouseLeave={onMouseLeave}
|
||||||
isActive={activeIndex === index}
|
>
|
||||||
key={item.key}
|
<BottomBlock.Header>
|
||||||
event={item}
|
<div className="flex items-center">
|
||||||
onJump={() => {
|
<span className="font-semibold color-gray-medium mr-4">
|
||||||
stopAutoscroll();
|
Stack Events
|
||||||
devTools.update(INDEX_KEY, { index: filteredList.indexOf(item) });
|
</span>
|
||||||
jump(item.time);
|
<Tabs
|
||||||
}}
|
renameTab={mapNames}
|
||||||
onClick={() => showDetails(item)}
|
tabs={tabs}
|
||||||
|
active={activeTab}
|
||||||
|
onClick={onTabClick}
|
||||||
|
border={false}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className={'flex items-center gap-2'}>
|
||||||
|
{isMobile ? null : (
|
||||||
|
<Segmented
|
||||||
|
options={[
|
||||||
|
{ label: 'All Tabs', value: 'all' },
|
||||||
|
{
|
||||||
|
label: (
|
||||||
|
<Tooltip title="Stack Events overview is available only for all tabs combined.">
|
||||||
|
<span>Current Tab</span>
|
||||||
|
</Tooltip>
|
||||||
|
),
|
||||||
|
value: 'current',
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
defaultValue="all"
|
||||||
|
size="small"
|
||||||
|
className="rounded-full font-medium"
|
||||||
/>
|
/>
|
||||||
))}
|
)}
|
||||||
</VList>
|
<Input
|
||||||
</NoContent>
|
className="rounded-lg"
|
||||||
</BottomBlock.Content>
|
placeholder="Filter by keyword"
|
||||||
</BottomBlock>
|
name="filter"
|
||||||
);
|
height={28}
|
||||||
});
|
onChange={onFilterChange}
|
||||||
|
value={filter}
|
||||||
|
size="small"
|
||||||
|
prefix={<SearchOutlined className="text-neutral-400" />}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</BottomBlock.Header>
|
||||||
|
<BottomBlock.Content className="overflow-y-auto">
|
||||||
|
<NoContent
|
||||||
|
title={
|
||||||
|
<div className="capitalize flex items-center mt-16 gap-2">
|
||||||
|
<InfoCircleOutlined size={18} />
|
||||||
|
No Data
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
size="small"
|
||||||
|
show={filteredList.length === 0}
|
||||||
|
>
|
||||||
|
<VList ref={_list} count={filteredList.length || 1}>
|
||||||
|
{filteredList.map((item, index) => (
|
||||||
|
<StackEventRow
|
||||||
|
isActive={activeIndex === index}
|
||||||
|
key={item.key}
|
||||||
|
event={item}
|
||||||
|
onJump={() => {
|
||||||
|
stopAutoscroll();
|
||||||
|
devTools.update(INDEX_KEY, {
|
||||||
|
index: filteredList.indexOf(item),
|
||||||
|
});
|
||||||
|
jump(item.time);
|
||||||
|
}}
|
||||||
|
onClick={() => showDetails(item)}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</VList>
|
||||||
|
</NoContent>
|
||||||
|
</BottomBlock.Content>
|
||||||
|
</BottomBlock>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
|
||||||
22
frontend/app/components/shared/DevTools/TabSelector.tsx
Normal file
22
frontend/app/components/shared/DevTools/TabSelector.tsx
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
import React from 'react'
|
||||||
|
import { Segmented } from 'antd'
|
||||||
|
import { useStore } from 'App/mstore';
|
||||||
|
import { observer } from 'mobx-react-lite';
|
||||||
|
|
||||||
|
function TabSelector() {
|
||||||
|
const { uiPlayerStore } = useStore();
|
||||||
|
const currentValue = uiPlayerStore.dataSource;
|
||||||
|
const options = [
|
||||||
|
{ label: 'All Tabs', value: 'all' },
|
||||||
|
{ label: 'Current Tab', value: 'current' }
|
||||||
|
]
|
||||||
|
|
||||||
|
const onChange = (value: 'all' | 'current') => {
|
||||||
|
uiPlayerStore.changeDataSource(value)
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Segmented options={options} value={currentValue} onChange={onChange} className='font-medium rounded-lg' size='small' />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default observer(TabSelector)
|
||||||
23
frontend/app/components/shared/DevTools/TabTag.tsx
Normal file
23
frontend/app/components/shared/DevTools/TabTag.tsx
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { Tooltip } from 'antd';
|
||||||
|
import { observer } from 'mobx-react-lite';
|
||||||
|
import { PlayerContext } from 'Components/Session/playerContext';
|
||||||
|
|
||||||
|
function TabTag({ logSource, logTabId }: { logSource: number; logTabId: string }) {
|
||||||
|
const { store } = React.useContext(PlayerContext);
|
||||||
|
const { tabNames } = store.get();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tooltip title={`${tabNames[logTabId] ?? `Tab ${logSource}`}`} placement="left">
|
||||||
|
<div
|
||||||
|
className={
|
||||||
|
'bg-gray-light rounded-full min-w-5 min-h-5 w-5 h-5 flex items-center justify-center text-xs cursor-default'
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{logSource}
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default observer(TabTag);
|
||||||
|
|
@ -199,7 +199,7 @@ export default class TimeTable extends React.PureComponent<Props, State> {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'dev-row border-b border-color-gray-light-shade group items-center',
|
'dev-row border-b border-neutral-950/5 group items-center text-sm',
|
||||||
stl.row,
|
stl.row,
|
||||||
{
|
{
|
||||||
[stl.hoverable]: hoverable,
|
[stl.hoverable]: hoverable,
|
||||||
|
|
@ -215,7 +215,7 @@ export default class TimeTable extends React.PureComponent<Props, State> {
|
||||||
{columns
|
{columns
|
||||||
.filter((i: any) => !i.hidden)
|
.filter((i: any) => !i.hidden)
|
||||||
.map(({ dataKey, render, width, label }) => (
|
.map(({ dataKey, render, width, label }) => (
|
||||||
<div key={parseInt(label.replace(' ', '')+dataKey, 36)} className={cn(stl.cell, 'overflow-ellipsis overflow-hidden')} style={{ width: `${width}px` }}>
|
<div key={parseInt(label.replace(' ', '')+dataKey, 36)} className={cn(stl.cell, 'overflow-ellipsis overflow-hidden !py-0.5')} style={{ width: `${width}px` }}>
|
||||||
{render
|
{render
|
||||||
? render(row)
|
? render(row)
|
||||||
: row[dataKey || ''] || <i className="color-gray-light">{'empty'}</i>}
|
: row[dataKey || ''] || <i className="color-gray-light">{'empty'}</i>}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,11 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
// import Select from 'Shared/Select';
|
import { MenuProps, Select } from 'antd';
|
||||||
import { Dropdown, MenuProps, Select, Space } from 'antd';
|
|
||||||
import { DownOutlined, SmileOutlined } from '@ant-design/icons';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
payload: any;
|
payload: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
function NodeDropdown(props: Props) {
|
function NodeDropdown(props: Props) {
|
||||||
const items: MenuProps['items'] = [
|
|
||||||
{
|
|
||||||
key: '1',
|
|
||||||
label: (
|
|
||||||
<a target='_blank' rel='noopener noreferrer' href='https://www.antgroup.com'>
|
|
||||||
1st menu item
|
|
||||||
</a>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
];
|
|
||||||
return (
|
return (
|
||||||
<Select style={{ width: 120 }} placeholder='Slect Event' dropdownStyle={{
|
<Select style={{ width: 120 }} placeholder='Slect Event' dropdownStyle={{
|
||||||
border: 'none'
|
border: 'none'
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ function LiveSessionList() {
|
||||||
const totalLiveSessions = sessionStore.totalLiveSessions;
|
const totalLiveSessions = sessionStore.totalLiveSessions;
|
||||||
const loading = sessionStore.loadingLiveSessions;
|
const loading = sessionStore.loadingLiveSessions;
|
||||||
const { currentPage } = searchStoreLive;
|
const { currentPage } = searchStoreLive;
|
||||||
const metaList = customFieldStore.list
|
const metaList = customFieldStore.list;
|
||||||
const metaListLoading = customFieldStore.isLoading;
|
const metaListLoading = customFieldStore.isLoading;
|
||||||
|
|
||||||
let timeoutId: any;
|
let timeoutId: any;
|
||||||
|
|
@ -32,7 +32,7 @@ function LiveSessionList() {
|
||||||
const hasUserFilter = filters.map((i: any) => i.key).includes(KEYS.USERID);
|
const hasUserFilter = filters.map((i: any) => i.key).includes(KEYS.USERID);
|
||||||
const sortOptions = [{ label: 'Start Time', value: 'timestamp' }].concat(
|
const sortOptions = [{ label: 'Start Time', value: 'timestamp' }].concat(
|
||||||
metaList
|
metaList
|
||||||
.map(({ key} : any) => ({
|
.map(({ key }: any) => ({
|
||||||
label: capitalize(key),
|
label: capitalize(key),
|
||||||
value: key
|
value: key
|
||||||
}))
|
}))
|
||||||
|
|
@ -40,21 +40,33 @@ function LiveSessionList() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (metaListLoading) return;
|
if (metaListLoading) return;
|
||||||
|
|
||||||
const _filter = { ...filter };
|
const _filter = { ...filter };
|
||||||
|
let shouldUpdate = false;
|
||||||
|
|
||||||
|
// Set default sort if not already set
|
||||||
if (sortOptions[1] && !filter.sort) {
|
if (sortOptions[1] && !filter.sort) {
|
||||||
_filter.sort = sortOptions[1].value;
|
_filter.sort = sortOptions[1].value;
|
||||||
|
shouldUpdate = true;
|
||||||
}
|
}
|
||||||
searchStoreLive.edit(_filter);
|
|
||||||
|
// Only update filters if there's a change
|
||||||
|
if (shouldUpdate) {
|
||||||
|
searchStoreLive.edit(_filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start auto-refresh timeout
|
||||||
timeout();
|
timeout();
|
||||||
|
|
||||||
|
// Cleanup on component unmount or re-run
|
||||||
return () => {
|
return () => {
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
};
|
};
|
||||||
}, [metaListLoading]);
|
}, [metaListLoading, filter.sort]); // Add necessary dependencies
|
||||||
|
|
||||||
const refetch = () => {
|
const refetch = () => {
|
||||||
searchStoreLive.edit({ ...filter })
|
|
||||||
void searchStoreLive.fetchSessions();
|
void searchStoreLive.fetchSessions();
|
||||||
}
|
};
|
||||||
|
|
||||||
const onUserClick = (userId: string, userAnonymousId: string) => {
|
const onUserClick = (userId: string, userAnonymousId: string) => {
|
||||||
if (userId) {
|
if (userId) {
|
||||||
|
|
@ -66,7 +78,6 @@ function LiveSessionList() {
|
||||||
|
|
||||||
const onSortChange = ({ value }: any) => {
|
const onSortChange = ({ value }: any) => {
|
||||||
searchStoreLive.edit({ sort: value.value });
|
searchStoreLive.edit({ sort: value.value });
|
||||||
void searchStoreLive.fetchSessions();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const timeout = () => {
|
const timeout = () => {
|
||||||
|
|
@ -102,8 +113,7 @@ function LiveSessionList() {
|
||||||
<div className="mx-2" />
|
<div className="mx-2" />
|
||||||
<SortOrderButton
|
<SortOrderButton
|
||||||
onChange={(state: any) => {
|
onChange={(state: any) => {
|
||||||
searchStoreLive.edit({ order: state })
|
searchStoreLive.edit({ order: state });
|
||||||
void searchStoreLive.fetchSessions();
|
|
||||||
}}
|
}}
|
||||||
sortOrder={filter.order}
|
sortOrder={filter.order}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ function LiveSessionSearch() {
|
||||||
|
|
||||||
const onUpdateFilter = (filterIndex: number, filter: any) => {
|
const onUpdateFilter = (filterIndex: number, filter: any) => {
|
||||||
searchStoreLive.updateFilter(filterIndex, filter);
|
searchStoreLive.updateFilter(filterIndex, filter);
|
||||||
void searchStoreLive.fetchSessions();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRemoveFilter = (filterIndex: number) => {
|
const onRemoveFilter = (filterIndex: number) => {
|
||||||
|
|
@ -33,16 +32,12 @@ function LiveSessionSearch() {
|
||||||
searchStoreLive.edit({
|
searchStoreLive.edit({
|
||||||
filters: newFilters
|
filters: newFilters
|
||||||
});
|
});
|
||||||
|
|
||||||
void searchStoreLive.fetchSessions();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChangeEventsOrder = (e: any, { name, value }: any) => {
|
const onChangeEventsOrder = (e: any, { name, value }: any) => {
|
||||||
searchStoreLive.edit({
|
searchStoreLive.edit({
|
||||||
eventsOrder: value
|
eventsOrder: value
|
||||||
});
|
});
|
||||||
|
|
||||||
void searchStoreLive.fetchSessions();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (hasEvents || hasFilters) ? (
|
return (hasEvents || hasFilters) ? (
|
||||||
|
|
|
||||||
|
|
@ -11,50 +11,57 @@ import { useStore } from 'App/mstore';
|
||||||
import { debounce } from 'App/utils';
|
import { debounce } from 'App/utils';
|
||||||
import useSessionSearchQueryHandler from 'App/hooks/useSessionSearchQueryHandler';
|
import useSessionSearchQueryHandler from 'App/hooks/useSessionSearchQueryHandler';
|
||||||
|
|
||||||
let debounceFetch: any = () => {
|
let debounceFetch: () => void;
|
||||||
};
|
|
||||||
|
|
||||||
function SessionSearch() {
|
function SessionSearch() {
|
||||||
const { tagWatchStore, aiFiltersStore, searchStore, customFieldStore, projectsStore } = useStore();
|
const { tagWatchStore, aiFiltersStore, searchStore, customFieldStore, projectsStore } = useStore();
|
||||||
const appliedFilter = searchStore.instance;
|
const appliedFilter = searchStore.instance;
|
||||||
const metaLoading = customFieldStore.isLoading;
|
const metaLoading = customFieldStore.isLoading;
|
||||||
const hasEvents = appliedFilter.filters.filter((i: any) => i.isEvent).length > 0;
|
const hasEvents = appliedFilter.filters.some((i: any) => i.isEvent);
|
||||||
const hasFilters = appliedFilter.filters.filter((i: any) => !i.isEvent).length > 0;
|
const hasFilters = appliedFilter.filters.some((i: any) => !i.isEvent);
|
||||||
const saveRequestPayloads = projectsStore.instance?.saveRequestPayloads ?? false;
|
const saveRequestPayloads = projectsStore.instance?.saveRequestPayloads ?? false;
|
||||||
|
|
||||||
useSessionSearchQueryHandler({
|
useSessionSearchQueryHandler({
|
||||||
appliedFilter,
|
appliedFilter,
|
||||||
loading: metaLoading,
|
loading: metaLoading,
|
||||||
onBeforeLoad: async () => {
|
onBeforeLoad: async () => {
|
||||||
const tags = await tagWatchStore.getTags();
|
try {
|
||||||
if (tags) {
|
const tags = await tagWatchStore.getTags();
|
||||||
addOptionsToFilter(
|
if (tags) {
|
||||||
FilterKey.TAGGED_ELEMENT,
|
addOptionsToFilter(
|
||||||
tags.map((tag) => ({
|
FilterKey.TAGGED_ELEMENT,
|
||||||
label: tag.name,
|
tags.map((tag) => ({
|
||||||
value: tag.tagId.toString()
|
label: tag.name,
|
||||||
}))
|
value: tag.tagId.toString()
|
||||||
);
|
}))
|
||||||
searchStore.refreshFilterOptions();
|
);
|
||||||
|
searchStore.refreshFilterOptions();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error during onBeforeLoad:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
debounceFetch = debounce(() => searchStore.fetchSessions(), 500);
|
debounceFetch = debounce(() => searchStore.fetchSessions(), 500);
|
||||||
// void searchStore.fetchSessions(true)
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (searchStore.urlParsed) return;
|
||||||
debounceFetch();
|
debounceFetch();
|
||||||
}, [appliedFilter.filters]);
|
}, [appliedFilter.filters]);
|
||||||
|
|
||||||
const onAddFilter = (filter: any) => {
|
const onAddFilter = (filter: any) => {
|
||||||
searchStore.addFilter(filter);
|
searchStore.addFilter(filter);
|
||||||
|
|
||||||
|
debounceFetch();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onUpdateFilter = (filterIndex: any, filter: any) => {
|
const onUpdateFilter = (filterIndex: any, filter: any) => {
|
||||||
searchStore.updateFilter(filterIndex, filter);
|
searchStore.updateFilter(filterIndex, filter);
|
||||||
|
|
||||||
|
debounceFetch();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFilterMove = (newFilters: any) => {
|
const onFilterMove = (newFilters: any) => {
|
||||||
|
|
@ -85,49 +92,47 @@ function SessionSearch() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const showPanel = hasEvents || hasFilters || aiFiltersStore.isLoading;
|
const showPanel = hasEvents || hasFilters || aiFiltersStore.isLoading;
|
||||||
return !metaLoading ? (
|
|
||||||
<>
|
|
||||||
{showPanel ? (
|
|
||||||
<div className="border bg-white rounded-lg mt-4">
|
|
||||||
<div className="p-5">
|
|
||||||
{aiFiltersStore.isLoading ? (
|
|
||||||
<div className={'font-semibold flex items-center gap-2 mb-2'}>
|
|
||||||
<AnimatedSVG name={ICONS.LOADER} size={18} />
|
|
||||||
<span>Translating your query into search steps...</span>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
{hasEvents || hasFilters ? (
|
|
||||||
<FilterList
|
|
||||||
filter={appliedFilter}
|
|
||||||
onUpdateFilter={onUpdateFilter}
|
|
||||||
onRemoveFilter={onRemoveFilter}
|
|
||||||
onChangeEventsOrder={onChangeEventsOrder}
|
|
||||||
onFilterMove={onFilterMove}
|
|
||||||
saveRequestPayloads={saveRequestPayloads}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{hasEvents || hasFilters ? (
|
if (metaLoading) return null;
|
||||||
<div className="border-t px-5 py-1 flex items-center -mx-2">
|
if (!showPanel) return null;
|
||||||
<div>
|
|
||||||
<FilterSelection filter={undefined} onFilterClick={onAddFilter}>
|
return (
|
||||||
<Button variant="text-primary" className="mr-2" icon="plus">
|
<div className="border bg-white rounded-lg mt-4">
|
||||||
ADD STEP
|
<div className="p-5">
|
||||||
</Button>
|
{aiFiltersStore.isLoading ? (
|
||||||
</FilterSelection>
|
<div className={'font-semibold flex items-center gap-2 mb-2'}>
|
||||||
</div>
|
<AnimatedSVG name={ICONS.LOADER} size={18} />
|
||||||
<div className="ml-auto flex items-center">
|
<span>Translating your query into search steps...</span>
|
||||||
<SaveFilterButton />
|
</div>
|
||||||
</div>
|
) : null}
|
||||||
</div>
|
{hasEvents || hasFilters ? (
|
||||||
) : null}
|
<FilterList
|
||||||
|
filter={appliedFilter}
|
||||||
|
onUpdateFilter={onUpdateFilter}
|
||||||
|
onRemoveFilter={onRemoveFilter}
|
||||||
|
onChangeEventsOrder={onChangeEventsOrder}
|
||||||
|
onFilterMove={onFilterMove}
|
||||||
|
saveRequestPayloads={saveRequestPayloads}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{hasEvents || hasFilters ? (
|
||||||
|
<div className="border-t px-5 py-1 flex items-center -mx-2">
|
||||||
|
<div>
|
||||||
|
<FilterSelection filter={undefined} onFilterClick={onAddFilter}>
|
||||||
|
<Button variant="text-primary" className="mr-2" icon="plus">
|
||||||
|
ADD STEP
|
||||||
|
</Button>
|
||||||
|
</FilterSelection>
|
||||||
|
</div>
|
||||||
|
<div className="ml-auto flex items-center">
|
||||||
|
<SaveFilterButton />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : null}
|
||||||
<></>
|
</div>
|
||||||
)}
|
);
|
||||||
</>
|
|
||||||
) : null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default observer(SessionSearch);
|
export default observer(SessionSearch);
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,19 @@ import React from 'react';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
|
|
||||||
import LatestSessionsMessage from './components/LatestSessionsMessage';
|
import LatestSessionsMessage from './components/LatestSessionsMessage';
|
||||||
import NotesList from './components/Notes/NoteList';
|
|
||||||
import SessionHeader from './components/SessionHeader';
|
import SessionHeader from './components/SessionHeader';
|
||||||
import SessionList from './components/SessionList';
|
import SessionList from './components/SessionList';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
|
import NoSessionsMessage from 'Shared/NoSessionsMessage/NoSessionsMessage';
|
||||||
|
import MainSearchBar from 'Shared/MainSearchBar/MainSearchBar';
|
||||||
|
import SessionSearch from 'Shared/SessionSearch/SessionSearch';
|
||||||
|
import usePageTitle from '@/hooks/usePageTitle';
|
||||||
|
|
||||||
function SessionsTabOverview() {
|
function SessionsTabOverview() {
|
||||||
const [query, setQuery] = React.useState('');
|
const [query, setQuery] = React.useState('');
|
||||||
const { aiFiltersStore, searchStore } = useStore();
|
const { aiFiltersStore, searchStore } = useStore();
|
||||||
const appliedFilter = searchStore.instance;
|
const appliedFilter = searchStore.instance;
|
||||||
const isNotesRoute = searchStore.activeTab.type === 'notes';
|
usePageTitle('Sessions - OpenReplay');
|
||||||
|
|
||||||
const handleKeyDown = (event: any) => {
|
const handleKeyDown = (event: any) => {
|
||||||
if (event.key === 'Enter') {
|
if (event.key === 'Enter') {
|
||||||
|
|
@ -25,25 +28,27 @@ function SessionsTabOverview() {
|
||||||
|
|
||||||
const testingKey = localStorage.getItem('__mauricio_testing_access') === 'true';
|
const testingKey = localStorage.getItem('__mauricio_testing_access') === 'true';
|
||||||
return (
|
return (
|
||||||
<div className="widget-wrapper">
|
<>
|
||||||
{testingKey ? (
|
<NoSessionsMessage />
|
||||||
<Input
|
<MainSearchBar />
|
||||||
value={query}
|
<SessionSearch />
|
||||||
onKeyDown={handleKeyDown}
|
<div className="my-4" />
|
||||||
onChange={(e) => setQuery(e.target.value)}
|
<div className="widget-wrapper">
|
||||||
className={'mb-2'}
|
{testingKey ? (
|
||||||
placeholder={'ask session ai'}
|
<Input
|
||||||
/>
|
value={query}
|
||||||
) : null}
|
onKeyDown={handleKeyDown}
|
||||||
<SessionHeader />
|
onChange={(e) => setQuery(e.target.value)}
|
||||||
<div className="border-b" />
|
className={'mb-2'}
|
||||||
<LatestSessionsMessage />
|
placeholder={'ask session ai'}
|
||||||
{!isNotesRoute ? (
|
/>
|
||||||
|
) : null}
|
||||||
|
<SessionHeader />
|
||||||
|
<div className="border-b" />
|
||||||
|
<LatestSessionsMessage />
|
||||||
<SessionList />
|
<SessionList />
|
||||||
) : (
|
</div>
|
||||||
<NotesList />
|
</>
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import SessionList from 'Shared/SessionsTabOverview/components/SessionList/SessionList';
|
||||||
|
import NoteTags from 'Shared/SessionsTabOverview/components/Notes/NoteTags';
|
||||||
|
import { Loader, NoContent, Pagination } from 'UI';
|
||||||
|
import AnimatedSVG from 'Shared/AnimatedSVG';
|
||||||
|
import { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
|
||||||
|
import NoteItem from 'Shared/SessionsTabOverview/components/Notes/NoteItem';
|
||||||
|
import { useStore } from '@/mstore';
|
||||||
|
import { observer } from 'mobx-react-lite';
|
||||||
|
import SessionItem from 'Shared/SessionItem/SessionItem';
|
||||||
|
import usePageTitle from '@/hooks/usePageTitle';
|
||||||
|
|
||||||
|
function Bookmarks() {
|
||||||
|
const { projectsStore, sessionStore, customFieldStore, userStore, searchStore } = useStore();
|
||||||
|
const isEnterprise = userStore.isEnterprise;
|
||||||
|
const isLoggedIn = userStore.isLoggedIn;
|
||||||
|
const bookmarks = sessionStore.bookmarks;
|
||||||
|
|
||||||
|
usePageTitle('Bookmarks - OpenReplay');
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
void sessionStore.fetchBookmarkedSessions();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="widget-wrapper">
|
||||||
|
<div className="flex items-center px-4 py-1 justify-between w-full">
|
||||||
|
<h2 className="text-2xl capitalize mr-4">Bookmarks</h2>
|
||||||
|
</div>
|
||||||
|
<div className="border-b" />
|
||||||
|
<Loader loading={bookmarks.loading}>
|
||||||
|
<NoContent
|
||||||
|
show={bookmarks.list.length === 0}
|
||||||
|
title={
|
||||||
|
<div className="flex flex-col items-center justify-center">
|
||||||
|
{/* <Icon name="no-dashboard" size={80} color="figmaColors-accent-secondary" /> */}
|
||||||
|
<AnimatedSVG name={ICONS.NO_BOOKMARKS} size={60} />
|
||||||
|
<div className="text-center mt-4 text-lg font-medium">No sessions bookmarked</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="border-b rounded bg-white">
|
||||||
|
{bookmarks.list.map((session: any) => (
|
||||||
|
<div key={session.sessionId} className="border-b">
|
||||||
|
<SessionItem
|
||||||
|
session={session}
|
||||||
|
hasUserFilter={false}
|
||||||
|
// onUserClick={() => {}}
|
||||||
|
// metaList={metaList}
|
||||||
|
// lastPlayedSessionId={lastPlayedSessionId}
|
||||||
|
bookmarked={true}
|
||||||
|
// toggleFavorite={toggleFavorite}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="w-full flex items-center justify-between py-4 px-6">
|
||||||
|
<div className="text-disabled-text">
|
||||||
|
Showing{' '}
|
||||||
|
<span className="font-semibold">{Math.min(bookmarks.list.length, bookmarks.pageSize)}</span> out
|
||||||
|
of <span className="font-semibold">{bookmarks.total}</span> sessions.
|
||||||
|
</div>
|
||||||
|
<Pagination
|
||||||
|
page={bookmarks.page}
|
||||||
|
total={bookmarks.total}
|
||||||
|
onPageChange={(page) => sessionStore.updateBookmarksPage(page)}
|
||||||
|
limit={bookmarks.pageSize}
|
||||||
|
debounceRequest={100}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</NoContent>
|
||||||
|
</Loader>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default observer(Bookmarks);
|
||||||
|
|
@ -7,11 +7,16 @@ import { observer } from 'mobx-react-lite';
|
||||||
function LatestSessionsMessage() {
|
function LatestSessionsMessage() {
|
||||||
const { searchStore } = useStore();
|
const { searchStore } = useStore();
|
||||||
const count = searchStore.latestList.size;
|
const count = searchStore.latestList.size;
|
||||||
|
|
||||||
|
const onShowNewSessions = () => {
|
||||||
|
void searchStore.updateCurrentPage(1, true);
|
||||||
|
};
|
||||||
|
|
||||||
return count > 0 ? (
|
return count > 0 ? (
|
||||||
<div
|
<div
|
||||||
className="bg-amber-50 p-1 flex w-full border-b text-center justify-center link"
|
className="bg-amber-50 p-1 flex w-full border-b text-center justify-center link"
|
||||||
style={{ backgroundColor: 'rgb(255 251 235)' }}
|
style={{ backgroundColor: 'rgb(255 251 235)' }}
|
||||||
onClick={() => searchStore.updateCurrentPage(1)}
|
onClick={onShowNewSessions}
|
||||||
>
|
>
|
||||||
Show {numberWithCommas(count)} New {count > 1 ? 'Sessions' : 'Session'}
|
Show {numberWithCommas(count)} New {count > 1 ? 'Sessions' : 'Session'}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -5,57 +5,72 @@ import NoteItem from './NoteItem';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
|
import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
|
||||||
|
import NoteTags from 'Shared/SessionsTabOverview/components/Notes/NoteTags';
|
||||||
|
import usePageTitle from '@/hooks/usePageTitle';
|
||||||
|
|
||||||
function NotesList() {
|
function NotesList() {
|
||||||
|
usePageTitle('Notes - OpenReplay');
|
||||||
const { notesStore } = useStore();
|
const { notesStore } = useStore();
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
void notesStore.fetchNotes();
|
void notesStore.fetchNotes();
|
||||||
}, [notesStore.page]);
|
}, [notesStore.page]);
|
||||||
|
|
||||||
const list = notesStore.notes;
|
const list = notesStore.notes;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Loader loading={notesStore.loading}>
|
<>
|
||||||
<NoContent
|
<div className="widget-wrapper">
|
||||||
show={list.length === 0}
|
<div className="flex items-center px-4 py-1 justify-between w-full">
|
||||||
title={
|
<h2 className="text-2xl capitalize mr-4">Notes</h2>
|
||||||
<div className="flex flex-col items-center justify-center">
|
|
||||||
{/* <Icon name="no-dashboard" size={80} color="figmaColors-accent-secondary" /> */}
|
|
||||||
<AnimatedSVG name={ICONS.NO_NOTES} size={60} />
|
|
||||||
<div className="text-center mt-4 text-lg font-medium">No notes yet</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
subtext={
|
|
||||||
<div className="text-center flex justify-center items-center flex-col">
|
|
||||||
Note observations during session replays and share them with your team.
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className="border-b rounded bg-white">
|
|
||||||
{list.map((note) => (
|
|
||||||
<React.Fragment key={note.noteId}>
|
|
||||||
<NoteItem note={note} />
|
|
||||||
</React.Fragment>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="w-full flex items-center justify-between py-4 px-6">
|
<div className="flex items-center justify-end w-full">
|
||||||
<div className="text-disabled-text">
|
<NoteTags />
|
||||||
Showing{' '}
|
|
||||||
<span className="font-semibold">{Math.min(list.length, notesStore.pageSize)}</span> out
|
|
||||||
of <span className="font-semibold">{notesStore.total}</span> notes
|
|
||||||
</div>
|
</div>
|
||||||
<Pagination
|
|
||||||
page={notesStore.page}
|
|
||||||
total={notesStore.total}
|
|
||||||
onPageChange={(page) => notesStore.changePage(page)}
|
|
||||||
limit={notesStore.pageSize}
|
|
||||||
debounceRequest={100}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</NoContent>
|
<div className="border-b" />
|
||||||
</Loader>
|
<Loader loading={notesStore.loading}>
|
||||||
|
<NoContent
|
||||||
|
show={list.length === 0}
|
||||||
|
title={
|
||||||
|
<div className="flex flex-col items-center justify-center">
|
||||||
|
{/* <Icon name="no-dashboard" size={80} color="figmaColors-accent-secondary" /> */}
|
||||||
|
<AnimatedSVG name={ICONS.NO_NOTES} size={60} />
|
||||||
|
<div className="text-center mt-4 text-lg font-medium">No notes yet</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
subtext={
|
||||||
|
<div className="text-center flex justify-center items-center flex-col">
|
||||||
|
Note observations during session replays and share them with your team.
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="border-b rounded bg-white">
|
||||||
|
{list.map((note) => (
|
||||||
|
<React.Fragment key={note.noteId}>
|
||||||
|
<NoteItem note={note} />
|
||||||
|
</React.Fragment>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="w-full flex items-center justify-between py-4 px-6">
|
||||||
|
<div className="text-disabled-text">
|
||||||
|
Showing{' '}
|
||||||
|
<span className="font-semibold">{Math.min(list.length, notesStore.pageSize)}</span> out
|
||||||
|
of <span className="font-semibold">{notesStore.total}</span> notes
|
||||||
|
</div>
|
||||||
|
<Pagination
|
||||||
|
page={notesStore.page}
|
||||||
|
total={notesStore.total}
|
||||||
|
onPageChange={(page) => notesStore.changePage(page)}
|
||||||
|
limit={notesStore.pageSize}
|
||||||
|
debounceRequest={100}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</NoContent>
|
||||||
|
</Loader>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import React, { useMemo } from 'react';
|
||||||
import Period from 'Types/app/period';
|
import Period from 'Types/app/period';
|
||||||
import SelectDateRange from 'Shared/SelectDateRange';
|
import SelectDateRange from 'Shared/SelectDateRange';
|
||||||
import SessionTags from '../SessionTags';
|
import SessionTags from '../SessionTags';
|
||||||
import NoteTags from '../Notes/NoteTags';
|
|
||||||
import SessionSort from '../SessionSort';
|
import SessionSort from '../SessionSort';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useStore } from 'App/mstore';
|
import { useStore } from 'App/mstore';
|
||||||
|
|
@ -17,14 +16,12 @@ function SessionHeader() {
|
||||||
const period = Period({ start: startDate, end: endDate, rangeName: rangeValue });
|
const period = Period({ start: startDate, end: endDate, rangeName: rangeValue });
|
||||||
|
|
||||||
const title = useMemo(() => {
|
const title = useMemo(() => {
|
||||||
if (activeTab.type === 'notes') {
|
if (!activeTab) return;
|
||||||
return 'Notes';
|
|
||||||
}
|
|
||||||
if (activeTab.type === 'bookmarks') {
|
if (activeTab.type === 'bookmarks') {
|
||||||
return isEnterprise ? 'Vault' : 'Bookmarks';
|
return isEnterprise ? 'Vault' : 'Bookmarks';
|
||||||
}
|
}
|
||||||
return 'Sessions';
|
return 'Sessions';
|
||||||
}, [activeTab.type, isEnterprise]);
|
}, [isEnterprise, activeTab]);
|
||||||
|
|
||||||
const onDateChange = (e: any) => {
|
const onDateChange = (e: any) => {
|
||||||
const dateValues = e.toJSON();
|
const dateValues = e.toJSON();
|
||||||
|
|
@ -35,26 +32,15 @@ function SessionHeader() {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center px-4 py-1 justify-between w-full">
|
<div className="flex items-center px-4 py-1 justify-between w-full">
|
||||||
<h2 className="text-2xl capitalize mr-4">{title}</h2>
|
<h2 className="text-2xl capitalize mr-4">{title}</h2>
|
||||||
{activeTab.type !== 'notes' ? (
|
<div className="flex items-center w-full justify-end">
|
||||||
<div className="flex items-center w-full justify-end">
|
{activeTab?.type !== 'bookmarks' && <SessionTags />}
|
||||||
{activeTab.type !== 'bookmarks' && (
|
<div className="mr-auto" />
|
||||||
<>
|
<Space>
|
||||||
<SessionTags />
|
{activeTab?.type !== 'bookmarks' &&
|
||||||
<div className="mr-auto" />
|
<SelectDateRange isAnt period={period} onChange={onDateChange} right={true} />}
|
||||||
<Space>
|
<SessionSort />
|
||||||
<SelectDateRange isAnt period={period} onChange={onDateChange} right={true} />
|
</Space>
|
||||||
<SessionSort />
|
</div>
|
||||||
</Space>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
{activeTab.type === 'notes' && (
|
|
||||||
<div className="flex items-center justify-end w-full">
|
|
||||||
<NoteTags />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ function SessionList() {
|
||||||
}, [isBookmark, isVault, activeTab, location.pathname]);
|
}, [isBookmark, isVault, activeTab, location.pathname]);
|
||||||
const [statusData, setStatusData] = React.useState<SessionStatus>({ status: 0, count: 0 });
|
const [statusData, setStatusData] = React.useState<SessionStatus>({ status: 0, count: 0 });
|
||||||
|
|
||||||
|
|
||||||
const fetchStatus = async () => {
|
const fetchStatus = async () => {
|
||||||
const response = await sessionService.getRecordingStatus();
|
const response = await sessionService.getRecordingStatus();
|
||||||
setStatusData({
|
setStatusData({
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
import { DateTime, Duration } from 'luxon'; // TODO
|
import { DateTime, Duration } from 'luxon'; // TODO
|
||||||
import { Timezone } from 'App/mstore/types/sessionSettings';
|
import { Timezone } from 'App/mstore/types/sessionSettings';
|
||||||
|
import { LAST_24_HOURS, LAST_30_DAYS, LAST_7_DAYS } from 'Types/app/period';
|
||||||
|
import { CUSTOM_RANGE } from '@/dateRange';
|
||||||
|
|
||||||
export function getDateFromString(date: string, format = 'yyyy-MM-dd HH:mm:ss:SSS'): string {
|
export function getDateFromString(date: string, format = 'yyyy-MM-dd HH:mm:ss:SSS'): string {
|
||||||
return DateTime.fromISO(date).toFormat(format);
|
return DateTime.fromISO(date).toFormat(format);
|
||||||
|
|
@ -191,3 +193,35 @@ export const countDaysFrom = (timestamp: number): number => {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
return Math.round(Math.abs(d.getTime() - date.toJSDate().getTime()) / (1000 * 3600 * 24));
|
return Math.round(Math.abs(d.getTime() - date.toJSDate().getTime()) / (1000 * 3600 * 24));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const getDateRangeUTC = (rangeName: string, customStartDate?: number, customEndDate?: number): {
|
||||||
|
startDate: number;
|
||||||
|
endDate: number
|
||||||
|
} => {
|
||||||
|
let endDate = new Date().getTime();
|
||||||
|
let startDate: number;
|
||||||
|
|
||||||
|
switch (rangeName) {
|
||||||
|
case LAST_7_DAYS:
|
||||||
|
startDate = endDate - 7 * 24 * 60 * 60 * 1000;
|
||||||
|
break;
|
||||||
|
case LAST_30_DAYS:
|
||||||
|
startDate = endDate - 30 * 24 * 60 * 60 * 1000;
|
||||||
|
break;
|
||||||
|
case CUSTOM_RANGE:
|
||||||
|
if (!customStartDate || !customEndDate) {
|
||||||
|
throw new Error('Start date and end date must be provided for CUSTOM_RANGE.');
|
||||||
|
}
|
||||||
|
startDate = customStartDate;
|
||||||
|
endDate = customEndDate;
|
||||||
|
break;
|
||||||
|
case LAST_24_HOURS:
|
||||||
|
default:
|
||||||
|
startDate = endDate - 24 * 60 * 60 * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
startDate,
|
||||||
|
endDate
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,46 +6,59 @@ import Search from '@/mstore/types/search';
|
||||||
import { getFilterFromJson } from 'Types/filter/newFilter';
|
import { getFilterFromJson } from 'Types/filter/newFilter';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
onBeforeLoad?: () => Promise<any>;
|
onBeforeLoad?: () => Promise<void>;
|
||||||
appliedFilter: any;
|
appliedFilter: Record<string, any>;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useSessionSearchQueryHandler = (props: Props) => {
|
const useSessionSearchQueryHandler = ({ onBeforeLoad, appliedFilter, loading }: Props) => {
|
||||||
const { searchStore } = useStore();
|
const { searchStore } = useStore();
|
||||||
const [beforeHookLoaded, setBeforeHookLoaded] = useState(!props.onBeforeLoad);
|
const [beforeHookLoaded, setBeforeHookLoaded] = useState(!onBeforeLoad);
|
||||||
const { appliedFilter, loading } = props;
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
|
// Apply filter from the query string when the component mounts
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const applyFilterFromQuery = async () => {
|
const applyFilterFromQuery = async () => {
|
||||||
if (!loading && !searchStore.urlParsed) {
|
if (!loading && !searchStore.urlParsed) {
|
||||||
if (props.onBeforeLoad) {
|
try {
|
||||||
await props.onBeforeLoad();
|
if (onBeforeLoad) {
|
||||||
setBeforeHookLoaded(true);
|
await onBeforeLoad();
|
||||||
}
|
setBeforeHookLoaded(true);
|
||||||
|
}
|
||||||
|
|
||||||
const converter = JsonUrlConverter.urlParamsToJson(history.location.search);
|
const converter = JsonUrlConverter.urlParamsToJson(history.location.search);
|
||||||
const json: any = getFilterFromJson(converter.toJSON());
|
const json = getFilterFromJson(converter.toJSON());
|
||||||
const filter = new Search(json);
|
const filter = new Search(json);
|
||||||
searchStore.applyFilter(filter, true);
|
searchStore.applyFilter(filter, true);
|
||||||
searchStore.setUrlParsed()
|
searchStore.setUrlParsed();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error applying filter from query:', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void applyFilterFromQuery();
|
void applyFilterFromQuery();
|
||||||
}, [loading]);
|
}, [loading, onBeforeLoad, searchStore, history.location.search]);
|
||||||
|
|
||||||
|
// Update the URL whenever the appliedFilter changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const generateUrlQuery = () => {
|
const updateUrlWithFilter = () => {
|
||||||
if (!loading && beforeHookLoaded) {
|
if (!loading && beforeHookLoaded) {
|
||||||
const converter = JsonUrlConverter.jsonToUrlParams(appliedFilter);
|
const query = JsonUrlConverter.jsonToUrlParams(appliedFilter);
|
||||||
history.replace({ search: converter });
|
history.replace({ search: query });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
generateUrlQuery();
|
updateUrlWithFilter();
|
||||||
}, [appliedFilter, loading, beforeHookLoaded]);
|
}, [appliedFilter, loading, beforeHookLoaded, history]);
|
||||||
|
|
||||||
|
// Ensure the URL syncs on remount if already parsed
|
||||||
|
useEffect(() => {
|
||||||
|
if (searchStore.urlParsed) {
|
||||||
|
const query = JsonUrlConverter.jsonToUrlParams(appliedFilter);
|
||||||
|
history.replace({ search: query });
|
||||||
|
}
|
||||||
|
}, [appliedFilter, searchStore.urlParsed, history]);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ export default class FilterStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
setTopValues = (key: string, values: TopValue[]) => {
|
setTopValues = (key: string, values: TopValue[]) => {
|
||||||
this.topValues[key] = values.filter((value) => value !== null && value.value !== '');
|
this.topValues[key] = values?.filter((value) => value !== null && value.value !== '');
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchTopValues = async (key: string, source?: string) => {
|
fetchTopValues = async (key: string, source?: string) => {
|
||||||
|
|
|
||||||
|
|
@ -162,15 +162,14 @@ class SearchStore {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCurrentPage(page: number) {
|
updateCurrentPage(page: number, force = false) {
|
||||||
this.currentPage = page;
|
this.currentPage = page;
|
||||||
void this.fetchSessions();
|
void this.fetchSessions(force);
|
||||||
}
|
}
|
||||||
|
|
||||||
setActiveTab(tab: string) {
|
setActiveTab(tab: string) {
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
this.activeTab = TAB_MAP[tab];
|
this.activeTab = TAB_MAP[tab];
|
||||||
this.currentPage = 1;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,12 +228,13 @@ class SearchStore {
|
||||||
if (this.latestRequestTime) {
|
if (this.latestRequestTime) {
|
||||||
const period = Period({ rangeName: CUSTOM_RANGE, start: this.latestRequestTime, end: Date.now() });
|
const period = Period({ rangeName: CUSTOM_RANGE, start: this.latestRequestTime, end: Date.now() });
|
||||||
const newTimestamps: any = period.toJSON();
|
const newTimestamps: any = period.toJSON();
|
||||||
filter.startTimestamp = newTimestamps.startDate;
|
filter.startDate = newTimestamps.startDate;
|
||||||
filter.endTimestamp = newTimestamps.endDate;
|
filter.endDate = newTimestamps.endDate;
|
||||||
}
|
}
|
||||||
searchService.checkLatestSessions(filter).then((response: any) => {
|
searchService.checkLatestSessions(filter).then((response: any) => {
|
||||||
this.latestList = response;
|
runInAction(() => {
|
||||||
this.latestRequestTime = Date.now();
|
this.latestList = List(response);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -264,8 +264,10 @@ class SearchStore {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.currentPage = 1;
|
||||||
|
|
||||||
if (filter.value && filter.value[0] && filter.value[0] !== '') {
|
if (filter.value && filter.value[0] && filter.value[0] !== '') {
|
||||||
this.fetchSessions();
|
void this.fetchSessions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -327,6 +329,7 @@ class SearchStore {
|
||||||
|
|
||||||
if (this.activeTags[0] && this.activeTags[0] !== 'all') {
|
if (this.activeTags[0] && this.activeTags[0] !== 'all') {
|
||||||
const tagFilter = filtersMap[FilterKey.ISSUE];
|
const tagFilter = filtersMap[FilterKey.ISSUE];
|
||||||
|
tagFilter.type = tagFilter.type.toLowerCase();
|
||||||
tagFilter.value = [issues_types.find((i: any) => i.type === this.activeTags[0])?.type];
|
tagFilter.value = [issues_types.find((i: any) => i.type === this.activeTags[0])?.type];
|
||||||
delete tagFilter.operatorOptions;
|
delete tagFilter.operatorOptions;
|
||||||
delete tagFilter.options;
|
delete tagFilter.options;
|
||||||
|
|
@ -336,6 +339,9 @@ class SearchStore {
|
||||||
filter.filters = filter.filters.concat(tagFilter);
|
filter.filters = filter.filters.concat(tagFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.latestRequestTime = Date.now();
|
||||||
|
this.latestList = List();
|
||||||
|
|
||||||
await sessionStore.fetchSessions({
|
await sessionStore.fetchSessions({
|
||||||
...filter,
|
...filter,
|
||||||
page: this.currentPage,
|
page: this.currentPage,
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@ import { FilterCategory, FilterKey } from 'Types/filter/filterType';
|
||||||
import {
|
import {
|
||||||
filtersMap,
|
filtersMap,
|
||||||
generateFilterOptions,
|
generateFilterOptions,
|
||||||
liveFiltersMap,
|
liveFiltersMap
|
||||||
} from 'Types/filter/newFilter';
|
} from 'Types/filter/newFilter';
|
||||||
import { List } from 'immutable';
|
import { List } from 'immutable';
|
||||||
import { makeAutoObservable } from 'mobx';
|
import { makeAutoObservable, reaction } from 'mobx';
|
||||||
import Search from 'App/mstore/types/search';
|
import Search from 'App/mstore/types/search';
|
||||||
import { checkFilterValue, IFilter } from 'App/mstore/types/filter';
|
import { checkFilterValue, IFilter } from 'App/mstore/types/filter';
|
||||||
import FilterItem from 'App/mstore/types/filterItem';
|
import FilterItem from 'App/mstore/types/filterItem';
|
||||||
|
|
@ -63,11 +63,29 @@ class SearchStoreLive {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
makeAutoObservable(this);
|
makeAutoObservable(this);
|
||||||
|
|
||||||
|
// Reset currentPage to 1 only on filter changes
|
||||||
|
reaction(
|
||||||
|
() => this.instance,
|
||||||
|
() => {
|
||||||
|
this.currentPage = 1;
|
||||||
|
void this.fetchSessions();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Fetch sessions when currentPage changes
|
||||||
|
reaction(
|
||||||
|
() => this.currentPage,
|
||||||
|
() => {
|
||||||
|
void this.fetchSessions();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get filterList() {
|
get filterList() {
|
||||||
return generateFilterOptions(filtersMap);
|
return generateFilterOptions(filtersMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
get filterListLive() {
|
get filterListLive() {
|
||||||
return generateFilterOptions(liveFiltersMap);
|
return generateFilterOptions(liveFiltersMap);
|
||||||
}
|
}
|
||||||
|
|
@ -96,14 +114,12 @@ class SearchStoreLive {
|
||||||
|
|
||||||
edit(instance: Partial<Search>) {
|
edit(instance: Partial<Search>) {
|
||||||
this.instance = new Search(Object.assign({ ...this.instance }, instance));
|
this.instance = new Search(Object.assign({ ...this.instance }, instance));
|
||||||
this.currentPage = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
apply(filter: any, fromUrl: boolean) {
|
apply(filter: any, fromUrl: boolean) {
|
||||||
if (fromUrl) {
|
if (fromUrl) {
|
||||||
this.instance = new Search(filter);
|
this.instance = new Search(filter);
|
||||||
this.currentPage = 1;
|
|
||||||
} else {
|
} else {
|
||||||
this.instance = { ...this.instance, ...filter };
|
this.instance = { ...this.instance, ...filter };
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +131,6 @@ class SearchStoreLive {
|
||||||
|
|
||||||
updateCurrentPage(page: number) {
|
updateCurrentPage(page: number) {
|
||||||
this.currentPage = page;
|
this.currentPage = page;
|
||||||
this.fetchSessions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clearSearch() {
|
clearSearch() {
|
||||||
|
|
@ -140,22 +155,25 @@ class SearchStoreLive {
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
const oldFilter = this.instance.filters[index];
|
// Update existing filter
|
||||||
const updatedFilter = {
|
// @ts-ignore
|
||||||
...oldFilter,
|
this.instance.filters[index] = {
|
||||||
value: oldFilter.value.concat(filter.value)
|
...this.instance.filters[index],
|
||||||
|
value: this.instance.filters[index].value.concat(filter.value)
|
||||||
};
|
};
|
||||||
oldFilter.merge(updatedFilter);
|
|
||||||
} else {
|
} else {
|
||||||
this.instance.filters.push(filter);
|
// Add new filter (create a new array reference to notify MobX)
|
||||||
this.instance = new Search({
|
this.instance.filters = [...this.instance.filters, filter];
|
||||||
...this.instance.toData()
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter.value && filter.value[0] && filter.value[0] !== '') {
|
// Update the instance to trigger reactions
|
||||||
this.fetchSessions();
|
this.instance = new Search({
|
||||||
}
|
...this.instance.toData()
|
||||||
|
});
|
||||||
|
|
||||||
|
// if (filter.value && filter.value[0] && filter.value[0] !== '') {
|
||||||
|
// void this.fetchSessions();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
addFilterByKeyAndValue(key: any, value: any, operator?: string, sourceOperator?: string, source?: string) {
|
addFilterByKeyAndValue(key: any, value: any, operator?: string, sourceOperator?: string, source?: string) {
|
||||||
|
|
@ -200,7 +218,7 @@ class SearchStoreLive {
|
||||||
};
|
};
|
||||||
|
|
||||||
async fetchSessions() {
|
async fetchSessions() {
|
||||||
await sessionStore.fetchLiveSessions(this.instance.toSearch());
|
await sessionStore.fetchLiveSessions({ ...this.instance.toSearch(), page: this.currentPage });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,12 +94,19 @@ class DevTools {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Bookmarks {
|
||||||
|
list: Session[];
|
||||||
|
page: number;
|
||||||
|
total: number;
|
||||||
|
pageSize: number;
|
||||||
|
loading: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export default class SessionStore {
|
export default class SessionStore {
|
||||||
userFilter: UserFilter = new UserFilter();
|
userFilter: UserFilter = new UserFilter();
|
||||||
devTools: DevTools = new DevTools();
|
devTools: DevTools = new DevTools();
|
||||||
list: Session[] = [];
|
list: Session[] = [];
|
||||||
|
bookmarks: Bookmarks = { list: [], page: 1, total: 0, pageSize: 10, loading: false };
|
||||||
sessionIds: string[] = [];
|
sessionIds: string[] = [];
|
||||||
current = new Session();
|
current = new Session();
|
||||||
total = 0;
|
total = 0;
|
||||||
|
|
@ -170,7 +177,7 @@ export default class SessionStore {
|
||||||
}
|
}
|
||||||
const nextEntryNum =
|
const nextEntryNum =
|
||||||
keys.length > 0
|
keys.length > 0
|
||||||
? Math.max(...keys.map((key) => this.prefetchedMobUrls[key].entryNum || 0)) + 1
|
? Math.max(...keys.map((key) => this.prefetchedMobUrls[key]?.entryNum || 0)) + 1
|
||||||
: 0;
|
: 0;
|
||||||
this.prefetchedMobUrls[sessionId] = {
|
this.prefetchedMobUrls[sessionId] = {
|
||||||
data: fileData,
|
data: fileData,
|
||||||
|
|
@ -529,9 +536,33 @@ export default class SessionStore {
|
||||||
this.list = [];
|
this.list = [];
|
||||||
this.total = 0;
|
this.total = 0;
|
||||||
this.sessionIds = [];
|
this.sessionIds = [];
|
||||||
|
this.bookmarks = { list: [], page: 1, total: 0, pageSize: 10, loading: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
setLastPlayedSessionId = (sessionId: string) => {
|
setLastPlayedSessionId = (sessionId: string) => {
|
||||||
this.lastPlayedSessionId = sessionId;
|
this.lastPlayedSessionId = sessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fetchBookmarkedSessions() {
|
||||||
|
try {
|
||||||
|
this.bookmarks.loading = true;
|
||||||
|
const params = {
|
||||||
|
page: this.bookmarks.page,
|
||||||
|
limit: this.bookmarks.pageSize,
|
||||||
|
bookmarked: true,
|
||||||
|
}
|
||||||
|
const data = await sessionService.getSessions(params);
|
||||||
|
this.bookmarks.list = data.sessions.map((s: any) => new Session(s));
|
||||||
|
this.bookmarks.total = data.total;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
} finally {
|
||||||
|
this.bookmarks.loading = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateBookmarksPage(page: number) {
|
||||||
|
this.bookmarks.page = page;
|
||||||
|
void this.fetchBookmarkedSessions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { DATE_RANGE_VALUES, CUSTOM_RANGE, getDateRangeFromValue } from 'App/dateRange';
|
import { CUSTOM_RANGE, DATE_RANGE_VALUES, getDateRangeFromValue } from 'App/dateRange';
|
||||||
import Filter, { checkFilterValue, IFilter } from 'App/mstore/types/filter';
|
import Filter, { IFilter } from 'App/mstore/types/filter';
|
||||||
import FilterItem from 'App/mstore/types/filterItem';
|
import FilterItem from 'App/mstore/types/filterItem';
|
||||||
import { action, makeAutoObservable, observable } from 'mobx';
|
import { makeAutoObservable, observable } from 'mobx';
|
||||||
|
import { LAST_24_HOURS, LAST_30_DAYS, LAST_7_DAYS } from 'Types/app/period';
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const rangeValue = DATE_RANGE_VALUES.LAST_24_HOURS;
|
const rangeValue = DATE_RANGE_VALUES.LAST_24_HOURS;
|
||||||
|
|
@ -69,7 +70,7 @@ export default class Search {
|
||||||
|
|
||||||
constructor(initialData?: Partial<ISearch>) {
|
constructor(initialData?: Partial<ISearch>) {
|
||||||
makeAutoObservable(this, {
|
makeAutoObservable(this, {
|
||||||
filters: observable,
|
filters: observable
|
||||||
});
|
});
|
||||||
Object.assign(this, {
|
Object.assign(this, {
|
||||||
name: '',
|
name: '',
|
||||||
|
|
@ -142,11 +143,48 @@ export default class Search {
|
||||||
return new FilterItem(filter).toJson();
|
return new FilterItem(filter).toJson();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { startDate, endDate } = this.getDateRange(js.rangeValue, js.startDate, js.endDate);
|
||||||
|
js.startDate = startDate;
|
||||||
|
js.endDate = endDate;
|
||||||
|
|
||||||
delete js.createdAt;
|
delete js.createdAt;
|
||||||
delete js.key;
|
delete js.key;
|
||||||
return js;
|
return js;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getDateRange(rangeName: string, customStartDate: number, customEndDate: number): {
|
||||||
|
startDate: number;
|
||||||
|
endDate: number
|
||||||
|
} {
|
||||||
|
let endDate = new Date().getTime();
|
||||||
|
let startDate: number;
|
||||||
|
|
||||||
|
switch (rangeName) {
|
||||||
|
case LAST_7_DAYS:
|
||||||
|
startDate = endDate - 7 * 24 * 60 * 60 * 1000;
|
||||||
|
break;
|
||||||
|
case LAST_30_DAYS:
|
||||||
|
startDate = endDate - 30 * 24 * 60 * 60 * 1000;
|
||||||
|
break;
|
||||||
|
case CUSTOM_RANGE:
|
||||||
|
if (!customStartDate || !customEndDate) {
|
||||||
|
throw new Error('Start date and end date must be provided for CUSTOM_RANGE.');
|
||||||
|
}
|
||||||
|
startDate = customStartDate;
|
||||||
|
endDate = customEndDate;
|
||||||
|
break;
|
||||||
|
case LAST_24_HOURS:
|
||||||
|
default:
|
||||||
|
startDate = endDate - 24 * 60 * 60 * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
startDate,
|
||||||
|
endDate
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fromJS({ eventsOrder, filters, events, custom, ...filterData }: any) {
|
fromJS({ eventsOrder, filters, events, custom, ...filterData }: any) {
|
||||||
let startDate, endDate;
|
let startDate, endDate;
|
||||||
const rValue = filterData.rangeValue || rangeValue;
|
const rValue = filterData.rangeValue || rangeValue;
|
||||||
|
|
@ -176,3 +214,4 @@ export default class Search {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -314,9 +314,9 @@ export default class Widget {
|
||||||
} else if (this.metricType === FUNNEL) {
|
} else if (this.metricType === FUNNEL) {
|
||||||
_data.funnel = new Funnel().fromJSON(_data);
|
_data.funnel = new Funnel().fromJSON(_data);
|
||||||
} else if (this.metricType === TABLE) {
|
} else if (this.metricType === TABLE) {
|
||||||
const total = data[0]['total'];
|
// const total = data[0]['total'];
|
||||||
const count = data[0]['count'];
|
const count = data[0]['count'];
|
||||||
_data[0]['values'] = data[0]['values'].map((s: any) => new SessionsByRow().fromJson(s, total, this.metricOf));
|
_data[0]['values'] = data[0]['values'].map((s: any) => new SessionsByRow().fromJson(s, count, this.metricOf));
|
||||||
} else {
|
} else {
|
||||||
if (data.hasOwnProperty('chart')) {
|
if (data.hasOwnProperty('chart')) {
|
||||||
_data['value'] = data.value;
|
_data['value'] = data.value;
|
||||||
|
|
|
||||||
|
|
@ -66,11 +66,16 @@ export default class UiPlayerStore {
|
||||||
endTs: 0,
|
endTs: 0,
|
||||||
}
|
}
|
||||||
zoomTab: 'overview' | 'journey' | 'issues' | 'errors' = 'overview'
|
zoomTab: 'overview' | 'journey' | 'issues' | 'errors' = 'overview'
|
||||||
|
dataSource: 'all' | 'current' = 'all'
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
makeAutoObservable(this);
|
makeAutoObservable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeDataSource = (source: 'all' | 'current') => {
|
||||||
|
this.dataSource = source;
|
||||||
|
}
|
||||||
|
|
||||||
toggleFullscreen = (val?: boolean) => {
|
toggleFullscreen = (val?: boolean) => {
|
||||||
this.fullscreen = val ?? !this.fullscreen;
|
this.fullscreen = val ?? !this.fullscreen;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@ class UserStore {
|
||||||
get isEnterprise() {
|
get isEnterprise() {
|
||||||
return (
|
return (
|
||||||
this.account?.edition === 'ee' ||
|
this.account?.edition === 'ee' ||
|
||||||
this.account?.edition === 'msaas' ||
|
|
||||||
this.authStore.authDetails?.edition === 'ee'
|
this.authStore.authDetails?.edition === 'ee'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,18 @@
|
||||||
import { Store } from './types'
|
import { Store } from './types'
|
||||||
|
|
||||||
export default class SimpleSore<G extends Object, S extends Object = G> implements Store<G, S> {
|
export default class SimpleStore<G extends Record<string, any>, S extends Record<string, any> = G> implements Store<G, S> {
|
||||||
constructor(private state: G){}
|
constructor(private state: G){}
|
||||||
get(): G {
|
get(): G {
|
||||||
return this.state
|
return this.state
|
||||||
}
|
}
|
||||||
update(newState: Partial<S>) {
|
update = (newState: Partial<S>) => {
|
||||||
Object.assign(this.state, newState)
|
Object.assign(this.state, newState)
|
||||||
}
|
}
|
||||||
|
updateTabStates = (id: string, newState: Partial<S>) => {
|
||||||
|
try {
|
||||||
|
Object.assign(this.state.tabStates[id], newState)
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Error updating tab state', e, id, newState, this.state, this)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ export interface Interval {
|
||||||
export interface Store<G extends Object, S extends Object = G> {
|
export interface Store<G extends Object, S extends Object = G> {
|
||||||
get(): G
|
get(): G
|
||||||
update(state: Partial<S>): void
|
update(state: Partial<S>): void
|
||||||
|
updateTabStates(id: string, state: Partial<S>): void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,7 @@ export default class MessageLoader {
|
||||||
try {
|
try {
|
||||||
await this.loadMobs();
|
await this.loadMobs();
|
||||||
} catch (sessionLoadError) {
|
} catch (sessionLoadError) {
|
||||||
|
console.info('!', sessionLoadError);
|
||||||
try {
|
try {
|
||||||
await this.loadEFSMobs();
|
await this.loadEFSMobs();
|
||||||
} catch (unprocessedLoadError) {
|
} catch (unprocessedLoadError) {
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ export default class MessageManager {
|
||||||
closedTabs: [],
|
closedTabs: [],
|
||||||
sessionStart: 0,
|
sessionStart: 0,
|
||||||
tabNames: {},
|
tabNames: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
private clickManager: ListWalker<MouseClick> = new ListWalker();
|
private clickManager: ListWalker<MouseClick> = new ListWalker();
|
||||||
private mouseThrashingManager: ListWalker<MouseThrashing> = new ListWalker();
|
private mouseThrashingManager: ListWalker<MouseThrashing> = new ListWalker();
|
||||||
|
|
@ -179,6 +179,7 @@ export default class MessageManager {
|
||||||
this.activityManager.end();
|
this.activityManager.end();
|
||||||
this.state.update({ skipIntervals: this.activityManager.list });
|
this.state.update({ skipIntervals: this.activityManager.list });
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.values(this.tabs).forEach((tab) => tab.onFileReadSuccess?.());
|
Object.values(this.tabs).forEach((tab) => tab.onFileReadSuccess?.());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -317,6 +318,7 @@ export default class MessageManager {
|
||||||
if (msg.tp === 9999) return;
|
if (msg.tp === 9999) return;
|
||||||
if (!this.tabs[msg.tabId]) {
|
if (!this.tabs[msg.tabId]) {
|
||||||
this.tabsAmount++;
|
this.tabsAmount++;
|
||||||
|
this.state.update({ tabStates: { ...this.state.get().tabStates, [msg.tabId]: TabSessionManager.INITIAL_STATE } });
|
||||||
this.tabs[msg.tabId] = new TabSessionManager(
|
this.tabs[msg.tabId] = new TabSessionManager(
|
||||||
this.session,
|
this.session,
|
||||||
this.state,
|
this.state,
|
||||||
|
|
|
||||||
|
|
@ -163,15 +163,7 @@ export default class TabSessionManager {
|
||||||
* Because we use main state (from messageManager), we have to update it this way
|
* Because we use main state (from messageManager), we have to update it this way
|
||||||
* */
|
* */
|
||||||
updateLocalState(state: Partial<TabState>) {
|
updateLocalState(state: Partial<TabState>) {
|
||||||
this.state.update({
|
this.state.updateTabStates(this.id, state);
|
||||||
tabStates: {
|
|
||||||
...this.state.get().tabStates,
|
|
||||||
[this.id]: {
|
|
||||||
...this.state.get().tabStates[this.id],
|
|
||||||
...state,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private setCSSLoading = (cssLoading: boolean) => {
|
private setCSSLoading = (cssLoading: boolean) => {
|
||||||
|
|
@ -202,6 +194,7 @@ export default class TabSessionManager {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstTitleSet = false
|
||||||
distributeMessage(msg: Message): void {
|
distributeMessage(msg: Message): void {
|
||||||
this.lastMessageTs = msg.time;
|
this.lastMessageTs = msg.time;
|
||||||
switch (msg.tp) {
|
switch (msg.tp) {
|
||||||
|
|
@ -242,6 +235,10 @@ export default class TabSessionManager {
|
||||||
case MType.SetPageLocationDeprecated:
|
case MType.SetPageLocationDeprecated:
|
||||||
case MType.SetPageLocation:
|
case MType.SetPageLocation:
|
||||||
this.locationManager.append(msg);
|
this.locationManager.append(msg);
|
||||||
|
if ('documentTitle' in msg && !this.firstTitleSet) {
|
||||||
|
this.state.update({ tabNames: { ...this.state.get().tabNames, [this.id]: msg.documentTitle } });
|
||||||
|
this.firstTitleSet = true
|
||||||
|
}
|
||||||
if (msg.navigationStart > 0) {
|
if (msg.navigationStart > 0) {
|
||||||
this.loadedLocationManager.append(msg);
|
this.loadedLocationManager.append(msg);
|
||||||
}
|
}
|
||||||
|
|
@ -414,8 +411,9 @@ export default class TabSessionManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(stateToUpdate, this.lists.moveGetState(t));
|
Object.assign(stateToUpdate, this.lists.moveGetState(t));
|
||||||
Object.keys(stateToUpdate).length > 0 &&
|
if (Object.keys(stateToUpdate).length > 0) {
|
||||||
this.updateLocalState(stateToUpdate);
|
this.updateLocalState(stateToUpdate);
|
||||||
|
}
|
||||||
/* Sequence of the managers is important here */
|
/* Sequence of the managers is important here */
|
||||||
// Preparing the size of "screen"
|
// Preparing the size of "screen"
|
||||||
const lastResize = this.resizeManager.moveGetLast(t, index);
|
const lastResize = this.resizeManager.moveGetLast(t, index);
|
||||||
|
|
|
||||||
|
|
@ -436,3 +436,7 @@ p {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-segmented-item{
|
||||||
|
border-radius: .5rem !important;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import Period, { CUSTOM_RANGE } from 'Types/app/period';
|
import Period, { CUSTOM_RANGE, LAST_24_HOURS } from 'Types/app/period';
|
||||||
import { filtersMap } from 'Types/filter/newFilter';
|
|
||||||
|
|
||||||
|
const DEFAULT_SORT = 'startTs';
|
||||||
|
const DEFAULT_ORDER = 'desc';
|
||||||
|
const DEFAULT_EVENTS_ORDER = 'then';
|
||||||
|
|
||||||
class Filter {
|
class Filter {
|
||||||
key: string;
|
key: string;
|
||||||
|
|
@ -25,24 +27,28 @@ class Filter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class InputJson {
|
export class InputJson {
|
||||||
filters: Filter[];
|
filters: Filter[];
|
||||||
rangeValue: string;
|
rangeValue: string;
|
||||||
startDate: number;
|
startDate?: number;
|
||||||
endDate: number;
|
endDate?: number;
|
||||||
sort: string;
|
sort: string;
|
||||||
order: string;
|
order: string;
|
||||||
eventsOrder: string;
|
eventsOrder: string;
|
||||||
|
|
||||||
constructor(filters: Filter[], rangeValue: string, startDate: number, endDate: number, sort: string, order: string, eventsOrder: string) {
|
constructor(
|
||||||
|
filters: Filter[],
|
||||||
|
rangeValue: string,
|
||||||
|
sort: string,
|
||||||
|
order: string,
|
||||||
|
eventsOrder: string,
|
||||||
|
startDate?: string | number,
|
||||||
|
endDate?: string | number
|
||||||
|
) {
|
||||||
this.filters = filters;
|
this.filters = filters;
|
||||||
// .map((f: any) => {
|
|
||||||
// const subFilters = f.filters ? f.filters.map((sf: any) => new Filter(sf.key, sf.operator, sf.value, sf.filters)) : undefined;
|
|
||||||
// return new Filter(f.key, f.operator, f.value, subFilters);
|
|
||||||
// });
|
|
||||||
this.rangeValue = rangeValue;
|
this.rangeValue = rangeValue;
|
||||||
this.startDate = startDate;
|
this.startDate = startDate ? +startDate : undefined;
|
||||||
this.endDate = endDate;
|
this.endDate = endDate ? +endDate : undefined;
|
||||||
this.sort = sort;
|
this.sort = sort;
|
||||||
this.order = order;
|
this.order = order;
|
||||||
this.eventsOrder = eventsOrder;
|
this.eventsOrder = eventsOrder;
|
||||||
|
|
@ -50,17 +56,28 @@ class InputJson {
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return {
|
return {
|
||||||
filters: this.filters.map(f => f.toJSON()),
|
filters: this.filters.map((f) => f.toJSON()),
|
||||||
rangeValue: this.rangeValue,
|
rangeValue: this.rangeValue,
|
||||||
startDate: this.startDate,
|
startDate: this.startDate ?? null,
|
||||||
endDate: this.endDate,
|
endDate: this.endDate ?? null,
|
||||||
sort: this.sort,
|
sort: this.sort,
|
||||||
order: this.order,
|
order: this.order,
|
||||||
eventsOrder: this.eventsOrder
|
eventsOrder: this.eventsOrder
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
fromJSON(json: Record<string, any>): InputJson {
|
||||||
|
return new InputJson(
|
||||||
|
json.filters.map((f: any) => new Filter(f.key, f.operator, f.value, f.filters)),
|
||||||
|
json.rangeValue,
|
||||||
|
json.sort,
|
||||||
|
json.order,
|
||||||
|
json.eventsOrder,
|
||||||
|
json.startDate,
|
||||||
|
json.endDate
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class JsonUrlConverter {
|
export class JsonUrlConverter {
|
||||||
static keyMap = {
|
static keyMap = {
|
||||||
|
|
@ -76,35 +93,46 @@ export class JsonUrlConverter {
|
||||||
filters: 'f'
|
filters: 'f'
|
||||||
};
|
};
|
||||||
|
|
||||||
static getDateRangeValues(rangeValue: string, startDate: number | undefined, endDate: number | undefined): [number, number] {
|
static getDateRangeValues(
|
||||||
if (rangeValue === 'CUSTOM_RANGE') {
|
rangeValue: string,
|
||||||
return [startDate!, endDate!];
|
startDate: string | null,
|
||||||
|
endDate: string | null
|
||||||
|
): [string, string] {
|
||||||
|
if (rangeValue === CUSTOM_RANGE) {
|
||||||
|
return [startDate || '', endDate || ''];
|
||||||
}
|
}
|
||||||
const period = Period({ rangeName: rangeValue });
|
const period: any = Period({ rangeName: rangeValue });
|
||||||
return [period.start, period.end];
|
return [period.start, period.end];
|
||||||
}
|
}
|
||||||
|
|
||||||
static jsonToUrlParams(json: InputJson): string {
|
static jsonToUrlParams(json: Record<string, any>): string {
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
|
|
||||||
const addFilterParams = (filter: Filter, prefix: string) => {
|
const addFilterParams = (filter: Filter, prefix: string) => {
|
||||||
params.append(`${prefix}${this.keyMap.key}`, filter.key);
|
params.append(`${prefix}${this.keyMap.key}`, filter.key);
|
||||||
params.append(`${prefix}${this.keyMap.operator}`, filter.operator);
|
params.append(`${prefix}${this.keyMap.operator}`, filter.operator);
|
||||||
if (filter.value) {
|
filter.value?.forEach((v, i) =>
|
||||||
filter.value.forEach((v, i) => params.append(`${prefix}${this.keyMap.value}[${i}]`, v || ''));
|
params.append(`${prefix}${this.keyMap.value}[${i}]`, v || '')
|
||||||
}
|
);
|
||||||
if (filter.filters) {
|
filter.filters?.forEach((f, i) =>
|
||||||
filter.filters.forEach((f, i) => addFilterParams(f, `${prefix}${this.keyMap.filters}[${i}].`));
|
addFilterParams(f, `${prefix}${this.keyMap.filters}[${i}].`)
|
||||||
}
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
json.filters.forEach((filter, index) => addFilterParams(filter, `${this.keyMap.filters}[${index}].`));
|
json.filters.forEach((filter: any, index: number) =>
|
||||||
|
addFilterParams(filter, `${this.keyMap.filters}[${index}].`)
|
||||||
const rangeValues = this.getDateRangeValues(json.rangeValue, json.startDate, json.endDate);
|
);
|
||||||
|
|
||||||
params.append(this.keyMap.rangeValue, json.rangeValue);
|
params.append(this.keyMap.rangeValue, json.rangeValue);
|
||||||
params.append(this.keyMap.startDate, rangeValues[0].toString());
|
if (json.rangeValue === CUSTOM_RANGE) {
|
||||||
params.append(this.keyMap.endDate, rangeValues[1].toString());
|
const rangeValues = this.getDateRangeValues(
|
||||||
|
json.rangeValue,
|
||||||
|
json.startDate?.toString() || null,
|
||||||
|
json.endDate?.toString() || null
|
||||||
|
);
|
||||||
|
params.append(this.keyMap.startDate, rangeValues[0]);
|
||||||
|
params.append(this.keyMap.endDate, rangeValues[1]);
|
||||||
|
}
|
||||||
params.append(this.keyMap.sort, json.sort);
|
params.append(this.keyMap.sort, json.sort);
|
||||||
params.append(this.keyMap.order, json.order);
|
params.append(this.keyMap.order, json.order);
|
||||||
params.append(this.keyMap.eventsOrder, json.eventsOrder);
|
params.append(this.keyMap.eventsOrder, json.eventsOrder);
|
||||||
|
|
@ -130,7 +158,7 @@ export class JsonUrlConverter {
|
||||||
filters.push(getFilterParams(`${prefix}${this.keyMap.filters}[${index}].`));
|
filters.push(getFilterParams(`${prefix}${this.keyMap.filters}[${index}].`));
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
return new Filter(key, operator, value.length ? value : '', filters.length ? filters : []);
|
return new Filter(key, operator, value.length ? value : [], filters.length ? filters : []);
|
||||||
};
|
};
|
||||||
|
|
||||||
const filters: Filter[] = [];
|
const filters: Filter[] = [];
|
||||||
|
|
@ -140,23 +168,22 @@ export class JsonUrlConverter {
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rangeValue = params.get(this.keyMap.rangeValue) || 'LAST_24_HOURS';
|
const rangeValue = params.get(this.keyMap.rangeValue) || LAST_24_HOURS;
|
||||||
const rangeValues = this.getDateRangeValues(rangeValue, params.get(this.keyMap.startDate), params.get(this.keyMap.endDate));
|
const rangeValues = this.getDateRangeValues(rangeValue, params.get(this.keyMap.startDate), params.get(this.keyMap.endDate));
|
||||||
const startDate = rangeValues[0];
|
|
||||||
const endDate = rangeValues[1];
|
|
||||||
|
|
||||||
return new InputJson(
|
return new InputJson(
|
||||||
filters,
|
filters,
|
||||||
rangeValue,
|
rangeValue,
|
||||||
startDate,
|
params.get(this.keyMap.sort) || DEFAULT_SORT,
|
||||||
endDate,
|
params.get(this.keyMap.order) || DEFAULT_ORDER,
|
||||||
params.get(this.keyMap.sort) || 'startTs',
|
params.get(this.keyMap.eventsOrder) || DEFAULT_EVENTS_ORDER,
|
||||||
params.get(this.keyMap.order) || 'desc',
|
rangeValues[0],
|
||||||
params.get(this.keyMap.eventsOrder) || 'then'
|
rangeValues[1]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Example usage
|
// Example usage
|
||||||
// const urlParams = '?f[0].k=click&f[0].op=on&f[0].v[0]=Refresh&f[1].k=fetch&f[1].op=is&f[1].v[0]=&f[1].f[0].k=fetchUrl&f[1].f[0].op=is&f[1].f[0].v[0]=/g/collect&f[1].f[1].k=fetchStatusCode&f[1].f[1].op=>=&f[1].f[1].v[0]=400&f[1].f[2].k=fetchMethod&f[1].f[2].op=is&f[1].f[2].v[0]=&f[1].f[3].k=fetchDuration&f[1].f[3].op==&f[1].f[3].v[0]=&f[1].f[4].k=fetchRequestBody&f[1].f[4].op=is&f[1].f[4].v[0]=&f[1].f[5].k=fetchResponseBody&f[1].f[5].op=is&f[1].f[5].v[0]=&rv=LAST_24_HOURS&sd=1731343412555&ed=1731429812555&s=startTs&o=desc&st=false&eo=then';
|
// const urlParams = '?f[0].k=click&f[0].op=on&f[0].v[0]=Refresh&f[1].k=fetch&f[1].op=is&f[1].v[0]=&f[1].f[0].k=fetchUrl&f[1].f[0].op=is&f[1].f[0].v[0]=/g/collect&f[1].f[1].k=fetchStatusCode&f[1].f[1].op=>=&f[1].f[1].v[0]=400&f[1].f[2].k=fetchMethod&f[1].f[2].op=is&f[1].f[2].v[0]=&f[1].f[3].k=fetchDuration&f[1].f[3].op==&f[1].f[3].v[0]=&f[1].f[4].k=fetchRequestBody&f[1].f[4].op=is&f[1].f[4].v[0]=&f[1].f[5].k=fetchResponseBody&f[1].f[5].op=is&f[1].f[5].v[0]=&rv=LAST_24_HOURS&sd=1731343412555&ed=1731429812555&s=startTs&o=desc&st=false&eo=then';
|
||||||
// const parsedJson = JsonUrlConverter.urlParamsToJson(urlParams);
|
// const parsedJson = JsonUrlConverter.urlParamsToJson(urlParams);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ export function validateIP(value) {
|
||||||
|
|
||||||
export function validateURL(value) {
|
export function validateURL(value) {
|
||||||
if (typeof value !== 'string') return false;
|
if (typeof value !== 'string') return false;
|
||||||
const urlRegex = /^(http|https):\/\/(?:www\.)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}(\/\S*)?$/i;
|
const urlRegex = /^(http|https):\/\/(?:www\.)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}(:\d+)?(\/\S*)?$/i;
|
||||||
const ipRegex = /^(http|https):\/\/(?:localhost|(\d{1,3}\.){3}\d{1,3})(:\d+)?(\/\S*)?$/i;
|
const ipRegex = /^(http|https):\/\/(?:localhost|(\d{1,3}\.){3}\d{1,3})(:\d+)?(\/\S*)?$/i;
|
||||||
return urlRegex.test(value) || ipRegex.test(value);
|
return urlRegex.test(value) || ipRegex.test(value);
|
||||||
}
|
}
|
||||||
|
|
@ -89,4 +89,4 @@ export const validatePassword = (password) => {
|
||||||
const regex =
|
const regex =
|
||||||
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?])[A-Za-z\d!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]{8,}$/;
|
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?])[A-Za-z\d!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]{8,}$/;
|
||||||
return regex.test(password);
|
return regex.test(password);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
"@babel/plugin-transform-private-methods": "^7.23.3",
|
"@babel/plugin-transform-private-methods": "^7.23.3",
|
||||||
"@floating-ui/react-dom-interactions": "^0.10.3",
|
"@floating-ui/react-dom-interactions": "^0.10.3",
|
||||||
"@medv/finder": "^3.1.0",
|
"@medv/finder": "^3.1.0",
|
||||||
"@sentry/browser": "^5.21.1",
|
"@sentry/browser": "^8.34.0",
|
||||||
"@svg-maps/world": "^1.0.1",
|
"@svg-maps/world": "^1.0.1",
|
||||||
"@tanstack/react-query": "^5.56.2",
|
"@tanstack/react-query": "^5.56.2",
|
||||||
"@wojtekmaj/react-daterange-picker": "^6.0.0",
|
"@wojtekmaj/react-daterange-picker": "^6.0.0",
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
"@babel/preset-typescript": "^7.23.2",
|
"@babel/preset-typescript": "^7.23.2",
|
||||||
"@babel/runtime": "^7.23.2",
|
"@babel/runtime": "^7.23.2",
|
||||||
"@jest/globals": "^29.7.0",
|
"@jest/globals": "^29.7.0",
|
||||||
"@openreplay/sourcemap-uploader": "^3.0.8",
|
"@openreplay/sourcemap-uploader": "^3.0.10",
|
||||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||||
"@types/luxon": "^3.4.2",
|
"@types/luxon": "^3.4.2",
|
||||||
"@types/node": "^22.7.8",
|
"@types/node": "^22.7.8",
|
||||||
|
|
@ -116,6 +116,7 @@
|
||||||
"cypress": "^13.3.0",
|
"cypress": "^13.3.0",
|
||||||
"cypress-image-snapshot": "^4.0.1",
|
"cypress-image-snapshot": "^4.0.1",
|
||||||
"dotenv": "^6.2.0",
|
"dotenv": "^6.2.0",
|
||||||
|
"esbuild-loader": "^4.2.2",
|
||||||
"eslint": "^8.15.0",
|
"eslint": "^8.15.0",
|
||||||
"eslint-plugin-react": "^7.29.4",
|
"eslint-plugin-react": "^7.29.4",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import CopyWebpackPlugin from 'copy-webpack-plugin';
|
||||||
import HtmlWebpackPlugin from "html-webpack-plugin";
|
import HtmlWebpackPlugin from "html-webpack-plugin";
|
||||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
||||||
import CompressionPlugin from "compression-webpack-plugin";
|
import CompressionPlugin from "compression-webpack-plugin";
|
||||||
|
import { EsbuildPlugin } from 'esbuild-loader';
|
||||||
|
|
||||||
const dotenv = require('dotenv').config({ path: __dirname + '/.env' })
|
const dotenv = require('dotenv').config({ path: __dirname + '/.env' })
|
||||||
const isDevelopment = process.env.NODE_ENV !== 'production'
|
const isDevelopment = process.env.NODE_ENV !== 'production'
|
||||||
const stylesHandler = MiniCssExtractPlugin.loader;
|
const stylesHandler = MiniCssExtractPlugin.loader;
|
||||||
|
|
@ -28,23 +30,32 @@ const config: Configuration = {
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
chunks: 'all',
|
chunks: 'all',
|
||||||
},
|
},
|
||||||
|
minimizer: [
|
||||||
|
new EsbuildPlugin({
|
||||||
|
target: 'es2020',
|
||||||
|
css: true
|
||||||
|
})
|
||||||
|
]
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
exprContextCritical: false,
|
exprContextCritical: false,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.(ts|js)x?$/i,
|
test: /\.tsx?$/i,
|
||||||
exclude: isDevelopment ? /node_modules/ : undefined,
|
exclude: isDevelopment ? /node_modules/ : undefined,
|
||||||
use: ['thread-loader', {
|
loader: "esbuild-loader",
|
||||||
loader: "babel-loader",
|
options: {
|
||||||
options: {
|
target: 'es2020',
|
||||||
presets: [
|
},
|
||||||
"@babel/preset-env",
|
},
|
||||||
"@babel/preset-react",
|
{
|
||||||
"@babel/preset-typescript",
|
test: /\.jsx?$/i,
|
||||||
],
|
exclude: isDevelopment ? /node_modules/ : undefined,
|
||||||
},
|
loader: "esbuild-loader",
|
||||||
}],
|
options: {
|
||||||
|
loader: 'jsx',
|
||||||
|
target: 'es2020',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.s[ac]ss$/i,
|
test: /\.s[ac]ss$/i,
|
||||||
|
|
@ -111,7 +122,11 @@ const config: Configuration = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new CompressionPlugin(),
|
(isDevelopment ? false : new CompressionPlugin({
|
||||||
|
test: /\.(js|css|html|svg)$/,
|
||||||
|
algorithm: 'brotliCompress',
|
||||||
|
threshold: 10240,
|
||||||
|
})),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
// 'process.env': ENV_VARIABLES,
|
// 'process.env': ENV_VARIABLES,
|
||||||
'window.env': ENV_VARIABLES,
|
'window.env': ENV_VARIABLES,
|
||||||
|
|
@ -131,6 +146,7 @@ const config: Configuration = {
|
||||||
performance: {
|
performance: {
|
||||||
hints: false,
|
hints: false,
|
||||||
},
|
},
|
||||||
|
watchOptions: { ignored: "**/node_modules/**" },
|
||||||
devServer: {
|
devServer: {
|
||||||
// static: path.join(__dirname, "public"),
|
// static: path.join(__dirname, "public"),
|
||||||
historyApiFallback: true,
|
historyApiFallback: true,
|
||||||
|
|
@ -138,7 +154,6 @@ const config: Configuration = {
|
||||||
open: true,
|
open: true,
|
||||||
port: 3333,
|
port: 3333,
|
||||||
hot: true,
|
hot: true,
|
||||||
compress: true,
|
|
||||||
allowedHosts: "all",
|
allowedHosts: "all",
|
||||||
client: {
|
client: {
|
||||||
overlay: {
|
overlay: {
|
||||||
|
|
|
||||||
|
|
@ -1898,6 +1898,167 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/aix-ppc64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/aix-ppc64@npm:0.21.5"
|
||||||
|
conditions: os=aix & cpu=ppc64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/android-arm64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/android-arm64@npm:0.21.5"
|
||||||
|
conditions: os=android & cpu=arm64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/android-arm@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/android-arm@npm:0.21.5"
|
||||||
|
conditions: os=android & cpu=arm
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/android-x64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/android-x64@npm:0.21.5"
|
||||||
|
conditions: os=android & cpu=x64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/darwin-arm64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/darwin-arm64@npm:0.21.5"
|
||||||
|
conditions: os=darwin & cpu=arm64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/darwin-x64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/darwin-x64@npm:0.21.5"
|
||||||
|
conditions: os=darwin & cpu=x64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/freebsd-arm64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/freebsd-arm64@npm:0.21.5"
|
||||||
|
conditions: os=freebsd & cpu=arm64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/freebsd-x64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/freebsd-x64@npm:0.21.5"
|
||||||
|
conditions: os=freebsd & cpu=x64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-arm64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-arm64@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=arm64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-arm@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-arm@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=arm
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-ia32@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-ia32@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=ia32
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-loong64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-loong64@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=loong64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-mips64el@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-mips64el@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=mips64el
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-ppc64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-ppc64@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=ppc64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-riscv64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-riscv64@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=riscv64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-s390x@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-s390x@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=s390x
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/linux-x64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/linux-x64@npm:0.21.5"
|
||||||
|
conditions: os=linux & cpu=x64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/netbsd-x64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/netbsd-x64@npm:0.21.5"
|
||||||
|
conditions: os=netbsd & cpu=x64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/openbsd-x64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/openbsd-x64@npm:0.21.5"
|
||||||
|
conditions: os=openbsd & cpu=x64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/sunos-x64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/sunos-x64@npm:0.21.5"
|
||||||
|
conditions: os=sunos & cpu=x64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/win32-arm64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/win32-arm64@npm:0.21.5"
|
||||||
|
conditions: os=win32 & cpu=arm64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/win32-ia32@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/win32-ia32@npm:0.21.5"
|
||||||
|
conditions: os=win32 & cpu=ia32
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"@esbuild/win32-x64@npm:0.21.5":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "@esbuild/win32-x64@npm:0.21.5"
|
||||||
|
conditions: os=win32 & cpu=x64
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@eslint-community/eslint-utils@npm:^4.2.0":
|
"@eslint-community/eslint-utils@npm:^4.2.0":
|
||||||
version: 4.4.1
|
version: 4.4.1
|
||||||
resolution: "@eslint-community/eslint-utils@npm:4.4.1"
|
resolution: "@eslint-community/eslint-utils@npm:4.4.1"
|
||||||
|
|
@ -2471,15 +2632,16 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@openreplay/sourcemap-uploader@npm:^3.0.8":
|
"@openreplay/sourcemap-uploader@npm:^3.0.10":
|
||||||
version: 3.0.10
|
version: 3.0.13
|
||||||
resolution: "@openreplay/sourcemap-uploader@npm:3.0.10"
|
resolution: "@openreplay/sourcemap-uploader@npm:3.0.13"
|
||||||
dependencies:
|
dependencies:
|
||||||
argparse: "npm:^2.0.1"
|
argparse: "npm:^2.0.1"
|
||||||
|
glob: "npm:^8.0.3"
|
||||||
glob-promise: "npm:^6.0.7"
|
glob-promise: "npm:^6.0.7"
|
||||||
bin:
|
bin:
|
||||||
sourcemap-uploader: cli.js
|
sourcemap-uploader: cli.js
|
||||||
checksum: 10c1/aa22a161020f55e96c3835cb719f4c530728ccb55e90d1a0bbc96c5243bffb900e204dd6275f1dee2927db3c4439b5d33c38c60774e5340ccb36acab95f30cc5
|
checksum: 10c1/1bab68b1a2f348973d9c027e00b9e027a833cec998e9a8a6c2872585d46fcdfb6f1492b98fd42f04ed2e6c4f913ec19e44a24be95460e1f7d1e08f6edf15eabe
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|
@ -7001,6 +7163,100 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"esbuild-loader@npm:^4.2.2":
|
||||||
|
version: 4.2.2
|
||||||
|
resolution: "esbuild-loader@npm:4.2.2"
|
||||||
|
dependencies:
|
||||||
|
esbuild: "npm:^0.21.0"
|
||||||
|
get-tsconfig: "npm:^4.7.0"
|
||||||
|
loader-utils: "npm:^2.0.4"
|
||||||
|
webpack-sources: "npm:^1.4.3"
|
||||||
|
peerDependencies:
|
||||||
|
webpack: ^4.40.0 || ^5.0.0
|
||||||
|
checksum: 10c1/2e29724312e75ffdb06d6421536078f36c135e9d8563bd413d78b061bf24459e06661f6baadd11a7f8e630e22abdf0d9d18921d51460bd2eeee47e000e29fd17
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
|
"esbuild@npm:^0.21.0":
|
||||||
|
version: 0.21.5
|
||||||
|
resolution: "esbuild@npm:0.21.5"
|
||||||
|
dependencies:
|
||||||
|
"@esbuild/aix-ppc64": "npm:0.21.5"
|
||||||
|
"@esbuild/android-arm": "npm:0.21.5"
|
||||||
|
"@esbuild/android-arm64": "npm:0.21.5"
|
||||||
|
"@esbuild/android-x64": "npm:0.21.5"
|
||||||
|
"@esbuild/darwin-arm64": "npm:0.21.5"
|
||||||
|
"@esbuild/darwin-x64": "npm:0.21.5"
|
||||||
|
"@esbuild/freebsd-arm64": "npm:0.21.5"
|
||||||
|
"@esbuild/freebsd-x64": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-arm": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-arm64": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-ia32": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-loong64": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-mips64el": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-ppc64": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-riscv64": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-s390x": "npm:0.21.5"
|
||||||
|
"@esbuild/linux-x64": "npm:0.21.5"
|
||||||
|
"@esbuild/netbsd-x64": "npm:0.21.5"
|
||||||
|
"@esbuild/openbsd-x64": "npm:0.21.5"
|
||||||
|
"@esbuild/sunos-x64": "npm:0.21.5"
|
||||||
|
"@esbuild/win32-arm64": "npm:0.21.5"
|
||||||
|
"@esbuild/win32-ia32": "npm:0.21.5"
|
||||||
|
"@esbuild/win32-x64": "npm:0.21.5"
|
||||||
|
dependenciesMeta:
|
||||||
|
"@esbuild/aix-ppc64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/android-arm":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/android-arm64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/android-x64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/darwin-arm64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/darwin-x64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/freebsd-arm64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/freebsd-x64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-arm":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-arm64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-ia32":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-loong64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-mips64el":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-ppc64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-riscv64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-s390x":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/linux-x64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/netbsd-x64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/openbsd-x64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/sunos-x64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/win32-arm64":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/win32-ia32":
|
||||||
|
optional: true
|
||||||
|
"@esbuild/win32-x64":
|
||||||
|
optional: true
|
||||||
|
bin:
|
||||||
|
esbuild: bin/esbuild
|
||||||
|
checksum: 10c1/1bed0f5871043244bc2033f323a7e86e06d808df955b47bc5579bb3855d107b67f0adace7d4c747deea856cfc7bb798c3320a4b96ebb832112c915f377b5c9ed
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"escalade@npm:^3.1.1, escalade@npm:^3.2.0":
|
"escalade@npm:^3.1.1, escalade@npm:^3.2.0":
|
||||||
version: 3.2.0
|
version: 3.2.0
|
||||||
resolution: "escalade@npm:3.2.0"
|
resolution: "escalade@npm:3.2.0"
|
||||||
|
|
@ -7967,6 +8223,15 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"get-tsconfig@npm:^4.7.0":
|
||||||
|
version: 4.8.1
|
||||||
|
resolution: "get-tsconfig@npm:4.8.1"
|
||||||
|
dependencies:
|
||||||
|
resolve-pkg-maps: "npm:^1.0.0"
|
||||||
|
checksum: 10c1/680263b7ee8ceb66e88d6625d5b62fe432e280cf313e962e52bfaaae65d286ffe8f22ee35032a40ba0f9988469bcac92b1146ac837da33b8fad97a5b5b763806
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"get-user-locale@npm:^2.2.1":
|
"get-user-locale@npm:^2.2.1":
|
||||||
version: 2.3.2
|
version: 2.3.2
|
||||||
resolution: "get-user-locale@npm:2.3.2"
|
resolution: "get-user-locale@npm:2.3.2"
|
||||||
|
|
@ -8058,7 +8323,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"glob@npm:^8.0.1":
|
"glob@npm:^8.0.1, glob@npm:^8.0.3":
|
||||||
version: 8.1.0
|
version: 8.1.0
|
||||||
resolution: "glob@npm:8.1.0"
|
resolution: "glob@npm:8.1.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -10198,7 +10463,7 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"loader-utils@npm:^2.0.0":
|
"loader-utils@npm:^2.0.0, loader-utils@npm:^2.0.4":
|
||||||
version: 2.0.4
|
version: 2.0.4
|
||||||
resolution: "loader-utils@npm:2.0.4"
|
resolution: "loader-utils@npm:2.0.4"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -11308,7 +11573,7 @@ __metadata:
|
||||||
"@floating-ui/react-dom-interactions": "npm:^0.10.3"
|
"@floating-ui/react-dom-interactions": "npm:^0.10.3"
|
||||||
"@jest/globals": "npm:^29.7.0"
|
"@jest/globals": "npm:^29.7.0"
|
||||||
"@medv/finder": "npm:^3.1.0"
|
"@medv/finder": "npm:^3.1.0"
|
||||||
"@openreplay/sourcemap-uploader": "npm:^3.0.8"
|
"@openreplay/sourcemap-uploader": "npm:^3.0.10"
|
||||||
"@sentry/browser": "npm:^5.21.1"
|
"@sentry/browser": "npm:^5.21.1"
|
||||||
"@svg-maps/world": "npm:^1.0.1"
|
"@svg-maps/world": "npm:^1.0.1"
|
||||||
"@tanstack/react-query": "npm:^5.56.2"
|
"@tanstack/react-query": "npm:^5.56.2"
|
||||||
|
|
@ -11342,6 +11607,7 @@ __metadata:
|
||||||
cypress: "npm:^13.3.0"
|
cypress: "npm:^13.3.0"
|
||||||
cypress-image-snapshot: "npm:^4.0.1"
|
cypress-image-snapshot: "npm:^4.0.1"
|
||||||
dotenv: "npm:^6.2.0"
|
dotenv: "npm:^6.2.0"
|
||||||
|
esbuild-loader: "npm:^4.2.2"
|
||||||
eslint: "npm:^8.15.0"
|
eslint: "npm:^8.15.0"
|
||||||
eslint-plugin-react: "npm:^7.29.4"
|
eslint-plugin-react: "npm:^7.29.4"
|
||||||
fflate: "npm:^0.8.2"
|
fflate: "npm:^0.8.2"
|
||||||
|
|
@ -13847,6 +14113,13 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"resolve-pkg-maps@npm:^1.0.0":
|
||||||
|
version: 1.0.0
|
||||||
|
resolution: "resolve-pkg-maps@npm:1.0.0"
|
||||||
|
checksum: 10c1/e6f8dbe20ebbfdea61503670e5f325782e6d983e59e33c81b314a48910f2edcb9534975c5a14d789d2830c3ab3ae49f022dd6e2fdb56330f242ee3fbd60b46c5
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"resolve.exports@npm:^2.0.0":
|
"resolve.exports@npm:^2.0.0":
|
||||||
version: 2.0.2
|
version: 2.0.2
|
||||||
resolution: "resolve.exports@npm:2.0.2"
|
resolution: "resolve.exports@npm:2.0.2"
|
||||||
|
|
@ -14514,6 +14787,13 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"source-list-map@npm:^2.0.0":
|
||||||
|
version: 2.0.1
|
||||||
|
resolution: "source-list-map@npm:2.0.1"
|
||||||
|
checksum: 10c1/bb3b0d59f90518f20b996eb57a29a62fbd0735f84649f2949591f01ef43a31a27b095a4c9b2f27edce4ea4c8d5b757b86476c532c813e1de84c340d7f2a41264
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"source-map-js@npm:>=0.6.2 <2.0.0, source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.1":
|
"source-map-js@npm:>=0.6.2 <2.0.0, source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.1":
|
||||||
version: 1.2.1
|
version: 1.2.1
|
||||||
resolution: "source-map-js@npm:1.2.1"
|
resolution: "source-map-js@npm:1.2.1"
|
||||||
|
|
@ -16154,6 +16434,16 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"webpack-sources@npm:^1.4.3":
|
||||||
|
version: 1.4.3
|
||||||
|
resolution: "webpack-sources@npm:1.4.3"
|
||||||
|
dependencies:
|
||||||
|
source-list-map: "npm:^2.0.0"
|
||||||
|
source-map: "npm:~0.6.1"
|
||||||
|
checksum: 10c1/fc3c601c48df84178b6e8a297b3d844ea5580011b8cd7d382ffe0241b9fae1f44124337a2981d55f314cd4517f25d9fda20549cd96b279b47a00ac0727cea80f
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"webpack-sources@npm:^3.2.3":
|
"webpack-sources@npm:^3.2.3":
|
||||||
version: 3.2.3
|
version: 3.2.3
|
||||||
resolution: "webpack-sources@npm:3.2.3"
|
resolution: "webpack-sources@npm:3.2.3"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ COMMON_PG_PASSWORD="change_me_pg_password"
|
||||||
COMMON_VERSION="v1.16.0"
|
COMMON_VERSION="v1.16.0"
|
||||||
## DB versions
|
## DB versions
|
||||||
######################################
|
######################################
|
||||||
POSTGRES_VERSION="14.5.0"
|
POSTGRES_VERSION="15.10.0"
|
||||||
REDIS_VERSION="6.0.12-debian-10-r33"
|
REDIS_VERSION="6.0.12-debian-10-r33"
|
||||||
MINIO_VERSION="2023.2.10-debian-11-r1"
|
MINIO_VERSION="2023.2.10-debian-11-r1"
|
||||||
######################################
|
######################################
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue