Commit 9542a3f6 authored by wenmo's avatar wenmo

session展示

parent 7aa316d7
...@@ -70,7 +70,7 @@ public class StudioController { ...@@ -70,7 +70,7 @@ public class StudioController {
/** /**
* 创建session * 创建session
*/ */
@PostMapping("/createSession") @PutMapping("/createSession")
public Result createSession(@RequestBody SessionDTO sessionDTO) { public Result createSession(@RequestBody SessionDTO sessionDTO) {
return Result.succeed(studioService.createSession(sessionDTO,"admin"),"创建成功"); return Result.succeed(studioService.createSession(sessionDTO,"admin"),"创建成功");
} }
......
...@@ -75,7 +75,7 @@ const SessionForm: React.FC<UpdateFormProps> = (props) => { ...@@ -75,7 +75,7 @@ const SessionForm: React.FC<UpdateFormProps> = (props) => {
<Item <Item
name="type" name="type"
label="访问权限" label="访问权限"
rules={[{required: true, message: '请输入别名!'}]}> >
<Select defaultValue="PUBLIC"> <Select defaultValue="PUBLIC">
<Option value="PUBLIC">共享</Option> <Option value="PUBLIC">共享</Option>
<Option value="PRIVATE">私密</Option> <Option value="PRIVATE">私密</Option>
...@@ -84,7 +84,7 @@ const SessionForm: React.FC<UpdateFormProps> = (props) => { ...@@ -84,7 +84,7 @@ const SessionForm: React.FC<UpdateFormProps> = (props) => {
<Item <Item
name="useRemote" name="useRemote"
label="是否远程" label="是否远程"
rules={[{required: true, message: '禁用则为本地模式'}]}> >
<Switch checkedChildren="启用" unCheckedChildren="禁用" <Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={formVals.useRemote}/> defaultChecked={formVals.useRemote}/>
</Item> </Item>
......
...@@ -121,6 +121,8 @@ const StudioConnector = (props:any) => { ...@@ -121,6 +121,8 @@ const StudioConnector = (props:any) => {
const keySessionsEvent=(key, item)=>{ const keySessionsEvent=(key, item)=>{
if(key=='delete'){ if(key=='delete'){
clearSession(item.session,current.task,dispatch); clearSession(item.session,current.task,dispatch);
}else if(key=='connect'){
}else{ }else{
message.warn("敬请期待"); message.warn("敬请期待");
} }
...@@ -171,6 +173,41 @@ const StudioConnector = (props:any) => { ...@@ -171,6 +173,41 @@ const StudioConnector = (props:any) => {
key: "session", key: "session",
sorter: true, sorter: true,
...getColumnSearchProps("session"), ...getColumnSearchProps("session"),
},{
title: "执行模式",
key: "useRemote",
sorter: true,
...getColumnSearchProps("useRemote"),
render:function(text, record, index) {
return record.sessionConfig.useRemote?'远程':'本地';
}
},{
title: "集群名",
key: "clusterName",
sorter: true,
...getColumnSearchProps("clusterName"),
render:function(text, record, index) {
return record.sessionConfig.clusterName;
}
},{
title: "JobManager地址",
key: "address",
sorter: true,
...getColumnSearchProps("address"),
render:function(text, record, index) {
return record.sessionConfig.address;
}
},{
title: "创建人",
dataIndex: "createUser",
key: "createUser",
sorter: true,
...getColumnSearchProps("createUser"),
},{
title: "创建时间",
dataIndex: "createTime",
key: "createTime",
sorter: true,
},{ },{
title: '操作', title: '操作',
dataIndex: 'option', dataIndex: 'option',
...@@ -181,7 +218,7 @@ const StudioConnector = (props:any) => { ...@@ -181,7 +218,7 @@ const StudioConnector = (props:any) => {
message.warn('敬请期待'); message.warn('敬请期待');
}} }}
> >
描述 连接
</a>,<Divider type="vertical" />,<a </a>,<Divider type="vertical" />,<a
onClick={() => { onClick={() => {
keySessionsEvent('delete',record); keySessionsEvent('delete',record);
...@@ -276,17 +313,14 @@ const StudioConnector = (props:any) => { ...@@ -276,17 +313,14 @@ const StudioConnector = (props:any) => {
</ModalForm> </ModalForm>
<SessionForm <SessionForm
onSubmit={async (value) => { onSubmit={async (value) => {
console.log(value);
const success = await handleAddOrUpdate("api/studio/createSession",value); const success = await handleAddOrUpdate("api/studio/createSession",value);
if (success) { if (success) {
handleCreateSessionModalVisible(false); handleCreateSessionModalVisible(false);
/*if (actionRef.current) {
actionRef.current.reload();
}*/
} }
}} }}
onCancel={() => { onCancel={() => {
handleCreateSessionModalVisible(false); handleCreateSessionModalVisible(false);
// setFormValues({});
}} }}
updateModalVisible={createSessionModalVisible} updateModalVisible={createSessionModalVisible}
values={{}} values={{}}
......
import {Effect, Reducer} from "umi"; import {Effect, Reducer} from "umi";
import { import {
getData, handleAddOrUpdate handleAddOrUpdate
} from "@/components/Common/crud"; } from "@/components/Common/crud";
export type ClusterType = { export type ClusterType = {
......
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