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
f6fa733e
Commit
f6fa733e
authored
6 years ago
by
barnettZQG
Browse files
Options
Download
Email Patches
Plain Diff
[REV] update ui for plugin config
parent
b24dadfe
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/AddPort/index.js
+2
-7
src/components/AddPort/index.js
src/routes/App/plugin.js
+29
-11
src/routes/App/plugin.js
with
31 additions
and
18 deletions
+31
-18
src/components/AddPort/index.js
+
2
-
7
View file @
f6fa733e
...
...
@@ -26,13 +26,8 @@ export default class AddPort extends PureComponent {
handleCheckPort
=
(
rule
,
value
,
callback
)
=>
{
const
{
getFieldValue
}
=
this
.
props
.
form
;
if
((
this
.
props
.
isImageApp
||
this
.
props
.
isDockerfile
)){
if
(
value
<
1
||
value
>
65535
){
callback
(
"
端口范围为1-65535
"
);
return
;
}
}
else
{
if
(
value
<
1025
||
value
>
65535
){
callback
(
"
端口范围为1025-65535
"
);
if
(
value
<
1
||
value
>
65534
){
callback
(
"
端口范围为1-65534
"
);
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/routes/App/plugin.js
+
29
-
11
View file @
f6fa733e
...
...
@@ -46,6 +46,7 @@ class UpdateMemory extends PureComponent {
return
(
<
Modal
title
=
"
内存修改
"
visible
onOk
=
{
this
.
handleOk
}
onCancel
=
{
this
.
props
.
onCancel
}
>
<
Select
style
=
{{
width
:
"
100%
"
}}
value
=
{
this
.
state
.
memory
}
onChange
=
{
this
.
handleChange
}
>
<
Option
value
=
{
32
}
>
32
M
<
/Option
>
<
Option
value
=
{
64
}
>
64
M
<
/Option
>
<
Option
value
=
{
128
}
>
128
M
<
/Option
>
<
Option
value
=
{
256
}
>
256
M
<
/Option
>
...
...
@@ -120,7 +121,7 @@ class ConfigItems extends PureComponent {
disabled
=
{
!
item
.
is_change
}
value
=
{
item
.
attr_value
||
item
.
attr_default_value
||
""
}
>
{
options
.
map
(
v
=>
<
Option
value
=
{
v
}
>
{
v
}
<
/Option>
)
}
{
options
.
map
(
v
=>
<
Option
key
=
{
v
}
value
=
{
v
}
>
{
v
}
<
/Option>
)
}
<
/Select
>
<
/FormItem
>
);
...
...
@@ -148,7 +149,7 @@ class ConfigItems extends PureComponent {
value
=
{(
item
.
attr_value
||
item
.
attr_default_value
||
""
).
split
(
"
,
"
)}
mode
=
"
multiple
"
>
{
options
.
map
(
v
=>
<
Option
value
=
{
v
}
>
{
v
}
<
/Option>
)
}
{
options
.
map
(
v
=>
<
Option
key
=
{
v
}
value
=
{
v
}
>
{
v
}
<
/Option>
)
}
<
/Select
>
<
/FormItem
>
);
...
...
@@ -170,14 +171,14 @@ class ConfigDownstreamPort extends PureComponent {
super
(
props
);
const
data
=
this
.
props
.
data
;
this
.
state
=
{
currApp
:
data
[
0
].
dest_service_
cname
,
currApp
:
data
[
0
].
dest_service_
alias
,
currPort
:
data
[
0
].
port
,
};
}
getAppByName
=
app
Name
=>
this
.
props
.
data
.
filter
(
item
=>
item
.
dest_service_
cname
===
app
Name
);
handleAppChange
=
(
app
Name
)
=>
{
const
apps
=
this
.
getAppByName
(
app
Name
);
this
.
setState
({
currApp
:
app
Name
,
currPort
:
apps
[
0
].
port
});
getAppByName
=
app
Alias
=>
this
.
props
.
data
.
filter
(
item
=>
item
.
dest_service_
alias
===
app
Alias
);
handleAppChange
=
(
app
Alias
)
=>
{
const
apps
=
this
.
getAppByName
(
app
Alias
);
this
.
setState
({
currApp
:
app
Alias
,
currPort
:
apps
[
0
].
port
});
};
handlePortChange
=
(
port
)
=>
{
this
.
setState
({
currPort
:
port
});
...
...
@@ -192,12 +193,29 @@ class ConfigDownstreamPort extends PureComponent {
const
apps
=
this
.
getAppByName
(
currApp
);
return
apps
.
filter
(
item
=>
item
.
port
===
currPort
)[
0
];
};
render
()
{
getApps
=
()
=>
{
const
data
=
this
.
props
.
data
;
let
n
=
[]
let
apps
=
[]
data
.
map
(
item
=>
{
if
(
n
.
indexOf
(
item
.
dest_service_alias
)
==
-
1
)
{
n
.
push
(
item
.
dest_service_alias
);
apps
.
push
({
dest_service_alias
:
item
.
dest_service_alias
,
dest_service_cname
:
item
.
dest_service_cname
,
port
:
item
.
port
,
})
}
});
console
.
log
(
apps
)
return
apps
}
render
()
{
const
currData
=
this
.
getCurrData
();
const
currPort
=
this
.
state
.
currPort
;
const
currApp
=
this
.
state
.
currApp
;
const
ports
=
this
.
getCurrPorts
();
const
apps
=
this
.
getApps
()
return
(
<
Card
style
=
{{
...
...
@@ -214,8 +232,8 @@ class ConfigDownstreamPort extends PureComponent {
>
下游应用
:{
"
"
}
<
Select
onChange
=
{
this
.
handleAppChange
}
value
=
{
currApp
}
>
{
data
.
map
(
item
=>
(
<
Option
value
=
{
item
.
dest_service_
cname
}
>
{
item
.
dest_service_cname
}
<
/Option
>
{
apps
.
map
(
item
=>
(
item
&&
<
Option
key
=
{
item
.
dest_service_alias
+
item
.
port
}
value
=
{
item
.
dest_service_
alias
}
>
{
item
.
dest_service_cname
}
<
/Option
>
))}
<
/Select
>
<
/span>{" "
}
...
...
@@ -269,7 +287,7 @@ class ConfigUpstreamPort extends PureComponent {
>
端口号
:{
"
"
}
<
Select
onChange
=
{
this
.
handlePortChange
}
value
=
{
currPort
}
>
{
data
.
map
(
item
=>
<
Option
value
=
{
item
.
port
}
>
{
item
.
port
}
<
/Option>
)
}
{
data
.
map
(
item
=>
<
Option
key
=
{
item
.
port
}
value
=
{
item
.
port
}
>
{
item
.
port
}
<
/Option>
)
}
<
/Select
>
<
/span>{" "
}
<
span
style
=
{{
marginRight
:
24
}}
>
端口协议
:
{
currData
.
protocol
}
<
/span>{" "
}
...
...
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