Commit f7708f53 authored by 皮倩雯's avatar 皮倩雯

fix: '修改数据库连接配置界面样式'

parent 86489883
Pipeline #42620 skipped with stages
...@@ -60,7 +60,7 @@ const GlobalHeaderRight = props => { ...@@ -60,7 +60,7 @@ const GlobalHeaderRight = props => {
文档说明 文档说明
</a> </a>
</div> </div>
<Colophon /> {/* <Colophon /> */}
<div style={{ margin: '0 10px' }}> <div style={{ margin: '0 10px' }}>
<a <a
target="_blank" target="_blank"
......
...@@ -48,16 +48,16 @@ const DatabaseConnectConfig = props => { ...@@ -48,16 +48,16 @@ const DatabaseConnectConfig = props => {
</TabPane> </TabPane>
))} ))}
</Tabs> */} </Tabs> */}
<Hr />
<SQLServerTable /> <SQLServerTable />
<br /> <br />
<Hr />
<OracleTable /> <OracleTable />
<br /> <br />
<Hr />
<MongDBTable /> <MongDBTable />
<br /> <br />
<Hr />
<MySQLTable /> <MySQLTable />
</Card> </Card>
</PageContainer> </PageContainer>
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
getMongoDBConnectionTest, getMongoDBConnectionTest,
GetConnString, GetConnString,
DeleteConnString, DeleteConnString,
GetConnTest GetConnTest,
} from '@/services/database/api'; } from '@/services/database/api';
import AddModal from './AddModal'; import AddModal from './AddModal';
const MongDBTable = props => { const MongDBTable = props => {
...@@ -34,11 +34,12 @@ const MongDBTable = props => { ...@@ -34,11 +34,12 @@ const MongDBTable = props => {
// setTableLoading(false); // setTableLoading(false);
// }); // });
GetConnString({ GetConnString({
Type:"MongoDB" Type: 'MongoDB',
}).then(resnew => { })
.then(resnew => {
setTableLoading(false); setTableLoading(false);
if (resnew.code == 0) { if (resnew.code == 0) {
let res = resnew.data let res = resnew.data;
setDataList(res); setDataList(res);
} }
}) })
...@@ -80,9 +81,10 @@ const MongDBTable = props => { ...@@ -80,9 +81,10 @@ const MongDBTable = props => {
// console.error(err); // console.error(err);
// }); // });
GetConnTest({ GetConnTest({
Type:"MongoDB", Type: 'MongoDB',
name:item.name name: item.name,
}).then(res => { })
.then(res => {
setTableLoading(false); setTableLoading(false);
if (res.code == 0) { if (res.code == 0) {
notification.success({ notification.success({
...@@ -102,7 +104,6 @@ const MongDBTable = props => { ...@@ -102,7 +104,6 @@ const MongDBTable = props => {
setTableLoading(false); setTableLoading(false);
console.error(err); console.error(err);
}); });
}; };
// 删除 // 删除
const handleDel = (val, item) => { const handleDel = (val, item) => {
...@@ -130,7 +131,7 @@ const MongDBTable = props => { ...@@ -130,7 +131,7 @@ const MongDBTable = props => {
// }) // })
// .catch(err => console.error(err)); // .catch(err => console.error(err));
DeleteConnString({ DeleteConnString({
name:name name,
}).then(res => { }).then(res => {
setFlag(flag + 1); setFlag(flag + 1);
if (res.code == 0) { if (res.code == 0) {
...@@ -146,7 +147,7 @@ const MongDBTable = props => { ...@@ -146,7 +147,7 @@ const MongDBTable = props => {
description: res.msg || '删除失败', description: res.msg || '删除失败',
}); });
} }
}) });
}; };
// 编辑 // 编辑
const handleEdit = (val, item) => { const handleEdit = (val, item) => {
...@@ -222,11 +223,7 @@ const MongDBTable = props => { ...@@ -222,11 +223,7 @@ const MongDBTable = props => {
key: 'options', key: 'options',
width: 300, width: 300,
render: (val, item) => [ render: (val, item) => [
<Button <Button size="small" type="primary" onClick={() => handleCon(val, item)}>
size="small"
type="primary"
onClick={() => handleCon(val, item)}
>
测试连接 测试连接
</Button>, </Button>,
<Button <Button
...@@ -265,7 +262,7 @@ const MongDBTable = props => { ...@@ -265,7 +262,7 @@ const MongDBTable = props => {
bordered bordered
loading={tableLoading} loading={tableLoading}
dataSource={dataList} dataSource={dataList}
options={{ reload: false, fullScreen: false }} options={false}
toolBarRender={() => [ toolBarRender={() => [
<Button <Button
type="primary" type="primary"
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
deleteConnString, deleteConnString,
GetConnString, GetConnString,
DeleteConnString, DeleteConnString,
GetConnTest GetConnTest,
} from '@/services/database/api'; } from '@/services/database/api';
import AddModal from './AddModal'; import AddModal from './AddModal';
const MySQLTable = props => { const MySQLTable = props => {
...@@ -34,11 +34,12 @@ const MySQLTable = props => { ...@@ -34,11 +34,12 @@ const MySQLTable = props => {
// setTableLoading(false); // setTableLoading(false);
// }); // });
GetConnString({ GetConnString({
Type:"MySQL" Type: 'MySQL',
}).then(resnew => { })
.then(resnew => {
setTableLoading(false); setTableLoading(false);
if (resnew.code == 0) { if (resnew.code == 0) {
let res = resnew.data let res = resnew.data;
setDataList(res); setDataList(res);
} }
}) })
...@@ -80,9 +81,10 @@ const MySQLTable = props => { ...@@ -80,9 +81,10 @@ const MySQLTable = props => {
// console.error(err); // console.error(err);
// }); // });
GetConnTest({ GetConnTest({
Type:"MySQL", Type: 'MySQL',
name:item.name name: item.name,
}).then(res => { })
.then(res => {
setTableLoading(false); setTableLoading(false);
if (res.code == 0) { if (res.code == 0) {
notification.success({ notification.success({
...@@ -129,7 +131,7 @@ const MySQLTable = props => { ...@@ -129,7 +131,7 @@ const MySQLTable = props => {
// }) // })
// .catch(err => console.error(err)); // .catch(err => console.error(err));
DeleteConnString({ DeleteConnString({
name:name name,
}).then(res => { }).then(res => {
setFlag(flag + 1); setFlag(flag + 1);
if (res.code == 0) { if (res.code == 0) {
...@@ -145,7 +147,7 @@ const MySQLTable = props => { ...@@ -145,7 +147,7 @@ const MySQLTable = props => {
description: res.msg || '删除失败', description: res.msg || '删除失败',
}); });
} }
}) });
}; };
// 编辑 // 编辑
const handleEdit = (val, item) => { const handleEdit = (val, item) => {
...@@ -198,11 +200,7 @@ const MySQLTable = props => { ...@@ -198,11 +200,7 @@ const MySQLTable = props => {
key: 'options', key: 'options',
width: 300, width: 300,
render: (val, item) => [ render: (val, item) => [
<Button <Button size="small" type="primary" onClick={() => handleCon(val, item)}>
size="small"
type="primary"
onClick={() => handleCon(val, item)}
>
测试连接 测试连接
</Button>, </Button>,
<Button <Button
...@@ -241,7 +239,7 @@ const MySQLTable = props => { ...@@ -241,7 +239,7 @@ const MySQLTable = props => {
bordered bordered
loading={tableLoading} loading={tableLoading}
dataSource={dataList} dataSource={dataList}
options={{ reload: false, fullScreen: false }} options={false}
toolBarRender={() => [ toolBarRender={() => [
<Button <Button
type="primary" type="primary"
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
deleteConnString, deleteConnString,
GetConnString, GetConnString,
DeleteConnString, DeleteConnString,
GetConnTest GetConnTest,
} from '@/services/database/api'; } from '@/services/database/api';
import AddModal from './AddModal'; import AddModal from './AddModal';
const OracleTable = props => { const OracleTable = props => {
...@@ -34,11 +34,12 @@ const OracleTable = props => { ...@@ -34,11 +34,12 @@ const OracleTable = props => {
// setTableLoading(false); // setTableLoading(false);
// }); // });
GetConnString({ GetConnString({
Type:"Oracle" Type: 'Oracle',
}).then(resnew => { })
.then(resnew => {
setTableLoading(false); setTableLoading(false);
if (resnew.code == 0) { if (resnew.code == 0) {
let res = resnew.data let res = resnew.data;
setDataList(res); setDataList(res);
} }
}) })
...@@ -80,9 +81,10 @@ const OracleTable = props => { ...@@ -80,9 +81,10 @@ const OracleTable = props => {
// console.error(err); // console.error(err);
// }); // });
GetConnTest({ GetConnTest({
Type:"Oracle", Type: 'Oracle',
name:item.name name: item.name,
}).then(res => { })
.then(res => {
setTableLoading(false); setTableLoading(false);
if (res.code == 0) { if (res.code == 0) {
notification.success({ notification.success({
...@@ -129,7 +131,7 @@ const OracleTable = props => { ...@@ -129,7 +131,7 @@ const OracleTable = props => {
// }) // })
// .catch(err => console.error(err)); // .catch(err => console.error(err));
DeleteConnString({ DeleteConnString({
name:name name,
}).then(res => { }).then(res => {
setFlag(flag + 1); setFlag(flag + 1);
if (res.code == 0) { if (res.code == 0) {
...@@ -145,7 +147,7 @@ const OracleTable = props => { ...@@ -145,7 +147,7 @@ const OracleTable = props => {
description: res.msg || '删除失败', description: res.msg || '删除失败',
}); });
} }
}) });
}; };
// 编辑 // 编辑
const handleEdit = (val, item) => { const handleEdit = (val, item) => {
...@@ -191,11 +193,7 @@ const OracleTable = props => { ...@@ -191,11 +193,7 @@ const OracleTable = props => {
key: 'options', key: 'options',
width: 300, width: 300,
render: (val, item) => [ render: (val, item) => [
<Button <Button size="small" type="primary" onClick={() => handleCon(val, item)}>
size="small"
type="primary"
onClick={() => handleCon(val, item)}
>
测试连接 测试连接
</Button>, </Button>,
<Button <Button
...@@ -234,7 +232,7 @@ const OracleTable = props => { ...@@ -234,7 +232,7 @@ const OracleTable = props => {
bordered bordered
loading={tableLoading} loading={tableLoading}
dataSource={dataList} dataSource={dataList}
options={{ reload: false, fullScreen: false }} options={false}
toolBarRender={() => [ toolBarRender={() => [
<Button <Button
type="primary" type="primary"
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import { Button, Popconfirm, notification } from 'antd'; import { Button, Popconfirm, notification } from 'antd';
import { import { GetConnString, DeleteConnString, GetConnTest } from '@/services/database/api';
getSQLServerConnString,
deleteConnString,
getSQLServerConnectionTest,
GetConnString,
DeleteConnString,
GetConnTest
} from '@/services/database/api';
import AddModal from './AddModal'; import AddModal from './AddModal';
const SQLServerTable = props => { const SQLServerTable = props => {
const [flag, setFlag] = useState(1); const [flag, setFlag] = useState(1);
...@@ -34,11 +27,12 @@ const SQLServerTable = props => { ...@@ -34,11 +27,12 @@ const SQLServerTable = props => {
// setTableLoading(false); // setTableLoading(false);
// }); // });
GetConnString({ GetConnString({
Type:"SQLServer" Type: 'SQLServer',
}).then(resnew => { })
.then(resnew => {
setTableLoading(false); setTableLoading(false);
if (resnew.code == 0) { if (resnew.code == 0) {
let res = resnew.data let res = resnew.data;
setDataList(res); setDataList(res);
} }
}) })
...@@ -80,9 +74,10 @@ const SQLServerTable = props => { ...@@ -80,9 +74,10 @@ const SQLServerTable = props => {
// console.error(err); // console.error(err);
// }); // });
GetConnTest({ GetConnTest({
Type:"SQLServer", Type: 'SQLServer',
name:item.name name: item.name,
}).then(res => { })
.then(res => {
setTableLoading(false); setTableLoading(false);
if (res.code == 0) { if (res.code == 0) {
notification.success({ notification.success({
...@@ -129,7 +124,7 @@ const SQLServerTable = props => { ...@@ -129,7 +124,7 @@ const SQLServerTable = props => {
// }) // })
// .catch(err => console.error(err)); // .catch(err => console.error(err));
DeleteConnString({ DeleteConnString({
name:name name,
}).then(res => { }).then(res => {
setFlag(flag + 1); setFlag(flag + 1);
if (res.code == 0) { if (res.code == 0) {
...@@ -145,7 +140,7 @@ const SQLServerTable = props => { ...@@ -145,7 +140,7 @@ const SQLServerTable = props => {
description: res.msg || '删除失败', description: res.msg || '删除失败',
}); });
} }
}) });
}; };
// 编辑 // 编辑
const handleEdit = (val, item) => { const handleEdit = (val, item) => {
...@@ -199,12 +194,7 @@ const SQLServerTable = props => { ...@@ -199,12 +194,7 @@ const SQLServerTable = props => {
key: 'options', key: 'options',
width: 300, width: 300,
render: (val, item) => [ render: (val, item) => [
<Button <Button size="small" type="primary" onClick={() => handleCon(val, item)} key="testLink">
size="small"
type="primary"
onClick={() => handleCon(val, item)}
key="testLink"
>
测试连接 测试连接
</Button>, </Button>,
<Button <Button
...@@ -245,7 +235,7 @@ const SQLServerTable = props => { ...@@ -245,7 +235,7 @@ const SQLServerTable = props => {
bordered bordered
loading={tableLoading} loading={tableLoading}
dataSource={dataList} dataSource={dataList}
options={{ reload: false, fullScreen: false }} options={false}
toolBarRender={() => [ toolBarRender={() => [
<Button <Button
type="primary" type="primary"
......
...@@ -163,7 +163,10 @@ const IotConfig = () => { ...@@ -163,7 +163,10 @@ const IotConfig = () => {
]} ]}
> >
<div style={{ display: 'flex', justifyContent: 'flex-start' }}> <div style={{ display: 'flex', justifyContent: 'flex-start' }}>
<Input style={{ width: '300px', marginLeft: '15px' }} /> <Input
style={{ width: '300px', marginLeft: '15px' }}
placeholder="请输入服务地址"
/>
<span style={{ display: show1 }}> <span style={{ display: show1 }}>
<img <img
src={Yes} src={Yes}
......
...@@ -152,7 +152,10 @@ const MessageConfig = () => { ...@@ -152,7 +152,10 @@ const MessageConfig = () => {
]} ]}
> >
<div style={{ display: 'flex', justifyContent: 'flex-start' }}> <div style={{ display: 'flex', justifyContent: 'flex-start' }}>
<Input style={{ width: '300px', marginLeft: '15px' }} /> <Input
style={{ width: '300px', marginLeft: '15px' }}
placeholder="请输入服务地址"
/>
<span style={{ display: show1 }}> <span style={{ display: show1 }}>
<img <img
src={Yes} src={Yes}
......
...@@ -192,7 +192,7 @@ const ProxyConfig = () => { ...@@ -192,7 +192,7 @@ const ProxyConfig = () => {
}, },
]} ]}
> >
<Input style={{ marginLeft: '15px', width: '300px' }} /> <Input style={{ marginLeft: '15px', width: '300px' }} placeholder="请输入ngnix端口" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
style={{ marginLeft: '20px' }} style={{ marginLeft: '20px' }}
...@@ -210,7 +210,7 @@ const ProxyConfig = () => { ...@@ -210,7 +210,7 @@ const ProxyConfig = () => {
]} ]}
hasFeedback hasFeedback
> >
<Input style={{ marginLeft: '34px', width: '300px' }} /> <Input style={{ marginLeft: '34px', width: '300px' }} placeholder="请输入IIS地址" />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
style={{ marginLeft: '20px' }} style={{ marginLeft: '20px' }}
...@@ -228,7 +228,7 @@ const ProxyConfig = () => { ...@@ -228,7 +228,7 @@ const ProxyConfig = () => {
}, },
]} ]}
> >
<Input style={{ marginLeft: '18px', width: '300px' }} /> <Input style={{ marginLeft: '18px', width: '300px' }} placeholder="请输入EMQ地址" />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit" style={{ marginLeft: '130px' }}> <Button type="primary" htmlType="submit" style={{ marginLeft: '130px' }}>
......
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