Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos.core
Commits
b27d537e
Commit
b27d537e
authored
May 13, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
slapos_jio: use portal_catalog to be complaint with listbox pagination
See merge request
nexedi/slapos.core!528
parents
74ce8553
0df7e6f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Organisation_getComputeNodeTrackingList.py
...hal_json_style/Organisation_getComputeNodeTrackingList.py
+9
-8
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Project_getComputeNodeTrackingList.py
...apos_hal_json_style/Project_getComputeNodeTrackingList.py
+9
-7
No files found.
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Organisation_getComputeNodeTrackingList.py
View file @
b27d537e
# This script might not be efficient to a large quantities of
# Compute Nodes
from
DateTime
import
DateTime
kw
=
{
"node_uid"
:
context
.
getUid
(),
"at_date"
:
DateTime
()}
portal
=
context
.
getPortalObject
()
def
filter_per_portal_type
(
document
):
if
document
.
getPortalType
()
==
"Compute Node"
\
...
...
@@ -17,6 +13,11 @@ def filter_per_portal_type(document):
and
document
.
getValidationState
()
==
"validated"
:
return
document
return
[
i
.
getObject
()
for
i
in
context
.
portal_simulation
.
getCurrentTrackingList
(
**
kw
)
if
filter_per_portal_type
(
i
.
getObject
())]
uid_list
=
[
i
.
uid
for
i
in
context
.
portal_simulation
.
getCurrentTrackingList
(
node_uid
=
context
.
getUid
(),
at_date
=
DateTime
())
if
filter_per_portal_type
(
i
.
getObject
())]
if
not
uid_list
:
return
[]
return
portal
.
portal_catalog
(
uid
=
uid_list
,
**
kw
)
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Project_getComputeNodeTrackingList.py
View file @
b27d537e
# This script might not be efficient to a large quantities of
# Compute Nodes
from
DateTime
import
DateTime
kw
=
{
"project_uid"
:
context
.
getUid
(),
"at_date"
:
DateTime
()}
portal
=
context
.
getPortalObject
()
def
filter_per_portal_type
(
document
):
if
document
.
getPortalType
()
==
"Compute Node"
\
...
...
@@ -16,6 +13,11 @@ def filter_per_portal_type(document):
and
document
.
getValidationState
()
==
"validated"
:
return
document
return
[
i
.
getObject
()
for
i
in
context
.
portal_simulation
.
getCurrentTrackingList
(
**
kw
)
if
filter_per_portal_type
(
i
.
getObject
())]
uid_list
=
[
i
.
uid
for
i
in
context
.
portal_simulation
.
getCurrentTrackingList
(
project_uid
=
context
.
getUid
(),
at_date
=
DateTime
())
if
filter_per_portal_type
(
i
.
getObject
())]
if
not
uid_list
:
return
[]
return
portal
.
portal_catalog
(
uid
=
uid_list
,
**
kw
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment