Unverified Commit f4183616 authored by gaoyan's avatar gaoyan Committed by GitHub

formate code (#2352)

parent 67bd6278
......@@ -19,7 +19,13 @@ import { chooseTenantSubmit, outLogin } from '@/services/BusinessCrud';
import { setTenantStorageAndCookie } from '@/utils/function';
import { l } from '@/utils/intl';
import { ErrorNotification, SuccessNotification } from '@/utils/messages';
import {ClearOutlined, LogoutOutlined, TeamOutlined, UserOutlined, UserSwitchOutlined} from '@ant-design/icons';
import {
ClearOutlined,
LogoutOutlined,
TeamOutlined,
UserOutlined,
UserSwitchOutlined
} from '@ant-design/icons';
import { setAlpha } from '@ant-design/pro-components';
import { useEmotionCss } from '@ant-design/use-emotion-css';
import { history, useModel } from '@umijs/max';
......@@ -216,7 +222,7 @@ const AvatarDropdown = () => {
key: 'clearPageCache',
icon: <ClearOutlined />,
label: l('menu.account.clearPageCache'),
onClick: ()=>{
onClick: () => {
window.localStorage.removeItem('persist:root');
window.location.reload();
}
......
This diff is collapsed.
......@@ -44,7 +44,6 @@ import { SettingConfigKeyEnum } from '@/pages/SettingCenter/GlobalSetting/Settin
import { handlePutDataJson } from '@/services/BusinessCrud';
import { BaseConfigProperties } from '@/types/SettingCenter/data';
import { l } from '@/utils/intl';
import { ErrorNotification } from '@/utils/messages';
import { connect } from '@@/exports';
import {
EnvironmentOutlined,
......
......@@ -23,7 +23,7 @@ import { API_CONSTANTS } from '@/services/endpoints';
import { useRequest } from '@@/exports';
import { ProCard } from '@ant-design/pro-components';
import { Spin, Tabs, Typography } from 'antd';
import {EditorLanguage} from "monaco-editor/esm/metadata";
import { EditorLanguage } from 'monaco-editor/esm/metadata';
const { Text, Paragraph } = Typography;
......@@ -46,7 +46,7 @@ const JobManagerLogsTab = (props: JobProps) => {
params: { address: jmaddr }
});
const getLog = (ur: any,language?:EditorLanguage) => {
const getLog = (ur: any, language?: EditorLanguage) => {
return (
<Spin spinning={ur.loading}>
<CodeShow language={language} code={ur.data ? ur.data : 'No Log'} height={600} />
......@@ -56,7 +56,17 @@ const JobManagerLogsTab = (props: JobProps) => {
const getDump = (ur: any) => {
return (
<Spin spinning={ur.loading}>
<CodeShow language={"kotlin"} code={ur.data ? (JSON.parse(ur.data)['threadInfos'] as any[]).map(x=>x['stringifiedThreadInfo']).join("") : 'No Log'} height={600} />
<CodeShow
language={'kotlin'}
code={
ur.data
? (JSON.parse(ur.data)['threadInfos'] as any[])
.map((x) => x['stringifiedThreadInfo'])
.join('')
: 'No Log'
}
height={600}
/>
</Spin>
);
};
......@@ -66,7 +76,7 @@ const JobManagerLogsTab = (props: JobProps) => {
<Tabs
size={'small'}
items={[
{ label: 'Log', key: 'LOG', children: getLog(log,"java") },
{ label: 'Log', key: 'LOG', children: getLog(log, 'java') },
{ label: 'Std Out', key: 'STDOUT', children: getLog(stdout) },
{ label: 'Thread Dump', key: 'DUMP', children: getDump(dump) }
]}
......
......@@ -6,7 +6,7 @@ import { queryList } from '@/services/api';
import { PROTABLE_OPTIONS_PUBLIC } from '@/services/constants';
import { API_CONSTANTS } from '@/services/endpoints';
import { Jobs } from '@/types/DevOps/data';
import {parseMilliSecondStr, parseSecondStr} from '@/utils/function';
import { parseMilliSecondStr } from '@/utils/function';
import { l } from '@/utils/intl';
import { ClockCircleTwoTone, EyeTwoTone } from '@ant-design/icons';
import type { ActionType, ProColumns } from '@ant-design/pro-components';
......
......@@ -47,43 +47,43 @@ const JobErrorView: React.FC = () => {
rank: 2,
name: '任务2',
value: 20000,
key: '任务2'
key: '任务2'
},
{
rank: 3,
name: '任务3',
value: 30000,
key: '任务3'
key: '任务3'
},
{
rank: 4,
name: '任务4',
value: 40000,
key: '任务4'
key: '任务4'
},
{
rank: 5,
name: '任务5',
value: 50000,
key: '任务5'
key: '任务5'
},
{
rank: 6,
name: '任务6',
value: 60000,
key: '任务6'
key: '任务6'
},
{
rank: 7,
name: '任务7',
value: 70000,
key: '任务7'
key: '任务7'
},
{
rank: 8,
name: '任务8',
value: 80000,
key: '任务8'
key: '任务8'
}
]);
......
......@@ -23,70 +23,69 @@ import JobRecoveryView from '@/pages/Home/JobOverView/JobRecoveryView';
import JobRunView from '@/pages/Home/JobOverView/JobRunView';
import JobStatusPie from '@/pages/Home/JobOverView/JobStatusPie';
import LoadScoreGauge from '@/pages/Home/JobOverView/LoadScoreGauge';
import {l} from '@/utils/intl';
import {ProCard} from '@ant-design/pro-components';
import {Badge} from 'antd';
import { l } from '@/utils/intl';
import { ProCard } from '@ant-design/pro-components';
import { Badge } from 'antd';
import RcResizeObserver from 'rc-resize-observer';
import React, {useState} from 'react';
import React, { useState } from 'react';
const noPadding = {
paddingInline: '0',
paddingBlock: '0'
paddingInline: '0',
paddingBlock: '0'
};
const JobOverView: React.FC = () => {
const [split, setSplit] = useState<'vertical' | 'horizontal' | undefined>('vertical');
const [split, setSplit] = useState<'vertical' | 'horizontal' | undefined>('vertical');
return (
<RcResizeObserver.Collection>
<RcResizeObserver
key='resize-observer'
onResize={(offset) => {
setSplit(offset.width < 596 ? 'horizontal' : 'vertical');
}}
>
<ProCard
title={
<>
<Badge status='processing'/>
{l('home.job.metrics')}
</>
}
headerBordered
bordered
size='small'
split={split}
bodyStyle={noPadding}
>
<ProCard split={split} bodyStyle={noPadding}>
<ProCard split='horizontal'>
<ProCard bodyStyle={{padding: '0 12px'}}>
<JobRunView/>
</ProCard>
<ProCard bodyStyle={{padding: '0 12px'}}>
<JobFinishedView/>
</ProCard>
<ProCard bodyStyle={{padding: '0 12px'}}>
<JobRecoveryView/>
</ProCard>
</ProCard>
<ProCard title={l('home.job.running.status')} bodyStyle={noPadding}>
<JobStatusPie/>
</ProCard>
</ProCard>
<ProCard split={split} bodyStyle={noPadding}>
<ProCard title={l('home.server.load')} bodyStyle={noPadding}>
<LoadScoreGauge/>
</ProCard>
<ProCard split='horizontal' bodyStyle={noPadding}>
<JobErrorView/>
</ProCard>
</ProCard>
</ProCard>
</RcResizeObserver>
</RcResizeObserver.Collection>
);
return (
<RcResizeObserver.Collection>
<RcResizeObserver
key='resize-observer'
onResize={(offset) => {
setSplit(offset.width < 596 ? 'horizontal' : 'vertical');
}}
>
<ProCard
title={
<>
<Badge status='processing' />
{l('home.job.metrics')}
</>
}
headerBordered
bordered
size='small'
split={split}
bodyStyle={noPadding}
>
<ProCard split={split} bodyStyle={noPadding}>
<ProCard split='horizontal'>
<ProCard bodyStyle={{ padding: '0 12px' }}>
<JobRunView />
</ProCard>
<ProCard bodyStyle={{ padding: '0 12px' }}>
<JobFinishedView />
</ProCard>
<ProCard bodyStyle={{ padding: '0 12px' }}>
<JobRecoveryView />
</ProCard>
</ProCard>
<ProCard title={l('home.job.running.status')} bodyStyle={noPadding}>
<JobStatusPie />
</ProCard>
</ProCard>
<ProCard split={split} bodyStyle={noPadding}>
<ProCard title={l('home.server.load')} bodyStyle={noPadding}>
<LoadScoreGauge />
</ProCard>
<ProCard split='horizontal' bodyStyle={noPadding}>
<JobErrorView />
</ProCard>
</ProCard>
</ProCard>
</RcResizeObserver>
</RcResizeObserver.Collection>
);
};
export default JobOverView;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment