Skip to content

Commit

Permalink
Spotless Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu-mingye authored and github-actions[bot] committed Nov 17, 2023
1 parent 22f7221 commit 00b5c43
Show file tree
Hide file tree
Showing 15 changed files with 289 additions and 179 deletions.
121 changes: 62 additions & 59 deletions dinky-web/src/components/CustomEditor/CodeShow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import { Loading } from '@/pages/Other/Loading';
import { MonacoEditorOptions } from '@/types/Public/data';
import { convertCodeEditTheme } from '@/utils/function';
import { Editor, useMonaco } from '@monaco-editor/react';
import { Col, Row } from 'antd';
import { editor } from 'monaco-editor';
import { EditorLanguage } from 'monaco-editor/esm/metadata';
import React, { CSSProperties, useEffect, useRef, useState } from 'react';
import { CSSProperties, useEffect, useRef, useState } from 'react';
import FullscreenBtn from '../FullscreenBtn';
import {Col, Row} from "antd";

// loader.config({monaco});
/**
Expand Down Expand Up @@ -204,67 +204,70 @@ const CodeShow = (props: CodeShowFormProps) => {
/**
* render
*/
return <>
<Row wrap={false}>
<Col flex="auto">
{/* fullScreen button */}
{fullScreenBtn && (
<FullscreenBtn
isFullscreen={fullScreen}
fullScreenCallBack={() => setFullScreen(!fullScreen)}
/>
)}
return (
<>
<Row wrap={false}>
<Col flex='auto'>
{/* fullScreen button */}
{fullScreenBtn && (
<FullscreenBtn
isFullscreen={fullScreen}
fullScreenCallBack={() => setFullScreen(!fullScreen)}
/>
)}

{/* editor */}
<Editor
width={width}
height={height}
loading={<Loading loading={loading} />}
value={code ?? ''}
language={language}
options={{
scrollBeyondLastLine: false,
readOnly: true,
wordWrap: autoWrap,
autoDetectHighContrast: true,
selectOnLineNumbers: true,
fixedOverflowWidgets: true,
autoClosingDelete: 'always',
lineNumbers,
minimap: { enabled: false },
scrollbar: {
// Subtle shadows to the left & top. Defaults to true.
useShadows: false,
{/* editor */}
<Editor
width={width}
height={height}
loading={<Loading loading={loading} />}
value={code ?? ''}
language={language}
options={{
scrollBeyondLastLine: false,
readOnly: true,
wordWrap: autoWrap,
autoDetectHighContrast: true,
selectOnLineNumbers: true,
fixedOverflowWidgets: true,
autoClosingDelete: 'always',
lineNumbers,
minimap: { enabled: false },
scrollbar: {
// Subtle shadows to the left & top. Defaults to true.
useShadows: false,

// Render vertical arrows. Defaults to false.
// verticalHasArrows: true,
// Render horizontal arrows. Defaults to false.
// horizontalHasArrows: true,
// Render vertical arrows. Defaults to false.
// verticalHasArrows: true,
// Render horizontal arrows. Defaults to false.
// horizontalHasArrows: true,

// Render vertical scrollbar.
// Accepted values: 'auto', 'visible', 'hidden'.
// Defaults to 'auto'
vertical: 'visible',
// Render horizontal scrollbar.
// Accepted values: 'auto', 'visible', 'hidden'.
// Defaults to 'auto'
horizontal: 'visible',
verticalScrollbarSize: 8,
horizontalScrollbarSize: 8,
arrowSize: 30
},
...options
}}
onMount={editorDidMount}
theme={convertCodeEditTheme()}
/>
</Col>
{showFloatButton && <Col flex="none">
// Render vertical scrollbar.
// Accepted values: 'auto', 'visible', 'hidden'.
// Defaults to 'auto'
vertical: 'visible',
// Render horizontal scrollbar.
// Accepted values: 'auto', 'visible', 'hidden'.
// Defaults to 'auto'
horizontal: 'visible',
verticalScrollbarSize: 8,
horizontalScrollbarSize: 8,
arrowSize: 30
},
...options
}}
onMount={editorDidMount}
theme={convertCodeEditTheme()}
/>
</Col>
{showFloatButton && (
<Col flex='none'>
<EditorFloatBtn {...restEditBtnProps} />
</Col>
}
</Row>
</>
</Col>
)}
</Row>
</>
);
};

export default CodeShow;
17 changes: 9 additions & 8 deletions dinky-web/src/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -612,22 +612,21 @@ span .mtkb {
font-weight: inherit;
}


// ============================= layout split pane style start =============================
.split-pane {
position: relative;
display: flex;
flex-direction: column;
width: 100%;
overflow: hidden;
position: relative;
}

.Resizer {
background: #000;
opacity: .2;
z-index: 1;
box-sizing: border-box;
background: #000;
background-clip: padding-box;
opacity: 0.2;
}

.Resizer:hover {
Expand All @@ -642,7 +641,8 @@ span .mtkb {
cursor: row-resize;
}

.Resizer.horizontal:hover, .Resizer.horizontal.resizing {
.Resizer.horizontal:hover,
.Resizer.horizontal.resizing {
border-top: 5px solid rgba(0, 0, 0, 0.5);
border-bottom: 5px solid rgba(0, 0, 0, 0.5);
}
Expand All @@ -651,14 +651,15 @@ span .mtkb {
width: 11px;
height: 98%;
margin: 0 -5px;
border-left: 5px solid rgba(255, 255, 255, 0);
border-right: 5px solid rgba(255, 255, 255, 0);
border-left: 5px solid rgba(255, 255, 255, 0);
cursor: col-resize;
}

.Resizer.vertical:hover, .Resizer.vertical.resizing {
border-left: 5px solid rgba(0, 0, 0, 0.5);
.Resizer.vertical:hover,
.Resizer.vertical.resizing {
border-right: 5px solid rgba(0, 0, 0, 0.5);
border-left: 5px solid rgba(0, 0, 0, 0.5);
}

.DragLayer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ import { DataStudioTabsItemType, StateType } from '@/pages/DataStudio/model';
import { SSE_TOPIC } from '@/pages/DevOps/constants';
import { API_CONSTANTS } from '@/services/endpoints';
import { parseMilliSecondStr } from '@/utils/function';
import { connect, useModel, useRequest } from '@umijs/max';
import { SplitPane } from '@andrewray/react-multi-split-pane';
import { Pane } from '@andrewray/react-multi-split-pane/dist/lib/Pane';
import { CheckOutlined, CloseCircleFilled, LoadingOutlined } from '@ant-design/icons';
import { connect, useModel, useRequest } from '@umijs/max';
import { Empty, Space, Typography } from 'antd';
import { DataNode } from 'antd/es/tree';
import DirectoryTree from 'antd/es/tree/DirectoryTree';
import {Key, useEffect, useRef, useState} from 'react';
import {SplitPane} from "@andrewray/react-multi-split-pane";
import {Pane} from "@andrewray/react-multi-split-pane/dist/lib/Pane";
import * as React from "react";
import { Key, useEffect, useRef, useState } from 'react';

const { Text } = Typography;

Expand Down Expand Up @@ -76,7 +75,6 @@ const ConsoleContent = (props: ConsoleProps) => {
subscribeTopic: model.subscribeTopic
}));


const onUpdate = (data: ProcessStep) => {
setProcessNode((prevState: any) => {
//如果key不一致代表重新提交了任务,清空旧状态
Expand Down Expand Up @@ -140,10 +138,21 @@ const ConsoleContent = (props: ConsoleProps) => {
setExpandedKeys(expandedKeys);
};


return <div style={{height: props.height - 53}}>
<SplitPane split={'vertical'} defaultSizes={[100, 500]} minSize={100} className={'split-pane'} >
<Pane className={'split-pane'} forwardRef={refObject} minSize={100} size={100} split={'horizontal'}>
return (
<div style={{ height: props.height - 53 }}>
<SplitPane
split={'vertical'}
defaultSizes={[100, 500]}
minSize={100}
className={'split-pane'}
>
<Pane
className={'split-pane'}
forwardRef={refObject}
minSize={100}
size={100}
split={'horizontal'}
>
{processNode ? (
<DirectoryTree
className={'treeList'}
Expand All @@ -160,7 +169,13 @@ const ConsoleContent = (props: ConsoleProps) => {
)}
</Pane>

<Pane className={'split-pane'} forwardRef={refObject} minSize={100} size={100} split={'horizontal'}>
<Pane
className={'split-pane'}
forwardRef={refObject}
minSize={100}
size={100}
split={'horizontal'}
>
<CodeShow
code={selectNode?.log ? selectNode.log : ''}
height={props.height - 53}
Expand All @@ -170,7 +185,7 @@ const ConsoleContent = (props: ConsoleProps) => {
</Pane>
</SplitPane>
</div>

);
};

export default connect(({ Studio }: { Studio: StateType }) => ({
Expand Down
13 changes: 5 additions & 8 deletions dinky-web/src/pages/DevOps/JobDetail/JobLogs/JobLogsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ import { JobProps } from '@/pages/DevOps/JobDetail/data';
import ExceptionTab from '@/pages/DevOps/JobDetail/JobLogs/components/ExceptionTab';
import JobManagerLogsTab from '@/pages/DevOps/JobDetail/JobLogs/components/JobManagerLogsTab';
import TaskManagerLogsTab from '@/pages/DevOps/JobDetail/JobLogs/components/TaskManagerLogsTab';
import { ProCard } from "@ant-design/pro-components";
import { useState } from "react";

import { ProCard } from '@ant-design/pro-components';
import { useState } from 'react';

const JobLogsTab = (props: JobProps) => {
const { jobDetail } = props;

const [activeKey, setActiveKey] = useState('Exception');


const tabsItems =[
const tabsItems = [
{
label: 'Exception',
key: 'Exception',
Expand All @@ -48,8 +46,7 @@ const JobLogsTab = (props: JobProps) => {
key: 'TaskManager',
children: <TaskManagerLogsTab jobDetail={jobDetail} />
}
]

];

return (
<>
Expand All @@ -60,7 +57,7 @@ const JobLogsTab = (props: JobProps) => {
type: 'card',
activeKey: activeKey,
onChange: setActiveKey,
items: tabsItems,
items: tabsItems
}}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ const ExceptionTab = (props: JobProps) => {
);
};

return <ProCard bodyStyle={{height: parent.innerHeight - 200, overflow: 'auto'}}>{renderLogTab()}</ProCard>;
return (
<ProCard bodyStyle={{ height: parent.innerHeight - 200, overflow: 'auto' }}>
{renderLogTab()}
</ProCard>
);
};

export default ExceptionTab;
Loading

0 comments on commit 00b5c43

Please sign in to comment.