2023-09-02 05:12:05 +02:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) Microsoft Corporation.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
2023-10-26 20:15:43 +02:00
|
|
|
import type { ActionTraceEventInContext } from './modelUtil';
|
2023-09-02 05:12:05 +02:00
|
|
|
import * as React from 'react';
|
|
|
|
|
import { ListView } from '@web/components/listView';
|
|
|
|
|
import { PlaceholderPanel } from './placeholderPanel';
|
|
|
|
|
|
2023-10-26 20:15:43 +02:00
|
|
|
const LogList = ListView<{ message: string, time: number }>;
|
2023-09-02 05:12:05 +02:00
|
|
|
|
|
|
|
|
export const LogTab: React.FunctionComponent<{
|
2023-10-26 20:15:43 +02:00
|
|
|
action: ActionTraceEventInContext | undefined,
|
2023-09-02 05:12:05 +02:00
|
|
|
}> = ({ action }) => {
|
|
|
|
|
if (!action?.log.length)
|
|
|
|
|
return <PlaceholderPanel text='No log entries' />;
|
|
|
|
|
return <LogList
|
2023-09-08 02:14:39 +02:00
|
|
|
name='log'
|
2023-09-02 05:12:05 +02:00
|
|
|
items={action?.log || []}
|
2023-10-26 20:15:43 +02:00
|
|
|
render={logLine => logLine.message}
|
2023-09-02 05:12:05 +02:00
|
|
|
/>;
|
|
|
|
|
};
|