Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Questdb
提交
7b28dbf1
Q
Questdb
项目概览
jobily
/
Questdb
12 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
Questdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7b28dbf1
编写于
4月 23, 2016
作者:
V
Vlad Ilyushchenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
first cut of virtualised grid
上级
bd149993
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
189 addition
and
105 deletion
+189
-105
core/src/main/resources/site/public/scripts/qdb.js
core/src/main/resources/site/public/scripts/qdb.js
+1
-1
core/src/main/resources/site/public/styles/qdb.css
core/src/main/resources/site/public/styles/qdb.css
+1
-1
ui/app/index.html
ui/app/index.html
+16
-19
ui/app/scripts/grid.js
ui/app/scripts/grid.js
+143
-46
ui/app/scripts/query.js
ui/app/scripts/query.js
+11
-19
ui/app/styles/_grid.scss
ui/app/styles/_grid.scss
+17
-19
未找到文件。
core/src/main/resources/site/public/scripts/qdb.js
浏览文件 @
7b28dbf1
此差异已折叠。
点击以展开。
core/src/main/resources/site/public/styles/qdb.css
浏览文件 @
7b28dbf1
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
ui/app/index.html
浏览文件 @
7b28dbf1
...
...
@@ -6,27 +6,19 @@
~ | |_| | |_| | __/\__ \ |_| |_| | |_) |
~ \__\_\\__,_|\___||___/\__|____/|____/
~
~
The MIT License (MIT)
~
Copyright (c) 2014-2016 Appsicle
~
~ Copyright (C) 2016 Appsicle
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ Permission is hereby granted, free of charge, to any person obtaining a
~ copy of this software and associated documentation files (the "Software"),
~ to deal in the Software without restriction, including without limitation
~ the rights to use, copy, modify, merge, publish, distribute, sublicense,
~ and/or sell copies of the Software, and to permit persons to whom the
~ Software is furnished to do so, subject to the following conditions:
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ The above copyright notice and this permission notice shall be included in
~ all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
~ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
~ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
~ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
~ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
~ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
~ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--suppress HtmlUnknownTag -->
...
...
@@ -150,7 +142,12 @@
<div
class=
"col-lg-12"
>
<div
class=
"ibox"
>
<div
class=
"ibox-content"
>
<div
id=
"grid"
></div>
<div
id=
"grid"
>
<div
class=
"qg-header-row"
></div>
<div
class=
"qg-viewport"
>
<div
class=
"qg-canvas"
></div>
</div>
</div>
</div>
</div>
</div>
...
...
ui/app/scripts/grid.js
浏览文件 @
7b28dbf1
...
...
@@ -5,27 +5,19 @@
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
*
The MIT License (MIT)
*
Copyright (c) 2014-2016 Appsicle
*
* Copyright (C) 2016 Appsicle
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* http://www.apache.org/licenses/LICENSE-2.0
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
/*globals $:false */
...
...
@@ -39,19 +31,99 @@
};
var
$style
;
var
div
=
$
(
this
);
var
viewport
;
var
canvas
;
var
header
;
var
colMax
;
var
data
;
// viewport height
var
vp
=
400
;
// row height in px
var
rh
=
30
;
// virtual row count in grid
var
r
;
// max virtual y (height) of grid canvas
var
yMax
;
// current virtual y of grid canvas
var
y
;
// actual height of grid canvas
var
h
;
// last scroll top
var
top
;
// yMax / h - ratio between virtual and actual height
var
M
;
// offset to bring virtual y inline with actual y
var
o
;
// row div cache
var
rows
=
{};
function
addRows
(
n
)
{
r
+=
n
;
yMax
=
r
*
rh
;
if
(
yMax
<
10000000
)
{
h
=
yMax
;
}
else
{
h
=
10000000
;
}
M
=
Math
.
ceil
(
yMax
/
h
);
canvas
.
css
(
'
height
'
,
h
);
}
function
renderPermMarkup
()
{
header
=
$
(
'
<div class="qg-header-row"></div>
'
);
header
.
appendTo
(
div
);
canvas
=
$
(
'
<div class="qg-canvas"></div>
'
);
canvas
.
appendTo
(
div
);
function
renderRow
(
row
)
{
var
d
=
data
.
result
[
row
];
var
rowDiv
=
$
(
'
<div class="qg-r"/>
'
);
for
(
var
k
=
0
;
k
<
d
.
length
;
k
++
)
{
var
str
=
d
[
k
]
!==
null
?
d
[
k
].
toString
()
:
'
null
'
;
$
(
'
<div class="qg-c qg-w
'
+
k
+
'
">
'
+
str
+
'
</div>
'
).
appendTo
(
rowDiv
);
}
return
rowDiv
.
css
({
top
:
row
*
rh
-
o
,
height
:
rh
})
.
appendTo
(
canvas
);
}
function
renderViewport
()
{
// calculate the viewport + buffer
var
t
=
Math
.
max
(
0
,
Math
.
floor
((
y
-
vp
)
/
rh
));
var
b
=
Math
.
min
(
yMax
/
rh
-
1
,
Math
.
ceil
((
y
+
vp
+
vp
)
/
rh
));
// remove rows no longer in the viewport
for
(
var
i
in
rows
)
{
if
(
i
<
t
||
i
>
b
)
{
rows
[
i
].
remove
();
delete
rows
[
i
];
}
}
// add new rows
for
(
i
=
t
;
i
<=
b
;
i
++
)
{
if
(
!
rows
[
i
])
{
rows
[
i
]
=
renderRow
(
i
);
}
}
}
canvas
.
bind
(
'
scroll
'
,
function
()
{
header
.
scrollLeft
(
canvas
.
scrollLeft
());
});
function
viewportScroll
(
force
)
{
header
.
scrollLeft
(
viewport
.
scrollLeft
());
var
scrollTop
=
viewport
.
scrollTop
();
if
(
scrollTop
!==
top
||
force
)
{
if
(
Math
.
abs
(
scrollTop
-
top
)
>
vp
)
{
onJump
(
scrollTop
);
}
else
{
onNearScroll
(
scrollTop
);
}
renderViewport
();
}
}
function
renderPermMarkup
()
{
header
=
div
.
find
(
'
.qg-header-row
'
);
viewport
=
div
.
find
(
'
.qg-viewport
'
);
viewport
.
scroll
(
viewportScroll
);
canvas
=
div
.
find
(
'
.qg-canvas
'
);
}
function
createCss
()
{
...
...
@@ -65,6 +137,7 @@
sum
+=
w
;
}
rules
.
push
(
'
.qg-r{width:
'
+
sum
+
'
px;}
'
);
rules
.
push
(
'
.qg-canvas{width:
'
+
sum
+
'
px;}
'
);
if
(
$style
[
0
].
styleSheet
)
{
// IE
$style
[
0
].
styleSheet
.
cssText
=
rules
.
join
(
'
'
);
...
...
@@ -73,61 +146,85 @@
}
}
function
render
(
r
)
{
function
computeColumnWidths
(
)
{
colMax
=
[];
var
i
,
k
;
for
(
i
=
0
;
i
<
r
.
columns
.
length
;
i
++
)
{
var
c
=
r
.
columns
[
i
];
for
(
i
=
0
;
i
<
data
.
columns
.
length
;
i
++
)
{
var
c
=
data
.
columns
[
i
];
$
(
'
<div class="qg-header qg-w
'
+
i
+
'
">
'
+
c
.
name
+
'
</div>
'
).
appendTo
(
header
);
colMax
.
push
(
0
);
colMax
.
push
(
c
.
name
.
length
*
1.2
);
}
for
(
i
=
0
;
i
<
r
.
result
.
length
;
i
++
)
{
var
row
=
r
.
result
[
i
];
var
rowDiv
=
$
(
'
<div class="qg-r"></div>
'
);
var
max
=
data
.
result
.
length
>
100
?
100
:
data
.
result
.
length
;
for
(
i
=
0
;
i
<
max
;
i
++
)
{
var
row
=
data
.
result
[
i
];
for
(
k
=
0
;
k
<
row
.
length
;
k
++
)
{
var
cell
=
row
[
k
];
var
str
=
cell
!==
null
?
cell
.
toString
()
:
'
null
'
;
colMax
[
k
]
=
Math
.
max
(
str
.
length
,
colMax
[
k
]);
$
(
'
<div class="qg-c qg-w
'
+
k
+
'
">
'
+
str
+
'
</div>
'
).
appendTo
(
rowDiv
);
}
rowDiv
.
appendTo
(
canvas
);
}
}
function
clear
()
{
top
=
0
;
y
=
0
;
o
=
0
;
r
=
0
;
if
(
$style
)
{
$style
.
remove
();
}
header
.
empty
();
canvas
.
empty
();
rows
=
{};
}
function
resizeCanvas
()
{
var
top
=
canvas
[
0
].
getBoundingClientRect
().
top
;
var
h
=
Math
.
round
((
window
.
innerHeight
-
top
));
h
=
h
-
90
;
canvas
[
0
].
style
.
height
=
h
+
'
px
'
;
function
resizeViewport
()
{
var
t
=
viewport
[
0
].
getBoundingClientRect
().
top
;
vp
=
Math
.
round
((
window
.
innerHeight
-
t
))
-
90
;
viewport
.
css
(
'
height
'
,
vp
);
}
function
resizeDiv
()
{
var
top
=
div
[
0
].
getBoundingClientRect
().
top
;
var
h
=
Math
.
round
((
window
.
innerHeight
-
top
));
h
=
h
-
90
;
div
[
0
].
style
.
height
=
h
+
'
px
'
;
var
t
=
div
[
0
].
getBoundingClientRect
().
top
;
div
.
css
(
'
height
'
,
Math
.
round
((
window
.
innerHeight
-
t
))
-
90
);
}
function
resize
()
{
resize
Canvas
();
resize
Viewport
();
resizeDiv
();
}
function
onNearScroll
(
scrollTop
)
{
y
+=
scrollTop
-
top
;
top
=
scrollTop
;
}
function
removeAllRows
()
{
for
(
var
i
in
rows
)
{
rows
[
i
].
remove
();
delete
rows
[
i
];
}
}
function
onJump
(
scrollTop
)
{
y
=
scrollTop
===
0
?
0
:
Math
.
ceil
((
scrollTop
+
vp
)
*
M
-
vp
);
top
=
scrollTop
;
o
=
y
-
top
;
removeAllRows
();
}
//noinspection JSUnusedLocalSymbols
function
update
(
x
,
m
)
{
data
=
m
.
r
;
clear
();
render
(
m
.
r
);
addRows
(
data
.
result
.
length
);
computeColumnWidths
();
createCss
();
resize
();
viewportScroll
(
true
);
}
function
bind
()
{
...
...
ui/app/scripts/query.js
浏览文件 @
7b28dbf1
...
...
@@ -5,27 +5,19 @@
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
*
The MIT License (MIT)
*
Copyright (c) 2014-2016 Appsicle
*
* Copyright (C) 2016 Appsicle
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* http://www.apache.org/licenses/LICENSE-2.0
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
/*globals $:false */
...
...
@@ -85,7 +77,7 @@
function
qq
()
{
abortActive
();
requestParams
.
query
=
qry
.
q
;
requestParams
.
limit
=
'
0,100
'
;
requestParams
.
limit
=
'
0,100
00
'
;
requestParams
.
withCount
=
false
;
time
=
new
Date
().
getTime
();
hActiveRequest
=
$
.
get
(
'
/js
'
,
requestParams
).
done
(
handleServerResponse
).
fail
(
handleServerError
);
...
...
ui/app/styles/_grid.scss
浏览文件 @
7b28dbf1
...
...
@@ -5,27 +5,19 @@
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
*
The MIT License (MIT)
*
Copyright (c) 2014-2016 Appsicle
*
* Copyright (C) 2016 Appsicle
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* http://www.apache.org/licenses/LICENSE-2.0
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#grid
{
...
...
@@ -41,6 +33,7 @@
.qg-r
{
border-bottom
:
1px
solid
#e6e6e6
;
position
:
absolute
;
}
.qg-r
:hover
{
...
...
@@ -57,10 +50,15 @@
text-align
:
right
;
}
.qg-
canvas
{
.qg-
viewport
{
overflow
:
auto
;
}
.qg-canvas
{
position
:
relative
;
overflow
:
hidden
;
}
.qg-c
{
display
:
inline-block
;
padding
:
3px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录