Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6bd5b3b4
authored
Dec 14, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
美化绘画IU
parent
b244a1dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
50 deletions
+55
-50
common/constants.go
+1
-1
controller/midjourney.go
+6
-0
web/src/components/MjLogsTable.js
+48
-49
No files found.
common/constants.go
View file @
6bd5b3b4
...
...
@@ -11,7 +11,7 @@ import (
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
SystemName
=
"
One
API"
var
SystemName
=
"
New
API"
var
ServerAddress
=
"http://localhost:3000"
var
PayAddress
=
""
var
EpayId
=
""
...
...
controller/midjourney.go
View file @
6bd5b3b4
...
...
@@ -187,6 +187,12 @@ func GetUserMidjourney(c *gin.Context) {
if
logs
==
nil
{
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
{
"success"
:
true
,
"message"
:
""
,
...
...
web/src/components/MjLogsTable.js
View file @
6bd5b3b4
...
...
@@ -2,7 +2,19 @@ import React, {useEffect, useState} from 'react';
import
{
Label
}
from
'semantic-ui-react'
;
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
{
renderNumber
,
renderQuota
,
stringToColor
}
from
'../helpers/render'
;
...
...
@@ -194,19 +206,16 @@ const LogsTable = () => {
}
return
(
text
.
length
>
10
?
<>
{
text
.
slice
(
0
,
10
)}
<
Button
onClick
=
{()
=>
{
setModalContent
(
text
);
setIsModalOpen
(
true
);
}}
>
查看全部
<
/Button
>
<
/
>
:
text
<
Typography
.
Text
ellipsis
=
{{
showTooltip
:
true
}}
style
=
{{
width
:
100
}}
onClick
=
{()
=>
{
setModalContent
(
text
);
setIsModalOpen
(
true
);
}}
>
{
text
}
<
/Typography.Text
>
);
}
},
...
...
@@ -220,19 +229,16 @@ const LogsTable = () => {
}
return
(
text
.
length
>
10
?
<>
{
text
.
slice
(
0
,
10
)}
<
Button
onClick
=
{()
=>
{
setModalContent
(
text
);
setIsModalOpen
(
true
);
}}
>
查看全部
<
/Button
>
<
/
>
:
text
<
Typography
.
Text
ellipsis
=
{{
showTooltip
:
true
}}
style
=
{{
width
:
100
}}
onClick
=
{()
=>
{
setModalContent
(
text
);
setIsModalOpen
(
true
);
}}
>
{
text
}
<
/Typography.Text
>
);
}
},
...
...
@@ -246,19 +252,16 @@ const LogsTable = () => {
}
return
(
text
.
length
>
10
?
<>
{
text
.
slice
(
0
,
10
)}
<
Button
onClick
=
{()
=>
{
setModalContent
(
text
);
setIsModalOpen
(
true
);
}}
>
查看全部
<
/Button
>
<
/
>
:
text
<
Typography
.
Text
ellipsis
=
{{
showTooltip
:
true
}}
style
=
{{
width
:
100
}}
onClick
=
{()
=>
{
setModalContent
(
text
);
setIsModalOpen
(
true
);
}}
>
{
text
}
<
/Typography.Text
>
);
}
}
...
...
@@ -414,15 +417,11 @@ const LogsTable = () => {
>
<
p
style
=
{{
whiteSpace
:
'pre-line'
}}
>
{
modalContent
}
<
/p
>
<
/Modal
>
{
/* 模态框组件,用于展示图片 */
}
<
Modal
title
=
"图片预览"
visible
=
{
isModalOpenurl
}
onCancel
=
{()
=>
setIsModalOpenurl
(
false
)}
footer
=
{
null
}
// 模态框不显示底部按钮
>
<
img
src
=
{
modalImageUrl
}
style
=
{{
width
:
'100%'
}}
alt
=
"结果图片"
/>
<
/Modal
>
<
ImagePreview
src
=
{
modalImageUrl
}
visible
=
{
isModalOpenurl
}
onVisibleChange
=
{(
visible
)
=>
setIsModalOpenurl
(
visible
)}
/
>
<
/Layout
>
<
/
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment