Commit 99174be3 authored by godkaikai's avatar godkaikai

0.2.1

parent 61576e02
......@@ -5,7 +5,7 @@
<parent>
<artifactId>dlink</artifactId>
<groupId>com.dlink</groupId>
<version>0.3.0-SNAPSHOT</version>
<version>0.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>dlink-client</artifactId>
<groupId>com.dlink</groupId>
<version>0.3.0-SNAPSHOT</version>
<version>0.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>dlink</artifactId>
<groupId>com.dlink</groupId>
<version>0.3.0-SNAPSHOT</version>
<version>0.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>dlink-connectors</artifactId>
<groupId>com.dlink</groupId>
<version>0.3.0-SNAPSHOT</version>
<version>0.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>dlink</artifactId>
<groupId>com.dlink</groupId>
<version>0.3.0-SNAPSHOT</version>
<version>0.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>dlink</artifactId>
<groupId>com.dlink</groupId>
<version>0.3.0-SNAPSHOT</version>
<version>0.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
......
......@@ -113,16 +113,16 @@ public class JobManager {
}
} catch (Exception e) {
e.printStackTrace();
/*StackTraceElement[] trace = e.getStackTrace();
StackTraceElement[] trace = e.getStackTrace();
StringBuffer resMsg = new StringBuffer("");
for (StackTraceElement s : trace) {
resMsg.append(" \n " + s + " ");
}*/
}
runResult.setFinishDate(LocalDateTime.now());
runResult.setSuccess(false);
// runResult.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage());
// runResult.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + " \n >>>堆栈信息<<<" + resMsg.toString());
runResult.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + "\n >>>异常原因<<< \n" + e.getCause().toString());
runResult.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + " \n >>>堆栈信息<<<" + resMsg.toString());
// runResult.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + "\n >>>异常原因<<< \n" + e.getCause().toString());
return runResult;
}
return runResult;
......@@ -172,15 +172,15 @@ public class JobManager {
}
} catch (Exception e) {
e.printStackTrace();
/*StackTraceElement[] trace = e.getStackTrace();
StackTraceElement[] trace = e.getStackTrace();
StringBuilder resMsg = new StringBuilder();
for (StackTraceElement s : trace) {
resMsg.append(" \n " + s + " ");
}*/
}
result.setSuccess(false);
// result.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage());
// result.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + "\n >>>堆栈信息<<<" + resMsg.toString());
result.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + "\n >>>异常原因<<< \n" + e.toString());
result.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + "\n >>>堆栈信息<<<" + resMsg.toString());
// result.setError(LocalDateTime.now().toString() + ":" + "运行第" + currentIndex + "行sql时出现异常:" + e.getMessage() + "\n >>>异常原因<<< \n" + e.toString());
return result;
}
......
import {message, Input, Button, Space, Table, Dropdown, Menu, Empty,Divider} from "antd";
import {message, Input, Button, Space, Table, Dropdown, Menu, Empty,Divider,Tooltip} from "antd";
import {StateType} from "@/pages/FlinkSqlStudio/model";
import {connect} from "umi";
import {useState} from "react";
......@@ -200,21 +200,23 @@ const StudioConnector = (props:any) => {
return (
<>
<Space>
<Button
type="primary"
icon={<SearchOutlined />}
loading={loadings[0]}
onClick={() => getTables()}
/>
<Button
danger
icon={<DeleteOutlined />}
loading={loadings[2]}
onClick={() => clearSession()}
/>
</Space>
{tableData&&tableData.length>0?(<Table dataSource={tableData} columns={getColumns()} />):(<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />)}
<div style={{float: "right"}}>
<Tooltip title="刷新连接器">
<Button
type="text"
icon={<SearchOutlined />}
onClick={getTables}
/>
</Tooltip>
<Tooltip title="清空连接器">
<Button
type="text"
icon={<DeleteOutlined />}
onClick={clearSession}
/>
</Tooltip>
</div>
{tableData&&tableData.length>0?(<Table dataSource={tableData} columns={getColumns()} size="small" />):(<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />)}
</>
);
};
......
......@@ -115,7 +115,7 @@ const StudioTable = (props:any) => {
{item.jobName&&<Text code>{item.jobName}</Text>}
{item.jobId&&<Text code>{item.jobId}</Text>}
<Text keyboard>{item.time}ms</Text>
{item.statement.substring(0,20)}</>);
{item.statement.substring(0,20)+"..."}</>);
return (<Option value={index} label={tag}>
{tag}
</Option>)
......
......@@ -16,7 +16,7 @@ const { TabPane } = Tabs;
const StudioConsole = (props:any) => {
return (
<Tabs defaultActiveKey="StudioMsg" size="small" tabPosition="bottom" style={{ border: "1px solid #f0f0f0"}}>
<Tabs defaultActiveKey="StudioMsg" size="small" tabPosition="top" style={{ border: "1px solid #f0f0f0",margin: "0 32px"}}>
<TabPane
tab={
<span>
......
......@@ -21,7 +21,7 @@ interface IRightContent {
const FlinkSqlEditor = (props:any) => {
const {
height = '300px',
height = '100%',
width = '100%',
language = 'sql',
onChange=(val: string, event: { changes: { text: any }[] })=>{},
......
import {Typography, Divider, Badge, Empty} from "antd";
const { Title, Paragraph, Text, Link } = Typography;
const StudioMsg = () => {
return (
<Typography>
<Title level={3}>基本概念与使用</Title>
<Paragraph>
介绍了 0.2.1 版本 Flink 集群、共享会话、同步执行、异步提交的概念及使用。
</Paragraph>
<Title level={4}>Flink 集群</Title>
<Paragraph>
<p>Flink 集群主要有两种,LOCAL 和 REMOTE,通过集群中心进行新集群的注册,注册成功后,点击心跳刷新状态,需要重新进入Studio后新集群才会被加载到下拉框。</p>
<p>LOCAL 模式为通过 dlink 自身环境和内存进行 FlinkSql 的执行。</p>
<p>REMOTE 模式会将 FlinkSql 进行解析处理后提交到目标集群进行执行。</p>
</Paragraph>
<Title level={4}>共享会话</Title>
<Paragraph>
<p>FlinkSql 执行过程所有创建的 Table 等都被存储到了共享会话的 Catalogue 中,不同集群间的 Catalogue 不共享。</p>
</Paragraph>
<Title level={4}>同步执行</Title>
<Paragraph>
<p>同步执行当前选项卡的 FlinkSql 在选中的集群上执行,执行完成后将数据结果展示在前端。</p>
</Paragraph>
<Title level={4}>异步提交</Title>
<Paragraph>
<p>异步提交当前选项卡或右键的树节点的 FlinkSql 在选中的集群上异步执行,无返回值,不记录历史。</p>
</Paragraph>
</Typography>
);
};
export default StudioMsg;
......@@ -2,15 +2,16 @@ import styles from "./index.less";
import {Menu, Dropdown, Tooltip, Row, Col, Popconfirm, notification, Modal,message} from "antd";
import {PauseCircleTwoTone, CopyTwoTone, DeleteTwoTone,PlayCircleTwoTone,DiffTwoTone,
FileAddTwoTone,FolderOpenTwoTone,SafetyCertificateTwoTone,SaveTwoTone,FlagTwoTone,
EnvironmentOutlined,SmileOutlined,RocketTwoTone} from "@ant-design/icons";
EnvironmentOutlined,SmileOutlined,RocketTwoTone,QuestionCircleTwoTone} from "@ant-design/icons";
import Space from "antd/es/space";
import Divider from "antd/es/divider";
import Button from "antd/es/button/button";
import Breadcrumb from "antd/es/breadcrumb/Breadcrumb";
import {StateType} from "@/pages/FlinkSqlStudio/model";
import {connect} from "umi";
import {handleSubmit, postAll} from "@/components/Common/crud";
import {handleSubmit, postDataArray} from "@/components/Common/crud";
import {executeSql} from "@/pages/FlinkSqlStudio/service";
import StudioHelp from "../StudioHelp";
const menu = (
<Menu>
......@@ -52,6 +53,11 @@ const StudioMenu = (props: any) => {
const result = executeSql(param);
result.then(res=>{
notification.close(taskKey);
if(res.datas.success){
message.success('执行成功');
}else{
message.success('执行失败');
}
let newTabs = tabs;
for(let i=0;i<newTabs.panes.length;i++){
if(newTabs.panes[i].key==key){
......@@ -75,16 +81,31 @@ const StudioMenu = (props: any) => {
message.error(`草稿【${current.title}】无法被提交,请创建或选择有效作业进行提交`);
return false;
}
const taskKey = (Math.random()*1000)+'';
Modal.confirm({
title: '异步提交作业',
content: `确定异步提交作业【${current.task.alias}】到其配置的集群吗?`,
content: `确定异步提交作业【${current.task.alias}】到其配置的集群吗?请确认您的作业是否已经被保存!`,
okText: '确认',
cancelText: '取消',
onOk:async () => {
let task = {
id:current.task.id,
};
handleSubmit('/api/task/submit','异步提交作业',[task]);
notification.success({
message: `任务【${current.task.alias} 】正在异步提交`,
description: current.task.statement,
duration:null,
key:taskKey,
icon: <SmileOutlined style={{ color: '#108ee9' }} />,
});
const res = await postDataArray('/api/task/submit',[task.id]);
notification.close(taskKey);
if(res.datas[0].success){
message.success('异步提交成功');
}else{
message.success('异步提交失败');
}
}
});
};
......@@ -121,6 +142,16 @@ const StudioMenu = (props: any) => {
return itemList;
};
const showHelp=()=>{
Modal.info({
title: '使用帮助',
width:1000,
content: (
<StudioHelp />
),
onOk() {},
});
};
return (
<Row className={styles.container}>
<Col span={24}>
......@@ -168,7 +199,7 @@ const StudioMenu = (props: any) => {
type="text"
icon={<FolderOpenTwoTone twoToneColor="#ddd" />}
/>
<Tooltip title="保存当前的 FlinkSql">
<Tooltip title="保存当前的 FlinkSql 及配置">
<Button
type="text"
icon={<SaveTwoTone />}
......@@ -228,6 +259,13 @@ const StudioMenu = (props: any) => {
type="text"
icon={<DeleteTwoTone twoToneColor="#ddd" />}
/>
<Tooltip title="查看使用帮助">
<Button
type="text"
icon={<QuestionCircleTwoTone />}
onClick={showHelp}
/>
</Tooltip>
</Col>
</Row>
</Col>
......
import {connect} from "umi";
import {StateType} from "@/pages/FlinkSqlStudio/model";
import {Form, InputNumber,Input,Switch,Select,Tag,Row,Col,Divider} from "antd";
import {InfoCircleOutlined,PlusOutlined} from "@ant-design/icons";
import {Form, InputNumber,Input,Switch,Select,Tag,Row,Col,Divider,Tooltip,Button} from "antd";
import {InfoCircleOutlined,PlusOutlined,MinusSquareOutlined} from "@ant-design/icons";
import styles from "./index.less";
import {useEffect, useState} from "react";
......@@ -60,6 +60,19 @@ const StudioSetting = (props: any) => {
};
const localOption = (<><Tag color="default">Local</Tag>本地环境</>);
return (
<>
<Row>
<Col span={24}>
<div style={{float: "right"}}>
<Tooltip title="最小化">
<Button
type="text"
icon={<MinusSquareOutlined />}
/>
</Tooltip>
</div>
</Col>
</Row>
<Form
form={form}
layout="vertical"
......@@ -163,6 +176,7 @@ const StudioSetting = (props: any) => {
</Col>
</Row>
</Form>
</>
);
};
......
import React, {useEffect, useRef, useState} from "react";
import {connect} from "umi";
import {DownOutlined, FrownFilled, FrownOutlined, MehOutlined, SmileOutlined} from "@ant-design/icons";
import {Tree, Input, Menu, Empty, Button, message, Modal} from 'antd';
import {DownOutlined, SwitcherOutlined, FrownOutlined, MehOutlined, SmileOutlined,FolderAddOutlined} from "@ant-design/icons";
import {Tree, Input, Menu, Empty, Button, message, Modal,Tooltip,Row,Col} from 'antd';
import {getCatalogueTreeData} from "@/pages/FlinkSqlStudio/service";
import {convertToTreeData, DataType, TreeDataNode} from "@/components/Studio/StudioTree/Function";
import style from "./index.less";
......@@ -48,6 +48,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
const [treeData, setTreeData] = useState<TreeDataNode[]>();
const [dataList, setDataList] = useState<[]>();
const [expandedKeys, setExpandedKeys] = useState<[]>();
const [rightClickNodeTreeItem,setRightClickNodeTreeItem] = useState<RightClickMenu>();
const {rightClickMenu,dispatch,tabs} = props;
const [updateCatalogueModalVisible, handleUpdateCatalogueModalVisible] = useState<boolean>(false);
......@@ -85,6 +86,8 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
toSubmit(rightClickNode);
}else if(key=='CreateCatalogue'){
createCatalogue(rightClickNode);
}else if(key=='CreateRootCatalogue'){
createRootCatalogue(rightClickNode);
}else if(key=='CreateTask'){
createTask(rightClickNode);
}else if(key=='Rename'){
......@@ -147,6 +150,16 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
}
};
const createRootCatalogue=()=>{
handleUpdateCatalogueModalVisible(true);
setIsCreate(true);
setCatalogueFormValues({
isLeaf: false,
parentId: 0,
});
getTreeData();
};
const toSubmit=(node:TreeDataNode)=>{
Modal.confirm({
title: '提交作业',
......@@ -219,6 +232,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
}else if(rightClickNode&&rightClickNode.children&&rightClickNode.children.length>0){
menuItems=(<>
<Menu.Item key='CreateCatalogue'>{'创建目录'}</Menu.Item>
<Menu.Item key='CreateRootCatalogue'>{'创建根目录'}</Menu.Item>
<Menu.Item key='CreateTask'>{'创建作业'}</Menu.Item>
<Menu.Item key='Rename'>{'重命名'}</Menu.Item>
<Menu.Item disabled>{'删除'}</Menu.Item>
......@@ -279,15 +293,45 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
}
};
const offExpandAll = ()=>{
setExpandedKeys([]);
};
const onExpand=(expandedKeys:[])=>{
setExpandedKeys(expandedKeys);
};
return (
<div className={style.tree_div}>
<Search style={{marginBottom: 8}} placeholder="Search" onChange={onChange}/>
<div className={style.tree_div} >
<Row>
<Col span={24}>
<div style={{float: "right"}}>
<Tooltip title="创建根目录">
<Button
type="text"
icon={<FolderAddOutlined />}
onClick={createRootCatalogue}
/>
</Tooltip>
<Tooltip title="折叠目录">
<Button
type="text"
icon={<SwitcherOutlined />}
onClick={offExpandAll}
/>
</Tooltip>
</div>
</Col>
</Row>
{/*<Search style={{marginBottom: 8}} placeholder="Search" onChange={onChange}/>*/}
<DirectoryTree
multiple
onRightClick={onRightClick}
onSelect={onSelect}
switcherIcon={<DownOutlined/>}
treeData={treeData}
onExpand ={onExpand }
expandedKeys={expandedKeys}
/>
{getNodeTreeRightClickMenu()}
{getEmpty()}
......
......@@ -50,6 +50,14 @@
.anticon {
vertical-align: 0;
}
.ant-tabs-left > .ant-tabs-content-holder > .ant-tabs-content > .ant-tabs-tabpane, .ant-tabs-left > div > .ant-tabs-content-holder > .ant-tabs-content > .ant-tabs-tabpane {
padding-left: 10px;
}
.ant-tabs-right > .ant-tabs-content-holder > .ant-tabs-content > .ant-tabs-tabpane, .ant-tabs-right > div > .ant-tabs-content-holder > .ant-tabs-content > .ant-tabs-tabpane {
padding-right: 10px;
}
}
}
/* --- tabs 垂直样式 --- end */
......
......@@ -66,7 +66,7 @@ const Studio: React.FC<StudioProps> = (props) => {
<TabPane tab={<span><FireOutlined /> 任务</span>} key="FlinkTask" >
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
</TabPane>
<TabPane tab={<span><FunctionOutlined /> 函数</span>} key="FlinkTask" >
<TabPane tab={<span><FunctionOutlined /> 函数</span>} key="Function" >
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
</TabPane>
</Tabs>
......
......@@ -29,7 +29,7 @@ export default {
'pages.welcome.link': '欢迎加入',
'pages.welcome.star': '欢迎 Star ',
'pages.welcome.advancedLayout': 'Github',
'pages.welcome.alertMessage': '实时计算平台 Dlink & Apache Flink 即将发布,目前为体验版,版本号为 0.2.0。',
'pages.welcome.alertMessage': '实时计算平台 Dlink & Apache Flink 即将发布,目前为体验版,版本号为 0.2.1。',
'pages.admin.subPage.title': ' 这个页面只有 admin 权限才能查看',
'pages.admin.subPage.alertMessage': 'umi ui 现已发布,欢迎使用 npm run ui 启动体验。',
'pages.searchTable.createForm.newRule': '新建规则',
......
......@@ -20,7 +20,7 @@ export default (): React.ReactNode => {
<Alert
message={intl.formatMessage({
id: 'pages.welcome.alertMessage',
defaultMessage: '实时计算平台 Dlink & Apache Flink 即将发布,目前为体验版,版本号为 0.2.0。',
defaultMessage: '实时计算平台 Dlink & Apache Flink 即将发布,目前为体验版,版本号为 0.2.1。',
})}
type="success"
showIcon
......@@ -148,7 +148,7 @@ export default (): React.ReactNode => {
<Paragraph>
<ul>
<li>
<Link href="">FlinkSql Studio 页面仿IDE设计改进</Link>
<Link href="">FlinkSql Studio 页面仿IDE紧凑型设计改进</Link>
</li>
<li>
<Link href="">解决了目录树右键菜单的不能任意点关闭问题</Link>
......@@ -159,6 +159,21 @@ export default (): React.ReactNode => {
<li>
<Link href="">解决了当前位置不根据选项卡刷新的问题</Link>
</li>
<li>
<Link href="">增加了目录树非空文件夹的灰色删除按钮</Link>
</li>
<li>
<Link href="">增加了目录树创建根目录按钮以及折叠按钮</Link>
</li>
<li>
<Link href="">优化了连接器刷新与清空按钮</Link>
</li>
<li>
<Link href="">优化了作业异步提交的提示</Link>
</li>
<li>
<Link href="">增加了简易的使用帮助</Link>
</li>
</ul>
</Paragraph>
</Timeline.Item>
......
......@@ -7,7 +7,7 @@
<groupId>com.dlink</groupId>
<artifactId>dlink</artifactId>
<packaging>pom</packaging>
<version>0.3.0-SNAPSHOT</version>
<version>0.2.1</version>
<modules>
<module>dlink-core</module>
<module>dlink-admin</module>
......
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