diff --git a/package.json b/package.json index 15d65b1..66918d9 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,9 @@ ], "scripts": { "build": "yarn workspace @patternfly/react-log-viewer build", + "build:watch": "npm run build:watch -w @patternfly/react-log-viewer", "build:docs": "yarn workspace @patternfly/react-log-viewer docs:build", - "start": "yarn build && concurrently --kill-others \"yarn workspace @patternfly/react-log-viewer docs:develop\"", + "start": "concurrently --kill-others \"npm run build:watch\" \"npm run docs:develop -w @patternfly/react-log-viewer\"", "serve:docs": "yarn workspace @patternfly/react-log-viewer docs:serve", "clean": "yarn workspace @patternfly/react-log-viewer clean", "lint:js": "node --max-old-space-size=4096 node_modules/.bin/eslint packages --ext js,jsx,ts,tsx --cache", diff --git a/packages/module/package.json b/packages/module/package.json index 2935dd4..50e97a8 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -10,6 +10,7 @@ }, "scripts": { "build": "yarn build:esm && yarn build:cjs", + "build:watch": "npm run build:esm -- --watch", "build:esm": "tsc --build --verbose ./tsconfig.json", "build:cjs": "tsc --build --verbose ./tsconfig.cjs.json", "clean": "rimraf dist", diff --git a/packages/module/patternfly-docs/content/extensions/react-log-viewer/examples/realTestData.js b/packages/module/patternfly-docs/content/extensions/react-log-viewer/examples/realTestData.js index 682592c..bffbeb0 100644 --- a/packages/module/patternfly-docs/content/extensions/react-log-viewer/examples/realTestData.js +++ b/packages/module/patternfly-docs/content/extensions/react-log-viewer/examples/realTestData.js @@ -6,5 +6,6 @@ export const data = { 'ERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.strategy.properties.rollingUpdate.properties.maxUnavailable has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.env.items..properties.valueFrom.properties.resourceFieldRef.properties.divisor has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.lifecycle.properties.postStart.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.lifecycle.properties.postStart.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.lifecycle.properties.preStop.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.lifecycle.properties.preStop.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.livenessProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.livenessProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.readinessProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.readinessProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.resources.properties.limits.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.resources.properties.requests.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.startupProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.containers.items..properties.startupProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.env.items..properties.valueFrom.properties.resourceFieldRef.properties.divisor has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.lifecycle.properties.postStart.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.lifecycle.properties.postStart.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.lifecycle.properties.preStop.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.lifecycle.properties.preStop.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.livenessProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.livenessProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.readinessProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.readinessProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.resources.properties.limits.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.resources.properties.requests.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.startupProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.ephemeralContainers.items..properties.startupProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.env.items..properties.valueFrom.properties.resourceFieldRef.properties.divisor has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.lifecycle.properties.postStart.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.lifecycle.properties.postStart.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.lifecycle.properties.preStop.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.lifecycle.properties.preStop.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.livenessProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.livenessProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.readinessProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.readinessProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.resources.properties.limits.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.resources.properties.requests.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.startupProbe.properties.httpGet.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.initContainers.items..properties.startupProbe.properties.tcpSocket.properties.port has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.overhead.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.volumes.items..properties.downwardAPI.properties.items.items..properties.resourceFieldRef.properties.divisor has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.volumes.items..properties.emptyDir.properties.sizeLimit has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.volumes.items..properties.ephemeral.properties.volumeClaimTemplate.properties.spec.properties.resources.properties.limits.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.volumes.items..properties.ephemeral.properties.volumeClaimTemplate.properties.spec.properties.resources.properties.requests.additionalProperties.schema has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.install.properties.spec.properties.deployments.items..properties.spec.properties.template.properties.spec.properties.volumes.items..properties.projected.properties.sources.items..properties.downwardAPI.properties.items.items..properties.resourceFieldRef.properties.divisor has invalid property: anyOf\nERROR $root.definitions.com.coreos.operators.v1alpha1.ClusterServiceVersion.properties.spec.properties.webhookdefinitions.items..properties.targetPort has invalid property: anyOf\nI0223 20:05:07.667701 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:07.667752 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:07.678136 17 store.go:1376] Monitoring clusterserviceversions.operators.coreos.com count at //operators.coreos.com/clusterserviceversions\nI0223 20:05:07.691254 17 aggregator.go:231] Updating OpenAPI spec because v1beta1.metrics.k8s.io is updated\nI0223 20:05:08.674654 17 trace.go:205] Trace[1868691782]: "List etcd3" key:/operators.coreos.com/clusterserviceversions,resourceVersion:,resourceVersionMatch:,limit:10000,continue: (23-Feb-2021 20:05:07.679) (total time: 995ms):\nTrace[1868691782]: [995.4145ms] [995.4145ms] END\nI0223 20:05:08.676188 17 cacher.go:405] cacher (*unstructured.Unstructured): initialized\nI0223 20:05:08.679737 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:08.679784 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:08.698161 17 store.go:1376] Monitoring revisions.serving.knative.dev count at //serving.knative.dev/revisions\nI0223 20:05:08.724867 17 cacher.go:405] cacher (*unstructured.Unstructured): initialized\nI0223 20:05:08.754671 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:08.754723 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:08.767631 17 store.go:1376] Monitoring subscriptions.messaging.knative.dev count at //messaging.knative.dev/subscriptions\nI0223 20:05:08.769534 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:08.769574 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:08.789584 17 store.go:1376] Monitoring subscriptions.messaging.knative.dev count at //messaging.knative.dev/subscriptions\nI0223 20:05:08.810383 17 cacher.go:405] cacher (*unstructured.Unstructured): initialized\nI0223 20:05:08.870012 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:08.870070 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:08.884241 17 store.go:1376] Monitoring sinkbindings.sources.knative.dev count at //sources.knative.dev/sinkbindings\nI0223 20:05:08.888348 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:08.888560 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:08.893263 17 trace.go:205] Trace[779616982]: "Call conversion webhook" custom-resource-definition:subscriptions.messaging.knative.dev,desired-api-version:messaging.knative.dev/v1beta1,object-count:1,UID:dc30bc31-0391-49ed-8c76-86daaa780e14 (23-Feb-2021 20:05:08.794) (total time: 98ms):\nTrace[779616982]: ---"Request completed" 98ms (20:05:00.892)\nTrace[779616982]: [98.488399ms] [98.488399ms] END\nI0223 20:05:08.906377 17 store.go:1376] Monitoring sinkbindings.sources.knative.dev count at //sources.knative.dev/sinkbindings\nI0223 20:05:08.908020 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:08.908056 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:08.930733 17 store.go:1376] Monitoring sinkbindings.sources.knative.dev count at //sources.knative.dev/sinkbindings\nI0223 20:05:08.932408 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:08.932459 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:08.942661 17 cacher.go:405] cacher (*unstructured.Unstructured): initialized\nI0223 20:05:08.946867 17 store.go:1376] Monitoring sinkbindings.sources.knative.dev count at //sources.knative.dev/sinkbindings\nI0223 20:05:08.976732 17 trace.go:205] Trace[417800427]: "Call conversion webhook" custom-resource-definition:sinkbindings.sources.knative.dev,desired-api-version:sources.knative.dev/v1alpha1,object-count:1,UID:4b5243e4-7878-436f-be04-be717cb0f5d2 (23-Feb-2021 20:05:08.902) (total time: 74ms):\nTrace[417800427]: ---"Request completed" 74ms (20:05:00.976)\nTrace[417800427]: [74.13198ms] [74.13198ms] END\nI0223 20:05:08.985668 17 trace.go:205] Trace[154168225]: "Call conversion webhook" custom-resource-definition:subscriptions.messaging.knative.dev,desired-api-version:messaging.knative.dev/v1beta1,object-count:1,UID:ae629e81-0e7d-48f1-acd0-a10d6cfbf71d (23-Feb-2021 20:05:08.894) (total time: 91ms):\nTrace[154168225]: ---"Request completed" 91ms (20:05:00.985)\nTrace[154168225]: [91.438968ms] [91.438968ms] END\nI0223 20:05:08.994436 17 trace.go:205] Trace[584246906]: "Call conversion webhook" custom-resource-definition:sinkbindings.sources.knative.dev,desired-api-version:sources.knative.dev/v1alpha2,object-count:1,UID:113685ab-0a01-4a89-a631-7df924e2a234 (23-Feb-2021 20:05:08.914) (total time: 79ms):\nTrace[584246906]: ---"Request completed" 79ms (20:05:00.994)\nTrace[584246906]: [79.431148ms] [79.431148ms] END\nI0223 20:05:09.018345 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:09.018401 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:09.031128 17 store.go:1376] Monitoring triggers.eventing.knative.dev count at //eventing.knative.dev/triggers\nI0223 20:05:09.032798 17 client.go:360] parsed scheme: "endpoint"\nI0223 20:05:09.032846 17 endpoint.go:68] ccResolverWrapper: sending new addresses to cc: [{https://10.0.137.156:2379 0 } {https://10.0.158.175:2379 0 } {https://10.0.171.12:2379 0 } {https://localhost:2379 0 }]\nI0223 20:05:09.051739 17 store.go:1376] Monitoring triggers.eventing.knative.dev count at //eventing.knative.dev/triggers\nI0223 20:05:09.061374 17 cacher.go:405] cacher (*unstructured.Unstructured): initialized\nI0223 20:05:09.077620 17 trace.go:205] Trace[522766072]: "Call conversion webhook" custom-resource-definition:sinkbindings.sources.knative.dev,desired-api-version:sources.knative.dev/v1alpha2,object-count:1,UID:3f02b86e-279b-48f8-86c5-1f991d16c2bf (23-Feb-2021 20:05:08.995) (total time: 82ms):\nTrace[522766072]: ---"Request completed" 82ms (20:05:00.077)\nTrace[522766072]: [82.519697ms] [82.519697ms] END\nI0223 20:05:09.079213 17 trace.go:205] Trace[1177843340]: "Call conversion webhook" custom-resource-definition:sinkbindings.sources.knative.dev,desired-api-version:sources.knative.dev/v1alpha1,object-count:1,UID:03355f47-7e36-4c38-8fac-5d88274d53f2 (23-Feb-2021 20:05:08.993) (total time: 85ms):\nTrace[1177843340]: ---"Request completed" 85ms (20:05:00.079)\nTrace[1177843340]: [85.564957ms] [85.564957ms] END\nI0223 20:05:09.079479 17 trace.go:205] Trace[1358236459]: "Call conversion webhook" custom-resource-definition:sinkbindings.sources.knative.dev,desired-api-version:sources.knative.dev/v1,object-count:1,UID:014eb05c-1142-4ab5-9afb-821a9c656d20 (23-Feb-2021 20:05:08.993) (total time: 85ms):\nTrace[1358236459]: ---"Request completed" 85ms (20:05:00.079)\nTrace[1358236459]: [85.687911ms] [85.687911ms] END\nI0223 20:05:09.080737 17 trace.go:205] Trace[1389066300]: "Call conversion webhook" custom-resource-definition:subscriptions.messaging.knative.dev,desired-api-version:messaging.knative.dev/v1beta1,object-count:1,UID:b21ca313-1b4a-4860-ab13-c36b8ee2d75c (23-Feb-2021 20:05:08.986) (total time: 94ms):\nTrace[1389066300]: ---"Request completed" 94ms (20:05:00.080)\nTrace[1389066300]: [94.341421ms] [94.341421ms] END\nI0223 20:05:09.088080 17 cacher.go:405] cacher (*unstructured.Unstructured): initialized\nI0223 20:05:09.176930 17 trace.go:205] Trace[499287539]: "Call conversion webhook" custom-resource-definition:sinkbindings.sources.knative.dev,desired-api-version:sources.knative.dev/v1,object-count:1,UID:d5cf8bb5-5d16-4497-8097-5809bd169e69 (23-Feb-2021 20:05:09.088) (total time: 87ms):\nTrace[499287539]: ---"Request completed" 87ms (20:05:00.176)\nTrace[499287539]: [87.977259ms] [87.977259ms] END\nI0223 20:05:09.178693 17 trace.go:205] Trace[632851168]: "Call conversion webhook" custom-resource-definition:triggers.eventing.knative.dev,desired-api-version:eventing.knative.dev/v1beta1,object-count:1,UID:ecd63ff4-facd-4a3c-b782-751b20615f5b (23-Feb-2021 20:05:09.085) (total time: 93ms):\nTrace[632851168]: ---"Request completed" 92ms (20:05:00.178)\nTrace[632851168]: [93.051535ms] [93.051535ms] END\nI0223 20:05:09.179793 17 trace.go:205] Trace[2084183409]: "Call conversion webhook" custom-resource-definition:subscriptions.messaging.knative.dev,desired-api-version:messaging.knative.dev/v1beta1,object-count:1,UID:d5ed3cee-18f2-4dd4-837e-46b164169981 (23-Feb-2021 20:05:09.087) (total time: 92ms):\nTrace[2084183409]: ---"Request completed" 92ms (20:05:00.179)\nTrace[2084183409]: [92.490416ms] [92.490416ms] END\nI0223 20:05:09.182656 17 cacher.go:405] cacher (*unstructured.Unstructured): initialized\nI0223 20:05:09.183483 17 trace.go:205] Trace[240293913]: "Call conversion webhook" custom-resource-definition:sinkbindings.sources.knative.dev,desired-api-version:sources.knative.dev/v1alpha2,object-count:1,UID:78ee597e-16c1-4a1c-98f2-c73004704dfa (23-Feb-2021 20:05:09.088) (total time: 95ms):\nTrace[240293913]: ---"Request completed" 95ms (20:05:00.183)\nTrace[240293913]: [95.411733ms] [95.411733ms] END', data3: 'I0223 20:39:09.342678 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:39:09.342725 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.158.175:2379 0 }] }\nI0223 20:39:09.342741 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:39:09.342948 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc02b047080, {CONNECTING }\nI0223 20:39:09.355135 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc02b047080, {READY }\nI0223 20:39:09.356758 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nI0223 20:39:09.905720 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:39:09.905783 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.137.156:2379 0 }] }\nI0223 20:39:09.905801 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:39:09.905898 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc01d3d8c00, {CONNECTING }\nI0223 20:39:09.921266 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc01d3d8c00, {READY }\nI0223 20:39:09.924744 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nI0223 20:39:17.533766 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:39:17.533829 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.171.12:2379 0 }] }\nI0223 20:39:17.533848 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:39:17.534106 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc0126046c0, {CONNECTING }\nI0223 20:39:17.543548 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc0126046c0, {READY }\nI0223 20:39:17.544838 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nI0223 20:39:18.558397 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:39:18.558470 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://localhost:2379 0 }] }\nI0223 20:39:18.558488 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:39:18.558854 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc020159ca0, {CONNECTING }\nI0223 20:39:18.570488 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc020159ca0, {READY }\nI0223 20:39:18.571686 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nE0223 20:39:33.145599 17 controller.go:116] loading OpenAPI spec for "v1.admission.work.open-cluster-management.io" failed with: OpenAPI spec does not exist\nI0223 20:39:33.145632 17 controller.go:129] OpenAPI AggregationController: action for item v1.admission.work.open-cluster-management.io: Rate Limited Requeue.\nE0223 20:39:33.178176 17 controller.go:116] loading OpenAPI spec for "v1beta1.webhook.certmanager.k8s.io" failed with: OpenAPI spec does not exist\nI0223 20:39:33.178219 17 controller.go:129] OpenAPI AggregationController: action for item v1beta1.webhook.certmanager.k8s.io: Rate Limited Requeue.\nE0223 20:39:33.196678 17 controller.go:116] loading OpenAPI spec for "v1.admission.hive.openshift.io" failed with: OpenAPI spec does not exist\nI0223 20:39:33.196719 17 controller.go:129] OpenAPI AggregationController: action for item v1.admission.hive.openshift.io: Rate Limited Requeue.\nE0223 20:39:33.215606 17 controller.go:116] loading OpenAPI spec for "v1.admission.cluster.open-cluster-management.io" failed with: OpenAPI spec does not exist\nI0223 20:39:33.215640 17 controller.go:129] OpenAPI AggregationController: action for item v1.admission.cluster.open-cluster-management.io: Rate Limited Requeue.\nI0223 20:39:33.815455 17 cacher.go:782] cacher (*core.Pod): 1 objects queued in incoming channel.\nI0223 20:39:33.815486 17 cacher.go:782] cacher (*core.Pod): 2 objects queued in incoming channel.\nE0223 20:39:50.321232 17 writers.go:107] apiserver was unable to write a JSON response: http: Handler timeout\nE0223 20:39:50.321441 17 status.go:71] apiserver received an error that is not an metav1.Status: &errors.errorString{s:"http: Handler timeout"}\nE0223 20:39:50.322557 17 writers.go:120] apiserver was unable to write a fallback JSON response: http: Handler timeout\nI0223 20:39:52.263464 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:39:52.263552 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.171.12:2379 0 }] }\nI0223 20:39:52.263567 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:39:52.263655 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc02c6afc90, {CONNECTING }\nI0223 20:39:52.274876 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc02c6afc90, {READY }\nI0223 20:39:52.275771 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nI0223 20:39:52.578122 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:39:52.578176 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.158.175:2379 0 }] }\nI0223 20:39:52.578193 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:39:52.578497 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc02cf76750, {CONNECTING }\nI0223 20:39:52.591004 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc02cf76750, {READY }\nI0223 20:39:52.592632 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nI0223 20:39:54.756286 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:39:54.756333 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.137.156:2379 0 }] }\nI0223 20:39:54.756344 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:39:54.756414 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc023625960, {CONNECTING }\nI0223 20:39:54.767808 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc023625960, {READY }\nI0223 20:39:54.769129 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nI0223 20:39:56.404294 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:39:56.404345 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://localhost:2379 0 }] }\nI0223 20:39:56.404361 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:39:56.404481 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc021f4dcb0, {CONNECTING }\nI0223 20:39:56.415138 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc021f4dcb0, {READY }\nI0223 20:39:56.416213 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nE0223 20:40:02.220022 17 writers.go:107] apiserver was unable to write a JSON response: http: Handler timeout\nE0223 20:40:02.220127 17 status.go:71] apiserver received an error that is not an metav1.Status: &errors.errorString{s:"http: Handler timeout"}\nE0223 20:40:02.221866 17 writers.go:120] apiserver was unable to write a fallback JSON response: http: Handler timeout\nI0223 20:40:25.339731 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:40:25.339789 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.158.175:2379 0 }] }\nI0223 20:40:25.339807 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:40:25.340129 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc015a709b0, {CONNECTING }\nI0223 20:40:25.353181 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc015a709b0, {READY }\nI0223 20:40:25.354655 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nI0223 20:40:30.462091 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:40:30.462135 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.171.12:2379 0 }] }\nI0223 20:40:30.462146 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:40:30.462230 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc016332960, {CONNECTING }\nI0223 20:40:30.472773 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc016332960, {READY }\nI0223 20:40:30.474206 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nE0223 20:40:31.243026 17 writers.go:107] apiserver was unable to write a JSON response: http: Handler timeout\nE0223 20:40:31.243150 17 status.go:71] apiserver received an error that is not an metav1.Status: &errors.errorString{s:"http: Handler timeout"}\nE0223 20:40:31.244166 17 writers.go:120] apiserver was unable to write a fallback JSON response: http: Handler timeout\nE0223 20:40:33.150787 17 controller.go:116] loading OpenAPI spec for "v1.admission.work.open-cluster-management.io" failed with: OpenAPI spec does not exist\nI0223 20:40:33.150819 17 controller.go:129] OpenAPI AggregationController: action for item v1.admission.work.open-cluster-management.io: Rate Limited Requeue.\nE0223 20:40:33.190190 17 controller.go:116] loading OpenAPI spec for "v1beta1.webhook.certmanager.k8s.io" failed with: OpenAPI spec does not exist\nI0223 20:40:33.190224 17 controller.go:129] OpenAPI AggregationController: action for item v1beta1.webhook.certmanager.k8s.io: Rate Limited Requeue.\nE0223 20:40:33.201566 17 controller.go:116] loading OpenAPI spec for "v1.admission.hive.openshift.io" failed with: OpenAPI spec does not exist\nI0223 20:40:33.201592 17 controller.go:129] OpenAPI AggregationController: action for item v1.admission.hive.openshift.io: Rate Limited Requeue.\nE0223 20:40:33.221136 17 controller.go:116] loading OpenAPI spec for "v1.admission.cluster.open-cluster-management.io" failed with: OpenAPI spec does not exist\nI0223 20:40:33.221163 17 controller.go:129] OpenAPI AggregationController: action for item v1.admission.cluster.open-cluster-management.io: Rate Limited Requeue.\nI0223 20:40:36.603974 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:40:36.604027 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://localhost:2379 0 }] }\nI0223 20:40:36.604042 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:40:36.604223 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc02aa90b70, {CONNECTING }\nI0223 20:40:36.613458 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc02aa90b70, {READY }\nI0223 20:40:36.614529 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nI0223 20:40:37.663227 17 client.go:360] parsed scheme: "passthrough"\nI0223 20:40:37.663281 17 passthrough.go:48] ccResolverWrapper: sending update to cc: {[{https://10.0.137.156:2379 0 }] }\nI0223 20:40:37.663296 17 clientconn.go:948] ClientConn switching balancer to "pick_first"\nI0223 20:40:37.663389 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc015fa35a0, {CONNECTING }\nI0223 20:40:37.676172 17 balancer_conn_wrappers.go:78] pickfirstBalancer: HandleSubConnStateChange: 0xc015fa35a0, {READY }\nI0223 20:40:37.677917 17 controlbuf.go:508] transport: loopyWriter.run returning. connection error: desc = "transport is closing"\nE0223 20:40:40.123848 17 writers.go:64] error encountered while streaming results via websocket: context canceled\nI0223 20:40:40.123959 17 trace.go:205] Trace[1418061176]: "Get" url:/api/v1/namespaces/openshift-kube-apiserver/pods/kube-apiserver-ip-10-0-171-12.ec2.internal/log,user-agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36,client:76.182.85.204 (23-Feb-2021 20:13:49.846) (total time: 1610277ms):\nTrace[1418061176]: ---"Transformed response object" 1610268ms (20:40:00.123)\nTrace[1418061176]: [26m50.277491693s] [26m50.277491693s] END', - data4: `\x1b[4;1mRunning "clean:all" (clean) task\x1b[0m\n\x1b[32m>> \x1b[39m0 paths cleaned.\n\n\x1b[4;1mRunning "copy:base" (copy) task\x1b[0m\nCreated 188 directories, copied 1433 files\n\n\x1b[4;1mRunning "copy:app" (copy) task\x1b[0m\nCreated 40 directories, copied 233 files\n\n\x1b[4;1mRunning "processhtml:dist" (processhtml) task\x1b[0m\n\n\x1b[4;1mRunning "ngAnnotate:dist" (ngAnnotate) task\x1b[0m\n\x1b[32m>> \x1b[39m52 files successfully generated.\n\n\x1b[4;1mRunning "uglify:dist" (uglify) task\x1b[0m\n\x1b[32m>> \x1b[39m2 sourcemaps created.\n\x1b[32m>> \x1b[39m2 files created.\n\n\x1b[4;1mRunning "less:app" (less) task\x1b[0m\n\x1b[32mFile target/dist/css/alertEvents.css created\x1b[39m\n\x1b[32mFile target/dist/css/application.css created\x1b[39m\n\n\x1b[4;1mRunning "less:libs" (less) task\x1b[0m\n\x1b[31mCreate file target/dist/css/libs.css failed\x1b[39m` + data4: `\x1b[4;1mRunning "clean:all" (clean) task\x1b[0m\n\x1b[32m>> \x1b[39m0 paths cleaned.\n\n\x1b[4;1mRunning "copy:base" (copy) task\x1b[0m\nCreated 188 directories, copied 1433 files\n\n\x1b[4;1mRunning "copy:app" (copy) task\x1b[0m\nCreated 40 directories, copied 233 files\n\n\x1b[4;1mRunning "processhtml:dist" (processhtml) task\x1b[0m\n\n\x1b[4;1mRunning "ngAnnotate:dist" (ngAnnotate) task\x1b[0m\n\x1b[32m>> \x1b[39m52 files successfully generated.\n\n\x1b[4;1mRunning "uglify:dist" (uglify) task\x1b[0m\n\x1b[32m>> \x1b[39m2 sourcemaps created.\n\x1b[32m>> \x1b[39m2 files created.\n\n\x1b[4;1mRunning "less:app" (less) task\x1b[0m\n\x1b[32mFile target/dist/css/alertEvents.css created\x1b[39m\n\x1b[32mFile target/dist/css/application.css created\x1b[39m\n\n\x1b[4;1mRunning "less:libs" (less) task\x1b[0m\n\x1b[31mCreate file target/dist/css/libs.css failed\x1b[39m`, + long: (length) => `${Array.from({ length: length / 2 }).reduce((acc, _) => acc + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ', '')}\n${Array.from({ length }).reduce((acc, _) => acc + 'Long dummy text number two, this should help test scrolling. ', '')}\nSecond line second line second line second line second line second line second line second line\nThird line`, }; diff --git a/packages/module/patternfly-docs/generated/extensions/log-viewer/react.js b/packages/module/patternfly-docs/generated/extensions/log-viewer/react.js index 2c70c71..94229cc 100644 --- a/packages/module/patternfly-docs/generated/extensions/log-viewer/react.js +++ b/packages/module/patternfly-docs/generated/extensions/log-viewer/react.js @@ -26,6 +26,11 @@ const pageData = { "type": "string | string[]", "description": "String or String Array data being sent by the consumer" }, + { + "name": "fastRowHeightEstimationLimit", + "type": "number", + "description": "The maximum char length for fast row height estimation.\nFor wrapped lines in Chrome based browsers, lines over this length will actually be rendered to the dom and\nmeasured to prevent a bug where one line can overlap another." + }, { "name": "footer", "type": "React.ReactNode", @@ -101,6 +106,11 @@ const pageData = { "type": "React.ReactNode", "description": "Toolbar rendered in the log viewer header" }, + { + "name": "useAnsiClasses", + "type": "boolean", + "description": "Flag to enable or disable the use of classes (instead of inline styles) for ANSI coloring/formatting." + }, { "name": "width", "type": "number | string", diff --git a/packages/module/src/LogViewer/LogViewer.tsx b/packages/module/src/LogViewer/LogViewer.tsx index 686d7fb..127f101 100644 --- a/packages/module/src/LogViewer/LogViewer.tsx +++ b/packages/module/src/LogViewer/LogViewer.tsx @@ -59,6 +59,11 @@ interface LogViewerProps { innerRef?: React.RefObject; /** Flag to enable or disable the use of classes (instead of inline styles) for ANSI coloring/formatting. */ useAnsiClasses?: boolean; + /** The maximum char length for fast row height estimation. + * For wrapped lines in Chrome based browsers, lines over this length will actually be rendered to the dom and + * measured to prevent a bug where one line can overlap another. + */ + fastRowHeightEstimationLimit?: number; } let canvas: HTMLCanvasElement | undefined; @@ -92,6 +97,7 @@ const LogViewerBase: React.FunctionComponent = memo( isTextWrapped = true, initialIndexWidth, useAnsiClasses, + fastRowHeightEstimationLimit = 5000, ...props }: LogViewerProps) => { const [searchedInput, setSearchedInput] = useState(''); @@ -108,6 +114,8 @@ const LogViewerBase: React.FunctionComponent = memo( /* Parse data every time it changes */ const parsedData = React.useMemo(() => parseConsoleOutput(data), [data]); + const isChrome = React.useMemo(() => navigator.userAgent.indexOf('Chrome') !== -1, []); + const ansiUp = new AnsiUp(); // eslint-disable-next-line camelcase ansiUp.escape_html = false; @@ -228,6 +236,26 @@ const LogViewerBase: React.FunctionComponent = memo( setListKey(listKey => listKey + 1); }, [isTextWrapped]); + const computeRowHeight = (rowText: string, estimatedHeight: number) => { + const logViewerList = containerRef.current.firstChild.firstChild; + + // early return with the estimated height if the log viewer list hasn't been rendered yet, + // this will be called again once it has been rendered and the correct height will be set + if (!logViewerList) { + return estimatedHeight; + } + + const dummyText = document.createElement('span'); + dummyText.className = css(styles.logViewerText); + dummyText.innerHTML = rowText; + + logViewerList.appendChild(dummyText); + const computedHeight = dummyText.clientHeight + logViewerList.removeChild(dummyText); + + return computedHeight + } + const guessRowHeight = (rowIndex: number) => { if (!isTextWrapped) { return lineHeight; @@ -237,7 +265,16 @@ const LogViewerBase: React.FunctionComponent = memo( // get the row numbers of the current text const numRows = Math.ceil(rowText.length / charNumsPerLine); // multiply by line height to get the total height - return lineHeight * (numRows || 1); + const heightGuess = lineHeight * (numRows || 1); + + // because of a bug in react-window (which seems to be limited to chrome) we need to + // actually compute row height in long lines to prevent them from overflowing. + // related issue https://github.com/bvaughn/react-window/issues/593 + if (rowText.length > fastRowHeightEstimationLimit && isChrome && isTextWrapped) { + return computeRowHeight(rowText, heightGuess); + } + + return heightGuess }; const createList = (parsedData: string[]) => (