Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rainbond Ui
Commits
d8833e78
Commit
d8833e78
authored
6 years ago
by
barnettZQG
Browse files
Options
Download
Plain Diff
Merge branch 'V3.7'
parents
069de05c
f635e62b
master
V3.7
V5.0
V5.1
V5.2
V5.3
dependabot/npm_and_yarn/axios-0.21.1
feature-helmapp
futureData
publiccloud
revert-299-Publishingmarket
revert-302-Publishingmarket
thirdLoading
upgrade
v5.3.2-release
v5.3.1-release
v5.3.0-release
v5.2.2-release
v5.2.1-release
v5.2.0-release
v5.2.0-beta2
v5.2.0-beta1
v5.1.11-release
v5.1.10-release
v5.1.9-release
v5.1.8-release
v5.1.6-release
v5.1.5-release
v5.1.4-release
v5.1.3-release
v5.1.2-release
v5.1.1-release
v5.1.0-release
v5.0.4-release
No related merge requests found
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
src/components/AppImport/index.js
+23
-8
src/components/AppImport/index.js
src/components/LogProcress/index.js
+6
-3
src/components/LogProcress/index.js
src/components/MarketAppDetailShow/index.js
+2
-1
src/components/MarketAppDetailShow/index.js
src/components/VisitBtn/index.js
+7
-7
src/components/VisitBtn/index.js
src/routes/App/index.js
+10
-5
src/routes/App/index.js
src/routes/App/setting.js
+29
-12
src/routes/App/setting.js
src/routes/Source/CloudApp.js
+53
-32
src/routes/Source/CloudApp.js
with
130 additions
and
68 deletions
+130
-68
src/components/AppImport/index.js
+
23
-
8
View file @
d8833e78
...
...
@@ -63,6 +63,9 @@ export default class Index extends PureComponent {
}
});
};
complete
=
()
=>
{
this
.
props
.
onOK
&&
this
.
props
.
onOK
()
}
closeAutoQuery
=
()
=>
{
this
.
autoQuery
=
false
;
this
.
setState
({
autoQuery
:
false
});
...
...
@@ -181,23 +184,32 @@ export default class Index extends PureComponent {
if
(
data
.
bean
&&
data
.
bean
.
status
==
"
uploading
"
)
{
return
}
if
(
data
.
bean
&&
(
data
.
bean
.
status
!=
"
success
"
&&
data
.
bean
.
status
!=
"
failed
"
)){
setTimeout
(()
=>
{
this
.
queryImportStatus
();
},
2000
);
}
else
if
(
data
.
bean
&&
data
.
bean
.
status
==
"
success
"
){
if
(
data
.
bean
&&
data
.
bean
.
status
==
"
partial_success
"
)
{
notification
.
success
({
message
:
"
部分应用导入失败,你可以重试或取消导入
"
});
return
}
if
(
data
.
bean
&&
data
.
bean
.
status
==
"
success
"
)
{
notification
.
success
({
message
:
"
导入完成
"
});
this
.
props
.
onOK
&&
this
.
props
.
onOK
()
}
else
if
(
data
.
bean
&&
data
.
bean
.
status
==
"
failed
"
){
return
}
if
(
data
.
bean
&&
data
.
bean
.
status
==
"
failed
"
)
{
notification
.
success
({
message
:
"
导入失败
"
message
:
"
应用
导入失败
"
});
return
}
setTimeout
(()
=>
{
this
.
queryImportStatus
();
},
2000
);
}
});
};
handleQueryImportDir
=
()
=>
{
if
(
this
.
autoQuery
)
{
this
.
props
.
dispatch
({
...
...
@@ -232,6 +244,7 @@ export default class Index extends PureComponent {
notification
.
success
({
message
:
"
开始重新导入
"
});
this
.
openQueryImportStatus
()
}
});
};
...
...
@@ -329,7 +342,9 @@ export default class Index extends PureComponent {
<
/span
>
{
app
.
status
==
"
failed
"
?
(
<
Button
onClick
=
{
this
.
reImportApp
(
app
.
file_name
)}
onClick
=
{()
=>
{
this
.
reImportApp
(
app
.
file_name
)
}}
size
=
"
small
"
>
重新导入
...
...
This diff is collapsed.
Click to expand it.
src/components/LogProcress/index.js
+
6
-
3
View file @
d8833e78
...
...
@@ -79,13 +79,16 @@ export default class Index extends PureComponent {
}
msg
+=
message
.
status
||
""
;
msg
+=
message
.
progress
||
""
;
if
(
data
.
step
!=
"
build-progress
"
)
{
if
(
msg
)
{
return
`<span className="time" style="margin-right: 8px">
${
moment
(
data
.
time
).
format
(
"
HH:mm:ss
"
)}
</span><span>
${
msg
||
""
}
</span>`
;
}
return
`<span className="time" style="margin-right: 8px">
${
moment
(
data
.
time
).
format
(
"
HH:mm:ss
"
)}
</span><span>
${
message
.
stream
}
</span>`
;
}
catch
(
e
)
{
return
""
;
}
if
(
data
.
message
)
{
return
`<span className="time" style="margin-right: 8px">
${
moment
(
data
.
time
).
format
(
"
HH:mm:ss
"
)}
</span><span>
${
msg
||
""
}
</span>`
;
}
return
""
}
};
createTmpElement
()
{
this
.
ele
=
document
.
createElement
(
"
p
"
);
...
...
This diff is collapsed.
Click to expand it.
src/components/MarketAppDetailShow/index.js
+
2
-
1
View file @
d8833e78
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
Modal
}
from
'
antd
'
;
import
{
Modal
,
Button
}
from
'
antd
'
;
import
ReactMarkdown
from
"
react-markdown
"
import
styles
from
'
./index.less
'
;
...
...
@@ -18,6 +18,7 @@ export default class Index extends PureComponent {
visible
=
{
true
}
onOk
=
{
this
.
props
.
onOk
}
onCancel
=
{
this
.
props
.
onCancel
}
footer
=
{
<
Button
onClick
=
{
this
.
props
.
onOk
}
>
确定
<
/Button>
}
title
=
{
this
.
state
.
title
}
width
=
{
700
}
>
...
...
This diff is collapsed.
Click to expand it.
src/components/VisitBtn/index.js
+
7
-
7
View file @
d8833e78
...
...
@@ -83,7 +83,7 @@ export default class Index extends PureComponent {
return
(
<
Fragment
>
<
Tooltip
title
=
"
跳转到应用对外访问端口对应的域名地址
"
>
<
Button
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
Button
type
=
{
this
.
props
.
btntype
}
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
/Tooltip
>
{
showModal
&&
(
<
Modal
...
...
@@ -118,7 +118,7 @@ export default class Index extends PureComponent {
if
(
links
.
length
===
1
)
{
return
(
<
Tooltip
title
=
"
跳转到应用对外访问端口对应的域名地址
"
>
<
Button
<
Button
type
=
{
this
.
props
.
btntype
}
onClick
=
{()
=>
{
window
.
open
(
links
[
0
]);
}}
...
...
@@ -131,7 +131,7 @@ export default class Index extends PureComponent {
return
(
<
Fragment
>
<
Tooltip
title
=
"
跳转到应用对外访问端口对应的域名地址
"
>
<
Button
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
Button
type
=
{
this
.
props
.
btntype
}
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
/Tooltip
>
{
showModal
&&
(
<
Modal
...
...
@@ -168,7 +168,7 @@ export default class Index extends PureComponent {
}
placement
=
"
bottomRight
"
>
<
Button
>
<
Button
type
=
{
this
.
props
.
btntype
}
>
<
a
href
=
{
links
[
0
]}
target
=
"
_blank
"
>
访问
<
/a
>
...
...
@@ -180,7 +180,7 @@ export default class Index extends PureComponent {
return
(
<
Fragment
>
<
Tooltip
title
=
"
跳转到应用对外访问端口对应的域名地址
"
>
<
Button
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
Button
type
=
{
this
.
props
.
btntype
}
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
/Tooltip
>
{
showModal
&&
(
<
Modal
...
...
@@ -217,7 +217,7 @@ export default class Index extends PureComponent {
return
(
<
Fragment
>
<
Tooltip
title
=
"
跳转到应用对外访问端口对应的域名地址
"
>
<
Button
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
Button
type
=
{
this
.
props
.
btntype
}
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
/Tooltip
>
{
showModal
&&
(
<
Modal
...
...
@@ -379,7 +379,7 @@ export default class Index extends PureComponent {
return
(
<
Fragment
>
<
Tooltip
title
=
"
跳转到应用对外访问端口对应的域名地址
"
>
<
Button
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
Button
type
=
{
this
.
props
.
btntype
}
onClick
=
{
this
.
showModal
}
>
访问
<
/Button
>
<
/Tooltip
>
{
showModal
&&
(
<
Modal
...
...
This diff is collapsed.
Click to expand it.
src/routes/App/index.js
+
10
-
5
View file @
d8833e78
...
...
@@ -596,13 +596,12 @@ class Main extends PureComponent {
<
Menu
.
Item
key
=
"
deleteApp
"
disabled
=
{
!
appUtil
.
canDelete
(
appDetail
)}
>
删除
<
/Menu.Item
>
<
/Menu
>
);
const
appAlias
=
this
.
getAppAlias
()
const
action
=
(
<
div
>
<
ButtonGroup
>
{(
appStatusUtil
.
canVisit
(
status
))
?
<
VisitBtn
app_alias
=
{
this
.
getAppAlias
()}
/
>
:
null
}
{(
appDetail
.
service
.
service_source
!=
"
market
"
&&
appStatusUtil
.
canVisit
(
status
))
&&
(
<
VisitBtn
btntype
=
"
default
"
app_alias
=
{
appAlias
}
/>
)
}
{(
appUtil
.
canStopApp
(
appDetail
))
&&
!
appStatusUtil
.
canStart
(
status
)
?
<
Button
disabled
=
{
!
appStatusUtil
.
canStop
(
status
)}
onClick
=
{
this
.
handleStop
}
>
关闭
<
/Button
>
...
...
@@ -631,7 +630,7 @@ class Main extends PureComponent {
<
Button
>
其他操作
<
Icon
type
=
"
ellipsis
"
/><
/Button
>
<
/Dropdown
>
<
/ButtonGroup
>
{(
appUtil
.
canDeploy
(
appDetail
)
&&
appStatusUtil
.
canDeploy
(
status
))
{(
appUtil
.
canDeploy
(
appDetail
)
&&
appStatusUtil
.
canDeploy
(
status
)
&&
appDetail
.
service
.
service_source
!=
"
market
"
)
?
this
.
state
.
showDeployTips
?
<
Tooltip
title
=
"
应用配置已更改,重新部署后生效
"
>
...
...
@@ -640,6 +639,12 @@ class Main extends PureComponent {
:
<
Button
onClick
=
{
this
.
handleDeploy
}
type
=
"
primary
"
>
重新部署
<
/Button
>
:
''
}
{
(
appDetail
.
service
.
service_source
==
"
market
"
&&
appDetail
.
service
.
is_upgrate
)
&&
(
<
Button
onClick
=
{
this
.
handleDeploy
}
type
=
"
primary
"
>
应用升级
<
/Button
>
)
}
{(
appDetail
.
service
.
service_source
==
"
market
"
&&
appStatusUtil
.
canVisit
(
status
))
&&
(
<
VisitBtn
btntype
=
"
primary
"
app_alias
=
{
appAlias
}
/>
)
}
<
/div
>
);
...
...
This diff is collapsed.
Click to expand it.
src/routes/App/setting.js
+
29
-
12
View file @
d8833e78
...
...
@@ -18,7 +18,7 @@ import AddVarModal from "./setting/env";
import
EditRunHealthCheck
from
"
./setting/edit-run-health-check
"
;
import
DescriptionList
from
"
../../components/DescriptionList
"
;
import
ChangeBuildSource
from
"
./setting/edit-buildsource
"
;
import
MarketAppDetailShow
from
"
../../components/MarketAppDetailShow
"
;
const
FormItem
=
Form
.
Item
;
@
connect
(
...
...
@@ -56,6 +56,8 @@ export default class Index extends PureComponent {
members
:
null
,
buildSource
:
null
,
changeBuildSource
:
false
,
showMarketAppDetail
:
false
,
showApp
:
{}
};
}
componentDidMount
()
{
...
...
@@ -450,6 +452,12 @@ export default class Index extends PureComponent {
hideDelMember
=
()
=>
{
this
.
setState
({
toDeleteMember
:
null
});
};
hideMarketAppDetail
=
()
=>
{
this
.
setState
({
showApp
:
{},
showMarketAppDetail
:
false
});
}
handleDelMember
=
()
=>
{
const
team_name
=
globalUtil
.
getCurrTeamName
();
this
.
props
.
dispatch
({
...
...
@@ -626,9 +634,20 @@ export default class Index extends PureComponent {
marginBottom
:
0
,
}}
{...
formItemLayout
}
label
=
"
镜像
名称
"
label
=
"
云市应用
名称
"
>
{
this
.
state
.
buildSource
.
image
}
{
this
.
state
.
buildSource
.
group_key
?(
<
a
href
=
"
javascript:;
"
onClick
=
{()
=>
{
this
.
setState
({
showApp
:
{
details
:
this
.
state
.
buildSource
.
details
,
group_name
:
this
.
state
.
buildSource
.
rain_app_name
,
group_key
:
this
.
state
.
buildSource
.
group_key
,
},
showMarketAppDetail
:
true
});
}}
>
{
this
.
state
.
buildSource
.
rain_app_name
}
<
/a
>
):(
"
无法找到源应用,可能已删除
"
)}
<
/FormItem
>
<
FormItem
style
=
{{
...
...
@@ -639,15 +658,6 @@ export default class Index extends PureComponent {
>
{
this
.
state
.
buildSource
.
version
}
<
/FormItem
>
<
FormItem
style
=
{{
marginBottom
:
0
,
}}
{...
formItemLayout
}
label
=
"
启动命令
"
>
{
this
.
state
.
buildSource
.
docker_cmd
}
<
/FormItem
>
<
/Fragment
>
)
:
(
""
...
...
@@ -1114,6 +1124,13 @@ export default class Index extends PureComponent {
onCancel
=
{
this
.
hideBuildSource
}
/
>
)}
{
this
.
state
.
showMarketAppDetail
&&
(
<
MarketAppDetailShow
onOk
=
{
this
.
hideMarketAppDetail
}
onCancel
=
{
this
.
hideMarketAppDetail
}
app
=
{
this
.
state
.
showApp
}
/
>
)}
<
/Fragment
>
);
}
...
...
This diff is collapsed.
Click to expand it.
src/routes/Source/CloudApp.js
+
53
-
32
View file @
d8833e78
import
React
,
{
PureComponent
,
Fragment
}
from
"
react
"
;
import
globalUtil
from
"
../../utils/global
"
;
import
MarketAppDetailShow
from
'
../../components/MarketAppDetailShow
'
import
MarketAppDetailShow
from
"
../../components/MarketAppDetailShow
"
;
import
BasicListStyles
from
"
../List/BasicList.less
"
;
import
{
Card
,
List
,
Avatar
,
Input
,
Radio
,
notification
}
from
"
antd
"
;
import
{
Card
,
List
,
Avatar
,
Input
,
Radio
,
notification
}
from
"
antd
"
;
const
RadioButton
=
Radio
.
Button
;
const
RadioGroup
=
Radio
.
Group
;
const
{
Search
}
=
Input
;
...
...
@@ -113,6 +106,41 @@ export default class CloudApp extends PureComponent {
showMarketAppDetail
:
false
});
};
getAction
=
item
=>
{
if
(
item
.
is_complete
)
{
if
(
item
.
is_upgrade
===
0
)
{
return
(
<
Fragment
>
<
span
>
已下载
,
无更新
<
/span
>
<
/Fragment
>
);
}
else
{
return
(
<
Fragment
>
<
a
href
=
"
javascript:;
"
onClick
=
{()
=>
{
this
.
handleLoadAppDetail
(
item
);
}}
>
更新新版本
<
/a
>
<
/Fragment
>
);
}
}
else
{
return
(
<
a
href
=
"
javascript:;
"
onClick
=
{()
=>
{
this
.
handleLoadAppDetail
(
item
);
}}
>
下载
<
/a
>
);
}
};
render
()
{
const
paginationProps
=
{
pageSize
:
this
.
state
.
pageSize
,
...
...
@@ -122,6 +150,7 @@ export default class CloudApp extends PureComponent {
this
.
handlePageChange
(
pageSize
);
}
};
return
(
<
Card
className
=
{
BasicListStyles
.
listCard
}
...
...
@@ -155,24 +184,7 @@ export default class CloudApp extends PureComponent {
pagination
=
{
paginationProps
}
dataSource
=
{
this
.
state
.
apps
}
renderItem
=
{
item
=>
(
<
List
.
Item
actions
=
{[
item
.
is_complete
?
(
<
Fragment
>
<
span
>
已下载
<
/span
>
<
/Fragment
>
)
:
(
<
a
href
=
"
javascript:;
"
onClick
=
{()
=>
{
this
.
handleLoadAppDetail
(
item
);
}}
>
下载
<
/a
>
)
]}
>
<
List
.
Item
actions
=
{[
this
.
getAction
(
item
)]}
>
<
List
.
Item
.
Meta
avatar
=
{
<
Avatar
...
...
@@ -186,9 +198,18 @@ export default class CloudApp extends PureComponent {
size
=
"
large
"
/>
}
title
=
{
<
a
style
=
{{
color
:
"
#1890ff
"
}}
href
=
"
javascript:;
"
onClick
=
{()
=>
{
this
.
showMarketAppDetail
(
item
)
}}
>
{
item
.
group_name
}{
item
.
is_official
&&
(
"
(官方发布)
"
)}
<
/a>
}
title
=
{
<
a
style
=
{{
color
:
"
#1890ff
"
}}
href
=
"
javascript:;
"
onClick
=
{()
=>
{
this
.
showMarketAppDetail
(
item
);
}}
>
{
item
.
group_name
}
{
item
.
is_official
&&
"
(官方发布)
"
}
<
/a
>
}
description
=
{
<
div
>
<
p
>
版本
:
{
item
.
version
}
<
/p
>
...
...
@@ -199,13 +220,13 @@ export default class CloudApp extends PureComponent {
<
/List.Item
>
)}
/
>
{
this
.
state
.
showMarketAppDetail
&&
(
{
this
.
state
.
showMarketAppDetail
&&
(
<
MarketAppDetailShow
onOk
=
{
this
.
hideMarketAppDetail
}
onCancel
=
{
this
.
hideMarketAppDetail
}
app
=
{
this
.
state
.
showApp
}
/
>
)}
)}
<
/Card
>
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help