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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
ac05e154
Commit
ac05e154
authored
Jul 10, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Replace custom HTML by status gadget
This gives same visual/information as user has
parent
25b4edc2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
292 additions
and
182 deletions
+292
-182
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCurrentUsageReport.xml
...skins/slapos_cloud/ComputeNode_viewCurrentUsageReport.xml
+2
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCurrentUsageReport/my_busy_compute_partition_list.xml
...viewCurrentUsageReport/my_busy_compute_partition_list.xml
+4
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCurrentUsageReport/my_busy_compute_partition_list_error_reported.xml
...eReport/my_busy_compute_partition_list_error_reported.xml
+121
-0
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCurrentUsageReport/my_busy_compute_partition_list_status.xml
...rentUsageReport/my_busy_compute_partition_list_status.xml
+165
-24
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_getSoftwareInstanceStatus.py
...lapos_cloud/ComputePartition_getSoftwareInstanceStatus.py
+0
-13
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_getSoftwareInstanceStatus.xml
...apos_cloud/ComputePartition_getSoftwareInstanceStatus.xml
+0
-62
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_getCurrentStatus.py
...l_skins/slapos_cloud/SoftwareInstance_getCurrentStatus.py
+0
-20
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_getCurrentStatus.xml
..._skins/slapos_cloud/SoftwareInstance_getCurrentStatus.xml
+0
-62
No files found.
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCurrentUsageReport.xml
View file @
ac05e154
...
@@ -102,12 +102,13 @@
...
@@ -102,12 +102,13 @@
<string>
listbox_installation_state
</string>
<string>
listbox_installation_state
</string>
<string>
listbox_usage
</string>
<string>
listbox_usage
</string>
<string>
my_busy_compute_partition_list_creation_date
</string>
<string>
my_busy_compute_partition_list_creation_date
</string>
<string>
my_busy_compute_partition_list_status
</string>
<string>
listbox_installation_status
</string>
<string>
listbox_installation_status
</string>
<string>
my_busy_compute_partition_list_instance_tree_title
</string>
<string>
my_busy_compute_partition_list_instance_tree_title
</string>
<string>
my_busy_compute_partition_list_instance_title
</string>
<string>
my_busy_compute_partition_list_instance_title
</string>
<string>
listbox_image
</string>
<string>
listbox_image
</string>
<string>
listbox_software_release
</string>
<string>
listbox_software_release
</string>
<string>
my_busy_compute_partition_list_error_reported
</string>
<string>
my_busy_compute_partition_list_status
</string>
</list>
</list>
</value>
</value>
</item>
</item>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCurrentUsageReport/my_busy_compute_partition_list.xml
View file @
ac05e154
...
@@ -429,6 +429,10 @@
...
@@ -429,6 +429,10 @@
<string>
status
</string>
<string>
status
</string>
<string>
Status
</string>
<string>
Status
</string>
</tuple>
</tuple>
<tuple>
<string>
error_reported
</string>
<string>
error_reported
</string>
</tuple>
</list>
</list>
</value>
</value>
</item>
</item>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCurrentUsageReport/my_busy_compute_partition_list_error_reported.xml
0 → 100644
View file @
ac05e154
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
editable
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_busy_compute_partition_list_error_reported
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_string_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Reported Error
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: cell.getAggregateRelatedValue(portal_type="Software Instance").SoftwareInstance_hasReportedError(include_message=True, )
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCurrentUsageReport/my_busy_compute_partition_list_status.xml
View file @
ac05e154
...
@@ -2,19 +2,10 @@
...
@@ -2,19 +2,10 @@
<ZopeData>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<pickle>
<global
name=
"
ProxyField"
module=
"Products.ERP5Form.Proxy
Field"
/>
<global
name=
"
GadgetField"
module=
"Products.ERP5Form.Gadget
Field"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_busy_compute_partition_list_status
</string>
</value>
<value>
<string>
my_busy_compute_partition_list_status
</string>
</value>
...
@@ -27,6 +18,10 @@
...
@@ -27,6 +18,10 @@
<key>
<string>
external_validator_failed
</string>
</key>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</item>
<item>
<key>
<string>
no_validator
</string>
</key>
<value>
<string>
Does not support this operation.
</string>
</value>
</item>
</dictionary>
</dictionary>
</value>
</value>
</item>
</item>
...
@@ -35,15 +30,67 @@
...
@@ -35,15 +30,67 @@
<value>
<value>
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
field_id
</string>
</key>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
data_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
form_id
</string>
</key>
<key>
<string>
js_sandbox
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
renderjs_extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
target
</string>
</key>
<key>
<string>
validator_field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_form_id
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -53,6 +100,18 @@
...
@@ -53,6 +100,18 @@
<key>
<string>
tales
</string>
</key>
<key>
<string>
tales
</string>
</key>
<value>
<value>
<dictionary>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
data_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<item>
<key>
<string>
default
</string>
</key>
<key>
<string>
default
</string>
</key>
<value>
<value>
...
@@ -60,15 +119,51 @@
...
@@ -60,15 +119,51 @@
</value>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
field_id
</string>
</key>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
form_id
</string>
</key>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
target
</string>
</key>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
js_sandbox
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
renderjs_extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_form_id
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -78,25 +173,71 @@
...
@@ -78,25 +173,71 @@
<key>
<string>
values
</string>
</key>
<key>
<string>
values
</string>
</key>
<value>
<value>
<dictionary>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
data_url
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<item>
<key>
<string>
default
</string>
</key>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
field_id
</string>
</key>
<key>
<string>
description
</string>
</key>
<value>
<string>
my_editor_field
</string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
form_id
</string>
</key>
<key>
<string>
editable
</string>
</key>
<value>
<
string>
Base_viewFieldLibrary
</string
>
</value>
<value>
<
int>
1
</int
>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
target
</string>
</key>
<key>
<string>
enabled
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string>
gadget_slapos_status.html
</string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
js_sandbox
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
renderjs_extra
</string>
</key>
<value>
<list/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
<value>
<string>
Instance Status
</string>
</value>
<value>
<string>
Status
</string>
</value>
</item>
<item>
<key>
<string>
validator_field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</value>
</value>
...
@@ -112,7 +253,7 @@
...
@@ -112,7 +253,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
_text
</string>
</key>
<key>
<string>
_text
</string>
</key>
<value>
<string>
cell/ComputePartition_getSoftwareInstanceStatus
</string>
</value>
<value>
<string>
python: {"result": cell.getAggregateRelatedValue(portal_type="Software Instance").getAccessStatus()}
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_getSoftwareInstanceStatus.py
deleted
100644 → 0
View file @
25b4edc2
software_instance
=
context
.
getAggregateRelatedValue
(
portal_type
=
'Software Instance'
)
status
=
""
state
=
'green'
if
software_instance
is
not
None
:
status
=
software_instance
.
SoftwareInstance_getCurrentStatus
()
if
status
.
startswith
(
'#error '
):
state
=
"red"
return
'<a href="%s" style="background-color: %s; display: block; height: 2em; width: 2em; float: left; margin: 5px;"></a> '
\
'<p style="float: left; line-height: 10px; margin-left: 10px;">%s</p>'
%
(
software_instance
.
getUrl
(),
state
,
status
)
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputePartition_getSoftwareInstanceStatus.xml
deleted
100644 → 0
View file @
25b4edc2
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ComputePartition_getSoftwareInstanceStatus
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_getCurrentStatus.py
deleted
100644 → 0
View file @
25b4edc2
"""Dirty script to return Software Instance state"""
state
=
context
.
getSlapState
()
has_partition
=
context
.
getAggregate
(
portal_type
=
"Compute Partition"
)
result
=
'Unable to calculate the status...'
if
has_partition
:
d
=
context
.
getAccessStatus
()
if
d
.
get
(
"no_data"
)
==
1
:
result
=
context
.
getSlapStateTitle
()
else
:
result
=
d
[
'text'
]
if
result
.
startswith
(
'#access '
):
result
=
result
[
len
(
'#access '
):]
else
:
if
state
in
[
"start_requested"
,
"stop_requested"
]:
result
=
'Looking for a free partition'
elif
state
in
[
"destroy_requested"
]:
result
=
'Destroyed'
return
result
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_getCurrentStatus.xml
deleted
100644 → 0
View file @
25b4edc2
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_getCurrentStatus
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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