Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2pext
plugin_dbui
Commits
cdde7d54
Commit
cdde7d54
authored
10 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
The report_4 view use Ext.data.Store instead of Ext.data.ArrayStore.
parent
0634076a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controllers/reports.py
+17
-13
17 additions, 13 deletions
controllers/reports.py
views/reports/report_4.html
+1
-6
1 addition, 6 deletions
views/reports/report_4.html
with
18 additions
and
19 deletions
controllers/reports.py
+
17
−
13
View file @
cdde7d54
...
...
@@ -47,26 +47,30 @@ def report_4():
"""
import
json
from
plugin_dbui
import
Store
selector
=
Selector
(
virtdb
.
report4
)
cfg
=
{}
cfg
=
Store
()
cfg
.
fields
=
[
dict
(
name
=
'
controller
'
,
type
=
'
string
'
),
dict
(
name
=
'
host
'
,
type
=
'
string
'
),
dict
(
name
=
'
collections
'
,
type
=
'
string
'
),
dict
(
name
=
'
ratio
'
,
type
=
'
number
'
)]
if
selector
.
grouping
or
selector
.
grouping_summary
:
cfg
[
'
groupField
'
]
=
'
controller
'
cfg
[
'
fields
'
]
=
[{
'
name
'
:
'
controller
'
,
'
type
'
:
'
string
'
},
{
'
name
'
:
'
host
'
,
'
type
'
:
'
string
'
},
{
'
name
'
:
'
collections
'
,
'
type
'
:
'
string
'
},
{
'
name
'
:
'
ratio
'
,
'
type
'
:
'
number
'
}]
cfg
.
groupField
=
'
controller
'
cfg
[
'
data
'
]
=
[]
cfg
.
data
=
[]
for
row
in
db
().
select
(
db
.
harvesters
.
ALL
):
cfg
[
'
data
'
].
append
([
row
.
controller
,
'
<a href=
"
http://www.web2py.com
"
>%s</a>
'
%
row
.
host
,
# row.host,
row
.
collections
,
row
.
ratio
])
di
=
dict
(
controller
=
row
.
controller
,
host
=
'
<a href=
"
http://www.web2py.com
"
>%s</a>
'
%
row
.
host
,
collections
=
row
.
collections
,
ratio
=
row
.
ratio
)
cfg
[
'
data
'
].
append
(
di
)
return
dict
(
msg
=
"
Hello world
"
,
cfg_store
=
json
.
dumps
(
cfg
),
...
...
This diff is collapsed.
Click to expand it.
views/reports/report_4.html
+
1
−
6
View file @
cdde7d54
...
...
@@ -15,11 +15,6 @@
#
response.write(DIV(_id=divgrid))
#
# Export python variables to the javascript
#
jsvars = "var cfgStore = %s;" % cfg_store
response.write(SCRIPT(jsvars), escape=False)
#
# Export python variables to the javascript
#
...
...
@@ -51,7 +46,7 @@
// instantiate the grid
Ext
.
create
(
'
App.grid.Panel
'
,
{
plugins
:
[
'
pGridExport
'
],
store
:
Ext
.
create
(
'
Ext.data.ArrayStore
'
,
cfgStore
)
,
store
:
cfgStore
,
columns
:
[
{
text
:
"
Controller
"
,
dataIndex
:
'
controller
'
,
flex
:
0.8
},
{
text
:
"
Host
"
,
dataIndex
:
'
host
'
,
flex
:
1
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment