Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
skywalking-rocketbot-ui
提交
202e2dfb
S
skywalking-rocketbot-ui
项目概览
apache
/
skywalking-rocketbot-ui
通知
17
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skywalking-rocketbot-ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
202e2dfb
编写于
6月 08, 2020
作者:
Q
Qiuxia Fan
提交者:
GitHub
6月 08, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bugfix: Dashboard templates (#307)
上级
dd721b15
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
71 addition
and
38 deletion
+71
-38
src/assets/lang/en.ts
src/assets/lang/en.ts
+9
-4
src/assets/lang/zh.ts
src/assets/lang/zh.ts
+8
-3
src/store/modules/dashboard/dashboard-data-query.ts
src/store/modules/dashboard/dashboard-data-query.ts
+2
-2
src/views/components/dashboard/charts/chart-edit.vue
src/views/components/dashboard/charts/chart-edit.vue
+13
-2
src/views/components/dashboard/tool-bar-btns.vue
src/views/components/dashboard/tool-bar-btns.vue
+4
-2
src/views/components/dashboard/tool-group.vue
src/views/components/dashboard/tool-group.vue
+5
-5
src/views/containers/dashboard.vue
src/views/containers/dashboard.vue
+30
-20
未找到文件。
src/assets/lang/en.ts
浏览文件 @
202e2dfb
...
...
@@ -32,9 +32,9 @@ const m = {
copy
:
'
Copy
'
,
reset
:
'
Reset
'
,
apply
:
'
Apply
'
,
create
Group
:
'
Create Group
'
,
groupType
:
'
Group
Type
'
,
groupName
:
'
Group
Name
'
,
create
Template
:
'
Create Template
'
,
templateType
:
'
Template
Type
'
,
templateName
:
'
Template
Name
'
,
template
:
'
Template
'
,
confirm
:
'
Confirm
'
,
cancel
:
'
Cancel
'
,
...
...
@@ -128,7 +128,7 @@ const m = {
excludeChildren
:
'
Exclude Children
'
,
view
:
'
View
'
,
timeTips
:
'
Time interval cannot exceed 60 days
'
,
standardAPM
:
'
Standard
APM
'
,
standardAPM
:
'
Standard
'
,
entityType
:
'
Entity type
'
,
independentSelector
:
'
Selectors
'
,
unknownMetrics
:
'
Unknown Metrics
'
,
...
...
@@ -142,6 +142,11 @@ const m = {
serviceFilter
:
'
Service Filter
'
,
endpointFilter
:
'
Endpoint Filter
'
,
editConfig
:
'
Edit Config
'
,
databaseView
:
'
Database
'
,
metricsView
:
'
NOC - Network Operation Center
'
,
sortOrder
:
'
Sort Order
'
,
descendOrder
:
'
Descend Order
'
,
increaseOrder
:
'
Increase Order
'
,
};
export
default
m
;
src/assets/lang/zh.ts
浏览文件 @
202e2dfb
...
...
@@ -32,9 +32,9 @@ const m = {
copy
:
'
拷贝
'
,
reset
:
'
重制
'
,
apply
:
'
应用
'
,
create
Group
:
'
创建分组
'
,
groupType
:
'
分组
类型
'
,
groupName
:
'
分组名
'
,
create
Template
:
'
创建模板
'
,
templateType
:
'
模板
类型
'
,
templateName
:
'
模板名称
'
,
template
:
'
模版
'
,
confirm
:
'
确定
'
,
cancel
:
'
取消
'
,
...
...
@@ -142,6 +142,11 @@ const m = {
serviceFilter
:
'
服务过滤器
'
,
endpointFilter
:
'
端点过滤器
'
,
editConfig
:
'
编辑
'
,
databaseView
:
'
数据库视图
'
,
metricsView
:
'
大屏视图
'
,
sortOrder
:
'
排序方式
'
,
descendOrder
:
'
递减顺序
'
,
increaseOrder
:
'
递增顺序
'
,
};
export
default
m
;
src/store/modules/dashboard/dashboard-data-query.ts
浏览文件 @
202e2dfb
...
...
@@ -66,7 +66,7 @@ const actions: ActionTree<State, any> = {
normal
:
true
,
scope
:
config
.
entityType
,
topN
:
10
,
order
:
'
DES
'
,
order
:
config
.
sortOrder
||
'
DES
'
,
},
}
:
{
...
...
@@ -90,7 +90,7 @@ const actions: ActionTree<State, any> = {
normal
,
scope
:
normal
?
config
.
entityType
:
config
.
parentService
?
'
Service
'
:
config
.
entityType
,
topN
:
10
,
order
:
'
DES
'
,
order
:
config
.
sortOrder
||
'
DES
'
,
},
}
:
{
...
...
src/views/components/dashboard/charts/chart-edit.vue
浏览文件 @
202e2dfb
...
...
@@ -156,7 +156,7 @@ limitations under the License. -->
<option
v-for=
"type in IndependentType"
:value=
"type.key"
:key=
"type.key"
>
{{
type
.
label
}}
</option>
</select>
</div>
<div
class=
"flex-h mb-5"
v-show=
"
isParentService
.includes(itemConfig.queryMetricType)"
>
<div
class=
"flex-h mb-5"
v-show=
"
nameMetrics
.includes(itemConfig.queryMetricType)"
>
<div
class=
"title grey sm"
>
{{
$t
(
'
parentService
'
)
}}
:
</div>
<select
class=
"long"
...
...
@@ -167,6 +167,17 @@ limitations under the License. -->
<option
:value=
"false"
>
{{
$t
(
'
noneParentService
'
)
}}
</option>
</select>
</div>
<div
class=
"flex-h mb-5"
v-show=
"nameMetrics.includes(itemConfig.queryMetricType)"
>
<div
class=
"title grey sm"
>
{{
$t
(
'
sortOrder
'
)
}}
:
</div>
<select
class=
"long"
v-model=
"itemConfig.sortOrder"
@
change=
"setItemConfig(
{ type: 'sortOrder', value: $event.target.value })"
>
<option
:value=
"'DES'"
>
{{
$t
(
'
descendOrder
'
)
}}
</option>
<option
:value=
"'ASC'"
>
{{
$t
(
'
increaseOrder
'
)
}}
</option>
</select>
</div>
<div
class=
"flex-h mb-5"
>
<div
class=
"title grey sm"
>
{{
$t
(
'
unit
'
)
}}
:
</div>
<input
...
...
@@ -255,7 +266,7 @@ limitations under the License. -->
private
queryMetricTypesList
:
any
=
[];
private
isDatabase
=
false
;
private
isLabel
=
false
;
private
isParentService
=
[
'
sortMetrics
'
,
'
readSampledRecords
'
];
private
nameMetrics
=
[
'
sortMetrics
'
,
'
readSampledRecords
'
];
private
created
()
{
this
.
itemConfig
=
this
.
item
;
...
...
src/views/components/dashboard/tool-bar-btns.vue
浏览文件 @
202e2dfb
...
...
@@ -83,9 +83,11 @@
}
}
private
exportData
()
{
const
data
=
this
.
rocketComps
.
tree
;
const
group
=
this
.
rocketComps
.
tree
[
this
.
rocketComps
.
group
];
delete
group
.
query
;
const
name
=
'
dashboard.json
'
;
saveFile
(
data
,
name
);
saveFile
([
group
],
name
);
}
}
</
script
>
...
...
src/views/components/dashboard/tool-group.vue
浏览文件 @
202e2dfb
...
...
@@ -37,14 +37,14 @@ limitations under the License. -->
<use
xlink:href=
"#todo-add"
></use>
</svg>
<div
class=
"rk-dashboard-group-add-box"
v-if=
"show"
>
<div
class=
"mb-10 vm"
>
{{
$t
(
'
create
Group
'
)
}}
</div>
<div
class=
"sm grey mb-5 mr-10"
>
{{
$t
(
'
group
Type
'
)
}}
</div>
<div
class=
"mb-10 vm"
>
{{
$t
(
'
create
Template
'
)
}}
</div>
<div
class=
"sm grey mb-5 mr-10"
>
{{
$t
(
'
template
Type
'
)
}}
</div>
<select
v-model=
"type"
class=
"rk-dashboard-group-sel"
>
<option
:value=
"DASHBOARDTYPE.SERVICE"
>
{{
$t
(
'
standardAPM
'
)
}}
</option>
<option
:value=
"DASHBOARDTYPE.METRIC"
>
{{
$t
(
'
metrics
'
)
}}
</option>
<option
:value=
"DASHBOARDTYPE.DATABASE"
>
{{
$t
(
'
database
'
)
}}
</option>
<option
:value=
"DASHBOARDTYPE.METRIC"
>
{{
$t
(
'
metrics
View
'
)
}}
</option>
<option
:value=
"DASHBOARDTYPE.DATABASE"
>
{{
$t
(
'
database
View
'
)
}}
</option>
</select>
<div
class=
"sm grey mb-5 mr-10"
>
{{
$t
(
'
group
Name
'
)
}}
</div>
<div
class=
"sm grey mb-5 mr-10"
>
{{
$t
(
'
template
Name
'
)
}}
</div>
<input
class=
"mb-5 rk-dashboard-group-input"
type=
"text"
v-model=
"name"
/>
<div
v-show=
"type === 'database'"
>
<label
class=
"mb-10 dib"
><input
type=
"checkbox"
v-model=
"template"
/>
{{
$t
(
'
template
'
)
}}
</label>
...
...
src/views/containers/dashboard.vue
浏览文件 @
202e2dfb
...
...
@@ -49,6 +49,13 @@ limitations under the License. -->
import
ToolNav
from
'
@/views/components/dashboard/tool-nav.vue
'
;
import
DashboardItem
from
'
@/views/components/dashboard/dashboard-item.vue
'
;
interface
ITemplate
{
name
:
string
;
type
:
string
;
configuration
:
string
;
activated
:
boolean
;
disabled
:
boolean
;
}
@
Component
({
components
:
{
ToolBar
,
...
...
@@ -100,28 +107,31 @@ limitations under the License. -->
// }).then((data: any) => {
// console.log(data);
// });
this
.
GET_ALL_TEMPLATES
().
then
(
(
allTemplate
:
Array
<
{
name
:
string
;
type
:
string
;
configuration
:
string
;
activated
:
boolean
;
disabled
:
boolean
;
}
>
,
)
=>
{
this
.
SET_ALL_TEMPLATES
(
allTemplate
);
if
(
window
.
localStorage
.
getItem
(
'
dashboard
'
))
{
const
data
:
string
=
`
${
window
.
localStorage
.
getItem
(
'
dashboard
'
)}
`
;
this
.
SET_COMPS_TREE
(
JSON
.
parse
(
data
));
}
else
{
const
template
=
allTemplate
.
filter
((
item
:
any
)
=>
item
.
type
===
'
DASHBOARD
'
&&
item
.
activated
)[
0
]
||
{};
this
.
SET_COMPS_TREE
(
JSON
.
parse
(
template
.
configuration
)
||
[]);
}
},
);
this
.
GET_ALL_TEMPLATES
().
then
((
allTemplate
:
ITemplate
[])
=>
{
this
.
SET_ALL_TEMPLATES
(
allTemplate
);
if
(
window
.
localStorage
.
getItem
(
'
version
'
)
!==
'
8.0
'
)
{
window
.
localStorage
.
removeItem
(
'
dashboard
'
);
this
.
setDashboardTemplates
(
allTemplate
);
this
.
handleOption
();
return
;
}
if
(
window
.
localStorage
.
getItem
(
'
dashboard
'
))
{
const
data
:
string
=
`
${
window
.
localStorage
.
getItem
(
'
dashboard
'
)}
`
;
this
.
SET_COMPS_TREE
(
JSON
.
parse
(
data
));
}
else
{
this
.
setDashboardTemplates
(
allTemplate
);
}
});
this
.
handleOption
();
}
private
setDashboardTemplates
(
allTemplate
:
ITemplate
[])
{
const
template
=
allTemplate
.
filter
((
item
:
ITemplate
)
=>
item
.
type
===
'
DASHBOARD
'
&&
item
.
activated
);
const
templatesConfiguration
=
template
.
map
((
item
:
ITemplate
)
=>
JSON
.
parse
(
item
.
configuration
)).
flat
(
1
);
this
.
SET_COMPS_TREE
(
templatesConfiguration
||
[]);
window
.
localStorage
.
setItem
(
'
version
'
,
'
8.0
'
);
window
.
localStorage
.
setItem
(
'
dashboard
'
,
JSON
.
stringify
(
templatesConfiguration
));
}
private
beforeDestroy
()
{
this
.
SET_EDIT
(
false
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录