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
Xavier Thompson
slapos.core
Commits
87c2783b
Commit
87c2783b
authored
Jul 04, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Remove massive computer partition status calculation
See merge request
nexedi/slapos.core!550
parents
cd8cff8f
a23b5ca0
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
63 additions
and
343 deletions
+63
-343
master/bt5/slapos_cloud/MixinTemplateItem/portal_components/mixin.erp5.SlapOSComputeNodeMixin.py
...em/portal_components/mixin.erp5.SlapOSComputeNodeMixin.py
+1
-63
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_css.css
...lateItem/web_page_module/rjs_gadget_slapos_status_css.css
+2
-6
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_css.xml
...lateItem/web_page_module/rjs_gadget_slapos_status_css.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_html.html
...teItem/web_page_module/rjs_gadget_slapos_status_html.html
+1
-6
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_html.xml
...ateItem/web_page_module/rjs_gadget_slapos_status_html.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_js.js
...mplateItem/web_page_module/rjs_gadget_slapos_status_js.js
+7
-121
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_js.xml
...plateItem/web_page_module/rjs_gadget_slapos_status_js.xml
+2
-2
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
master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSNetwork.zpt
...eItem/portal_tests/slaposjs_zuite/testSlapOSJSNetwork.zpt
+6
-6
master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSServer.zpt
...teItem/portal_tests/slaposjs_zuite/testSlapOSJSServer.zpt
+4
-4
master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSSite.zpt
...lateItem/portal_tests/slaposjs_zuite/testSlapOSJSSite.zpt
+10
-10
No files found.
master/bt5/slapos_cloud/MixinTemplateItem/portal_components/mixin.erp5.SlapOSComputeNodeMixin.py
View file @
87c2783b
...
@@ -131,10 +131,6 @@ class SlapOSComputeNodeMixin(object):
...
@@ -131,10 +131,6 @@ class SlapOSComputeNodeMixin(object):
# called on site
# called on site
pass
pass
# Also update cache for News Dict, so it speed up access of this UI.
key
=
'%s_partition_news'
%
self
.
getReference
()
self
.
_getCachedComputePartitionNewsDict
(
key
,
refresh_etag
)
def
_calculateRefreshEtag
(
self
):
def
_calculateRefreshEtag
(
self
):
# check max indexation timestamp
# check max indexation timestamp
# it is unlikely to get an empty catalog
# it is unlikely to get an empty catalog
...
@@ -333,62 +329,4 @@ class SlapOSComputeNodeMixin(object):
...
@@ -333,62 +329,4 @@ class SlapOSComputeNodeMixin(object):
raise
ValueError
(
'Wrong list of software releases on %r: %s'
%
(
raise
ValueError
(
'Wrong list of software releases on %r: %s'
%
(
self
.
getReference
(),
', '
.
join
([
q
.
getRelativeUrl
()
for
q
\
self
.
getReference
(),
', '
.
join
([
q
.
getRelativeUrl
()
for
q
\
in
software_installation_list
])
in
software_installation_list
])
))
))
\ No newline at end of file
def
getComputePartitionNewsDict
(
self
):
key
=
'%s_partition_news'
%
self
.
getReference
()
cache_plugin
=
self
.
_getCachePlugin
()
refresh_etag
=
self
.
_calculateRefreshEtag
()
try
:
entry
=
cache_plugin
.
get
(
key
,
DEFAULT_CACHE_SCOPE
)
except
KeyError
:
entry
=
None
if
entry
is
not
None
and
isinstance
(
entry
.
getValue
(),
dict
):
cached_dict
=
entry
.
getValue
()
cached_etag
=
cached_dict
.
get
(
'refresh_etag'
,
None
)
if
(
refresh_etag
!=
cached_etag
):
return
self
.
_getCachedComputePartitionNewsDict
(
key
,
refresh_etag
)
else
:
return
cached_dict
.
get
(
'data'
)
return
self
.
_getCachedComputePartitionNewsDict
(
key
,
refresh_etag
)
def
_getCachedComputePartitionNewsDict
(
self
,
key
,
refresh_etag
):
unrestrictedSearchResults
=
self
.
getPortalObject
().
portal_catalog
.
unrestrictedSearchResults
compute_partition_uid_list
=
[
x
.
uid
for
x
in
unrestrictedSearchResults
(
parent_uid
=
self
.
getUid
(),
validation_state
=
"validated"
,
portal_type
=
"Compute Partition"
)]
software_instance_list
=
unrestrictedSearchResults
(
portal_type
=
"Software Instance"
,
default_aggregate_uid
=
compute_partition_uid_list
,
validation_state
=
"validated"
,
group_by_list
=
[
'default_aggregate_uid'
],
select_list
=
[
'default_aggregate_uid'
,
'default_aggregate_title'
]
)
compute_partition_dict
=
{
}
for
software_instance
in
software_instance_list
:
compute_partition_dict
[
software_instance
.
default_aggregate_title
]
=
software_instance
.
getAccessStatus
()
try
:
self
.
_getCachePlugin
().
set
(
key
,
DEFAULT_CACHE_SCOPE
,
dict
(
time
=
time
.
time
(),
refresh_etag
=
refresh_etag
,
data
=
compute_partition_dict
),
cache_duration
=
self
.
getPortalObject
().
portal_caches
\
.
getRamCacheRoot
().
get
(
'compute_node_information_cache_factory'
\
).
cache_duration
)
except
(
Unauthorized
,
IndexError
):
# XXX: Unauthorized hack. Race condition of not ready setup delivery which provides
# security information shall not make this method fail, as it will be
# called later anyway
# Note: IndexError ignored, as it happend in case if full reindex is
# called on site
pass
return
compute_partition_dict
\ No newline at end of file
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_css.css
View file @
87c2783b
...
@@ -16,12 +16,8 @@
...
@@ -16,12 +16,8 @@
clear
:
left
;
clear
:
left
;
}
}
.ui-block-50
{
.ui-block
{
width
:
50%
!important
;
width
:
100%
}
.ui-btn-hide
{
display
:
none
!important
;
}
}
.ui-bar
{
.ui-bar
{
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_css.xml
View file @
87c2783b
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
1.40386.24679.243
20
</string>
</value>
<value>
<string>
100
9.35848.48037.158
20
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -264,7 +264,7 @@
...
@@ -264,7 +264,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
16
58172898.38
</float>
<float>
16
88482381.84
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_html.html
View file @
87c2783b
...
@@ -14,15 +14,10 @@
...
@@ -14,15 +14,10 @@
</head>
</head>
<body>
<body>
<div
class=
"ui-block-a ui-block
-50
main-status"
>
<div
class=
"ui-block-a ui-block main-status"
>
<div
class=
"ui-bar ui-corner-all first-child ui-btn-no-data"
>
<div
class=
"ui-bar ui-corner-all first-child ui-btn-no-data"
>
<a
class=
"ui-btn ui-btn-icon-left ui-icon-spinner ui-btn-color-white"
>
Node
</a>
<a
class=
"ui-btn ui-btn-icon-left ui-icon-spinner ui-btn-color-white"
>
Node
</a>
</div>
</div>
</div>
</div>
<div
class=
"ui-block-c ui-block-50 sub-status"
>
<div
class=
"ui-bar ui-corner-all first-child ui-btn-no-data"
>
<a
class=
"ui-btn ui-btn-icon-left ui-icon-spinner ui-btn-color-white"
>
Partitions
</a>
</div>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_html.xml
View file @
87c2783b
...
@@ -282,7 +282,7 @@
...
@@ -282,7 +282,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
1.26171.19762.4285
4
</string>
</value>
<value>
<string>
100
9.35843.10522.3802
4
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -302,7 +302,7 @@
...
@@ -302,7 +302,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
16
57906237.7
5
</float>
<float>
16
88481140.0
5
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_js.js
View file @
87c2783b
...
@@ -77,42 +77,6 @@
...
@@ -77,42 +77,6 @@
return
'
ui-btn-error
'
;
return
'
ui-btn-error
'
;
}
}
function
getComputePartitionStatus
(
options
)
{
var
message
,
compute_partition
,
partition_class
=
'
ui-btn-ok
'
,
error_amount
=
0
,
total_amount
=
0
;
if
(
!
options
)
{
return
'
ui-btn-no-data
'
;
}
for
(
compute_partition
in
options
)
{
if
(
options
.
hasOwnProperty
(
compute_partition
)
&&
options
[
compute_partition
].
text
)
{
message
=
options
[
compute_partition
].
text
;
if
(
message
.
startsWith
(
"
#error
"
))
{
partition_class
=
'
ui-btn-warning
'
;
error_amount
+=
1
;
}
total_amount
+=
1
;
if
((
error_amount
>
0
)
&&
(
error_amount
<
total_amount
))
{
// No need to continue the result will be a warnning
return
partition_class
;
}
}
}
if
(
!
total_amount
)
{
return
'
ui-btn-no-data
'
;
}
if
(
error_amount
===
total_amount
)
{
return
'
ui-btn-error
'
;
}
return
partition_class
;
}
function
getSoftwareInstallationStatus
(
options
)
{
function
getSoftwareInstallationStatus
(
options
)
{
if
((
!
options
)
||
(
options
&&
!
options
.
text
))
{
if
((
!
options
)
||
(
options
&&
!
options
.
text
))
{
return
'
ui-btn-no-data
'
;
return
'
ui-btn-no-data
'
;
...
@@ -163,81 +127,26 @@
...
@@ -163,81 +127,26 @@
return
status
;
return
status
;
}
}
function
getComputePartitionStatusList
(
options
)
{
var
compute_node_reference
,
status
=
'
ui-btn-no-data
'
,
previous_status
=
"
START
"
;
for
(
compute_node_reference
in
options
.
partition
)
{
if
(
options
.
partition
.
hasOwnProperty
(
compute_node_reference
))
{
status
=
getComputePartitionStatus
(
options
.
partition
[
compute_node_reference
]
);
if
(
previous_status
===
"
START
"
)
{
previous_status
=
status
;
}
if
(
status
===
'
ui-btn-warning
'
)
{
// XXX Drop warning
return
status
;
}
if
(
previous_status
!==
status
)
{
if
((
previous_status
===
'
ui-btn-error
'
)
&&
(
status
===
'
ui-btn-ok
'
))
{
return
'
ui-btn-warning
'
;
}
if
((
status
===
'
ui-btn-error
'
)
&&
(
previous_status
===
'
ui-btn-ok
'
))
{
return
'
ui-btn-warning
'
;
}
if
(
status
===
'
ui-btn-no-data
'
)
{
status
=
previous_status
;
}
}
}
}
return
status
;
}
function
getStatus
(
gadget
,
result
)
{
function
getStatus
(
gadget
,
result
)
{
var
i
,
status_class
=
'
ui-btn-no-data
'
,
var
status_class
=
'
ui-btn-no-data
'
,
right_class
=
'
ui-btn-no-data
'
,
main_status_div
=
gadget
.
element
.
querySelector
(
"
.main-status
"
),
main_status_div
=
gadget
.
element
.
querySelector
(
"
.main-status
"
),
sub_status_div
=
gadget
.
element
.
querySelector
(
"
.sub-status
"
),
monitor_url
=
''
,
monitor_url
=
''
,
main_link_configuration_dict
=
{
main_link_configuration_dict
=
{
class
:
"
ui-btn ui-btn-icon-left ui-icon-desktop
"
class
:
"
ui-btn ui-btn-icon-left ui-icon-desktop
"
},
sub_link_configuration_dict
=
{
class
:
"
ui-btn ui-btn-icon-left ui-icon-desktop
"
};
};
if
(
result
&&
result
.
monitor_url
)
{
if
(
result
&&
result
.
monitor_url
)
{
monitor_url
=
result
.
monitor_url
monitor_url
=
result
.
monitor_url
;
}
}
if
(
result
&&
result
.
portal_type
&&
result
.
portal_type
===
"
Compute Node
"
)
{
if
(
result
&&
result
.
portal_type
&&
result
.
portal_type
===
"
Compute Node
"
)
{
main_link_configuration_dict
.
href
=
monitor_url
;
main_link_configuration_dict
.
target
=
"
_target
"
;
main_link_configuration_dict
.
text
=
'
Node
'
;
main_link_configuration_dict
.
text
=
'
Node
'
;
sub_link_configuration_dict
.
href
=
monitor_url
;
main_link_configuration_dict
.
class
=
"
ui-btn ui-btn-icon-left
"
;
sub_link_configuration_dict
.
target
=
"
_target
"
;
status_class
=
getComputeNodeStatus
(
result
);
sub_link_configuration_dict
.
text
=
'
Partitions
'
;
if
(
result
&&
result
.
compute_node
)
{
status_class
=
getComputeNodeStatus
(
result
.
compute_node
);
}
if
((
status_class
===
'
ui-btn-error
'
)
||
(
status_class
===
'
ui-btn-no-data
'
))
{
right_class
=
status_class
;
}
else
{
if
(
result
&&
result
.
partition
)
{
right_class
=
getComputePartitionStatus
(
result
.
partition
);
}
}
}
else
if
(
result
&&
result
.
portal_type
&&
}
else
if
(
result
&&
result
.
portal_type
&&
result
.
portal_type
===
"
Software Installation
"
)
{
result
.
portal_type
===
"
Software Installation
"
)
{
status_class
=
getSoftwareInstallationStatus
(
result
);
status_class
=
getSoftwareInstallationStatus
(
result
);
main_link_configuration_dict
.
text
=
"
Installation
"
;
main_link_configuration_dict
.
text
=
"
Installation
"
;
right_class
=
"
ui-btn-hide
"
;
if
(
status_class
===
"
ui-btn-is-building
"
)
{
if
(
status_class
===
"
ui-btn-is-building
"
)
{
main_link_configuration_dict
.
text
=
"
Building
"
;
main_link_configuration_dict
.
text
=
"
Building
"
;
status_class
=
"
ui-btn-no-data
"
;
status_class
=
"
ui-btn-no-data
"
;
...
@@ -252,7 +161,6 @@
...
@@ -252,7 +161,6 @@
result
.
portal_type
===
"
Slave Instance
"
result
.
portal_type
===
"
Slave Instance
"
))
{
))
{
status_class
=
getInstanceStatus
(
result
);
status_class
=
getInstanceStatus
(
result
);
right_class
=
"
ui-btn-hide
"
;
if
(
status_class
===
'
ui-btn-is-slave
'
)
{
if
(
status_class
===
'
ui-btn-is-slave
'
)
{
status_class
=
'
ui-btn-color-white
'
;
status_class
=
'
ui-btn-color-white
'
;
main_link_configuration_dict
.
text
=
'
Slave
'
;
main_link_configuration_dict
.
text
=
'
Slave
'
;
...
@@ -274,7 +182,6 @@
...
@@ -274,7 +182,6 @@
result
.
portal_type
===
"
Instance Tree
"
)
{
result
.
portal_type
===
"
Instance Tree
"
)
{
status_class
=
getInstanceTreeStatus
(
result
);
status_class
=
getInstanceTreeStatus
(
result
);
// it should verify if the monitor-base-url is ready.
// it should verify if the monitor-base-url is ready.
right_class
=
"
ui-btn-hide
"
;
if
(
status_class
===
'
ui-btn-is-slave
'
)
{
if
(
status_class
===
'
ui-btn-is-slave
'
)
{
status_class
=
'
ui-btn-color-white
'
;
status_class
=
'
ui-btn-color-white
'
;
main_link_configuration_dict
.
text
=
'
Slave Only
'
;
main_link_configuration_dict
.
text
=
'
Slave Only
'
;
...
@@ -293,40 +200,18 @@
...
@@ -293,40 +200,18 @@
main_link_configuration_dict
.
text
=
'
Instance
'
;
main_link_configuration_dict
.
text
=
'
Instance
'
;
}
}
}
else
{
}
else
{
main_link_configuration_dict
.
href
=
monitor_url
;
main_link_configuration_dict
.
target
=
"
_target
"
;
main_link_configuration_dict
.
text
=
'
Node
'
;
main_link_configuration_dict
.
text
=
'
Node
'
;
sub_link_configuration_dict
.
href
=
monitor_url
;
main_link_configuration_dict
.
class
=
"
ui-btn ui-btn-icon-left
"
;
sub_link_configuration_dict
.
target
=
"
_target
"
;
sub_link_configuration_dict
.
text
=
'
Partitions
'
;
status_class
=
getComputeNodeStatusList
(
result
);
status_class
=
getComputeNodeStatusList
(
result
);
if
((
status_class
===
'
ui-btn-error
'
)
||
(
status_class
===
'
ui-btn-no-data
'
))
{
right_class
=
status_class
;
}
else
{
right_class
=
getComputePartitionStatusList
(
result
);
}
}
}
main_link_configuration_dict
.
text
=
'
'
+
main_link_configuration_dict
.
text
;
main_link_configuration_dict
.
text
=
'
'
+
main_link_configuration_dict
.
text
;
sub_link_configuration_dict
.
text
=
'
'
+
sub_link_configuration_dict
.
text
;
domsugar
(
main_status_div
.
querySelector
(
'
div
'
),
domsugar
(
main_status_div
.
querySelector
(
'
div
'
),
{
{
class
:
"
ui-bar ui-corner-all first-child
"
+
status_class
class
:
"
ui-bar ui-corner-all first-child
"
+
status_class
},
[
},
[
domsugar
(
"
a
"
,
main_link_configuration_dict
)
domsugar
(
"
a
"
,
main_link_configuration_dict
)
]);
]);
domsugar
(
sub_status_div
.
querySelector
(
'
div
'
),
{
class
:
"
ui-bar ui-corner-all last-child
"
+
right_class
},
[
domsugar
(
"
a
"
,
sub_link_configuration_dict
)
]);
if
(
right_class
===
'
ui-btn-hide
'
)
{
// expand main button to use the space
main_status_div
.
className
=
"
ui-block-a ui-block main-status
"
;
}
return
gadget
;
return
gadget
;
}
}
...
@@ -338,7 +223,8 @@
...
@@ -338,7 +223,8 @@
.
onLoop
(
function
()
{
.
onLoop
(
function
()
{
var
gadget
=
this
;
var
gadget
=
this
;
if
(
typeof
gadget
.
state
.
jio_key
===
'
string
'
&&
gadget
.
state
.
jio_key
!==
''
)
{
if
(
typeof
gadget
.
state
.
jio_key
===
'
string
'
&&
gadget
.
state
.
jio_key
!==
''
)
{
return
gadget
.
jio_get
(
gadget
.
state
.
jio_key
)
return
gadget
.
jio_get
(
gadget
.
state
.
jio_key
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
var
state_dict
=
result
.
news
||
{};
var
state_dict
=
result
.
news
||
{};
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_status_js.xml
View file @
87c2783b
...
@@ -278,7 +278,7 @@
...
@@ -278,7 +278,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
6.58340.40727.2362
0
</string>
</value>
<value>
<string>
100
9.34688.1170.3386
0
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -298,7 +298,7 @@
...
@@ -298,7 +298,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
168
0031759.77
</float>
<float>
168
8481138.46
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getNewsDictFromComputeNodeList.py
View file @
87c2783b
...
@@ -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 @
87c2783b
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 @
87c2783b
...
@@ -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 @
87c2783b
This diff is collapsed.
Click to expand it.
master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSNetwork.zpt
View file @
87c2783b
...
@@ -154,12 +154,12 @@
...
@@ -154,12 +154,12 @@
</tr>
</tr>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
...
@@ -206,12 +206,12 @@
...
@@ -206,12 +206,12 @@
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
...
@@ -227,12 +227,12 @@
...
@@ -227,12 +227,12 @@
</tr>
</tr>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
...
...
master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSServer.zpt
View file @
87c2783b
...
@@ -224,12 +224,12 @@
...
@@ -224,12 +224,12 @@
</tr>
</tr>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
...
@@ -245,12 +245,12 @@
...
@@ -245,12 +245,12 @@
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
...
...
master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSSite.zpt
View file @
87c2783b
...
@@ -179,23 +179,23 @@
...
@@ -179,23 +179,23 @@
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
...
@@ -212,34 +212,34 @@
...
@@ -212,34 +212,34 @@
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//div[contains(@class, 'leaflet-pane')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<!-- Check on listbox -->
<!-- Check on listbox -->
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(
@href, 'COMP-') and contains(
text(), 'Node')]
</td>
<td>
//td//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Node')]
</td>
<td></td>
<td></td>
</tr>
</tr>
...
...
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