Commit 9542a3f6 authored by wenmo's avatar wenmo

session展示

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