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
Jérome Perrin
slapos.core
Commits
7f6a241c
Commit
7f6a241c
authored
Jun 30, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Dont calculate things that user has no access into
parent
3242ed28
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
121 deletions
+26
-121
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getNewsDictFromComputeNodeList.py
...pos_hal_json_style/Base_getNewsDictFromComputeNodeList.py
+2
-7
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getStatusMonitorUrl.py
...l_skins/slapos_hal_json_style/Base_getStatusMonitorUrl.py
+0
-9
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_getNewsDict.py
...al_skins/slapos_hal_json_style/ComputeNode_getNewsDict.py
+1
-11
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+23
-94
No files found.
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getNewsDictFromComputeNodeList.py
View file @
7f6a241c
...
@@ -3,14 +3,9 @@ if REQUEST is not None:
...
@@ -3,14 +3,9 @@ if REQUEST is not None:
raise
Unauthorized
raise
Unauthorized
node_dict
=
{}
node_dict
=
{}
partition_dict
=
{}
for
compute_node
in
compute_node_list
:
for
compute_node
in
compute_node_list
:
reference
=
compute_node
.
getReference
()
node_dict
[
compute_node
.
getReference
()]
=
compute_node
.
getAccessStatus
()
node_dict
[
reference
]
=
compute_node
.
getAccessStatus
()
partition_dict
[
reference
]
=
compute_node
.
getComputePartitionNewsDict
()
return
{
"compute_node"
:
node_dict
,
return
{
"compute_node"
:
node_dict
,
"partition"
:
partition_dict
,
"reference"
:
context
.
getReference
(),
"reference"
:
context
.
getReference
(),
"portal_type"
:
context
.
getPortalType
(),
"portal_type"
:
context
.
getPortalType
()}
"monitor_url"
:
context
.
Base_getStatusMonitorUrl
(
compute_node_list
=
compute_node_list
)}
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getStatusMonitorUrl.py
View file @
7f6a241c
base_url
=
'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND '
base_url
=
'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND '
if
context
.
getPortalType
()
in
[
"Organisation"
,
"Computer Network"
]:
if
compute_node_list
is
None
:
return
""
compute_node_reference
=
","
.
join
([
'"'
+
i
.
getReference
()
+
'"'
for
i
in
compute_node_list
])
return
base_url
+
"aggregate_reference:(%s)"
%
compute_node_reference
if
context
.
getPortalType
()
==
"Instance Tree"
:
if
context
.
getPortalType
()
==
"Instance Tree"
:
for
connection_parameter
in
context
.
InstanceTree_getConnectionParameterList
(
raw
=
True
):
for
connection_parameter
in
context
.
InstanceTree_getConnectionParameterList
(
raw
=
True
):
if
connection_parameter
[
'connection_key'
]
==
"monitor-setup-url"
:
if
connection_parameter
[
'connection_key'
]
==
"monitor-setup-url"
:
...
@@ -15,6 +9,3 @@ if context.getPortalType() == "Instance Tree":
...
@@ -15,6 +9,3 @@ if context.getPortalType() == "Instance Tree":
if
context
.
getPortalType
()
in
[
"Software Instance"
,
"Slave Instance"
]:
if
context
.
getPortalType
()
in
[
"Software Instance"
,
"Slave Instance"
]:
return
base_url
+
"reference:%s"
%
context
.
getReference
()
return
base_url
+
"reference:%s"
%
context
.
getReference
()
if
context
.
getPortalType
()
==
"Compute Node"
:
return
base_url
+
"aggregate_reference:%s"
%
context
.
getReference
()
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_getNewsDict.py
View file @
7f6a241c
...
@@ -2,14 +2,4 @@ from zExceptions import Unauthorized
...
@@ -2,14 +2,4 @@ from zExceptions import Unauthorized
if
REQUEST
is
not
None
:
if
REQUEST
is
not
None
:
raise
Unauthorized
raise
Unauthorized
def
get_compute_partition_dict
():
return
context
.
getAccessStatus
()
compute_node_dict
=
context
.
getAccessStatus
()
compute_partition_dict
=
context
.
getComputePartitionNewsDict
()
return
{
"compute_node"
:
compute_node_dict
,
"partition"
:
compute_partition_dict
,
"portal_type"
:
compute_node_dict
[
'portal_type'
],
"reference"
:
compute_node_dict
[
'reference'
],
"monitor_url"
:
context
.
Base_getStatusMonitorUrl
()}
return
get_compute_partition_dict
()
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
7f6a241c
This diff is collapsed.
Click to expand it.
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