Commit 81615603 authored by wenmo's avatar wenmo

修复前端多处bug

parent 053967f7
......@@ -3,6 +3,7 @@ package com.dlink.job;
import cn.hutool.json.JSONUtil;
import com.dlink.assertion.Asserts;
import com.dlink.context.SpringContextUtils;
import com.dlink.gateway.GatewayType;
import com.dlink.model.Cluster;
import com.dlink.model.History;
import com.dlink.service.ClusterService;
......@@ -66,7 +67,7 @@ public class Job2MysqlHandler implements JobHandler {
Job job = JobContextHolder.getJob();
History history = new History();
history.setId(job.getId());
if(Asserts.isNullString(job.getJobId())){
if(job.isUseGateway()&&Asserts.isNullString(job.getJobId())){
job.setJobId("unknown-"+LocalDateTime.now().toString());
}
history.setJobId(job.getJobId());
......
......@@ -46,4 +46,26 @@ public enum GatewayType {
}
return false;
}
public static boolean isDeployCluster(String type){
switch (get(type)){
case YARN_APPLICATION:
case YARN_PER_JOB:
case KUBERNETES_APPLICATION:
return true;
default:
return false;
}
}
public boolean isDeployCluster(){
switch (value){
case "ya":
case "ypj":
case "ka":
return true;
default:
return false;
}
}
}
......@@ -12,7 +12,7 @@ const Settings: LayoutSettings & {
fixedHeader: false,
fixSiderbar: true,
colorWeak: false,
title: 'Dinky',
title: 'Dinky 实时计算平台',
pwa: false,
logo: 'dinky.svg',
iconfontUrl: '',
......
......@@ -84,9 +84,9 @@ export default [
component: './Settings',
},
{
path: '/welcome',
name: 'home',
icon: 'home',
path: '/about',
name: 'about',
icon: 'smile',
component: './Welcome',
},
{
......
......@@ -18,7 +18,7 @@ const {Option} = Select;
const Chart = (props:any) => {
const {current,result,height,dispatch} = props;
const [config, setConfig] = useState({});
const [config, setConfig] = useState(undefined);
const [type, setType] = useState<string>(CHART.LINE);
const [form] = Form.useForm();
......@@ -34,6 +34,7 @@ const Chart = (props:any) => {
const onValuesChange = (change: any, all: any) => {
if(change.type){
setConfig(undefined);
setType(change.type);
props.saveChart({type:change.type});
}
......@@ -73,15 +74,23 @@ const Chart = (props:any) => {
}
switch (current.console.chart.type){
case CHART.LINE:
return <Line data={current.console.result.result.rowData} {...config} />;
case CHART.BAR:
return <Bar data={current.console.result.result.rowData} {...config} />;
case CHART.PIE:
if(config.angleField){
return <Pie data={current.console.result.result.rowData} {...config} />;
} else {
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
}
if(config){
return <Line data={current.console.result.result.rowData} {...config} />;
} else {
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
}
case CHART.BAR:
if(config){
return <Bar data={current.console.result.result.rowData} {...config} />;
} else {
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
}
case CHART.PIE:
if(config && config.angleField){
return <Pie data={current.console.result.result.rowData} {...config} />;
} else {
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
}
default:
return <Line data={current.console.result.result.rowData} {...config} />;
}
......
......@@ -12,7 +12,7 @@ const StudioTable = (props: any) => {
const getColumns=(columns: [])=>{
let datas: any=[];
columns.map((item) => {
columns?.map((item) => {
datas.push({
field: item,
});
......
......@@ -153,10 +153,10 @@ const StudioConnector = (props: any) => {
const getColumns = () => {
let columns: any = [{
title: "表名",
dataIndex: "tablename",
key: "tablename",
dataIndex: "table name",
key: "table name",
sorter: true,
...getColumnSearchProps("tablename"),
...getColumnSearchProps("table name"),
}, {
title: '操作',
dataIndex: 'option',
......
export default {
'menu.welcome': '欢迎',
'menu.more-blocks': '更多区块',
'menu.home': '更新历史',
'menu.about': '关于',
'menu.admin': '管理页',
'menu.admin.sub-page': '二级管理页',
'menu.login': '登录',
......
......@@ -261,12 +261,8 @@ const Model: ModelType = {
}
return {
...state,
current: {
...newCurrent
},
tabs: {
...tabs
},
current: newCurrent,
tabs,
};
},
saveCurrentPath(state, {payload}) {
......@@ -299,24 +295,22 @@ const Model: ModelType = {
}
return {
...state,
current: {...newCurrent},
tabs: {...newTabs},
current: newCurrent,
tabs: newTabs,
};
},
saveTabs(state, {payload}) {
let newCurrent = state.current;
for (let i = 0; i < payload.panes.length; i++) {
if (payload.panes[i].key == payload.activeKey) {
newCurrent = {...payload.panes[i]};
newCurrent = payload.panes[i];
}
}
if(payload.panes.length === 0){
if(payload.panes.length == 0){
return {
...state,
current: undefined,
tabs: {
...payload,
},
tabs: payload,
currentPath: ['引导页'],
};
}
......@@ -326,9 +320,7 @@ const Model: ModelType = {
...newCurrent,
isModified:false,
},
tabs: {
...payload,
},
tabs: payload,
currentPath: newCurrent.path,
};
},
......@@ -340,28 +332,27 @@ const Model: ModelType = {
break;
}
}
const newCurrent = newTabs.panes[newTabs.panes.length - 1];
const newCurrent = undefined;
if(newTabs.panes.length > 0){
newCurrent = newTabs.panes[newTabs.panes.length - 1];
}
if (newTabs.activeKey == payload) {
newTabs.activeKey = newCurrent.key;
}
return {
...state,
current: {
...newCurrent,
},
tabs: {
...newTabs,
},
current: newCurrent,
tabs: newTabs,
};
},
closeTabs(state, {payload}) {
const {deleteType, current} = payload;
const newTabs = state.tabs;
const firstKey = newTabs.panes[0].key;
let newCurrent = newTabs.panes[0];
if (deleteType === 'CLOSE_OTHER') {
const newCurrent = newTabs.panes[0];
if (deleteType == 'CLOSE_OTHER') {
const keys = [firstKey, current.key];
newCurrent = {...current};
newCurrent = current;
newTabs.activeKey = current.key;
newTabs.panes = newTabs.panes.filter(item => keys.includes(item.key));
} else {
......@@ -371,31 +362,23 @@ const Model: ModelType = {
return {
...state,
current: {
...newCurrent
},
tabs: {
...newTabs,
}
current: newCurrent,
tabs: newTabs
};
},
changeActiveKey(state, {payload}) {
const {tabs} = state;
tabs.activeKey = payload;
const newTabs = state.tabs;
let newCurrent = state.current;
for (let i = 0; i < tabs.panes.length; i++) {
if (tabs.panes[i].key == tabs.activeKey) {
newCurrent = {...tabs.panes[i]};
newTabs.activeKey = payload;
for (let i = 0; i < newTabs.panes.length; i++) {
if (newTabs.panes[i].key == payload) {
newCurrent = newTabs.panes[i];
}
}
return {
...state,
current: {
...newCurrent,
},
tabs: {
...tabs,
},
current: newCurrent,
tabs: newTabs,
currentPath: newCurrent.path,
};
},
......@@ -403,24 +386,24 @@ const Model: ModelType = {
const newTabs = state.tabs;
const newCurrent = state.current;
for (let i = 0; i < newTabs.panes.length; i++) {
if (newTabs.panes[i].key === payload.key) {
newTabs.panes[i].task = {...payload};
if (newTabs.panes[i].key == payload.key) {
newTabs.panes[i].task = payload;
newTabs.panes[i].isModified = false;
if(newCurrent.key === payload.key){
newCurrent = {...newTabs.panes[i]};
if(newCurrent.key == payload.key){
newCurrent = newTabs.panes[i];
}
}
}
return {
...state,
current: {...newCurrent},
tabs: {...newTabs},
current: newCurrent,
tabs: newTabs,
};
},
saveSession(state, {payload}) {
return {
...state,
session: [...payload],
session: payload,
};
},
showRightClickMenu(state, {payload}) {
......@@ -450,16 +433,16 @@ const Model: ModelType = {
const newTabs = state?.tabs;
let newCurrent = state?.current;
for (let i = 0; i < newTabs.panes.length; i++) {
if (newTabs.panes[i].key === newTabs.activeKey) {
newTabs.panes[i].console.result.result = {...payload};
newCurrent = {...newTabs.panes[i]};
if (newTabs.panes[i].key == newTabs.activeKey) {
newTabs.panes[i].console.result.result = payload;
newCurrent = newTabs.panes[i];
break;
}
}
return {
...state,
current: {...newCurrent},
tabs: {...newTabs},
current: newCurrent,
tabs: newTabs,
};
},
saveCluster(state, {payload}) {
......@@ -491,16 +474,16 @@ const Model: ModelType = {
let newTabs = state?.tabs;
let newCurrent = state?.current;
for (let i = 0; i < newTabs.panes.length; i++) {
if (newTabs.panes[i].key === newTabs.activeKey) {
newTabs.panes[i].console.chart = {...payload};
newCurrent = {...newTabs.panes[i]};
if (newTabs.panes[i].key == newTabs.activeKey) {
newTabs.panes[i].console.chart = payload;
newCurrent = newTabs.panes[i];
break;
}
}
return {
...state,
current: {...newCurrent},
tabs: {...newTabs},
current: newCurrent,
tabs: newTabs,
};
},
},
......
import React from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Card, Alert, Typography,Timeline } from 'antd';
import { useIntl, FormattedMessage } from 'umi';
import styles from './Welcome.less';
......@@ -15,12 +14,12 @@ const CodePreview: React.FC = ({ children }) => (
export default (): React.ReactNode => {
const intl = useIntl();
return (
<PageContainer>
<>
<Card>
<Alert
message={intl.formatMessage({
id: 'pages.welcome.alertMessage',
defaultMessage: '实时计算平台 Dlink 即将发布,目前为体验版,版本号为 0.5.0。',
defaultMessage: '实时计算平台 Dinky 即将发布,目前为体验版,版本号为 0.5.0。',
})}
type="success"
showIcon
......@@ -575,11 +574,23 @@ export default (): React.ReactNode => {
<li>
<Link>修复 作业非remote作业进行remote语法校验的问题</Link>
</li>
<li>
<Link>增加 dlink-client-hadoop 版本定制依赖</Link>
</li>
<li>
<Link>优化 菜单</Link>
</li>
<li>
<Link>优化 pom及升级log4j至最新</Link>
</li>
<li>
<Link>修复 前端多处bug</Link>
</li>
</ul>
</Paragraph>
</Timeline.Item>
</Timeline>
</Card>
</PageContainer>
</>
);
};
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