Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢捷峰
discovery
Commits
4264fe8e
Commit
4264fe8e
authored
Sep 15, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改界面
parent
b59e3c63
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
44 deletions
+39
-44
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/controller/ServiceController.java
+9
-0
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/RouterTopology.java
+3
-3
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
+25
-41
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale.properties
+1
-0
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale_zh_CN.properties
+1
-0
No files found.
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/controller/ServiceController.java
View file @
4264fe8e
...
...
@@ -45,6 +45,15 @@ public class ServiceController {
return
result
;
}
public
static
List
<
String
>
getGroups
()
{
String
url
=
getUrl
()
+
"console/groups"
;
String
result
=
restTemplate
.
getForEntity
(
url
,
String
.
class
).
getBody
();
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
List
<
String
>>()
{
});
}
public
static
Map
<
String
,
List
<
Instance
>>
getInstanceMap
()
{
String
url
=
getUrl
()
+
"console/instance-map"
;
...
...
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/RouterTopology.java
View file @
4264fe8e
...
...
@@ -262,7 +262,7 @@ public class RouterTopology extends AbstractTopology {
if
(
this
.
instance
!=
instance
)
{
this
.
instance
=
instance
;
textField
.
setText
(
""
);
textField
.
setText
(
StringUtils
.
EMPTY
);
dataBox
.
clear
();
}
}
...
...
@@ -304,7 +304,7 @@ public class RouterTopology extends AbstractTopology {
if
(
routerPath
.
contains
(
";"
))
{
routerPath
=
routerPath
.
substring
(
0
,
routerPath
.
lastIndexOf
(
";"
));
}
else
{
routerPath
=
""
;
routerPath
=
StringUtils
.
EMPTY
;
}
textField
.
setText
(
routerPath
);
...
...
@@ -349,7 +349,7 @@ public class RouterTopology extends AbstractTopology {
private
static
final
long
serialVersionUID
=
1L
;
public
void
execute
(
ActionEvent
e
)
{
textField
.
setText
(
""
);
textField
.
setText
(
StringUtils
.
EMPTY
);
dataBox
.
clear
();
}
};
...
...
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
View file @
4264fe8e
...
...
@@ -299,7 +299,7 @@ public class ServiceTopology extends AbstractTopology {
}
}
return
""
;
return
StringUtils
.
EMPTY
;
}
private
String
getValidPlugin
(
List
<
Instance
>
instances
)
{
...
...
@@ -310,10 +310,10 @@ public class ServiceTopology extends AbstractTopology {
}
}
return
""
;
return
StringUtils
.
EMPTY
;
}
private
Object
[]
filter
ToArray
(
Map
<
String
,
List
<
Instance
>>
instanceMap
)
{
private
Object
[]
filter
Instances
(
Map
<
String
,
List
<
Instance
>>
instanceMap
)
{
List
<
String
>
filters
=
new
ArrayList
<
String
>();
for
(
Map
.
Entry
<
String
,
List
<
Instance
>>
entry
:
instanceMap
.
entrySet
())
{
List
<
Instance
>
instances
=
entry
.
getValue
();
...
...
@@ -326,30 +326,14 @@ public class ServiceTopology extends AbstractTopology {
}
}
if
(
filters
.
contains
(
""
))
{
filters
.
remove
(
""
);
if
(
filters
.
contains
(
StringUtils
.
EMPTY
))
{
filters
.
remove
(
StringUtils
.
EMPTY
);
}
filters
.
add
(
NO_FILTER
);
return
filters
.
toArray
();
}
private
Vector
<
Object
>
filterToVector
(
Map
<
String
,
List
<
Instance
>>
instanceMap
)
{
Vector
<
Object
>
filters
=
new
Vector
<
Object
>();
for
(
Map
.
Entry
<
String
,
List
<
Instance
>>
entry
:
instanceMap
.
entrySet
())
{
List
<
Instance
>
instances
=
entry
.
getValue
();
for
(
Instance
instance
:
instances
)
{
String
filter
=
InstanceEntityWrapper
.
getGroup
(
instance
);
String
plugin
=
InstanceEntityWrapper
.
getPlugin
(
instance
);
if
(
StringUtils
.
isNotEmpty
(
plugin
)
&&
!
filters
.
contains
(
filter
))
{
filters
.
add
(
filter
);
}
}
}
return
filters
;
}
private
Object
[]
filterServices
(
TNode
node
,
Map
<
String
,
List
<
Instance
>>
instanceMap
)
{
Set
<
String
>
services
=
instanceMap
.
keySet
();
List
<
String
>
filterServices
=
new
ArrayList
<
String
>();
...
...
@@ -379,7 +363,7 @@ public class ServiceTopology extends AbstractTopology {
}
private
String
getGroupName
(
String
serviceId
,
int
count
,
String
filter
)
{
return
ButtonManager
.
getHtmlText
(
serviceId
+
" ["
+
count
+
"]"
+
(
StringUtils
.
isNotEmpty
(
filter
)
?
"\n"
+
filter
:
""
));
return
ButtonManager
.
getHtmlText
(
serviceId
+
" ["
+
count
+
"]"
+
(
StringUtils
.
isNotEmpty
(
filter
)
?
"\n"
+
filter
:
StringUtils
.
EMPTY
));
}
@SuppressWarnings
(
"unchecked"
)
...
...
@@ -562,7 +546,7 @@ public class ServiceTopology extends AbstractTopology {
return
;
}
Object
[]
filters
=
filter
ToArray
(
instanceMap
);
Object
[]
filters
=
filter
Instances
(
instanceMap
);
if
(
filterPanel
==
null
)
{
filterPanel
=
new
FilterPanel
();
filterPanel
.
setPreferredSize
(
new
Dimension
(
320
,
60
));
...
...
@@ -736,16 +720,16 @@ public class ServiceTopology extends AbstractTopology {
return
;
}
Map
<
String
,
List
<
Instance
>>
instanceMap
=
null
;
List
<
String
>
groups
=
null
;
try
{
instanceMap
=
ServiceController
.
getInstanceMap
();
groups
=
ServiceController
.
getGroups
();
}
catch
(
Exception
ex
)
{
JExceptionDialog
.
traceException
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
ConsoleLocale
.
getString
(
"get_service_
instances
_failure"
),
ex
);
JExceptionDialog
.
traceException
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
ConsoleLocale
.
getString
(
"get_service_
group
_failure"
),
ex
);
return
;
}
Vector
<
Object
>
globalFilterVector
=
filterToVector
(
instanceMap
);
Vector
<
Object
>
globalFilterVector
=
new
Vector
<
Object
>(
groups
);
if
(
globalGrayPanel
==
null
)
{
globalGrayPanel
=
new
GlobalGrayPanel
();
...
...
@@ -853,7 +837,7 @@ public class ServiceTopology extends AbstractTopology {
@SuppressWarnings
(
"unchecked"
)
public
void
setFilters
(
Vector
<
Object
>
filters
)
{
filterList
.
setModel
(
new
BasicListModel
(
filters
));
ruleTextArea
.
setText
(
""
);
ruleTextArea
.
setText
(
StringUtils
.
EMPTY
);
}
private
JSecurityAction
createUpdateRuleAction
()
{
...
...
@@ -1077,15 +1061,15 @@ public class ServiceTopology extends AbstractTopology {
ruleTabbedPane
.
remove
(
localRulePanel
);
}
dynamicVersionTextField
.
setText
(
""
);
localVersionTextField
.
setText
(
""
);
dynamicVersionTextField
.
setText
(
StringUtils
.
EMPTY
);
localVersionTextField
.
setText
(
StringUtils
.
EMPTY
);
updateVersionButton
.
setText
(
ConsoleLocale
.
getString
(
"button_batch_update_version"
));
clearVersionButton
.
setText
(
ConsoleLocale
.
getString
(
"button_batch_clear_version"
));
updateVersionButton
.
setEnabled
(
versionControlEnabled
);
clearVersionButton
.
setEnabled
(
versionControlEnabled
);
dynamicRuleTextArea
.
setText
(
""
);
localRuleTextArea
.
setText
(
""
);
dynamicRuleTextArea
.
setText
(
StringUtils
.
EMPTY
);
localRuleTextArea
.
setText
(
StringUtils
.
EMPTY
);
updateRuleButton
.
setText
(
ConsoleLocale
.
getString
(
"button_batch_update_rule"
));
clearRuleButton
.
setText
(
ConsoleLocale
.
getString
(
"button_batch_clear_rule"
));
updateRuleButton
.
setEnabled
(
ruleControlEnabled
);
...
...
@@ -1452,15 +1436,15 @@ public class ServiceTopology extends AbstractTopology {
}
public
void
setToUI
()
{
groupStartXTextField
.
setText
(
groupLocationEntity
.
getStartX
()
+
""
);
groupStartYTextField
.
setText
(
groupLocationEntity
.
getStartY
()
+
""
);
groupHorizontalGapTextField
.
setText
(
groupLocationEntity
.
getHorizontalGap
()
+
""
);
groupVerticalGapTextField
.
setText
(
groupLocationEntity
.
getVerticalGap
()
+
""
);
nodeStartXTextField
.
setText
(
nodeLocationEntity
.
getStartX
()
+
""
);
nodeStartYTextField
.
setText
(
nodeLocationEntity
.
getStartY
()
+
""
);
nodeHorizontalGapTextField
.
setText
(
nodeLocationEntity
.
getHorizontalGap
()
+
""
);
nodeVerticalGapTextField
.
setText
(
nodeLocationEntity
.
getVerticalGap
()
+
""
);
groupStartXTextField
.
setText
(
groupLocationEntity
.
getStartX
()
+
StringUtils
.
EMPTY
);
groupStartYTextField
.
setText
(
groupLocationEntity
.
getStartY
()
+
StringUtils
.
EMPTY
);
groupHorizontalGapTextField
.
setText
(
groupLocationEntity
.
getHorizontalGap
()
+
StringUtils
.
EMPTY
);
groupVerticalGapTextField
.
setText
(
groupLocationEntity
.
getVerticalGap
()
+
StringUtils
.
EMPTY
);
nodeStartXTextField
.
setText
(
nodeLocationEntity
.
getStartX
()
+
StringUtils
.
EMPTY
);
nodeStartYTextField
.
setText
(
nodeLocationEntity
.
getStartY
()
+
StringUtils
.
EMPTY
);
nodeHorizontalGapTextField
.
setText
(
nodeLocationEntity
.
getHorizontalGap
()
+
StringUtils
.
EMPTY
);
nodeVerticalGapTextField
.
setText
(
nodeLocationEntity
.
getVerticalGap
()
+
StringUtils
.
EMPTY
);
}
public
boolean
setFromUI
()
{
...
...
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale.properties
View file @
4264fe8e
...
...
@@ -55,6 +55,7 @@ gray_rule_not_null=灰度规则不能为空
execute_result
=
执行结果
get_service_group_failure
=
获取服务组列表失败
get_service_instances_failure
=
获取服务和实例列表失败
query_data_failure
=
查询数据失败,可能相关实例已下线
group_not_for_gray_release
=
该服务集群不能执行灰度发布
...
...
discovery-console-desktop/src/main/resources/com/nepxion/discovery/console/desktop/locale/Locale_zh_CN.properties
View file @
4264fe8e
...
...
@@ -55,6 +55,7 @@ gray_rule_not_null=\u7070\u5ea6\u89c4\u5219\u4e0d\u80fd\u4e3a\u7a7a
execute_result
=
\u6267\u
884c
\u
7ed3
\u
679c
get_service_group_failure
=
\u
83b7
\u
53d6
\u
670d
\u
52a1
\u
7ec4
\u5217\u8868\u5931\u
8d25
get_service_instances_failure
=
\u
83b7
\u
53d6
\u
670d
\u
52a1
\u
548c
\u
5b9e
\u
4f8b
\u5217\u8868\u5931\u
8d25
query_data_failure
=
\u
67e5
\u
8be2
\u6570\u
636e
\u5931\u
8d25
\u
ff0c
\u
53ef
\u
80fd
\u
76f8
\u5173\u
5b9e
\u
4f8b
\u
5df2
\u
4e0b
\u
7ebf
group_not_for_gray_release
=
\u
8be5
\u
670d
\u
52a1
\u
96c6
\u
7fa4
\u
4e0d
\u
80fd
\u6267\u
884c
\u7070\u
5ea6
\u
53d1
\u
5e03
...
...
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