Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
1da75044
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1da75044
编写于
2月 08, 2019
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#4209 Dashboard render fix. Config dialog
上级
04506b17
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
15 deletion
+30
-15
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/model/DashboardConstants.java
.../jkiss/dbeaver/ui/dashboard/model/DashboardConstants.java
+1
-1
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/model/DashboardItemViewConfiguration.java
...er/ui/dashboard/model/DashboardItemViewConfiguration.java
+26
-12
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/model/DashboardViewConfiguration.java
...beaver/ui/dashboard/model/DashboardViewConfiguration.java
+3
-2
未找到文件。
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/model/DashboardConstants.java
浏览文件 @
1da75044
...
...
@@ -26,7 +26,7 @@ public class DashboardConstants {
public
static
final
String
RS_COL_TIMESTAMP
=
"STAT_TIMESTAMP"
;
public
static
final
int
DEF_DASHBOARD_MAXIMUM_ITEM_COUNT
=
300
;
public
static
final
long
DEF_DASHBOARD_MAXIMUM_AGE
=
24
*
60
*
60
*
1000
;
public
static
final
long
DEF_DASHBOARD_MAXIMUM_AGE
=
30
*
60
*
1000
;
// Half of hour
public
static
final
int
DEF_DASHBOARD_UPDATE_PERIOD
=
5000
;
public
static
final
double
DEF_DASHBOARD_WIDTH_RATIO
=
1.5
;
...
...
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/model/DashboardItemViewConfiguration.java
浏览文件 @
1da75044
...
...
@@ -17,28 +17,24 @@
package
org.jkiss.dbeaver.ui.dashboard.model
;
import
org.jkiss.dbeaver.ui.dashboard.registry.DashboardDescriptor
;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.xml.XMLBuilder
;
import
java.io.IOException
;
public
class
DashboardItemViewConfiguration
{
private
DashboardDescriptor
dashboardDescriptor
;
private
String
description
;
private
float
widthRatio
;
private
long
updatePeriod
;
private
int
maxItems
;
private
long
maxAge
;
private
String
description
;
public
DashboardDescriptor
getDashboardDescriptor
()
{
return
dashboardDescriptor
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
float
getWidthRatio
()
{
return
widthRatio
;
}
...
...
@@ -71,26 +67,44 @@ public class DashboardItemViewConfiguration {
this
.
maxAge
=
maxAge
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
DashboardItemViewConfiguration
(
DashboardDescriptor
dashboardDescriptor
)
{
this
.
dashboardDescriptor
=
dashboardDescriptor
;
this
.
description
=
dashboardDescriptor
.
getDescription
();
this
.
widthRatio
=
dashboardDescriptor
.
getWidthRatio
();
this
.
updatePeriod
=
dashboardDescriptor
.
getUpdatePeriod
();
this
.
maxItems
=
dashboardDescriptor
.
getMaxItems
();
this
.
maxAge
=
dashboardDescriptor
.
getMaxAge
();
this
.
description
=
dashboardDescriptor
.
getDescription
();
}
public
DashboardItemViewConfiguration
(
DashboardItemViewConfiguration
source
)
{
copyFrom
(
source
);
}
public
void
copyFrom
(
DashboardItemViewConfiguration
source
)
{
void
copyFrom
(
DashboardItemViewConfiguration
source
)
{
this
.
dashboardDescriptor
=
source
.
dashboardDescriptor
;
this
.
description
=
source
.
description
;
this
.
widthRatio
=
source
.
widthRatio
;
this
.
updatePeriod
=
source
.
updatePeriod
;
this
.
maxItems
=
source
.
maxItems
;
this
.
maxAge
=
source
.
maxAge
;
this
.
description
=
source
.
description
;
}
void
serialize
(
XMLBuilder
xml
)
throws
IOException
{
xml
.
addAttribute
(
"dashboard"
,
dashboardDescriptor
.
getId
());
xml
.
addAttribute
(
"widthRatio"
,
widthRatio
);
xml
.
addAttribute
(
"updatePeriod"
,
updatePeriod
);
xml
.
addAttribute
(
"maxItems"
,
maxItems
);
xml
.
addAttribute
(
"maxAge"
,
maxAge
);
if
(!
CommonUtils
.
isEmpty
(
description
))
{
xml
.
addAttribute
(
"description"
,
description
);
}
}
}
plugins/org.jkiss.dbeaver.ui.dashboard/src/org/jkiss/dbeaver/ui/dashboard/model/DashboardViewConfiguration.java
浏览文件 @
1da75044
...
...
@@ -65,14 +65,15 @@ public class DashboardViewConfiguration {
try
(
OutputStream
out
=
new
FileOutputStream
(
configFile
)){
XMLBuilder
xml
=
new
XMLBuilder
(
out
,
GeneralUtils
.
UTF8_ENCODING
);
xml
.
setButify
(
true
);
xml
.
startElement
(
"dashboards"
);
for
(
DashboardItemViewConfiguration
itemConfig
:
items
)
{
xml
.
startElement
(
"dashboard"
);
//
itemConfig.serialize(xml);
itemConfig
.
serialize
(
xml
);
xml
.
endElement
();
}
xml
.
endElement
();
out
.
flush
();
xml
.
flush
();
}
catch
(
Exception
e
)
{
log
.
error
(
"Error saving dashboard view configuration"
,
e
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录