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
15c7d8cc
Commit
15c7d8cc
authored
Aug 09, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改界面
parent
ce936acf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
2 deletions
+88
-2
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
+88
-2
No files found.
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/workspace/ServiceTopology.java
View file @
15c7d8cc
...
...
@@ -761,6 +761,8 @@ public class ServiceTopology extends AbstractTopology {
private
JBasicList
filterList
;
private
JBasicTextArea
ruleTextArea
;
private
JClassicButton
updateRuleButton
;
private
JClassicButton
clearRuleButton
;
public
GlobalGrayPanel
()
{
filterList
=
new
JBasicList
()
{
...
...
@@ -768,6 +770,10 @@ public class ServiceTopology extends AbstractTopology {
@Override
public
void
executeClicked
(
int
selectedRow
)
{
if
(
selectedRow
<
0
)
{
return
;
}
String
filter
=
getListData
().
get
(
selectedRow
).
toString
();
String
config
=
ServiceController
.
remoteConfigView
(
filter
,
filter
);
ruleTextArea
.
setText
(
config
);
...
...
@@ -778,14 +784,27 @@ public class ServiceTopology extends AbstractTopology {
JPanel
filterPanel
=
new
JPanel
();
filterPanel
.
setLayout
(
new
BorderLayout
());
filterPanel
.
setBorder
(
BorderFactory
.
createEmptyBorder
(
5
,
5
,
5
,
5
));
filterPanel
.
add
(
new
JBasicScrollPane
(
filterList
));
filterPanel
.
add
(
new
JBasicScrollPane
(
filterList
)
,
BorderLayout
.
CENTER
);
ruleTextArea
=
new
JBasicTextArea
();
updateRuleButton
=
new
JClassicButton
(
createUpdateRuleAction
());
updateRuleButton
.
setPreferredSize
(
new
Dimension
(
updateRuleButton
.
getPreferredSize
().
width
,
30
));
clearRuleButton
=
new
JClassicButton
(
createClearRuleAction
());
updateRuleButton
.
setPreferredSize
(
new
Dimension
(
clearRuleButton
.
getPreferredSize
().
width
,
30
));
JPanel
toolBar
=
new
JPanel
();
toolBar
.
setLayout
(
new
BoxLayout
(
toolBar
,
BoxLayout
.
X_AXIS
));
toolBar
.
add
(
updateRuleButton
);
toolBar
.
add
(
clearRuleButton
);
ButtonManager
.
updateUI
(
toolBar
);
JPanel
rulePanel
=
new
JPanel
();
rulePanel
.
setLayout
(
new
BorderLayout
());
rulePanel
.
setBorder
(
BorderFactory
.
createEmptyBorder
(
5
,
5
,
5
,
5
));
rulePanel
.
add
(
new
JBasicScrollPane
(
ruleTextArea
));
rulePanel
.
add
(
new
JBasicScrollPane
(
ruleTextArea
),
BorderLayout
.
CENTER
);
rulePanel
.
add
(
toolBar
,
BorderLayout
.
SOUTH
);
JDockable
dockable
=
(
JDockable
)
getDockableContainer
().
getContentPane
();
...
...
@@ -807,6 +826,73 @@ public class ServiceTopology extends AbstractTopology {
filterList
.
setModel
(
new
BasicListModel
(
filters
));
ruleTextArea
.
setText
(
""
);
}
private
JSecurityAction
createUpdateRuleAction
()
{
JSecurityAction
action
=
new
JSecurityAction
(
ConsoleLocale
.
getString
(
"button_update_rule"
),
ConsoleIconFactory
.
getSwingIcon
(
"save.png"
),
ConsoleLocale
.
getString
(
"button_update_rule"
))
{
private
static
final
long
serialVersionUID
=
1L
;
public
void
execute
(
ActionEvent
e
)
{
int
selectedRow
=
filterList
.
getSelectedIndex
();
if
(
selectedRow
<
0
)
{
JBasicOptionPane
.
showMessageDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
"请选择一个服务集群组"
,
SwingLocale
.
getString
(
"warning"
),
JBasicOptionPane
.
WARNING_MESSAGE
);
return
;
}
String
rule
=
ruleTextArea
.
getText
();
if
(
StringUtils
.
isEmpty
(
rule
))
{
JBasicOptionPane
.
showMessageDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
ConsoleLocale
.
getString
(
"gray_rule_not_null"
),
SwingLocale
.
getString
(
"warning"
),
JBasicOptionPane
.
WARNING_MESSAGE
);
return
;
}
String
filter
=
filterList
.
getListData
().
get
(
selectedRow
).
toString
();
String
result
=
null
;
try
{
result
=
ServiceController
.
remoteConfigUpdate
(
filter
,
filter
,
rule
);
}
catch
(
Exception
ex
)
{
JExceptionDialog
.
traceException
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
ConsoleLocale
.
getString
(
"query_data_failure"
),
ex
);
return
;
}
showResult
(
result
);
}
};
return
action
;
}
private
JSecurityAction
createClearRuleAction
()
{
JSecurityAction
action
=
new
JSecurityAction
(
ConsoleLocale
.
getString
(
"button_clear_rule"
),
ConsoleIconFactory
.
getSwingIcon
(
"paint.png"
),
ConsoleLocale
.
getString
(
"button_clear_rule"
))
{
private
static
final
long
serialVersionUID
=
1L
;
public
void
execute
(
ActionEvent
e
)
{
int
selectedRow
=
filterList
.
getSelectedIndex
();
if
(
selectedRow
<
0
)
{
JBasicOptionPane
.
showMessageDialog
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
"请选择一个服务集群组"
,
SwingLocale
.
getString
(
"warning"
),
JBasicOptionPane
.
WARNING_MESSAGE
);
return
;
}
String
filter
=
filterList
.
getListData
().
get
(
selectedRow
).
toString
();
String
result
=
null
;
try
{
result
=
ServiceController
.
remoteConfigClear
(
filter
,
filter
);
}
catch
(
Exception
ex
)
{
JExceptionDialog
.
traceException
(
HandleManager
.
getFrame
(
ServiceTopology
.
this
),
ConsoleLocale
.
getString
(
"query_data_failure"
),
ex
);
return
;
}
showResult
(
result
);
}
};
return
action
;
}
}
private
class
GrayPanel
extends
JPanel
{
...
...
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