Merge branch 'main' into dev

This commit is contained in:
nick-delirium 2023-04-07 16:08:57 +02:00
commit 2896ee7aa3
15 changed files with 376 additions and 351 deletions

View file

@ -10,9 +10,7 @@ from chalicelib.utils import pg_client
def app_connection_string(name, port, path):
namespace = config("POD_NAMESPACE", default="app")
conn_string = config("CLUSTER_URL", default="svc.cluster.local")
return (
"http://" + name + "." + namespace + "." + conn_string + ":" + port + "/" + path
)
return f"http://{name}.{namespace}.{conn_string}:{port}/{path}"
HEALTH_ENDPOINTS = {

View file

@ -11,9 +11,7 @@ from chalicelib.utils import pg_client, ch_client
def app_connection_string(name, port, path):
namespace = config("POD_NAMESPACE", default="app")
conn_string = config("CLUSTER_URL", default="svc.cluster.local")
return (
"http://" + name + "." + namespace + "." + conn_string + ":" + port + "/" + path
)
return f"http://{name}.{namespace}.{conn_string}:{port}/{path}"
HEALTH_ENDPOINTS = {

View file

@ -112,6 +112,7 @@ def get_replay(project_id, session_id, context: schemas.CurrentContext, full_dat
SELECT
s.*,
s.session_id::text AS session_id,
encode(file_key,'hex') AS file_key,
(SELECT project_key FROM public.projects WHERE project_id = %(project_id)s LIMIT 1) AS project_key
{"," if len(extra_query) > 0 else ""}{",".join(extra_query)}
{(",json_build_object(" + ",".join([f"'{m}',p.{m}" for m in metadata.column_names()]) + ") AS project_metadata") if group_metadata else ''}

View file

@ -56,7 +56,7 @@ function Player(props: IProps) {
</div>
{bottomBlock === CONSOLE ? (
<div style={{ maxWidth, width: '100%' }}>
<ConsolePanel />
<ConsolePanel isLive />
</div>
) : null}
{!fullView && !isMultiview ? (

View file

@ -1,8 +1,7 @@
import React, { useEffect } from 'react';
import React, { CSSProperties, useEffect } from 'react';
import cn from 'classnames';
import stl from './bottomBlock.module.css';
let timer = null;
const BottomBlock = ({
children = null,
className = '',
@ -10,6 +9,13 @@ const BottomBlock = ({
onMouseEnter = () => {},
onMouseLeave = () => {},
...props
}: {
children?: React.ReactNode;
className?: string;
additionalHeight?: number;
onMouseEnter?: () => void;
onMouseLeave?: () => void;
style?: Partial<CSSProperties>;
}) => {
useEffect(() => {}, []);

View file

@ -6,7 +6,7 @@ const Content = ({
children,
className,
...props
}) => (
}: { children?: React.ReactNode; className?: string }) => (
<div className={ cn(className, stl.content) } { ...props } >
{ children }
</div>

View file

@ -12,6 +12,12 @@ const Header = ({
onFilterChange,
showClose = true,
...props
}: {
children?: React.ReactNode;
className?: string;
closeBottomBlock?: () => void;
onFilterChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
showClose?: boolean;
}) => (
<div className={ cn("relative border-r border-l py-1", stl.header) } >
<div className={ cn("w-full h-full flex justify-between items-center", className) } >

View file

@ -29,7 +29,7 @@ const LEVEL_TAB = {
const TABS = [ALL, ERRORS, WARNINGS, INFO].map((tab) => ({ text: tab, key: tab }));
function renderWithNL(s = '') {
function renderWithNL(s: string | null = '') {
if (typeof s !== 'string') return '';
return s.split('\n').map((line, i) => <div key={i + line.slice(0, 6)} className={cn({ 'ml-20': i !== 0 })}>{line}</div>);
}
@ -59,7 +59,7 @@ const getIconProps = (level: any) => {
const INDEX_KEY = 'console';
function ConsolePanel() {
function ConsolePanel({ isLive }: { isLive: boolean }) {
const {
sessionStore: { devTools },
} = useStore()
@ -75,10 +75,13 @@ function ConsolePanel() {
const jump = (t: number) => player.jump(t)
const { logList, exceptionsList, logListNow, exceptionsListNow } = store.get()
const list = useMemo(() =>
logList.concat(exceptionsList).sort((a, b) => a.time - b.time),
const list = isLive ?
useMemo(() => logListNow.concat(exceptionsListNow).sort((a, b) => a.time - b.time),
[logListNow.length, exceptionsListNow.length]
) as ILog[]
: useMemo(() => logList.concat(exceptionsList).sort((a, b) => a.time - b.time),
[ logList.length, exceptionsList.length ],
) as ILog[]
) as ILog[]
let filteredList = useRegExListFilterMemo(list, l => l.value, filter)
filteredList = useTabListFilterMemo(filteredList, l => LEVEL_TAB[l.level], ALL, activeTab)
@ -101,7 +104,7 @@ function ConsolePanel() {
timeoutStartAutoscroll()
}
const _list = useRef(null); // TODO: fix react-virtualized types & incapsulate scrollToRow logic
const _list = useRef(null); // TODO: fix react-virtualized types & encapsulate scrollToRow logic
useEffect(() => {
if (_list.current) {
// @ts-ignore
@ -132,7 +135,7 @@ function ConsolePanel() {
return (
// @ts-ignore
<CellMeasurer cache={cache} columnIndex={0} key={key} rowIndex={index} parent={parent}>
{({ measure }: any) => (
{() => (
<ConsoleRow
style={style}
log={item}

View file

@ -21,7 +21,7 @@ function ConsoleRow(props: Props) {
const toggleExpand = () => {
setExpanded(!expanded);
setTimeout(() => recalcHeight(), 0);
setTimeout(() => recalcHeight?.(), 0);
};
return (
<div

View file

@ -1,7 +1,7 @@
import React from 'react';
import { Icon } from 'UI';
export default function CloseButton({ size, onClick, className = '', style }){
export default function CloseButton({ size, onClick, className = '', style }: { size?: number | string; onClick?: () => void; className?: string; style?: React.CSSProperties }){
return (
<button onClick={ onClick } className={ `${ className } cursor-pointer` } style={ style } >
<Icon name="close" size={ size } color="gray-medium"/>

View file

@ -109,7 +109,7 @@ export default class UserStore {
const newUser = new User().fromJson(response);
if (wasCreating) {
this.modifiedCount -= 1;
this.list.push(new User().fromJson(newUser));
this.list.push(newUser);
toast.success('User created successfully');
} else {
this.updateUser(newUser);

View file

@ -93,8 +93,10 @@ export default class WebPlayer extends Player {
scale = () => {
const { width, height } = this.wpState.get()
this.screen.scale({ width, height })
this.inspectorController.scale({ width, height })
if (!this.screen && !this.inspectorController) return;
// sometimes happens in live assist sessions for some reason
this.screen?.scale?.({ width, height })
this.inspectorController?.scale?.({ width, height })
this.targetMarker.updateMarkedTargets()
}

View file

@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.4
version: 0.1.7
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
AppVersion: "v1.11.4"
AppVersion: "v1.11.7"

View file

@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (frontends://semver.org/)
version: 0.1.5
version: 0.1.7
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
AppVersion: "v1.11.4"
AppVersion: "v1.11.6"

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 558 KiB

After

Width:  |  Height:  |  Size: 570 KiB