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
b742a658
Commit
b742a658
authored
10 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
The version view use an Ext.data.Store instead of an Ext.data.ArrayStore.
parent
8c38d139
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
controllers/plugin_dbui.py
+6
-7
6 additions, 7 deletions
controllers/plugin_dbui.py
modules/plugin_dbui/helper.py
+9
-9
9 additions, 9 deletions
modules/plugin_dbui/helper.py
views/plugin_dbui/versions.html
+11
-6
11 additions, 6 deletions
views/plugin_dbui/versions.html
with
26 additions
and
22 deletions
controllers/plugin_dbui.py
+
6
−
7
View file @
b742a658
...
...
@@ -417,15 +417,14 @@ def versions():
"""
Return the versions of the different part of the code.
"""
from
plugin_dbui
import
get_versions
from
plugin_dbui
import
get_versions
,
Store
# the configuration for the Ext.data.ArrayStore
cfg
=
dict
()
cfg
[
'
fields
'
]
=
[{
'
name
'
:
'
code
'
,
'
type
'
:
'
string
'
},
{
'
name
'
:
'
version
'
,
'
type
'
:
'
string
'
}]
# the configuration for the Ext.data.Store
cfg
=
Store
()
cfg
[
'
data
'
]
=
get_versions
()
cfg
.
fields
=
[
dict
(
name
=
'
code
'
,
type
=
'
string
'
),
dict
(
name
=
'
version
'
,
type
=
'
string
'
)]
cfg
.
data
=
get_versions
()
return
dict
(
cfg_store
=
json
.
dumps
(
cfg
))
This diff is collapsed.
Click to expand it.
modules/plugin_dbui/helper.py
+
9
−
9
View file @
b742a658
...
...
@@ -545,9 +545,9 @@ def get_store_id(name):
def
get_versions
():
"""
Get the versions of the application and plugins.
@rtype: list of
tuple
@return: each
tuple
contains the name of the software
and its version identifier.
@rtype: list of
dict
@return: each
dictionary
contains the name of the software
and its version identifier.
The keys are C{code} and C{version}
"""
server_path
,
client_path
=
get_reference_paths
()
...
...
@@ -629,12 +629,12 @@ def get_versions():
os
.
chdir
(
ref_path
)
# prepare the output
li
=
[
(
"
web2py
"
,
web2py
),
(
"
dbui
"
,
dbui
),
(
"
extjs
"
,
extjs
),
(
"
mathjax
"
,
mathjax
),
(
"
ace
"
,
ace
),
(
current
.
request
.
application
,
myapp
)]
li
=
[
dict
(
code
=
"
web2py
"
,
version
=
web2py
),
dict
(
code
=
"
dbui
"
,
version
=
dbui
),
dict
(
code
=
"
extjs
"
,
version
=
extjs
),
dict
(
code
=
"
mathjax
"
,
version
=
mathjax
),
dict
(
code
=
"
ace
"
,
version
=
ace
),
dict
(
code
=
current
.
request
.
application
,
version
=
myapp
)]
return
li
...
...
This diff is collapsed.
Click to expand it.
views/plugin_dbui/versions.html
+
11
−
6
View file @
b742a658
...
...
@@ -13,19 +13,23 @@
#
# unique identifier for the DIV block associated to the grid
#
divgrid = id(cfg_store)
divgrid =
"grid-%s" %
id(cfg_store)
#
# The title and the DIV block
#
response.write(H2(T("Software versions"), _class="dbui-h2 dbui-small-cap"))
response.write(DIV(_id=
"grid-%s" %
divgrid))
response.write(DIV(_id=divgrid))
#
# Export python variables to the javascript
#
jsvars = "var cfgStore = %s;" % cfg_store
jsvars = ["cfgStore = %s" % cfg_store,
"divgrid = '%s'" % divgrid]
jsvars = " var %s;" % ',\n'.join(jsvars)
response.write(SCRIPT(jsvars), escape=False)
}}
<script>
...
...
@@ -34,9 +38,10 @@
// instantiate the grid showing version numbers
//
var
grid
=
Ext
.
create
(
'
Ext.grid.Panel
'
,
{
console
.
log
(
1
,
cfgStore
);
var
grid
=
Ext
.
create
(
'
App.grid.Panel
'
,
{
plugins
:
[
'
pGridExport
'
],
store
:
Ext
.
create
(
'
Ext.data.ArrayStore
'
,
cfgStore
)
,
store
:
cfgStore
,
columns
:
[
{
text
:
"
Software
"
,
dataIndex
:
'
code
'
,
flex
:
0.8
},
{
text
:
"
Version
"
,
dataIndex
:
'
version
'
,
flex
:
1.2
}
...
...
@@ -44,7 +49,7 @@
forceFit
:
true
,
hideHeaders
:
true
,
padding
:
"
10 40 20 60
"
,
renderTo
:
'
grid-{{=
divgrid
}}
'
,
renderTo
:
divgrid
,
width
:
300
});
...
...
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