Unverified Commit eb6136bd authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

Fix gitbuild cannot close (#2525)

* Spotless Apply * fix git build model can not close * Spotless Apply * fix git & resource --------- Co-authored-by: 's avatarzhu-mingye <zhu-mingye@users.noreply.github.com>
parent 65137b54
...@@ -66,7 +66,7 @@ public class GetJarsStepSse extends StepSse { ...@@ -66,7 +66,7 @@ public class GetJarsStepSse extends StepSse {
GitProject gitProject = (GitProject) params.get("gitProject"); GitProject gitProject = (GitProject) params.get("gitProject");
ResourcesService resourcesService = SpringUtil.getBean(ResourcesService.class); ResourcesService resourcesService = SpringUtil.getBean(ResourcesService.class);
TreeNodeDTO gitFolder = resourcesService.createFolderOrGet(0, "git", ""); TreeNodeDTO gitFolder = resourcesService.createFolderOrGet(1, "git", "");
TreeNodeDTO treeNodeDTO = TreeNodeDTO treeNodeDTO =
resourcesService.createFolderOrGet(Convert.toInt(gitFolder.getId()), gitProject.getName(), ""); resourcesService.createFolderOrGet(Convert.toInt(gitFolder.getId()), gitProject.getName(), "");
return jars.stream() return jars.stream()
......
...@@ -64,7 +64,7 @@ public class PythonZipStepSse extends StepSse { ...@@ -64,7 +64,7 @@ public class PythonZipStepSse extends StepSse {
private String uploadResources(File zipFile, GitProject gitProject) { private String uploadResources(File zipFile, GitProject gitProject) {
ResourcesService resourcesService = SpringUtil.getBean(ResourcesService.class); ResourcesService resourcesService = SpringUtil.getBean(ResourcesService.class);
TreeNodeDTO gitFolder = resourcesService.createFolderOrGet(0, "git", ""); TreeNodeDTO gitFolder = resourcesService.createFolderOrGet(1, "git", "");
TreeNodeDTO treeNodeDTO = TreeNodeDTO treeNodeDTO =
resourcesService.createFolderOrGet(Convert.toInt(gitFolder.getId()), gitProject.getName(), ""); resourcesService.createFolderOrGet(Convert.toInt(gitFolder.getId()), gitProject.getName(), "");
resourcesService.uploadFile(Convert.toInt(treeNodeDTO.getId()), "", zipFile); resourcesService.uploadFile(Convert.toInt(treeNodeDTO.getId()), "", zipFile);
......
...@@ -190,8 +190,8 @@ export const buildAllSuggestionsToEditor = ( ...@@ -190,8 +190,8 @@ export const buildAllSuggestionsToEditor = (
range: range, range: range,
kind: mappingKind(item.kind), kind: mappingKind(item.kind),
insertText: item.insertText, insertText: item.insertText,
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
// detail: item?.detail, detail: item?.label?.description || ''
}; };
}); });
//todo: 补充补全建议 关键词建议 //todo: 补充补全建议 关键词建议
......
...@@ -127,16 +127,21 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -127,16 +127,21 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
resolveCompletionItem: (item: CompletionItem) => { resolveCompletionItem: (item: CompletionItem) => {
return { return {
...item, ...item,
detail: item.detail ?? `-- ${item.detail}` detail: item.detail
}; };
} }
}); });
} }
// editorInstance?.current?.onDidChangeModelContent?.(() => {
// console.log(editorInstance?.current, 'editorInstance')
// editorInstance?.current?.trigger('action', 'editor.action.triggerSuggest');
// });
/** /**
* editorDidMount * editorDidMount
* @param {editor.IStandaloneCodeEditor} editor * @param {editor.IStandaloneCodeEditor} editor
* @param monaco * @param monacoIns
*/ */
const editorDidMountChange = (editor: editor.IStandaloneCodeEditor, monacoIns: Monaco) => { const editorDidMountChange = (editor: editor.IStandaloneCodeEditor, monacoIns: Monaco) => {
if (editorRef?.current && monacoRef?.current && editorDidMount) { if (editorRef?.current && monacoRef?.current && editorDidMount) {
...@@ -214,6 +219,8 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -214,6 +219,8 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
showFoldingControls: 'always', // 代码折叠控件 'always' | 'mouseover' | 'never' showFoldingControls: 'always', // 代码折叠控件 'always' | 'mouseover' | 'never'
automaticLayout: true, // 自动布局 automaticLayout: true, // 自动布局
readOnly, // 是否只读 readOnly, // 是否只读
glyphMargin: true, // 字形边缘
formatOnType: true, // 代码格式化
wrappingIndent: wrappingIndent:
language === 'yaml' || language === 'yml' || language === 'json' ? 'indent' : 'none', language === 'yaml' || language === 'yml' || language === 'json' ? 'indent' : 'none',
inlineSuggest: { inlineSuggest: {
...@@ -223,8 +230,8 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -223,8 +230,8 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
allowQuickSuggestions: true, allowQuickSuggestions: true,
showOnAllSymbols: true showOnAllSymbols: true
}, },
inlineSuggestionVisible: true, // inlineSuggestionVisible: true,
quickSuggestions: true, quickSuggestions: enableSuggestions,
guides: { guides: {
bracketPairs: true bracketPairs: true
}, },
...@@ -234,12 +241,15 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -234,12 +241,15 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
}, },
foldingRanges: true, foldingRanges: true,
inlineCompletionsAccessibilityVerbose: true, inlineCompletionsAccessibilityVerbose: true,
smartSelect: {
selectLeadingAndTrailingWhitespace: true,
selectSubwords: true
},
suggest: { suggest: {
shareSuggestSelections: true, quickSuggestions: enableSuggestions,
quickSuggestions: true,
showStatusBar: true, showStatusBar: true,
preview: true, preview: true,
previewMode: 'preview', previewMode: 'subword',
showInlineDetails: true, showInlineDetails: true,
showMethods: true, showMethods: true,
showFunctions: true, showFunctions: true,
...@@ -280,6 +290,11 @@ const CodeEdit = (props: CodeEditFormProps & connect) => { ...@@ -280,6 +290,11 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
<> <>
<div className={'monaco-float'}> <div className={'monaco-float'}>
<Editor <Editor
beforeMount={(monaco: Monaco) => {
if (!monacoInstance?.current) {
monacoInstance.current = monaco;
}
}}
width={width} width={width}
height={height} height={height}
value={code} value={code}
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
export default { export default {
'button.create': 'Create', 'button.create': 'Create',
'button.close': 'Close', 'button.close': 'Close',
'button.daemon': 'Daemon Mode',
'button.confirm': 'Confirm', 'button.confirm': 'Confirm',
'button.recovery': 'Recovery', 'button.recovery': 'Recovery',
'button.cancel': 'Cancel', 'button.cancel': 'Cancel',
......
...@@ -23,6 +23,7 @@ export default { ...@@ -23,6 +23,7 @@ export default {
'button.create': '新建', 'button.create': '新建',
'button.recovery': '恢复', 'button.recovery': '恢复',
'button.close': '关闭', 'button.close': '关闭',
'button.daemon': '后台运行',
'button.confirm': '确定', 'button.confirm': '确定',
'button.cancel': '取消', 'button.cancel': '取消',
'button.finish': '完成', 'button.finish': '完成',
......
...@@ -52,7 +52,7 @@ const JsonToSql: React.FC = (props: connect) => { ...@@ -52,7 +52,7 @@ const JsonToSql: React.FC = (props: connect) => {
height={maxHeight + 'px'} height={maxHeight + 'px'}
code={jsonData} code={jsonData}
language={'json'} language={'json'}
onChange={(x:string) => { onChange={(x: string) => {
setJsonData(x ?? ''); setJsonData(x ?? '');
}} }}
/> />
......
...@@ -17,223 +17,221 @@ ...@@ -17,223 +17,221 @@
* *
*/ */
import {CircleBtn} from '@/components/CallBackButton/CircleBtn'; import { CircleBtn } from '@/components/CallBackButton/CircleBtn';
import Title from '@/components/Front/Title'; import Title from '@/components/Front/Title';
import ContentScroll from '@/components/Scroll/ContentScroll'; import ContentScroll from '@/components/Scroll/ContentScroll';
import MovableSidebar from '@/components/Sidebar/MovableSidebar'; import MovableSidebar from '@/components/Sidebar/MovableSidebar';
import {StateType, STUDIO_MODEL, VIEW} from '@/pages/DataStudio/model'; import { StateType, STUDIO_MODEL, VIEW } from '@/pages/DataStudio/model';
import {LeftBottomMoreTabs, LeftBottomSide} from '@/pages/DataStudio/route'; import { LeftBottomMoreTabs, LeftBottomSide } from '@/pages/DataStudio/route';
import {l} from '@/utils/intl'; import { l } from '@/utils/intl';
import {connect} from '@@/exports'; import { connect } from '@@/exports';
import {PlusOutlined} from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import {ConfigProvider, Space, Tabs} from 'antd'; import { ConfigProvider, Space, Tabs } from 'antd';
import React from 'react'; import React from 'react';
export type BottomContainerProps = { export type BottomContainerProps = {
size: number; size: number;
height: number | string; height: number | string;
}; };
const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
const {dispatch, size, bottomContainer, height} = props; const { dispatch, size, bottomContainer, height } = props;
const width = document.documentElement.clientWidth - VIEW.sideWidth * 2; const width = document.documentElement.clientWidth - VIEW.sideWidth * 2;
/** /**
* 侧边栏最小化 * 侧边栏最小化
*/ */
const handleMinimize = () => { const handleMinimize = () => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateSelectBottomKey, type: STUDIO_MODEL.updateSelectBottomKey,
payload: '' payload: ''
}); });
}; };
/** /**
* 更新底部高度 * 更新底部高度
* @param {number} height * @param {number} height
*/ */
const updateBottomHeight = (height: number) => { const updateBottomHeight = (height: number) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateBottomHeight, type: STUDIO_MODEL.updateBottomHeight,
payload: height payload: height
}); });
}; };
/** /**
* 更新中间内容高度 * 更新中间内容高度
* @param {number} height * @param {number} height
*/ */
const updateCenterContentHeight = (height: number) => { const updateCenterContentHeight = (height: number) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateCenterContentHeight, type: STUDIO_MODEL.updateCenterContentHeight,
payload: height payload: height
}); });
}; };
const updateSelectBottomSubKey = (key: string) => { const updateSelectBottomSubKey = (key: string) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateSelectBottomSubKey, type: STUDIO_MODEL.updateSelectBottomSubKey,
payload: key payload: key
}); });
}; };
/** /**
* 更新工具栏内容高度 * 更新工具栏内容高度
* @param {number} height * @param {number} height
*/ */
const updateToolContentHeight = (height: number) => { const updateToolContentHeight = (height: number) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateToolContentHeight, type: STUDIO_MODEL.updateToolContentHeight,
payload: height payload: height
}); });
}; };
const getSubTabs = () => { const getSubTabs = () => {
// @ts-ignore // @ts-ignore
return Object.values( return Object.values(
Object.keys(LeftBottomMoreTabs).map((x) => Object.keys(LeftBottomMoreTabs).map((x) =>
LeftBottomMoreTabs[x].map((y) => { LeftBottomMoreTabs[x].map((y) => {
return {...y, key: x + '/' + y.key}; return { ...y, key: x + '/' + y.key };
}) })
) )
).flatMap((x) => x); ).flatMap((x) => x);
}; };
/** /**
* 拖动回调 * 拖动回调
* @param event * @param event
* @param direction * @param direction
* @param {{offsetHeight: any}} elementRef * @param {{offsetHeight: any}} elementRef
*/ */
const resizeCallback = ( const resizeCallback = (
event: any, event: any,
direction: any, direction: any,
elementRef: { elementRef: {
offsetHeight: any; offsetHeight: any;
} }
) => { ) => {
const centerContentHeight = const centerContentHeight =
document.documentElement.clientHeight - document.documentElement.clientHeight -
VIEW.headerHeight - VIEW.headerHeight -
VIEW.headerNavHeight - VIEW.headerNavHeight -
VIEW.footerHeight - VIEW.footerHeight -
VIEW.otherHeight - VIEW.otherHeight -
elementRef.offsetHeight; elementRef.offsetHeight;
updateBottomHeight(elementRef.offsetHeight); updateBottomHeight(elementRef.offsetHeight);
updateCenterContentHeight(centerContentHeight); updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.leftMargin); updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
}; };
const renderTabPane = () => { const renderTabPane = () => {
// @ts-ignore // @ts-ignore
const leftBottomMoreTab = LeftBottomMoreTabs[bottomContainer.selectKey]; const leftBottomMoreTab = LeftBottomMoreTabs[bottomContainer.selectKey];
if (leftBottomMoreTab) { if (leftBottomMoreTab) {
const items = leftBottomMoreTab.map((item: any) => { const items = leftBottomMoreTab.map((item: any) => {
return { return {
key: bottomContainer.selectKey + '/' + item.key, key: bottomContainer.selectKey + '/' + item.key,
label: ( label: (
<span> <span>
{item.icon} {item.icon}
{item.label} {item.label}
</span> </span>
) )
}; };
}); });
return ( return (
<Tabs <Tabs
style={{height: '32px', display: '-webkit-box'}} style={{ height: '32px', display: '-webkit-box' }}
items={items} items={items}
type='card' type='card'
onChange={(key: string) => { onChange={(key: string) => {
updateSelectBottomSubKey(key.split('/')[1]); updateSelectBottomSubKey(key.split('/')[1]);
}} }}
activeKey={ activeKey={
bottomContainer.selectKey + bottomContainer.selectKey +
'/' + '/' +
bottomContainer.selectSubKey[bottomContainer.selectKey] bottomContainer.selectSubKey[bottomContainer.selectKey]
} }
size='small' size='small'
tabPosition='top' tabPosition='top'
/> />
); );
} }
return <></>; return <></>;
}; };
const renderItems = () => { const renderItems = () => {
return [ return [
...LeftBottomSide.map((x) => { ...LeftBottomSide.map((x) => {
return {...x, key: x.key + '/'}; return { ...x, key: x.key + '/' };
}), }),
...getSubTabs() ...getSubTabs()
].map((item) => { ].map((item) => {
return { return {
...item, ...item,
children: ( children: (
<ContentScroll height={props.height - VIEW.leftMargin}> <ContentScroll height={props.height - VIEW.leftMargin}>{item.children}</ContentScroll>
{item.children} )
</ContentScroll> };
) });
}; };
});
};
return ( return (
<MovableSidebar <MovableSidebar
title={ title={
<ConfigProvider <ConfigProvider
theme={{ theme={{
components: { components: {
Tabs: { Tabs: {
horizontalMargin: '0', horizontalMargin: '0',
cardPaddingSM: '6px', cardPaddingSM: '6px',
horizontalItemPadding: '0' horizontalItemPadding: '0'
} }
}
}}
>
<Space>
<Title>{l(bottomContainer.selectKey)}</Title>
{renderTabPane()}
</Space>
</ConfigProvider>
} }
visible={bottomContainer.selectKey} }}
style={{
zIndex: 999,
height: height,
marginTop: 0,
backgroundColor: '#fff',
position: 'fixed',
bottom: VIEW.footerHeight
}}
defaultSize={{width: '100%', height: height}}
minHeight={VIEW.midMargin}
maxHeight={size.contentHeight - 40}
onResize={(
event: any,
direction: any,
elementRef: {
offsetHeight: any;
}
) => resizeCallback(event, direction, elementRef)}
btnGroup={[<CircleBtn key={'max'} icon={<PlusOutlined/>}/>]}
enable={{top: true}}
handlerMinimize={handleMinimize}
maxWidth={width}
> >
<Tabs <Space>
activeKey={ <Title>{l(bottomContainer.selectKey)}</Title>
bottomContainer.selectKey + {renderTabPane()}
'/' + </Space>
(bottomContainer.selectSubKey[bottomContainer.selectKey] </ConfigProvider>
? bottomContainer.selectSubKey[bottomContainer.selectKey] }
: '') visible={bottomContainer.selectKey}
} style={{
items={renderItems()} zIndex: 999,
tabBarStyle={{display: 'none'}} height: height,
/> marginTop: 0,
</MovableSidebar> backgroundColor: '#fff',
); position: 'fixed',
bottom: VIEW.footerHeight
}}
defaultSize={{ width: '100%', height: height }}
minHeight={VIEW.midMargin}
maxHeight={size.contentHeight - 40}
onResize={(
event: any,
direction: any,
elementRef: {
offsetHeight: any;
}
) => resizeCallback(event, direction, elementRef)}
btnGroup={[<CircleBtn key={'max'} icon={<PlusOutlined />} />]}
enable={{ top: true }}
handlerMinimize={handleMinimize}
maxWidth={width}
>
<Tabs
activeKey={
bottomContainer.selectKey +
'/' +
(bottomContainer.selectSubKey[bottomContainer.selectKey]
? bottomContainer.selectSubKey[bottomContainer.selectKey]
: '')
}
items={renderItems()}
tabBarStyle={{ display: 'none' }}
/>
</MovableSidebar>
);
}; };
export default connect(({Studio}: { Studio: StateType }) => ({ export default connect(({ Studio }: { Studio: StateType }) => ({
bottomContainer: Studio.bottomContainer, bottomContainer: Studio.bottomContainer
}))(BottomContainer); }))(BottomContainer);
...@@ -17,104 +17,104 @@ ...@@ -17,104 +17,104 @@
* *
*/ */
import {CircleBtn, CircleDataStudioButtonProps} from '@/components/CallBackButton/CircleBtn'; import { CircleBtn, CircleDataStudioButtonProps } from '@/components/CallBackButton/CircleBtn';
import MovableSidebar, {MovableSidebarProps} from '@/components/Sidebar/MovableSidebar'; import MovableSidebar, { MovableSidebarProps } from '@/components/Sidebar/MovableSidebar';
import useThemeValue from '@/hooks/useThemeValue'; import useThemeValue from '@/hooks/useThemeValue';
import ProjectTitle from '@/pages/DataStudio/LeftContainer/Project/ProjectTitle'; import ProjectTitle from '@/pages/DataStudio/LeftContainer/Project/ProjectTitle';
import {StateType, STUDIO_MODEL, VIEW} from '@/pages/DataStudio/model'; import { StateType, STUDIO_MODEL, VIEW } from '@/pages/DataStudio/model';
import {BtnRoute, LeftSide} from '@/pages/DataStudio/route'; import { BtnRoute, LeftSide } from '@/pages/DataStudio/route';
import {connect} from '@@/exports'; import { connect } from '@@/exports';
import {Tabs} from 'antd'; import { Tabs } from 'antd';
import React from 'react'; import React from 'react';
export type LeftContainerProps = { export type LeftContainerProps = {
size: number; size: number;
leftContainer: StateType['leftContainer']; leftContainer: StateType['leftContainer'];
rightContainer: StateType['rightContainer']; rightContainer: StateType['rightContainer'];
}; };
const LeftContainer: React.FC<LeftContainerProps> = (props: any) => { const LeftContainer: React.FC<LeftContainerProps> = (props: any) => {
const { const {
dispatch, dispatch,
size, size,
toolContentHeight, toolContentHeight,
leftContainer, leftContainer,
rightContainer, rightContainer,
tabs: {panes, activeKey} tabs: { panes, activeKey }
} = props; } = props;
const themeValue = useThemeValue(); const themeValue = useThemeValue();
const MAX_WIDTH = size.width - 2 * VIEW.leftToolWidth - rightContainer.width - 700; const MAX_WIDTH = size.width - 2 * VIEW.leftToolWidth - rightContainer.width - 700;
/** /**
* 侧边栏大小变化 * 侧边栏大小变化
* @param width * @param width
*/ */
const handleReSizeChange = (width: any) => { const handleReSizeChange = (width: any) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateLeftWidth, type: STUDIO_MODEL.updateLeftWidth,
payload: width payload: width
}); });
}; };
/** /**
* 侧边栏最小化 * 侧边栏最小化
*/ */
const handleMinimize = () => { const handleMinimize = () => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateSelectLeftKey, type: STUDIO_MODEL.updateSelectLeftKey,
payload: '' payload: ''
}); });
}; };
/** /**
* 侧边栏最大化 * 侧边栏最大化
*/ */
const handleMaxsize = () => { const handleMaxsize = () => {
handleReSizeChange(MAX_WIDTH); handleReSizeChange(MAX_WIDTH);
}; };
/** /**
* 侧边栏属性 * 侧边栏属性
* @type {{onResize: (event: any, direction: any, elementRef: {offsetWidth: any}) => void, visible: boolean, defaultSize: {width: any, height: any}, enable: {right: boolean}, minWidth: number, title: string, handlerMinimize: () => void, contentHeight: any, maxWidth: number}} * @type {{onResize: (event: any, direction: any, elementRef: {offsetWidth: any}) => void, visible: boolean, defaultSize: {width: any, height: any}, enable: {right: boolean}, minWidth: number, title: string, handlerMinimize: () => void, contentHeight: any, maxWidth: number}}
*/ */
const restMovableSidebarProps: MovableSidebarProps = { const restMovableSidebarProps: MovableSidebarProps = {
contentHeight: toolContentHeight, contentHeight: toolContentHeight,
onResize: (event: any, direction: any, elementRef: { offsetWidth: any }) => onResize: (event: any, direction: any, elementRef: { offsetWidth: any }) =>
handleReSizeChange(elementRef.offsetWidth), handleReSizeChange(elementRef.offsetWidth),
title: <ProjectTitle/>, title: <ProjectTitle />,
handlerMinimize: () => handleMinimize(), handlerMinimize: () => handleMinimize(),
handlerMaxsize: handleMaxsize, handlerMaxsize: handleMaxsize,
visible: leftContainer.selectKey !== '', visible: leftContainer.selectKey !== '',
defaultSize: {width: leftContainer.width, height: leftContainer.height}, defaultSize: { width: leftContainer.width, height: leftContainer.height },
minWidth: 160, minWidth: 160,
maxWidth: MAX_WIDTH, maxWidth: MAX_WIDTH,
enable: {right: true}, enable: { right: true },
btnGroup: BtnRoute[leftContainer.selectKey] btnGroup: BtnRoute[leftContainer.selectKey]
? BtnRoute[leftContainer.selectKey].map((item: CircleDataStudioButtonProps) => ( ? BtnRoute[leftContainer.selectKey].map((item: CircleDataStudioButtonProps) => (
<CircleBtn <CircleBtn
title={item.title} title={item.title}
icon={item.icon} icon={item.icon}
onClick={() => item.onClick?.(panes, activeKey)} onClick={() => item.onClick?.(panes, activeKey)}
key={item.title} key={item.title}
/> />
)) ))
: [], : [],
style: {borderInlineEnd: `1px solid ${themeValue.borderColor}`} style: { borderInlineEnd: `1px solid ${themeValue.borderColor}` }
}; };
const content = ( const content = (
<Tabs activeKey={leftContainer.selectKey} items={LeftSide} tabBarStyle={{display: 'none'}}/> <Tabs activeKey={leftContainer.selectKey} items={LeftSide} tabBarStyle={{ display: 'none' }} />
); );
return ( return (
<MovableSidebar {...restMovableSidebarProps}> <MovableSidebar {...restMovableSidebarProps}>
{/*<Tabs activeKey={leftContainer.selectKey} items={LeftSide} tabBarStyle={{display: "none"}}/>*/} {/*<Tabs activeKey={leftContainer.selectKey} items={LeftSide} tabBarStyle={{display: "none"}}/>*/}
{content} {content}
</MovableSidebar> </MovableSidebar>
); );
}; };
export default connect(({Studio}: { Studio: StateType }) => ({ export default connect(({ Studio }: { Studio: StateType }) => ({
// leftContainer: Studio.leftContainer, // leftContainer: Studio.leftContainer,
// rightContainer: Studio.rightContainer, // rightContainer: Studio.rightContainer,
toolContentHeight: Studio.toolContentHeight, toolContentHeight: Studio.toolContentHeight,
tabs: Studio.tabs tabs: Studio.tabs
}))(LeftContainer); }))(LeftContainer);
...@@ -21,12 +21,12 @@ import { ...@@ -21,12 +21,12 @@ import {
DIFF_EDITOR_PARAMS, DIFF_EDITOR_PARAMS,
PARAM_DIFF_TABLE_COL PARAM_DIFF_TABLE_COL
} from '@/pages/DataStudio/MiddleContainer/Editor/constants'; } from '@/pages/DataStudio/MiddleContainer/Editor/constants';
import { convertCodeEditTheme } from '@/utils/function';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { DiffEditor } from '@monaco-editor/react'; import { DiffEditor } from '@monaco-editor/react';
import { Col, Modal, Row, Space, Table, Tabs, Typography } from 'antd'; import { Col, Modal, Row, Space, Table, Tabs, Typography } from 'antd';
import React from 'react'; import React from 'react';
import styles from './index.less'; import styles from './index.less';
import {convertCodeEditTheme} from "@/utils/function";
const { Text, Link } = Typography; const { Text, Link } = Typography;
......
...@@ -23,6 +23,7 @@ import { StateType } from '@/pages/DataStudio/model'; ...@@ -23,6 +23,7 @@ import { StateType } from '@/pages/DataStudio/model';
import { handleOption, handleRemoveById } from '@/services/BusinessCrud'; import { handleOption, handleRemoveById } from '@/services/BusinessCrud';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { TaskVersionListItem } from '@/types/Studio/data'; import { TaskVersionListItem } from '@/types/Studio/data';
import { convertCodeEditTheme } from '@/utils/function';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { useRequest } from '@@/exports'; import { useRequest } from '@@/exports';
import { RocketOutlined, SyncOutlined } from '@ant-design/icons'; import { RocketOutlined, SyncOutlined } from '@ant-design/icons';
...@@ -31,7 +32,6 @@ import { Button, Card, Modal, Tag } from 'antd'; ...@@ -31,7 +32,6 @@ import { Button, Card, Modal, Tag } from 'antd';
import moment from 'moment'; import moment from 'moment';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { connect } from 'umi'; import { connect } from 'umi';
import {convertCodeEditTheme} from "@/utils/function";
const HistoryVersion = (props: any) => { const HistoryVersion = (props: any) => {
const { const {
......
...@@ -225,7 +225,11 @@ const DataStudio = (props: any) => { ...@@ -225,7 +225,11 @@ const DataStudio = (props: any) => {
<Content style={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}> <Content style={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<LeftContainer size={size} leftContainer={leftContainer} rightContainer={rightContainer} /> <LeftContainer
size={size}
leftContainer={leftContainer}
rightContainer={rightContainer}
/>
<Content <Content
style={{ style={{
width: width:
......
...@@ -542,7 +542,7 @@ const Model: ModelType = { ...@@ -542,7 +542,7 @@ const Model: ModelType = {
* 更新底部高度 * 更新底部高度
*/ */
updateBottomHeight(state, { payload }) { updateBottomHeight(state, { payload }) {
if (payload!=state.bottomContainer.height) { if (payload != state.bottomContainer.height) {
return { return {
...state, ...state,
bottomContainer: { bottomContainer: {
......
...@@ -202,14 +202,32 @@ export const BuildSteps: React.FC<BuildStepsProps> = (props) => { ...@@ -202,14 +202,32 @@ export const BuildSteps: React.FC<BuildStepsProps> = (props) => {
{l('button.rebuild')} {l('button.rebuild')}
</Button>, </Button>,
<Button <Button
key={'finish'} key={'close'}
type={showLog ? 'default' : 'primary'} type={'primary'}
hidden={!showLog}
danger={showLog} danger={showLog}
onClick={() => handleCancel()}
>
{l('button.close')}
</Button>,
<Button
key={'finish'}
type={'primary'}
hidden={showLog}
disabled={steps[currentStep - 1]?.status === 'error' && percent !== 99} disabled={steps[currentStep - 1]?.status === 'error' && percent !== 99}
loading={currentStep !== steps.length && percent !== 99} loading={currentStep !== steps.length && percent !== 99}
onClick={() => handleCancel()} onClick={() => handleCancel()}
> >
{showLog ? l('button.close') : l('button.finish')} {l('button.finish')}
</Button>,
<Button
key={'daemon'}
hidden={!(currentStep !== steps.length && percent !== 99) || showLog}
onClick={() => handleCancel()}
>
{steps[currentStep - 1]?.status === 'error' && percent !== 99
? l('button.close')
: l('button.daemon')}
</Button> </Button>
]; ];
......
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