mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-18 00:16:37 +08:00
美化绘画IU
This commit is contained in:
parent
261dc43c4e
commit
0fdd4fc6e3
@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
var StartTime = time.Now().Unix() // unit: second
|
var StartTime = time.Now().Unix() // unit: second
|
||||||
var Version = "v0.0.0" // this hard coding will be replaced automatically when building, no need to manually change
|
var Version = "v0.0.0" // this hard coding will be replaced automatically when building, no need to manually change
|
||||||
var SystemName = "One API"
|
var SystemName = "New API"
|
||||||
var ServerAddress = "http://localhost:3000"
|
var ServerAddress = "http://localhost:3000"
|
||||||
var PayAddress = ""
|
var PayAddress = ""
|
||||||
var EpayId = ""
|
var EpayId = ""
|
||||||
|
@ -187,6 +187,12 @@ func GetUserMidjourney(c *gin.Context) {
|
|||||||
if logs == nil {
|
if logs == nil {
|
||||||
logs = make([]*model.Midjourney, 0)
|
logs = make([]*model.Midjourney, 0)
|
||||||
}
|
}
|
||||||
|
if !strings.Contains(common.ServerAddress, "localhost") {
|
||||||
|
for i, midjourney := range logs {
|
||||||
|
midjourney.ImageUrl = common.ServerAddress + "/mj/image/" + midjourney.MjId
|
||||||
|
logs[i] = midjourney
|
||||||
|
}
|
||||||
|
}
|
||||||
c.JSON(200, gin.H{
|
c.JSON(200, gin.H{
|
||||||
"success": true,
|
"success": true,
|
||||||
"message": "",
|
"message": "",
|
||||||
|
@ -2,7 +2,19 @@ import React, {useEffect, useState} from 'react';
|
|||||||
import {Label} from 'semantic-ui-react';
|
import {Label} from 'semantic-ui-react';
|
||||||
import {API, copy, isAdmin, showError, showSuccess, timestamp2string} from '../helpers';
|
import {API, copy, isAdmin, showError, showSuccess, timestamp2string} from '../helpers';
|
||||||
|
|
||||||
import {Table, Avatar, Tag, Form, Button, Layout, Select, Popover, Modal } from '@douyinfe/semi-ui';
|
import {
|
||||||
|
Table,
|
||||||
|
Avatar,
|
||||||
|
Tag,
|
||||||
|
Form,
|
||||||
|
Button,
|
||||||
|
Layout,
|
||||||
|
Select,
|
||||||
|
Popover,
|
||||||
|
Modal,
|
||||||
|
ImagePreview,
|
||||||
|
Typography
|
||||||
|
} from '@douyinfe/semi-ui';
|
||||||
import {ITEMS_PER_PAGE} from '../constants';
|
import {ITEMS_PER_PAGE} from '../constants';
|
||||||
import {renderNumber, renderQuota, stringToColor} from '../helpers/render';
|
import {renderNumber, renderQuota, stringToColor} from '../helpers/render';
|
||||||
|
|
||||||
@ -194,19 +206,16 @@ const LogsTable = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
text.length > 10 ?
|
<Typography.Text
|
||||||
<>
|
ellipsis={{ showTooltip: true }}
|
||||||
{text.slice(0, 10)}
|
style={{ width: 100 }}
|
||||||
<Button
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalContent(text);
|
setModalContent(text);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
查看全部
|
{text}
|
||||||
</Button>
|
</Typography.Text>
|
||||||
</>
|
|
||||||
: text
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -220,19 +229,16 @@ const LogsTable = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
text.length > 10 ?
|
<Typography.Text
|
||||||
<>
|
ellipsis={{ showTooltip: true }}
|
||||||
{text.slice(0, 10)}
|
style={{ width: 100 }}
|
||||||
<Button
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalContent(text);
|
setModalContent(text);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
查看全部
|
{text}
|
||||||
</Button>
|
</Typography.Text>
|
||||||
</>
|
|
||||||
: text
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -246,19 +252,16 @@ const LogsTable = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
text.length > 10 ?
|
<Typography.Text
|
||||||
<>
|
ellipsis={{ showTooltip: true }}
|
||||||
{text.slice(0, 10)}
|
style={{ width: 100 }}
|
||||||
<Button
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setModalContent(text);
|
setModalContent(text);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
查看全部
|
{text}
|
||||||
</Button>
|
</Typography.Text>
|
||||||
</>
|
|
||||||
: text
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -414,15 +417,11 @@ const LogsTable = () => {
|
|||||||
>
|
>
|
||||||
<p style={{ whiteSpace: 'pre-line' }}>{modalContent}</p>
|
<p style={{ whiteSpace: 'pre-line' }}>{modalContent}</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
{/* 模态框组件,用于展示图片 */}
|
<ImagePreview
|
||||||
<Modal
|
src={modalImageUrl}
|
||||||
title="图片预览"
|
|
||||||
visible={isModalOpenurl}
|
visible={isModalOpenurl}
|
||||||
onCancel={() => setIsModalOpenurl(false)}
|
onVisibleChange={(visible) => setIsModalOpenurl(visible)}
|
||||||
footer={null} // 模态框不显示底部按钮
|
/>
|
||||||
>
|
|
||||||
<img src={modalImageUrl} style={{ width: '100%' }} alt="结果图片" />
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
</Layout>
|
</Layout>
|
||||||
</>
|
</>
|
||||||
|
Loading…
Reference in New Issue
Block a user