Commit a347dc0d authored by 邓超's avatar 邓超

fix: 数据库初始化日志可以动态渲染html,初始化调用清除日志接口

parent 54b1ec53
Pipeline #33875 skipped with stages
...@@ -145,9 +145,10 @@ const InitDataBase = props => { ...@@ -145,9 +145,10 @@ const InitDataBase = props => {
setInitLoading(false); setInitLoading(false);
let arr = []; let arr = [];
arr.push( arr.push(
res.data.content res.data.content.split(/(\r\n)|(\n)/).map((item, index) => (
.split(/(\r\n)|(\n)/) // eslint-disable-next-line react/no-danger
.map((item, index) => <p key={index}>{item}</p>), <p key={index} dangerouslySetInnerHTML={{ __html: item }} />
)),
); );
console.log(arr); console.log(arr);
setInitContent(arr); setInitContent(arr);
...@@ -735,40 +736,15 @@ const InitDataBase = props => { ...@@ -735,40 +736,15 @@ const InitDataBase = props => {
</Button> </Button>
</Space> </Space>
<Space> <Space>
{/* <Popconfirm <Button
title="是否执行数据库初始化" type="primary"
okText="确认" onClick={() => {
cancelText="取消" getInitList();
onConfirm={() => { deleteInitDBLogNew();
initClick();
}} }}
> */} >
<Button type="primary" onClick={() => getInitList()}>
数据库初始化 数据库初始化
</Button> </Button>
{/* </Popconfirm> */}
{/* {defaultSqlDir && (
<Select
placeholder="请选择解决方案"
style={{ width: '200px' }}
defaultValue={defaultSqlDir}
onChange={e => {
handleSelect(e);
}}
>
{allSqlDir &&
allSqlDir.map((item, index) => {
if (item === '产品方案 (GCK平台)') {
return null;
}
return (
<Option value={item} key={index}>
{item}
</Option>
);
})}
</Select>
)} */}
</Space> </Space>
</Space> </Space>
</div> </div>
......
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