|
|
@ -60,7 +60,10 @@ const SettingsLogs = () => {
|
|
|
|
const [currentFilter, setCurrentFilter] = useState<Filter>('debug');
|
|
|
|
const [currentFilter, setCurrentFilter] = useState<Filter>('debug');
|
|
|
|
const [currentPageSize, setCurrentPageSize] = useState(25);
|
|
|
|
const [currentPageSize, setCurrentPageSize] = useState(25);
|
|
|
|
const [refreshInterval, setRefreshInterval] = useState(5000);
|
|
|
|
const [refreshInterval, setRefreshInterval] = useState(5000);
|
|
|
|
const [activeLog, setActiveLog] = useState<LogMessage | null>(null);
|
|
|
|
const [activeLog, setActiveLog] = useState<{
|
|
|
|
|
|
|
|
isOpen: boolean;
|
|
|
|
|
|
|
|
log?: LogMessage;
|
|
|
|
|
|
|
|
}>({ isOpen: false });
|
|
|
|
|
|
|
|
|
|
|
|
const page = router.query.page ? Number(router.query.page) : 1;
|
|
|
|
const page = router.query.page ? Number(router.query.page) : 1;
|
|
|
|
const pageIndex = page - 1;
|
|
|
|
const pageIndex = page - 1;
|
|
|
@ -143,14 +146,16 @@ const SettingsLogs = () => {
|
|
|
|
leaveFrom="opacity-100"
|
|
|
|
leaveFrom="opacity-100"
|
|
|
|
leaveTo="opacity-0"
|
|
|
|
leaveTo="opacity-0"
|
|
|
|
appear
|
|
|
|
appear
|
|
|
|
show={!!activeLog}
|
|
|
|
show={activeLog.isOpen}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Modal
|
|
|
|
<Modal
|
|
|
|
title={intl.formatMessage(messages.logDetails)}
|
|
|
|
title={intl.formatMessage(messages.logDetails)}
|
|
|
|
iconSvg={<DocumentSearchIcon />}
|
|
|
|
iconSvg={<DocumentSearchIcon />}
|
|
|
|
onCancel={() => setActiveLog(null)}
|
|
|
|
onCancel={() => setActiveLog({ log: activeLog.log, isOpen: false })}
|
|
|
|
cancelText={intl.formatMessage(globalMessages.close)}
|
|
|
|
cancelText={intl.formatMessage(globalMessages.close)}
|
|
|
|
onOk={() => (activeLog ? copyLogString(activeLog) : undefined)}
|
|
|
|
onOk={() =>
|
|
|
|
|
|
|
|
activeLog.log ? copyLogString(activeLog.log) : undefined
|
|
|
|
|
|
|
|
}
|
|
|
|
okText={intl.formatMessage(messages.copyToClipboard)}
|
|
|
|
okText={intl.formatMessage(messages.copyToClipboard)}
|
|
|
|
okButtonType="primary"
|
|
|
|
okButtonType="primary"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -162,7 +167,7 @@ const SettingsLogs = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="mb-1 text-sm font-medium leading-5 text-gray-400 sm:mt-2">
|
|
|
|
<div className="mb-1 text-sm font-medium leading-5 text-gray-400 sm:mt-2">
|
|
|
|
<div className="flex max-w-lg items-center">
|
|
|
|
<div className="flex max-w-lg items-center">
|
|
|
|
{intl.formatDate(activeLog.timestamp, {
|
|
|
|
{intl.formatDate(activeLog.log?.timestamp, {
|
|
|
|
year: 'numeric',
|
|
|
|
year: 'numeric',
|
|
|
|
month: 'short',
|
|
|
|
month: 'short',
|
|
|
|
day: '2-digit',
|
|
|
|
day: '2-digit',
|
|
|
@ -181,16 +186,16 @@ const SettingsLogs = () => {
|
|
|
|
<div className="flex max-w-lg items-center">
|
|
|
|
<div className="flex max-w-lg items-center">
|
|
|
|
<Badge
|
|
|
|
<Badge
|
|
|
|
badgeType={
|
|
|
|
badgeType={
|
|
|
|
activeLog.level === 'error'
|
|
|
|
activeLog.log?.level === 'error'
|
|
|
|
? 'danger'
|
|
|
|
? 'danger'
|
|
|
|
: activeLog.level === 'warn'
|
|
|
|
: activeLog.log?.level === 'warn'
|
|
|
|
? 'warning'
|
|
|
|
? 'warning'
|
|
|
|
: activeLog.level === 'info'
|
|
|
|
: activeLog.log?.level === 'info'
|
|
|
|
? 'success'
|
|
|
|
? 'success'
|
|
|
|
: 'default'
|
|
|
|
: 'default'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{activeLog.level.toUpperCase()}
|
|
|
|
{activeLog.log?.level.toUpperCase()}
|
|
|
|
</Badge>
|
|
|
|
</Badge>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -201,7 +206,7 @@ const SettingsLogs = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="mb-1 text-sm font-medium leading-5 text-gray-400 sm:mt-2">
|
|
|
|
<div className="mb-1 text-sm font-medium leading-5 text-gray-400 sm:mt-2">
|
|
|
|
<div className="flex max-w-lg items-center">
|
|
|
|
<div className="flex max-w-lg items-center">
|
|
|
|
{activeLog.label}
|
|
|
|
{activeLog.log?.label}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -211,18 +216,18 @@ const SettingsLogs = () => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="col-span-2 mb-1 text-sm font-medium leading-5 text-gray-400 sm:mt-2">
|
|
|
|
<div className="col-span-2 mb-1 text-sm font-medium leading-5 text-gray-400 sm:mt-2">
|
|
|
|
<div className="flex max-w-lg items-center">
|
|
|
|
<div className="flex max-w-lg items-center">
|
|
|
|
{activeLog.message}
|
|
|
|
{activeLog.log?.message}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{activeLog.data && (
|
|
|
|
{activeLog.log?.data && (
|
|
|
|
<div className="form-row">
|
|
|
|
<div className="form-row">
|
|
|
|
<div className="text-label">
|
|
|
|
<div className="text-label">
|
|
|
|
{intl.formatMessage(messages.extraData)}
|
|
|
|
{intl.formatMessage(messages.extraData)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="col-span-2 mb-1 text-sm font-medium leading-5 text-gray-400 sm:mt-2">
|
|
|
|
<div className="col-span-2 mb-1 text-sm font-medium leading-5 text-gray-400 sm:mt-2">
|
|
|
|
<code className="block max-h-64 w-full overflow-auto whitespace-pre bg-gray-800 px-6 py-4 ring-1 ring-gray-700">
|
|
|
|
<code className="block max-h-64 w-full overflow-auto whitespace-pre bg-gray-800 px-6 py-4 ring-1 ring-gray-700">
|
|
|
|
{JSON.stringify(activeLog.data, null, ' ')}
|
|
|
|
{JSON.stringify(activeLog.log?.data, null, ' ')}
|
|
|
|
</code>
|
|
|
|
</code>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -336,7 +341,9 @@ const SettingsLogs = () => {
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
buttonType="primary"
|
|
|
|
buttonType="primary"
|
|
|
|
buttonSize="sm"
|
|
|
|
buttonSize="sm"
|
|
|
|
onClick={() => setActiveLog(row)}
|
|
|
|
onClick={() =>
|
|
|
|
|
|
|
|
setActiveLog({ log: row, isOpen: true })
|
|
|
|
|
|
|
|
}
|
|
|
|
className="m-1"
|
|
|
|
className="m-1"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<DocumentSearchIcon className="icon-md" />
|
|
|
|
<DocumentSearchIcon className="icon-md" />
|
|
|
|