Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
incubator-dubbo-admin
提交
bca94f87
I
incubator-dubbo-admin
项目概览
爱吃血肠
/
incubator-dubbo-admin
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-dubbo-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bca94f87
编写于
9月 13, 2018
作者:
B
beiwei30
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/apache/incubator-dubbo-ops
into develop
上级
8db54cfe
bdf66a8d
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
688 addition
and
587 deletion
+688
-587
dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/RoutesController.java
...a/org/apache/dubbo/admin/controller/RoutesController.java
+7
-9
dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/ServiceController.java
.../org/apache/dubbo/admin/controller/ServiceController.java
+3
-3
dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/web/mvc/governance/RoutesController.java
...ache/dubbo/admin/web/mvc/governance/RoutesController.java
+555
-555
dubbo-admin-frontend/src/components/RoutingRule.vue
dubbo-admin-frontend/src/components/RoutingRule.vue
+115
-20
dubbo-admin-frontend/src/components/ServiceSearch.vue
dubbo-admin-frontend/src/components/ServiceSearch.vue
+8
-0
未找到文件。
dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/RoutesController.java
浏览文件 @
bca94f87
...
...
@@ -106,15 +106,13 @@ public class RoutesController {
return
route
;
}
@RequestMapping
(
"/enable"
)
public
boolean
enableRoute
(
@RequestParam
long
id
)
{
routeService
.
enableRoute
(
id
);
return
true
;
}
@RequestMapping
(
"/disable"
)
public
boolean
disableRoute
(
@RequestParam
long
id
)
{
routeService
.
disableRoute
(
id
);
@RequestMapping
(
"/changeStatus"
)
public
boolean
enableRoute
(
@RequestParam
long
id
,
@RequestParam
boolean
enabled
)
{
if
(
enabled
)
{
routeService
.
disableRoute
(
id
);
}
else
{
routeService
.
enableRoute
(
id
);
}
return
true
;
}
...
...
dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/ServiceController.java
浏览文件 @
bca94f87
...
...
@@ -57,7 +57,7 @@ public class ServiceController {
List
<
Provider
>
allProviders
=
providerService
.
findAll
();
List
<
ServiceDO
>
result
=
new
ArrayList
<>();
if
(
pattern
.
equals
(
"
App
"
))
{
if
(
pattern
.
equals
(
"
application
"
))
{
for
(
Provider
provider
:
allProviders
)
{
Map
<
String
,
String
>
map
=
StringUtils
.
parseQueryString
(
provider
.
getParameters
());
String
app
=
map
.
get
(
Constants
.
APPLICATION_KEY
);
...
...
@@ -71,7 +71,7 @@ public class ServiceController {
}
}
}
else
if
(
pattern
.
equals
(
"
Servic
e"
))
{
}
else
if
(
pattern
.
equals
(
"
service nam
e"
))
{
for
(
Provider
provider
:
allProviders
)
{
String
service
=
provider
.
getService
();
Map
<
String
,
String
>
map
=
StringUtils
.
parseQueryString
(
provider
.
getParameters
());
...
...
@@ -85,7 +85,7 @@ public class ServiceController {
}
}
}
else
if
(
pattern
.
equals
(
"I
p
"
))
{
}
else
if
(
pattern
.
equals
(
"I
P
"
))
{
for
(
Provider
provider
:
allProviders
)
{
String
address
=
provider
.
getAddress
();
Map
<
String
,
String
>
map
=
StringUtils
.
parseQueryString
(
provider
.
getParameters
());
...
...
dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/web/mvc/governance/RoutesController.java
浏览文件 @
bca94f87
此差异已折叠。
点击以展开。
dubbo-admin-frontend/src/components/RoutingRule.vue
浏览文件 @
bca94f87
...
...
@@ -52,16 +52,16 @@
class=
"elevation-0"
>
<template
slot=
"items"
slot-scope=
"props"
>
<td>
{{
props
.
item
.
rule
}}
</td>
<td
class=
"text-xs-left"
>
{{
props
.
item
.
service
}}
</td>
<td
class=
"text-xs-left"
>
{{
props
.
item
.
group
}}
</td>
<td
class=
"text-xs-left"
>
{{
props
.
item
.
priority
}}
</td>
<td
class=
"text-xs-left"
>
{{
props
.
item
.
status
}}
</td>
<td
class=
"text-xs-left"
>
{{
props
.
item
.
enabled
}}
</td>
<td
class=
"justify-center px-0"
>
<v-tooltip
bottom
v-for=
"op in operations"
:key=
"op.
callback
"
>
<v-icon
small
class=
"mr-2"
slot=
"activator"
@
click=
"
op.callback
"
>
<v-tooltip
bottom
v-for=
"op in operations"
:key=
"op.
id
"
>
<v-icon
small
class=
"mr-2"
slot=
"activator"
@
click=
"
itemOperation(op.icon, props.item)
"
>
{{
op
.
icon
}}
</v-icon>
<span>
{{
op
.
tooltip
}}
</span>
<span>
{{
op
.
tooltip
(
props
.
item
)
}}
</span>
</v-tooltip>
</td>
</
template
>
...
...
@@ -70,7 +70,7 @@
</v-card>
</v-flex>
<v-dialog
v-model=
"dialog"
full-width
persistent
>
<v-dialog
v-model=
"dialog"
width=
"800px"
persistent
>
<v-card>
<v-card-title
class=
"justify-center"
>
<span
class=
"headline"
>
Create New Routing Rule
</span>
...
...
@@ -94,6 +94,8 @@
:value=
"code"
:options=
"cmOption"
>
</codemirror>
<codemirror
v-model=
'ruleText'
:placeholder=
'placeholder'
:options=
"cmOption"
></codemirror>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
...
...
@@ -102,6 +104,17 @@
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog
v-model=
"warn"
persistent
max-width=
"500px"
>
<v-card>
<v-card-title
class=
"headline"
>
{{this.warnTitle}}
</v-card-title>
<v-card-text
>
{{this.warnText}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color=
"green darken-1"
flat
@
click.native=
"warn = false"
>
Disagree
</v-btn>
<v-btn
color=
"green darken-1"
flat
@
click.native=
"deleteItem(currentId)"
>
Agree
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-container>
</template>
...
...
@@ -112,6 +125,7 @@
import
'
codemirror/mode/yaml/yaml.js
'
import
'
codemirror/addon/display/autorefresh.js
'
import
'
codemirror/addon/display/placeholder
'
import
{
AXIOS
}
from
'
./http-common
'
export
default
{
components
:
{
codemirror
...
...
@@ -121,13 +135,38 @@
pattern
:
'
Service
'
,
filter
:
''
,
dialog
:
false
,
warn
:
false
,
application
:
''
,
service
:
''
,
ruleText
:
''
,
warnTitle
:
''
,
warnText
:
''
,
currentId
:
0
,
height
:
0
,
operations
:
[
{
icon
:
'
visibility
'
,
callback
:
'
viewItem(props.item)
'
,
tooltip
:
'
View
'
},
{
icon
:
'
edit
'
,
callback
:
'
editItem(props.item)
'
,
tooltip
:
'
Edit
'
},
{
icon
:
'
delete
'
,
callback
:
'
deleteItem(props.item)
'
,
tooltip
:
'
Delete
'
}
{
id
:
0
,
icon
:
'
visibility
'
,
tooltip
:
function
(
item
)
{
return
'
View
'
}},
{
id
:
1
,
icon
:
'
edit
'
,
tooltip
:
function
(
item
)
{
return
'
Edit
'
}},
{
id
:
2
,
icon
:
'
block
'
,
tooltip
:
function
(
item
)
{
if
(
item
.
enabled
===
true
)
{
return
'
Disable
'
}
return
'
Enable
'
}},
{
id
:
3
,
icon
:
'
delete
'
,
tooltip
:
function
(
item
)
{
return
'
Delete
'
}}
],
routingRules
:
[
{
...
...
@@ -160,14 +199,15 @@
},
headers
:
[
{
text
:
'
Rul
e Name
'
,
value
:
'
rul
e
'
,
text
:
'
Servic
e Name
'
,
value
:
'
servic
e
'
,
align
:
'
left
'
},
{
text
:
'
Service Name
'
,
value
:
'
service
'
,
text
:
'
Group
'
,
value
:
'
group
'
,
align
:
'
left
'
},
{
text
:
'
Priority
'
,
...
...
@@ -175,8 +215,8 @@
sortable
:
false
},
{
text
:
'
Status
'
,
value
:
'
status
'
,
text
:
'
Enabled
'
,
value
:
'
enabled
'
,
sortable
:
false
},
{
...
...
@@ -188,19 +228,61 @@
}),
methods
:
{
submit
:
function
()
{
console
.
log
(
'
submit
'
)
this
.
search
(
this
.
filter
,
true
)
},
search
:
function
(
filter
,
rewrite
)
{
AXIOS
.
get
(
'
/routes/all?serviceName=
'
+
filter
)
.
then
(
response
=>
{
this
.
routingRules
=
response
.
data
if
(
rewrite
)
{
this
.
$router
.
push
({
path
:
'
routingRule
'
,
query
:
{
serviceName
:
filter
}})
}
})
},
openDialog
:
function
()
{
this
.
dialog
=
true
},
enable
:
function
(
status
)
{
if
(
status
===
'
enabled
'
)
{
return
'
disable
'
itemOperation
:
function
(
icon
,
item
)
{
switch
(
icon
)
{
case
'
visibility
'
:
AXIOS
.
get
(
'
/routes/detail?id=
'
+
item
.
id
)
.
then
(
response
=>
{
let
route
=
response
.
data
this
.
service
=
route
.
service
this
.
ruleText
=
route
.
rule
this
.
cmOption
.
readOnly
=
true
this
.
dialog
=
true
})
break
case
'
edit
'
:
AXIOS
.
get
(
'
/routes/edit?id=
'
+
item
.
id
)
.
then
(
response
=>
{
console
.
log
(
'
edit
'
)
this
.
dialog
=
true
})
break
case
'
block
'
:
AXIOS
.
get
(
'
/routes/changeStatus?id=
'
+
item
.
id
)
.
then
(
response
=>
{
this
.
dialog
=
true
})
break
case
'
delete
'
:
this
.
warnTitle
=
'
Are you sure to Delete Routing Rule
'
this
.
warnText
=
'
serviceName:
'
+
item
.
service
this
.
warn
=
true
this
.
currentId
=
item
.
id
}
return
'
enable
'
},
setHeight
:
function
()
{
this
.
height
=
window
.
innerHeight
*
0.5
},
deleteItem
:
function
(
id
)
{
AXIOS
.
get
(
'
/routes/delete?id=
'
+
id
)
.
then
(
response
=>
{
this
.
warn
=
false
})
}
},
computed
:
{
...
...
@@ -210,6 +292,19 @@
},
created
()
{
this
.
setHeight
()
},
mounted
:
function
()
{
let
query
=
this
.
$route
.
query
let
service
=
''
Object
.
keys
(
query
).
forEach
(
function
(
key
)
{
if
(
key
===
'
serviceName
'
)
{
service
=
query
[
key
]
}
})
if
(
service
!==
''
)
{
this
.
filter
=
service
this
.
search
(
service
,
false
)
}
}
}
...
...
dubbo-admin-frontend/src/components/ServiceSearch.vue
浏览文件 @
bca94f87
...
...
@@ -166,6 +166,14 @@
}
})
if
(
filter
!==
''
&&
pattern
!==
''
)
{
this
.
filter
=
filter
if
(
pattern
===
'
service name
'
)
{
this
.
selected
=
0
}
else
if
(
pattern
===
'
application
'
)
{
this
.
selected
=
2
}
else
if
(
pattern
===
'
IP
'
)
{
this
.
selected
=
1
}
this
.
search
(
filter
,
pattern
,
false
)
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录