Commit 69bb9229 authored by Rafael Monnerat's avatar Rafael Monnerat

Refactor status gadget (unify)

See merge request !394
parents a0e68da7 c90d01c9
...@@ -78,7 +78,9 @@ class SlapOSCacheMixin: ...@@ -78,7 +78,9 @@ class SlapOSCacheMixin:
'since': '%s' % last_modified, 'since': '%s' % last_modified,
'state': "", 'state': "",
"text": "#error no data found for %s" % self.getReference(), "text": "#error no data found for %s" % self.getReference(),
"no_data": 1 "no_data": 1,
'reference': self.getReference(),
'portal_type': self.getPortalType()
} }
# Prepare for xml marshalling # Prepare for xml marshalling
#data_dict["text"] = data_dict["text"].decode("UTF-8") #data_dict["text"] = data_dict["text"].decode("UTF-8")
...@@ -128,7 +130,9 @@ class SlapOSCacheMixin: ...@@ -128,7 +130,9 @@ class SlapOSCacheMixin:
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
'text': '%s' % text, 'text': '%s' % text,
'since': '%s' % since, 'since': '%s' % since,
'state': state 'state': state,
'reference': self.getReference(),
'portal_type': self.getPortalType()
}) })
cache_duration = self._getAccessStatusCacheFactory().cache_duration cache_duration = self._getAccessStatusCacheFactory().cache_duration
......
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>SlapOSCacheMixin</string> </value> <value> <string>SlapOSCacheMixin</string> </value>
...@@ -61,28 +55,13 @@ ...@@ -61,28 +55,13 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -95,7 +74,7 @@ ...@@ -95,7 +74,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -104,7 +83,7 @@ ...@@ -104,7 +83,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
......
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
############################################################################## ##############################################################################
def _decode_with_json(value):
# Ensure value is serisalisable as json
return json.loads(json.dumps(value))
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
from DateTime import DateTime from DateTime import DateTime
from App.Common import rfc1123_date from App.Common import rfc1123_date
...@@ -67,6 +71,8 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -67,6 +71,8 @@ class TestSlapOSCloudSlapOSCacheMixin(
created_at = since created_at = since
def getBaseExpectedDict(doc): def getBaseExpectedDict(doc):
return { return {
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "SlapOS Master", "user": "SlapOS Master",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
'since': '%s' % since, 'since': '%s' % since,
...@@ -102,6 +108,8 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -102,6 +108,8 @@ class TestSlapOSCloudSlapOSCacheMixin(
def getExpectedCacheDict(doc): def getExpectedCacheDict(doc):
return json.dumps({ return json.dumps({
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "ERP5TypeTestCase", "user": "ERP5TypeTestCase",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
'since': '%s' % since, 'since': '%s' % since,
...@@ -109,22 +117,24 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -109,22 +117,24 @@ class TestSlapOSCloudSlapOSCacheMixin(
"text": "#access TEST123 %s" % doc.getUid() "text": "#access TEST123 %s" % doc.getUid()
}) })
def getBaseExpectedDict(doc): def getBaseExpectedDict(doc):
return { return _decode_with_json({
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "ERP5TypeTestCase", "user": "ERP5TypeTestCase",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
u'since': u'%s' % since, 'since': '%s' % since,
u'state': u"", 'state': "",
u"text": u"#access TEST123 %s" % doc.getUid(), "text": "#access TEST123 %s" % doc.getUid(),
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0 'no_data_since_5_minutes': 0
} })
# Check Compute Node # Check Compute Node
self.assertEqual(True, self.assertEqual(True,
self.compute_node.setAccessStatus("TEST123 %s" % self.compute_node.getUid())) self.compute_node.setAccessStatus("TEST123 %s" % self.compute_node.getUid()))
self.assertEqual(self.compute_node._getCachedAccessInfo(), self.assertEqual(self.compute_node._getCachedAccessInfo(),
getExpectedCacheDict(self.compute_node)) getExpectedCacheDict(self.compute_node))
self.assertEqual(self.compute_node.getAccessStatus(), self.assertEqual(_decode_with_json(self.compute_node.getAccessStatus()),
getBaseExpectedDict(self.compute_node)) getBaseExpectedDict(self.compute_node))
self.assertEqual(False, self.assertEqual(False,
self.compute_node.setAccessStatus("TEST123 %s" % self.compute_node.getUid())) self.compute_node.setAccessStatus("TEST123 %s" % self.compute_node.getUid()))
...@@ -135,7 +145,7 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -135,7 +145,7 @@ class TestSlapOSCloudSlapOSCacheMixin(
installation.setAccessStatus("TEST123 %s" % installation.getUid())) installation.setAccessStatus("TEST123 %s" % installation.getUid()))
self.assertEqual(installation._getCachedAccessInfo(), self.assertEqual(installation._getCachedAccessInfo(),
getExpectedCacheDict(installation)) getExpectedCacheDict(installation))
self.assertEqual(installation.getAccessStatus(), self.assertEqual(_decode_with_json(installation.getAccessStatus()),
getBaseExpectedDict(installation)) getBaseExpectedDict(installation))
self.assertEqual(False, self.assertEqual(False,
installation.setAccessStatus("TEST123 %s" % installation.getUid())) installation.setAccessStatus("TEST123 %s" % installation.getUid()))
...@@ -146,7 +156,7 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -146,7 +156,7 @@ class TestSlapOSCloudSlapOSCacheMixin(
partition.setAccessStatus("TEST123 %s" % partition.getUid())) partition.setAccessStatus("TEST123 %s" % partition.getUid()))
self.assertEqual(partition._getCachedAccessInfo(), self.assertEqual(partition._getCachedAccessInfo(),
getExpectedCacheDict(partition)) getExpectedCacheDict(partition))
self.assertEqual(partition.getAccessStatus(), self.assertEqual(_decode_with_json(partition.getAccessStatus()),
getBaseExpectedDict(partition)) getBaseExpectedDict(partition))
self.assertEqual(False, self.assertEqual(False,
partition.setAccessStatus("TEST123 %s" % partition.getUid())) partition.setAccessStatus("TEST123 %s" % partition.getUid()))
...@@ -158,7 +168,7 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -158,7 +168,7 @@ class TestSlapOSCloudSlapOSCacheMixin(
instance.setAccessStatus("TEST123 %s" % instance.getUid())) instance.setAccessStatus("TEST123 %s" % instance.getUid()))
self.assertEqual(instance._getCachedAccessInfo(), self.assertEqual(instance._getCachedAccessInfo(),
getExpectedCacheDict(instance)) getExpectedCacheDict(instance))
self.assertEqual(instance.getAccessStatus(), self.assertEqual(_decode_with_json(instance.getAccessStatus()),
getBaseExpectedDict(instance)) getBaseExpectedDict(instance))
self.assertEqual(False, self.assertEqual(False,
instance.setAccessStatus("TEST123 %s" % instance.getUid())) instance.setAccessStatus("TEST123 %s" % instance.getUid()))
...@@ -170,6 +180,8 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -170,6 +180,8 @@ class TestSlapOSCloudSlapOSCacheMixin(
def getExpectedCacheDict(doc): def getExpectedCacheDict(doc):
return json.dumps({ return json.dumps({
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "ERP5TypeTestCase", "user": "ERP5TypeTestCase",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
'since': '%s' % since, 'since': '%s' % since,
...@@ -177,15 +189,17 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -177,15 +189,17 @@ class TestSlapOSCloudSlapOSCacheMixin(
"text": "#access TEST123 %s" % doc.getUid() "text": "#access TEST123 %s" % doc.getUid()
}) })
def getBaseExpectedDict(doc): def getBaseExpectedDict(doc):
return { return _decode_with_json({
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "ERP5TypeTestCase", "user": "ERP5TypeTestCase",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
u'since': u'%s' % since, 'since': '%s' % since,
u'state': u"", 'state': "",
u"text": u"#access TEST123 %s" % doc.getUid(), "text": "#access TEST123 %s" % doc.getUid(),
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0 'no_data_since_5_minutes': 0
} })
self.tic() self.tic()
...@@ -202,7 +216,7 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -202,7 +216,7 @@ class TestSlapOSCloudSlapOSCacheMixin(
instance.setAccessStatus("TEST123 %s" % instance.getUid())) instance.setAccessStatus("TEST123 %s" % instance.getUid()))
self.assertEqual(instance._getCachedAccessInfo(), self.assertEqual(instance._getCachedAccessInfo(),
getExpectedCacheDict(instance)) getExpectedCacheDict(instance))
self.assertEqual(instance.getAccessStatus(), self.assertEqual(_decode_with_json(instance.getAccessStatus()),
getBaseExpectedDict(instance)) getBaseExpectedDict(instance))
self.tic() self.tic()
new_indexation_timestamp = self.portal.portal_catalog( new_indexation_timestamp = self.portal.portal_catalog(
...@@ -246,6 +260,8 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -246,6 +260,8 @@ class TestSlapOSCloudSlapOSCacheMixin(
def getExpectedCacheDict(doc): def getExpectedCacheDict(doc):
return json.dumps({ return json.dumps({
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "ERP5TypeTestCase", "user": "ERP5TypeTestCase",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
'since': '%s' % since, 'since': '%s' % since,
...@@ -253,22 +269,24 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -253,22 +269,24 @@ class TestSlapOSCloudSlapOSCacheMixin(
"text": "#error TEST123 %s" % doc.getUid() "text": "#error TEST123 %s" % doc.getUid()
}) })
def getBaseExpectedDict(doc): def getBaseExpectedDict(doc):
return { return _decode_with_json({
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "ERP5TypeTestCase", "user": "ERP5TypeTestCase",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
u'since': u'%s' % since, 'since': '%s' % since,
u'state': u"", 'state': "",
u"text": u"#error TEST123 %s" % doc.getUid(), "text": "#error TEST123 %s" % doc.getUid(),
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0 'no_data_since_5_minutes': 0
} })
# Check Compute Node # Check Compute Node
self.assertEqual(True, self.assertEqual(True,
self.compute_node.setErrorStatus("TEST123 %s" % self.compute_node.getUid())) self.compute_node.setErrorStatus("TEST123 %s" % self.compute_node.getUid()))
self.assertEqual(self.compute_node._getCachedAccessInfo(), self.assertEqual(self.compute_node._getCachedAccessInfo(),
getExpectedCacheDict(self.compute_node)) getExpectedCacheDict(self.compute_node))
self.assertEqual(self.compute_node.getAccessStatus(), self.assertEqual(_decode_with_json(self.compute_node.getAccessStatus()),
getBaseExpectedDict(self.compute_node)) getBaseExpectedDict(self.compute_node))
self.assertEqual(False, self.assertEqual(False,
self.compute_node.setErrorStatus("TEST123 %s" % self.compute_node.getUid())) self.compute_node.setErrorStatus("TEST123 %s" % self.compute_node.getUid()))
...@@ -279,7 +297,7 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -279,7 +297,7 @@ class TestSlapOSCloudSlapOSCacheMixin(
installation.setErrorStatus("TEST123 %s" % installation.getUid())) installation.setErrorStatus("TEST123 %s" % installation.getUid()))
self.assertEqual(installation._getCachedAccessInfo(), self.assertEqual(installation._getCachedAccessInfo(),
getExpectedCacheDict(installation)) getExpectedCacheDict(installation))
self.assertEqual(installation.getAccessStatus(), self.assertEqual(_decode_with_json(installation.getAccessStatus()),
getBaseExpectedDict(installation)) getBaseExpectedDict(installation))
self.assertEqual(False, self.assertEqual(False,
installation.setErrorStatus("TEST123 %s" % installation.getUid())) installation.setErrorStatus("TEST123 %s" % installation.getUid()))
...@@ -290,7 +308,7 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -290,7 +308,7 @@ class TestSlapOSCloudSlapOSCacheMixin(
partition.setErrorStatus("TEST123 %s" % partition.getUid())) partition.setErrorStatus("TEST123 %s" % partition.getUid()))
self.assertEqual(partition._getCachedAccessInfo(), self.assertEqual(partition._getCachedAccessInfo(),
getExpectedCacheDict(partition)) getExpectedCacheDict(partition))
self.assertEqual(partition.getAccessStatus(), self.assertEqual(_decode_with_json(partition.getAccessStatus()),
getBaseExpectedDict(partition)) getBaseExpectedDict(partition))
self.assertEqual(False, self.assertEqual(False,
partition.setErrorStatus("TEST123 %s" % partition.getUid())) partition.setErrorStatus("TEST123 %s" % partition.getUid()))
...@@ -301,7 +319,7 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -301,7 +319,7 @@ class TestSlapOSCloudSlapOSCacheMixin(
instance.setErrorStatus("TEST123 %s" % instance.getUid())) instance.setErrorStatus("TEST123 %s" % instance.getUid()))
self.assertEqual(instance._getCachedAccessInfo(), self.assertEqual(instance._getCachedAccessInfo(),
getExpectedCacheDict(instance)) getExpectedCacheDict(instance))
self.assertEqual(instance.getAccessStatus(), self.assertEqual(_decode_with_json(instance.getAccessStatus()),
getBaseExpectedDict(instance)) getBaseExpectedDict(instance))
self.assertEqual(False, self.assertEqual(False,
instance.setErrorStatus("TEST123 %s" % instance.getUid())) instance.setErrorStatus("TEST123 %s" % instance.getUid()))
...@@ -313,6 +331,8 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -313,6 +331,8 @@ class TestSlapOSCloudSlapOSCacheMixin(
def getExpectedCacheDict(doc): def getExpectedCacheDict(doc):
return json.dumps({ return json.dumps({
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "ERP5TypeTestCase", "user": "ERP5TypeTestCase",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
'since': '%s' % since, 'since': '%s' % since,
...@@ -320,15 +340,17 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -320,15 +340,17 @@ class TestSlapOSCloudSlapOSCacheMixin(
"text": "#building TEST123 %s" % doc.getUid() "text": "#building TEST123 %s" % doc.getUid()
}) })
def getBaseExpectedDict(doc): def getBaseExpectedDict(doc):
return { return _decode_with_json({
"portal_type": doc.getPortalType(),
"reference": doc.getReference(),
"user": "ERP5TypeTestCase", "user": "ERP5TypeTestCase",
'created_at': '%s' % created_at, 'created_at': '%s' % created_at,
u'since': u'%s' % since, 'since': '%s' % since,
u'state': u"", 'state': "",
u"text": u"#building TEST123 %s" % doc.getUid(), "text": "#building TEST123 %s" % doc.getUid(),
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0 'no_data_since_5_minutes': 0
} })
# Check Software Installation # Check Software Installation
installation = self.start_requested_software_installation installation = self.start_requested_software_installation
...@@ -336,7 +358,7 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -336,7 +358,7 @@ class TestSlapOSCloudSlapOSCacheMixin(
installation.setBuildingStatus("TEST123 %s" % installation.getUid())) installation.setBuildingStatus("TEST123 %s" % installation.getUid()))
self.assertEqual(installation._getCachedAccessInfo(), self.assertEqual(installation._getCachedAccessInfo(),
getExpectedCacheDict(installation)) getExpectedCacheDict(installation))
self.assertEqual(installation.getAccessStatus(), self.assertEqual(_decode_with_json(installation.getAccessStatus()),
getBaseExpectedDict(installation)) getBaseExpectedDict(installation))
self.assertEqual(False, self.assertEqual(False,
installation.setBuildingStatus("TEST123 %s" % installation.getUid())) installation.setBuildingStatus("TEST123 %s" % installation.getUid()))
......
...@@ -163,20 +163,11 @@ url_list = [ ...@@ -163,20 +163,11 @@ url_list = [
"gadget_erp5_attention_point.js", "gadget_erp5_attention_point.js",
"gadget_slapos_compute_node_map.html", "gadget_slapos_compute_node_map.html",
"gadget_slapos_compute_node_map.js", "gadget_slapos_compute_node_map.js",
"gadget_slapos_compute_node_status.css",
"gadget_slapos_compute_node_status.html",
"gadget_slapos_compute_node_status.js",
"gadget_slapos_event_discussion_entry.css", "gadget_slapos_event_discussion_entry.css",
"gadget_slapos_event_discussion_entry.html", "gadget_slapos_event_discussion_entry.html",
"gadget_slapos_event_discussion_entry.js", "gadget_slapos_event_discussion_entry.js",
"gadget_slapos_header.html", "gadget_slapos_header.html",
"gadget_slapos_header.js", "gadget_slapos_header.js",
"gadget_slapos_instance_tree_status.html",
"gadget_slapos_instance_tree_status.js",
"gadget_slapos_installation_status.html",
"gadget_slapos_installation_status.js",
"gadget_slapos_instance_status.html",
"gadget_slapos_instance_status.js",
"gadget_slapos_invoice_printout.html", "gadget_slapos_invoice_printout.html",
"gadget_slapos_invoice_printout.js", "gadget_slapos_invoice_printout.js",
"gadget_slapos_invoice_state.html", "gadget_slapos_invoice_state.html",
...@@ -186,17 +177,14 @@ url_list = [ ...@@ -186,17 +177,14 @@ url_list = [
"gadget_slapos_alert_listbox_field.js", "gadget_slapos_alert_listbox_field.js",
"gadget_slapos_alert_listbox_field.css", "gadget_slapos_alert_listbox_field.css",
"gadget_slapos_alert_listbox_field.html", "gadget_slapos_alert_listbox_field.html",
"gadget_slapos_network_status.html",
"gadget_slapos_network_status.js",
"gadget_slapos_panel.html", "gadget_slapos_panel.html",
"gadget_slapos_panel.js", "gadget_slapos_panel.js",
"gadget_slapos_panel.png?format=png", "gadget_slapos_panel.png?format=png",
"gadget_slapos_invoice_logo.png?format=", "gadget_slapos_invoice_logo.png?format=",
"gadget_slapos_payment_result.js", "gadget_slapos_payment_result.js",
"gadget_slapos_project_status.html", "gadget_slapos_status.css",
"gadget_slapos_project_status.js", "gadget_slapos_status.html",
"gadget_slapos_site_status.html", "gadget_slapos_status.js",
"gadget_slapos_site_status.js",
"gadget_slapos_utils.js", "gadget_slapos_utils.js",
"leaflet.css", "leaflet.css",
"leaflet.js", "leaflet.js",
......
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
tmp.style['min-width'] = '210px'; tmp.style['min-width'] = '210px';
container.appendChild(tmp); container.appendChild(tmp);
e.target._queue.push(function () { e.target._queue.push(function () {
return gadget.declareGadget('gadget_slapos_site_status.html', { return gadget.declareGadget('gadget_slapos_status.html', {
element: tmp element: tmp
}); });
}) })
......
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>superrafael</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.51816.55280.41267</string> </value> <value> <string>1001.24988.19785.29030</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1554319312.07</float> <float>1656977110.45</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -30,9 +30,10 @@ ...@@ -30,9 +30,10 @@
description: "The Status", description: "The Status",
hidden: 0, hidden: 0,
"default": {jio_key: value, "default": {jio_key: value,
result: news}, result: news,
portal_type: "Compute Node"},
key: "status", key: "status",
url: "gadget_slapos_compute_node_status.html", url: "gadget_slapos_status.html",
title: "Status", title: "Status",
type: "GadgetField" type: "GadgetField"
} }
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>995.25915.28776.41745</string> </value> <value> <string>1001.20429.28253.1211</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1634219804.24</float> <float>1656703797.9</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateDocument", "updateDocument") .declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
...@@ -36,9 +35,12 @@ ...@@ -36,9 +35,12 @@
css_class: "", css_class: "",
description: "The Status", description: "The Status",
hidden: 0, hidden: 0,
"default": {jio_key: value, result: value}, "default": {
jio_key: value,
result: value,
portal_type: "Software Installation"},
key: "status", key: "status",
url: "gadget_slapos_installation_status.html", url: "gadget_slapos_status.html",
title: "Status", title: "Status",
type: "GadgetField" type: "GadgetField"
} }
...@@ -294,11 +296,12 @@ ...@@ -294,11 +296,12 @@
"description": "", "description": "",
"title": results[2][29], "title": results[2][29],
"default": {jio_key: gadget.state.jio_key, "default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc.news}, result: gadget.state.doc.news,
portal_type: "Compute Node"},
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 0, "editable": 0,
"url": "gadget_slapos_compute_node_status.html", "url": "gadget_slapos_status.html",
"sandbox": "", "sandbox": "",
"key": "monitoring_status", "key": "monitoring_status",
"hidden": 0, "hidden": 0,
......
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.49476.87.8891</string> </value> <value> <string>1000.58064.4435.24422</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1617118020.93</float> <float>1656716026.45</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter") .declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateDocument", "updateDocument") .declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
...@@ -27,18 +28,23 @@ ...@@ -27,18 +28,23 @@
var gadget = this; var gadget = this;
return gadget.jio_allDocs(param_list[0]) return gadget.jio_allDocs(param_list[0])
.push(function (result) { .push(function (result) {
var i, value, len = result.data.total_rows; var i, value, news, len = result.data.total_rows;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
if (1 || (result.data.rows[i].value.hasOwnProperty("ComputeNode_getNewsDict"))) { if (1 || (result.data.rows[i].value.hasOwnProperty("ComputeNode_getNewsDict"))) {
value = result.data.rows[i].value.ComputeNode_getNewsDict; value = result.data.rows[i].id;
news = result.data.rows[i].value.ComputeNode_getNewsDict;
result.data.rows[i].value.ComputeNode_getNewsDict = { result.data.rows[i].value.ComputeNode_getNewsDict = {
field_gadget_param : { field_gadget_param : {
css_class: "", css_class: "",
description: "The Status", description: "The Status",
hidden: 0, hidden: 0,
"default": {jio_key: value, result: value}, "default": {
jio_key: value,
result: news,
portal_type: "Compute Node"
},
key: "status", key: "status",
url: "gadget_slapos_compute_node_status.html", url: "gadget_slapos_status.html",
title: gadget.title_translation, title: gadget.title_translation,
type: "GadgetField" type: "GadgetField"
} }
...@@ -102,7 +108,8 @@ ...@@ -102,7 +108,8 @@
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getDeclaredGadget('form_view'), gadget.getDeclaredGadget('form_view'),
gadget.getTranslationList(translation_list) gadget.getTranslationList(translation_list),
gadget.getSetting("hateoas_url")
]); ]);
}) })
.push(function (result) { .push(function (result) {
...@@ -141,7 +148,6 @@ ...@@ -141,7 +148,6 @@
"hidden": 0, "hidden": 0,
"type": "StringField" "type": "StringField"
}, },
"my_monitoring_status": { "my_monitoring_status": {
"description": "", "description": "",
"title": result[1][5], "title": result[1][5],
...@@ -150,7 +156,7 @@ ...@@ -150,7 +156,7 @@
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 0, "editable": 0,
"url": "gadget_slapos_network_status.html", "url": "gadget_slapos_status.html",
"sandbox": "", "sandbox": "",
"key": "monitoring_status", "key": "monitoring_status",
"hidden": 0, "hidden": 0,
...@@ -186,11 +192,11 @@ ...@@ -186,11 +192,11 @@
"editable_column_list": [], "editable_column_list": [],
"key": "slap_project_compute_node_listbox", "key": "slap_project_compute_node_listbox",
"lines": 10, "lines": 10,
"list_method": "portal_catalog", "list_method": "ComputerNetwork_getComputeNodeList",
// XXX TODO Filter by default_strict_allocation_scope_uid="!=%s" % context.getPortalObject().portal_categories.allocation_scope.close.forever.getUid(), "list_method_template": result[2] + "ERP5Document_getHateoas?mode=search&" +
"query": "urn:jio:allDocs?query=portal_type%3A%22" + "list_method=ComputerNetwork_getComputeNodeList&relative_url=" +
"Compute Node" + "%22%20AND%20" + gadget.state.jio_key + "&default_param_json=eyJpZ25vcmVfdW5rbm93bl9jb2x1bW5zIjogdHJ1ZX0={&query,select_list*,limit*,sort_on*,local_roles*}",
"subordination_reference%3A" + gadget.state.doc.reference, "query": "urn:jio:allDocs?query=",
"portal_type": [], "portal_type": [],
"search_column_list": column_list, "search_column_list": column_list,
"sort_column_list": column_list, "sort_column_list": column_list,
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.11833.796.41028</string> </value> <value> <string>1001.44818.54264.13038</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602260725.77</float> <float>1658167069.0</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
hidden: 0, hidden: 0,
"default": {jio_key: jio_key_value, result: value}, "default": {jio_key: jio_key_value, result: value},
key: "status", key: "status",
url: "gadget_slapos_instance_status.html", url: "gadget_slapos_status.html",
title: gadget.title_translation, title: gadget.title_translation,
type: "GadgetField" type: "GadgetField"
} }
...@@ -357,11 +357,11 @@ ...@@ -357,11 +357,11 @@
"description": "", "description": "",
"title": result[1][23], "title": result[1][23],
"default": {jio_key: gadget.state.jio_key, "default": {jio_key: gadget.state.jio_key,
result: gadget.state.doc.news}, result: gadget.state.doc},
"css_class": "", "css_class": "",
"required": 0, "required": 0,
"editable": 0, "editable": 0,
"url": "gadget_slapos_instance_tree_status.html", "url": "gadget_slapos_status.html",
"sandbox": "", "sandbox": "",
"key": "monitoring_status", "key": "monitoring_status",
"hidden": 0, "hidden": 0,
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>992.39464.63395.50176</string> </value> <value> <string>999.2068.62564.17</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1623227290.36</float> <float>1655115718.45</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
"default": {jio_key: value, "default": {jio_key: value,
result: news}, result: news},
key: "status", key: "status",
url: "gadget_slapos_network_status.html", url: "gadget_slapos_status.html",
title: "Status", title: "Status",
type: "GadgetField" type: "GadgetField"
} }
......
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>982.16656.9604.44475</string> </value> <value> <string>1000.2322.46712.16657</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1584111719.27</float> <float>1656703774.51</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
hidden: 0, hidden: 0,
"default": {jio_key: value, result: news}, "default": {jio_key: value, result: news},
key: "status", key: "status",
url: "gadget_slapos_project_status.html", url: "gadget_slapos_status.html",
title: "Status", title: "Status",
type: "GadgetField" type: "GadgetField"
} }
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>982.32516.46874.3959</string> </value> <value> <string>1000.2322.46712.16657</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1584107816.84</float> <float>1656975508.53</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
hidden: 0, hidden: 0,
"default": {jio_key: value_jio_key, result: value}, "default": {jio_key: value_jio_key, result: value},
key: "status", key: "status",
url: "gadget_slapos_compute_node_status.html", url: "gadget_slapos_status.html",
title: gadget.title_translation, title: gadget.title_translation,
type: "GadgetField" type: "GadgetField"
} }
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
hidden: 0, hidden: 0,
"default": {jio_key: value_jio_key, result: value}, "default": {jio_key: value_jio_key, result: value},
key: "status", key: "status",
url: "gadget_slapos_instance_tree_status.html", url: "gadget_slapos_status.html",
title: gadget.title_translation, title: gadget.title_translation,
type: "GadgetField" type: "GadgetField"
} }
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
hidden: 0, hidden: 0,
"default": {jio_key: value_jio_key, result: value}, "default": {jio_key: value_jio_key, result: value},
key: "status", key: "status",
url: "gadget_slapos_network_status.html", url: "gadget_slapos_status.html",
title: gadget.title_translation, title: gadget.title_translation,
type: "GadgetField" type: "GadgetField"
} }
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 0, "editable": 0,
"url": "gadget_slapos_project_status.html", "url": "gadget_slapos_status.html",
"sandbox": "", "sandbox": "",
"key": "monitoring_status", "key": "monitoring_status",
"hidden": 0, "hidden": 0,
......
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1000.20987.4444.10700</string> </value> <value> <string>1000.54051.30712.44322</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1652891827.46</float> <float>1655115677.76</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
hidden: 0, hidden: 0,
default: {jio_key: value, result: news}, default: {jio_key: value, result: news},
key: "status", key: "status",
url: "gadget_slapos_instance_tree_status.html", url: "gadget_slapos_status.html",
type: "GadgetField" type: "GadgetField"
} }
}; };
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>991.63523.46105.2850</string> </value> <value> <string>999.2068.62564.17</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1621432757.5</float> <float>1655115655.51</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
hidden: 0, hidden: 0,
default: { jio_key: value_jio_key, result: value }, default: { jio_key: value_jio_key, result: value },
key: 'status', key: 'status',
url: 'gadget_slapos_site_status.html', url: 'gadget_slapos_status.html',
title: 'Status', title: 'Status',
type: 'GadgetField' type: 'GadgetField'
} }
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>994.33249.63216.2816</string> </value> <value> <string>999.2068.62564.17</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1630552438.1</float> <float>1656975585.67</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
css_class: "", css_class: "",
description: gadget.description_translation, description: gadget.description_translation,
hidden: 0, hidden: 0,
"default": {jio_key: value_jio_key, result: value}, "default": {jio_key: value_jio_key, result: value, portal_type: "Compute Node"},
key: "status", key: "status",
url: "gadget_slapos_compute_node_status.html", url: "gadget_slapos_status.html",
title: gadget.title_translation, title: gadget.title_translation,
type: "GadgetField" type: "GadgetField"
} }
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 0, "editable": 0,
"url": "gadget_slapos_site_status.html", "url": "gadget_slapos_status.html",
"sandbox": "", "sandbox": "",
"key": "monitoring_status", "key": "monitoring_status",
"hidden": 0, "hidden": 0,
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.11773.24735.44390</string> </value> <value> <string>999.2068.62564.17</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602257151.8</float> <float>1654874891.91</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 0, "editable": 0,
"url": "gadget_slapos_installation_status.html", "url": "gadget_slapos_status.html",
"sandbox": "", "sandbox": "",
"key": "monitoring_status", "key": "monitoring_status",
"hidden": 0, "hidden": 0,
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.11768.7153.56183</string> </value> <value> <string>999.2068.62564.17</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602256822.25</float> <float>1655115861.91</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -162,11 +162,15 @@ ...@@ -162,11 +162,15 @@
"my_monitoring_status": { "my_monitoring_status": {
"description": "", "description": "",
"title": result[2][2], "title": result[2][2],
"default": {jio_key: gadget.state.jio_key}, "default": {
jio_key: gadget.state.jio_key,
result: gadget.state.doc.news,
portal_type: gadget.state.doc.portal_type
},
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 0, "editable": 0,
"url": "gadget_slapos_instance_status.html", "url": "gadget_slapos_status.html",
"sandbox": "", "sandbox": "",
"key": "monitoring_status", "key": "monitoring_status",
"hidden": gadget.state.doc.portal_type === "Slave Instance", "hidden": gadget.state.doc.portal_type === "Slave Instance",
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>986.45437.22132.61764</string> </value> <value> <string>1000.58063.29277.1706</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602256742.16</float> <float>1655115820.43</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
...@@ -26,7 +28,10 @@ ...@@ -26,7 +28,10 @@
.onEvent('submit', function () { .onEvent('submit', function () {
var gadget = this; var gadget = this;
return gadget.getDeclaredGadget('form_view') return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) { .push(function (form_gadget) {
return form_gadget.getContent(); return form_gadget.getContent();
}) })
...@@ -38,8 +43,12 @@ ...@@ -38,8 +43,12 @@
}); });
}) })
.push(function () { .push(function () {
// Workaround, find a way to open document without break gadget. return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
return gadget.redirect({"command": "change", "options": {"page": "slap_controller"}}); .push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
"options": {"page": "slap_controller"}});
});
}); });
}) })
...@@ -52,7 +61,9 @@ ...@@ -52,7 +61,9 @@
page_title_translation, page_title_translation,
translation_list = [ translation_list = [
"Parent Relative Url", "Parent Relative Url",
"Start Instance Tree:" "Start Instance Tree:",
"Service is Started."
]; ];
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
...@@ -65,6 +76,7 @@ ...@@ -65,6 +76,7 @@
.push(function (result) { .push(function (result) {
options.doc = result[1]; options.doc = result[1];
page_title_translation = result[2][1]; page_title_translation = result[2][1];
gadget.message_translation = result[2][2];
return result[0].render({ return result[0].render({
erp5_document: { erp5_document: {
"_embedded": {"_view": { "_embedded": {"_view": {
......
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.11753.9371.59426</string> </value> <value> <string>1001.45009.50995.61354</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602256083.33</float> <float>1658181254.36</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("updatePanel", "updatePanel") .declareAcquiredMethod("updatePanel", "updatePanel")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_post", "jio_post") .declareAcquiredMethod("jio_post", "jio_post")
...@@ -26,7 +28,10 @@ ...@@ -26,7 +28,10 @@
.onEvent('submit', function () { .onEvent('submit', function () {
var gadget = this; var gadget = this;
return gadget.getDeclaredGadget('form_view') return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) { .push(function (form_gadget) {
return form_gadget.getContent(); return form_gadget.getContent();
}) })
...@@ -38,8 +43,12 @@ ...@@ -38,8 +43,12 @@
}); });
}) })
.push(function () { .push(function () {
// Workaround, find a way to open document without break gadget. return gadget.notifySubmitted({message: gadget.message_translation, status: 'success'})
return gadget.redirect({"command": "change", "options": {"page": "slap_controller"}}); .push(function () {
// Workaround, find a way to open document without break gadget.
return gadget.redirect({"command": "change",
"options": {"page": "slap_controller"}});
});
}); });
}) })
...@@ -52,7 +61,9 @@ ...@@ -52,7 +61,9 @@
page_title_translation, page_title_translation,
translation_list = [ translation_list = [
"Parent Relative Url", "Parent Relative Url",
"Stop Instance Tree:" "Stop Instance Tree:",
"Service is Stopped."
]; ];
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
...@@ -65,6 +76,7 @@ ...@@ -65,6 +76,7 @@
.push(function (result) { .push(function (result) {
options.doc = result[1]; options.doc = result[1];
page_title_translation = result[2][1]; page_title_translation = result[2][1];
gadget.message_translation = result[2][2];
return result[0].render({ return result[0].render({
erp5_document: { erp5_document: {
"_embedded": {"_view": { "_embedded": {"_view": {
......
...@@ -279,7 +279,7 @@ ...@@ -279,7 +279,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.11752.29554.51882</string> </value> <value> <string>1001.45008.17324.2952</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1602255869.31</float> <float>1658207423.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1000.49354.9268.54869</string> </value> <value> <string>1000.49358.11392.5905</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1654593490.4</float> <float>1656976881.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
hidden: 0, hidden: 0,
"default": {jio_key: value_jio_key, result: value}, "default": {jio_key: value_jio_key, result: value},
key: "status", key: "status",
url: "gadget_slapos_site_status.html", url: "gadget_slapos_status.html",
title: "Status", title: "Status",
type: "GadgetField" type: "GadgetField"
} }
......
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1000.49340.48222.40550</string> </value> <value> <string>1000.49358.14576.324</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1654593493.33</float> <float>1656976814.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_slapos_compute_node_status.js"></script>
<link href="gadget_slapos_compute_node_status.css" rel="stylesheet" type="text/css"/>
<script id="inline-status-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >
<a class="ui-btn ui-btn-icon-left ui-icon-desktop" href={{monitor_url}} target=_blank> {{status_title}} </a></div></div>
<div class="ui-block-c" style="width:50%"><div class="ui-bar ui-corner-all last-child {{right_class}}" style="{{right_style}}">
<a class="ui-btn ui-btn-icon-left ui-icon-desktop" href="{{monitor_url}}" target=_blank> {{right_title}} </a></div></div>
</script>
<script id="loading-template" type="text/x-handlebars-template">
<button data-i18n="loading" type="submit" class="responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled" style="border:none;">loading</button>
</script>
</head>
<body>
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Compute Node </a>
</div>
</div>
<div class="ui-block-c" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Partitions </a>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>ERP5TypeTestCase</string>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_compute_node_status.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_compute_node_status_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884656.58</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Compute Node Status</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1502472194.78</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.58781.43824.3635</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1530120172.2</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1502472099.8</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*globals console, window, rJS, RSVP, loopEventListener, i18n, Handlebars, $*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
inline_status_source = gadget_klass.__template_element
.getElementById("inline-status-template")
.innerHTML,
inline_status_template = Handlebars.compile(inline_status_source);
function checkComputeNodeStatus(options) {
if (!options || !options.news || !options.news.text) {
return 'ui-btn-no-data';
}
if (options.news.text.startsWith("#access")) {
if (options.news.no_data_since_15_minutes) {
return 'ui-btn-error';
}
if (options.news.no_data_since_5_minutes) {
return 'ui-btn-warning';
}
return 'ui-btn-ok';
}
if (options.news.no_data) {
return 'ui-btn-no-data';
}
return 'ui-btn-error';
}
function checkComputePartitionStatus(options) {
var message,
compute_partition,
partition_class = 'ui-btn-ok',
error_amount = 0,
total_amount = 0;
if (!options || !options.compute_partition_news) {
return 'ui-btn-no-data';
}
for (compute_partition in options.compute_partition_news) {
if (options.compute_partition_news.hasOwnProperty(compute_partition) &&
options.compute_partition_news[compute_partition].text) {
message = options.compute_partition_news[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 === 0) {
return 'ui-btn-no-data';
}
if (error_amount === total_amount) {
// No need to continue the result will be a warnning
return 'ui-btn-error';
}
return partition_class;
}
function getStatus(gadget, result) {
var monitor_url,
status_class = 'ui-btn-no-data',
status_title = 'Compute Node',
right_title = 'Partitions',
right_class = 'ui-btn-no-data',
status_style = '',
right_style = '';
if (result && result.news && result.news.compute_node) {
status_class = checkComputeNodeStatus({news: result.news.compute_node});
}
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
if (result && result.news && result.news.partition) {
right_class = checkComputePartitionStatus(
{compute_partition_news: result.news.partition}
);
}
}
monitor_url = 'https://monitor.app.officejs.com/#/' +
'?page=ojsm_dispatch&query=portal_type%3A%22Software%20Instance%22%20' +
'AND%20aggregate_reference%3A%22' + result.reference + '%22';
gadget.element.innerHTML = inline_status_template({
monitor_url: monitor_url,
status_class: status_class,
status_title: status_title,
status_style: status_style,
right_class: right_class,
right_title: right_title,
right_style: right_style
});
return gadget;
}
function getStatusLoop(gadget) {
return new RSVP.Queue()
.push(function () {
return gadget.jio_get(gadget.options.value.jio_key);
})
.push(function (result) {
return getStatus(gadget, result);
});
}
gadget_klass
.ready(function (gadget) {
gadget.props = {};
return gadget.getSetting("hateoas_url")
.push(function (url) {
gadget.props.hateoas_url = url;
});
})
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareJob("getStatus", function (result) {
var gadget = this;
return getStatus(gadget, {news: result});
})
.onLoop(function () {
var gadget = this;
return getStatusLoop(gadget);
}, 300000)
.declareMethod("render", function (options) {
var gadget = this;
gadget.options = options;
gadget.flag = options.value.jio_key;
return gadget.getStatus(options.value.result);
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>ERP5TypeTestCase</string>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_compute_node_status.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_compute_node_status_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884656.64</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Compute Node Status JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1503589584.61</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.25610.31873.42666</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1568302726.92</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1503589449.87</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_slapos_installation_status.js"></script>
<link href="gadget_slapos_compute_node_status.css" rel="stylesheet" type="text/css"/>
<script id="inline-status-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >{{status_title}}</div></div>
<div class="ui-block-c" style="width:50%"><div class="ui-bar ui-corner-all last-child {{right_class}}" style="{{right_style}}">{{right_title}}</div></div>
</script>
<script id="loading-template" type="text/x-handlebars-template">
<button data-i18n="loading" type="submit" class="responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled" style="border:none;">loading</button>
</script>
</head>
<body>
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Installations </a>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_installation_status.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_installation_status_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884656.9</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Installation Status</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1509980695.62</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.58781.43824.3635</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1530120100.87</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1509980663.78</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*globals console, window, rJS, RSVP, loopEventListener, i18n, Handlebars, $*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
inline_status_source = gadget_klass.__template_element
.getElementById("inline-status-template")
.innerHTML,
inline_status_template = Handlebars.compile(inline_status_source);
function checkInstallationStatus(options) {
if ((!options) || (options && !options.news)) {
return 'ui-btn-no-data';
}
if (options.news.text.startsWith("#access")) {
return 'ui-btn-ok';
} else if (options.news.text.startsWith("#building")) {
return 'ui-btn-warning';
} else {
if (options.no_data) {
return 'ui-btn-no-data';
}
return 'ui-btn-error';
}
}
function getStatus(gadget) {
return new RSVP.Queue()
.push(function () {
return gadget.jio_get(gadget.options.value.jio_key);
})
.push(function (result) {
var status_class = 'ui-btn-no-data',
status_title = 'Installation',
status_style = "";
status_class = checkInstallationStatus(result);
if (status_class === 'ui-btn-no-data') {
status_style = "color: transparent !important;";
}
gadget.element.innerHTML = inline_status_template({
status_class: status_class,
status_title: status_title,
status_style: status_style
});
return gadget;
});
}
gadget_klass
.ready(function (gadget) {
gadget.props = {};
return gadget.getSetting("hateoas_url")
.push(function (url) {
gadget.props.hateoas_url = url;
});
})
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareJob("getStatus", function (result) {
var gadget = this,
status_class = 'ui-btn-no-data',
status_title = 'Installation',
status_style = "";
status_class = checkInstallationStatus({news: result});
if (status_class === 'ui-btn-no-data') {
status_style = "color: transparent !important;";
}
gadget.element.innerHTML = inline_status_template({
status_class: status_class,
status_title: status_title,
status_style: status_style
});
return gadget;
})
.onLoop(function () {
var gadget = this;
return getStatus(gadget);
}, 300000)
.declareMethod("render", function (options) {
var gadget = this;
gadget.options = options;
gadget.flag = options.value.jio_key;
return gadget.getStatus(options.value.result);
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_installation_status.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_installation_status_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884656.94</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Installation Status JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1509981097.66</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.38717.20279.51251</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1545928626.78</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1509981088.76</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_slapos_instance_status.js"></script>
<link href="gadget_slapos_compute_node_status.css" rel="stylesheet" type="text/css"/>
<script id="inline-status-no-link-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >{{status_title}}</div></div>
</script>
<script id="inline-status-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >
<a class="ui-btn ui-btn-icon-left ui-icon-desktop" href="{{monitor_url}}" target=_blank>{{status_title}}</a></div></div>
</script>
<script id="loading-template" type="text/x-handlebars-template">
<button data-i18n="loading" type="submit" class="responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled" style="border:none;">loading</button>
</script>
</head>
<body>
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Instance </a>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_instance_status.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_instance_status_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884657.03</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Instance Status</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510068888.36</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.32024.53732.34406</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1554213561.03</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510068868.36</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*globals console, window, rJS, RSVP, loopEventListener, i18n, Handlebars, $*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
inline_status_source = gadget_klass.__template_element
.getElementById("inline-status-template")
.innerHTML,
inline_status_template = Handlebars.compile(inline_status_source),
inline_status_no_link_source = gadget_klass.__template_element
.getElementById("inline-status-no-link-template")
.innerHTML,
inline_status_no_link_template = Handlebars
.compile(inline_status_no_link_source);
function checkInstanceStatus(options) {
if ((!options) || (options && !options.news)) {
return 'ui-btn-no-data';
}
if (options.news.text.startsWith("#access")) {
return 'ui-btn-ok';
} else {
if (options.news.no_data) {
return 'ui-btn-no-data';
}
else if (options.news.is_slave) {
return 'ui-btn-is-slave';
}
else if (options.news.is_stopped) {
return 'ui-btn-is-stopped';
}
else if (options.news.is_destroyed) {
return 'ui-btn-is-destroyed';
}
return 'ui-btn-error';
}
}
function getStatus(gadget, result) {
var status_class = 'ui-btn-no-data',
status_title = 'Instance',
status_style = "",
monitor_url,
template = inline_status_template;
monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type%3A%22Software%20Instance%22%20AND%20reference%3A%22' + result.reference + '%22';
status_class = checkInstanceStatus(result);
if (status_class === 'ui-btn-is-slave') {
status_class = 'ui-btn-no-data';
status_style = "color: white !important;";
status_title = 'Slave';
}
else if (status_class === 'ui-btn-is-stopped') {
status_class = 'ui-btn-no-data';
status_style = "color: white !important;";
status_title = 'Stopped';
}
else if (status_class === 'ui-btn-is-destroyed') {
status_class = 'ui-btn-no-data';
status_style = "color: white !important;";
status_title = 'Destroyed';
}
if (status_class === 'ui-btn-no-data') {
gadget.element.innerHTML = inline_status_no_link_template({
status_class: status_class,
status_title: status_title,
status_style: status_style
});
} else {
gadget.element.innerHTML = inline_status_template({
monitor_url: monitor_url,
status_class: status_class,
status_title: status_title,
status_style: status_style
});
}
return gadget;
}
function getStatusLoop(gadget) {
return new RSVP.Queue()
.push(function () {
return gadget.jio_get(gadget.options.value.jio_key);
})
.push(function (result) {
return getStatus(gadget, result);
});
}
gadget_klass
.ready(function (gadget) {
gadget.props = {};
return gadget.getSetting("hateoas_url")
.push(function (url) {
gadget.props.hateoas_url = url;
});
})
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareJob("getStatus", function (result) {
var gadget = this;
return getStatus(gadget, {news: result});
})
.onLoop(function () {
var gadget = this;
return getStatusLoop(gadget);
}, 300000)
.declareMethod("render", function (options) {
var gadget = this;
gadget.options = options;
gadget.flag = options.value.jio_key;
return gadget.getStatus(options.value.result);
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_instance_status.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_instance_status_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884657.06</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Instance Status JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510068986.88</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>superrafael</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.50363.35694.46455</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1554236784.11</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510068964.95</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_slapos_instance_tree_status.js"></script>
<link href="gadget_slapos_compute_node_status.css" rel="stylesheet" type="text/css"/>
<script id="inline-status-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >
<a class="ui-btn ui-btn-icon-left ui-icon-desktop" href="{{monitor_url}}" target=_blank> {{status_title}} </a></div></div>
</script>
<script id="inline-status-no-link-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >{{status_title}}</div></div>
</script>
<script id="loading-template" type="text/x-handlebars-template">
<button data-i18n="loading" type="submit" class="responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled" style="border:none;">loading</button>
</script>
</head>
<body>
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Instances </a>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_instance_tree_status.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_instance_tree_status_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884656.83</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Instance Tree Status</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510067718.74</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>superrafael</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>970.21496.17710.36488</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1554255222.31</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510067690.86</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*globals console, window, rJS, RSVP, loopEventListener, i18n, Handlebars, $*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
inline_status_source = gadget_klass.__template_element
.getElementById("inline-status-template")
.innerHTML,
inline_status_template = Handlebars.compile(inline_status_source),
inline_status_no_link_source = gadget_klass.__template_element
.getElementById("inline-status-no-link-template")
.innerHTML,
inline_status_no_link_template = Handlebars
.compile(inline_status_no_link_source);
function checkInstanceTreeStatus(options) {
var message,
instance,
partition_class = 'ui-btn-ok',
error_amount = 0,
total_amount = 0;
if ((!options) || (options && !options.instance)) {
return 'ui-btn-no-data';
}
if (options.is_slave) {
return 'ui-btn-is-slave';
}
else if (options.is_stopped) {
return 'ui-btn-is-stopped';
}
else if (options.is_destroyed) {
return 'ui-btn-is-destroyed';
}
for (instance in options.instance) {
message = options.instance[instance].text;
if (message.startsWith("#error")) {
partition_class = 'ui-btn-warning';
error_amount++;
}
total_amount++;
if ((error_amount > 0) && (error_amount < total_amount)) {
// No need to continue the result will be a warnning
return partition_class;
}
}
if (error_amount === total_amount) {
// No need to continue the result will be a warnning
return 'ui-btn-error';
}
return partition_class;
}
function getDoc(gadget) {
if (gadget.options.doc && gadget.options.doc !== undefined) {
return gadget.options.doc;
}
return gadget.jio_get(gadget.options.value.jio_key);
}
function getStatus(gadget, result) {
return new RSVP.Queue()
.push(function () {
return getDoc(gadget);
})
.push(function (jio_doc) {
var monitor_url,
connection_key,
status_class = 'ui-btn-no-data',
status_title = 'Instances',
status_style = "";
result = jio_doc;
status_class = checkInstanceTreeStatus(result.news);
// it should verify if the monitor-base-url is ready.
for (connection_key in result.connection_parameter_list) {
if (result.connection_parameter_list[connection_key].connection_key === "monitor-setup-url") {
monitor_url = result.connection_parameter_list[connection_key].connection_value;
}
}
if (monitor_url === "") {
monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type%3A%22Instance%20Tree%22%20AND%20title%3A' + result.title;
}
if (status_class === 'ui-btn-is-slave') {
status_class = 'ui-btn-no-data';
status_style = "color: white !important;";
status_title = 'Slave Only';
}
else if (status_class === 'ui-btn-is-stopped') {
status_class = 'ui-btn-no-data';
status_style = "color: white !important;";
status_title = 'Stopped';
}
else if (status_class === 'ui-btn-is-destroyed') {
status_class = 'ui-btn-no-data';
status_style = "color: white !important;";
status_title = 'Destroyed';
}
if (status_class === 'ui-btn-no-data') {
gadget.element.innerHTML = inline_status_no_link_template({
status_class: status_class,
status_title: status_title,
status_style: status_style
});
} else {
gadget.element.innerHTML = inline_status_template({
monitor_url: monitor_url,
status_class: status_class,
status_title: status_title,
status_style: status_style
});
}
return gadget;
}
);
}
function getStatusLoop(gadget) {
return new RSVP.Queue()
.push(function () {
return gadget.jio_get(gadget.options.value.jio_key);
})
.push(function (result) {
return getStatus(gadget, result);
});
}
gadget_klass
.setState({
has_monitor_info: false
})
.ready(function (gadget) {
gadget.props = {};
return gadget.getSetting("hateoas_url")
.push(function (url) {
gadget.props.hateoas_url = url;
});
})
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareJob("getStatus", function (result) {
var gadget = this;
return getStatus(gadget, {news: result});
})
.onLoop(function () {
var gadget = this;
return getStatusLoop(gadget);
}, 300000)
.declareMethod("render", function (options) {
var gadget = this;
gadget.options = options;
gadget.flag = options.value.jio_key;
return gadget.getStatus(options.value.result);
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_instance_tree_status.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_instance_tree_status_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884656.86</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Instance Tree Status JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510067801.81</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>superrafael</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.50748.25599.3686</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1554255778.44</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510067777.76</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_slapos_network_status.js"></script>
<link href="gadget_slapos_compute_node_status.css" rel="stylesheet" type="text/css"/>
<script id="inline-status-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >{{status_title}}</div></div>
<div class="ui-block-c" style="width:50%"><div class="ui-bar ui-corner-all last-child {{right_class}}" style="{{right_style}}">{{right_title}}</div></div>
</script>
<script id="loading-template" type="text/x-handlebars-template">
<button data-i18n="loading" type="submit" class="responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled" style="border:none;">loading</button>
</script>
</head>
<body>
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Compute Node </a>
</div>
</div>
<div class="ui-block-c" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Partitions </a>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_network_status.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_network_status_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884657.31</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Network Status</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510027167.54</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.58781.43824.3635</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1530120141.03</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510027148.47</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*globals console, window, rJS, RSVP, loopEventListener, i18n, Handlebars, $*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
inline_status_source = gadget_klass.__template_element
.getElementById("inline-status-template")
.innerHTML,
inline_status_template = Handlebars.compile(inline_status_source);
function checkComputeNodeStatus(options) {
if (!options) {
return 'ui-btn-no-data';
}
if (options.text.startsWith("#access")) {
if (options.no_data_since_15_minutes) {
return 'ui-btn-error';
}
if (options.no_data_since_5_minutes) {
return 'ui-btn-warning';
}
return 'ui-btn-ok';
} else {
if (options.no_data) {
return 'ui-btn-no-data';
}
return 'ui-btn-error';
}
}
function checkComputePartitionStatus(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) {
message = options[compute_partition].text;
if (message.startsWith("#error")) {
partition_class = 'ui-btn-warning';
error_amount++;
}
total_amount++;
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 checkNetworkStatus(options) {
var previous_status = "START",
status = 'ui-btn-no-data',
i;
for (i in options.news.compute_node) {
status = checkComputeNodeStatus(options.news.compute_node[i]);
if (previous_status === "START") {
previous_status = 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 checkNetworkPartitionStatus(options) {
var compute_node_reference,
status = 'ui-btn-no-data',
previous_status = "START";
for (compute_node_reference in options.news.partition) {
status = checkComputePartitionStatus(
options.news.partition[compute_node_reference]);
if (previous_status === "START") {
previous_status = status;
}
if (status === 'ui-btn-warning') {
// If status is warning, nothing after will change it.
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) {
var status_class = 'ui-btn-no-data',
status_title = 'Compute Node',
right_title = 'Partitions',
right_class = 'ui-btn-no-data';
status_class = checkNetworkStatus(result);
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
right_class = checkNetworkPartitionStatus(result);
}
gadget.element.innerHTML = inline_status_template({
status_class: status_class,
status_title: status_title,
right_class: right_class,
right_title: right_title
});
return gadget;
}
function getStatusLoop(gadget) {
return new RSVP.Queue()
.push(function () {
return gadget.jio_get(gadget.options.value.jio_key);
})
.push(function (result) {
return getStatus(gadget, result);
});
}
gadget_klass
.ready(function (gadget) {
gadget.props = {};
return gadget.getSetting("hateoas_url")
.push(function (url) {
gadget.props.hateoas_url = url;
});
})
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareJob("getStatus", function (result) {
var gadget = this;
return getStatus(gadget, {news: result});
})
.onLoop(function () {
var gadget = this;
return getStatusLoop(gadget);
}, 300000)
.declareMethod("render", function (options) {
var gadget = this;
gadget.options = options;
gadget.flag = options.value.jio_key;
return gadget.getStatus(options.value.result);
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_network_status.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_network_status_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884657.33</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Network Status JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510027216.38</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>974.62049.17150.785</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1555352227.27</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1510027196.68</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_slapos_project_status.js"></script>
<link href="gadget_slapos_compute_node_status.css" rel="stylesheet" type="text/css"/>
<script id="inline-status-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >
<a class="ui-btn ui-btn-icon-left ui-icon-desktop" href={{monitor_url}} target=_blank> {{status_title}} </a></div></div>
<div class="ui-block-c" style="width:50%"><div class="ui-bar ui-corner-all last-child {{right_class}}" style="{{right_style}}">
<a class="ui-btn ui-btn-icon-left ui-icon-desktop" href="{{monitor_url}}" target=_blank> {{right_title}} </a></div></div>
</script>
<script id="loading-template" type="text/x-handlebars-template">
<button data-i18n="loading" type="submit" class="responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled" style="border:none;">loading</button>
</script>
</head>
<body>
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Compute Node </a>
</div>
</div>
<div class="ui-block-c" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Partitions </a>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<list>
<string>Manager</string>
<string>Authenticated</string>
<string>Developer</string>
<string>Owner</string>
</list>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_project_status.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_project_status_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884657.52</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Project Status</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1513177217.87</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>966.58781.43824.3635</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1530120154.6</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1513176618.65</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*globals console, window, rJS, RSVP, loopEventListener, i18n, Handlebars, $*/
/*jslint indent: 2, nomen: true, maxlen: 90*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
inline_status_source = gadget_klass.__template_element
.getElementById("inline-status-template")
.innerHTML,
inline_status_template = Handlebars.compile(inline_status_source);
function checkComputeNodeStatus(options) {
if (!options || !options.text) {
return 'ui-btn-no-data';
}
if (options.text.startsWith("#access")) {
if (options.no_data_since_15_minutes) {
return 'ui-btn-error';
}
if (options.no_data_since_5_minutes) {
return 'ui-btn-warning';
}
return 'ui-btn-ok';
}
if (options.no_data) {
return 'ui-btn-no-data';
}
return 'ui-btn-error';
}
function checkComputePartitionStatus(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 checkProjectStatus(options) {
var previous_status = "START",
status = 'ui-btn-no-data',
i;
if (!options || !options.news || !options.news.compute_node) {
return status;
}
for (i in options.news.compute_node) {
if (options.news.compute_node.hasOwnProperty(i)) {
status = checkComputeNodeStatus(options.news.compute_node[i]);
if (previous_status === "START") {
previous_status = 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 checkProjectPartitionStatus(options) {
var compute_node_reference,
status = 'ui-btn-no-data',
previous_status = "START";
for (compute_node_reference in options.news.partition) {
if (options.news.partition.hasOwnProperty(compute_node_reference)) {
status = checkComputePartitionStatus(
options.news.partition[compute_node_reference]
);
if (previous_status === "START") {
previous_status = status;
}
if (status === 'ui-btn-warning') {
// If status is warning, nothing after will change it.
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) {
var monitor_url,
status_class = 'ui-btn-no-data',
status_title = 'Compute Node',
right_title = 'Partitions',
right_class = 'ui-btn-no-data',
status_style = '',
right_style = '';
status_class = checkProjectStatus(result);
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
right_class = checkProjectPartitionStatus(result);
}
monitor_url = gadget.props.hateoas_url +
gadget.options.value.jio_key + '/Base_redirectToMonitor';
gadget.element.innerHTML = inline_status_template({
monitor_url: monitor_url,
status_class: status_class,
status_title: status_title,
status_style: status_style,
right_class: right_class,
right_title: right_title,
right_style: right_style
});
return gadget;
}
function getStatusLoop(gadget) {
return new RSVP.Queue()
.push(function () {
return gadget.jio_get(gadget.options.value.jio_key);
})
.push(function (result) {
return getStatus(gadget, result);
});
}
gadget_klass
.ready(function (gadget) {
gadget.props = {};
return gadget.getSetting("hateoas_url")
.push(function (url) {
gadget.props.hateoas_url = url;
});
})
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareJob("getStatus", function (result) {
var gadget = this;
return getStatus(gadget, {news: result});
})
.onLoop(function () {
var gadget = this;
return getStatusLoop(gadget);
}, 300000)
.declareMethod("render", function (options) {
var gadget = this;
gadget.options = options;
gadget.flag = options.value.jio_key;
return gadget.getStatus(options.value.result);
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>creators</string> </key>
<value>
<tuple>
<string>zope</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_project_status.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_project_status_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1523884657.55</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SlapOS Project Status JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1513177043.03</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>978.25609.22500.25258</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1568302679.29</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1513176618.6</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_slapos_site_status.js"></script>
<link href="gadget_slapos_compute_node_status.css" rel="stylesheet" type="text/css"/>
<script id="inline-status-template" type="text/x-handlebars-template">
<div class="ui-block-a" style="width:50%"><div class="ui-bar ui-corner-all first-child {{status_class}}" style="{{status_style}}" >
<a class="ui-btn ui-btn-icon-left ui-icon-desktop" href={{monitor_url}} target=_blank> {{status_title}} </a></div></div>
<div class="ui-block-c" style="width:50%"><div class="ui-bar ui-corner-all last-child {{right_class}}" style="{{right_style}}">
<a class="ui-btn ui-btn-icon-left ui-icon-desktop" href="{{monitor_url}}" target=_blank> {{right_title}} </a></div></div>
</script>
<script id="loading-template" type="text/x-handlebars-template">
<button data-i18n="loading" type="submit" class="responsive ui-btn ui-icon-spinner ui-icon-spin ui-btn-icon-center ui-disabled" style="border:none;">loading</button>
</script>
</head>
<body>
<div class="ui-block-a" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Compute Node </a>
</div>
</div>
<div class="ui-block-c" style="width:50%">
<div class="ui-bar ui-corner-all first-child ui-btn-no-data">
<a class="ui-btn ui-btn-icon-left ui-icon-spinner" style="color: white !important;"> Partitions </a>
</div>
</div>
</body>
</html>
\ No newline at end of file
/*globals console, window, rJS, RSVP, loopEventListener, i18n, Handlebars, $*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
inline_status_source = gadget_klass.__template_element
.getElementById("inline-status-template")
.innerHTML,
inline_status_template = Handlebars.compile(inline_status_source);
function checkComputeNodeStatus(options) {
if (!options) {
return 'ui-btn-no-data';
}
if (options.text.startsWith("#access")) {
if (options.no_data_since_15_minutes) {
return 'ui-btn-error';
}
if (options.no_data_since_5_minutes) {
return 'ui-btn-warning';
}
return 'ui-btn-ok';
} else {
if (options.no_data) {
return 'ui-btn-no-data';
}
return 'ui-btn-error';
}
}
function checkComputePartitionStatus(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) {
message = options[compute_partition].text;
if (message.startsWith("#error")) {
partition_class = 'ui-btn-warning';
error_amount++;
}
total_amount++;
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 checkSiteStatus(options) {
var previous_status = "START",
status = 'ui-btn-no-data',
i;
for (i in options.news.compute_node) {
status = checkComputeNodeStatus(options.news.compute_node[i]);
if (previous_status === "START") {
previous_status = 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 checkSitePartitionStatus(options) {
var compute_node_reference,
status = 'ui-btn-no-data',
previous_status = "START";
for (compute_node_reference in options.news.partition) {
status = checkComputePartitionStatus(
options.news.partition[compute_node_reference]);
if (previous_status === "START") {
previous_status = status;
}
if (status === 'ui-btn-warning') {
// If status is warning, nothing after will change it.
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) {
var monitor_url,
status_class = 'ui-btn-no-data',
status_title = 'Compute Node',
right_title = 'Partitions',
right_class = 'ui-btn-no-data',
status_style = '',
right_style = '';
status_class = checkSiteStatus(result);
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
right_class = checkSitePartitionStatus(result);
}
monitor_url = gadget.props.hateoas_url + gadget.options.value.jio_key + '/Base_redirectToMonitor';
gadget.element.innerHTML = inline_status_template({
monitor_url: monitor_url,
status_class: status_class,
status_title: status_title,
status_style: status_style,
right_class: right_class,
right_title: right_title,
right_style: right_style
});
return gadget;
}
function getStatusLoop(gadget) {
return new RSVP.Queue()
.push(function () {
return gadget.jio_get(gadget.options.value.jio_key);
})
.push(function (result) {
return getStatus(gadget, result);
});
}
gadget_klass
.ready(function (gadget) {
gadget.props = {};
return gadget.getSetting("hateoas_url")
.push(function (url) {
gadget.props.hateoas_url = url;
});
})
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareMethod("getContent", function () {
return {};
})
.declareJob("getStatus", function (result) {
var gadget = this;
return getStatus(gadget, {news: result});
})
.onLoop(function () {
var gadget = this;
return getStatusLoop(gadget);
}, 300000)
.declareMethod("render", function (options) {
var gadget = this;
gadget.options = options;
gadget.flag = options.value.jio_key;
return gadget.getStatus(options.value.result);
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
...@@ -16,6 +16,18 @@ ...@@ -16,6 +16,18 @@
clear: left; clear: left;
} }
.ui-block-50 {
width: 50%;
}
.ui-btn-color-white {
color: white !important;
}
.ui-btn-hide {
display: none;
}
.ui-bar { .ui-bar {
position: relative; position: relative;
padding: .4em 1em; padding: .4em 1em;
......
...@@ -71,11 +71,13 @@ ...@@ -71,11 +71,13 @@
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
<value> <string>text/css</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_compute_node_status.css</string> </value> <value> <string>gadget_slapos_status.css</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -85,7 +87,7 @@ ...@@ -85,7 +87,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_compute_node_status_css</string> </value> <value> <string>rjs_gadget_slapos_status_css</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -103,7 +105,7 @@ ...@@ -103,7 +105,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Gadget SlapOS Compute Node Status</string> </value> <value> <string>Gadget SlapOS Status</string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
...@@ -240,7 +242,7 @@ ...@@ -240,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>992.39464.63395.50176</string> </value> <value> <string>1000.57958.38485.23927</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +260,7 @@ ...@@ -258,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1623147492.18</float> <float>1655110268.61</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="domsugar.js"></script>
<script src="gadget_slapos_status.js"></script>
<link href="gadget_slapos_status.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="ui-block-a ui-block-50 main-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"> Compute Node </a>
</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>
</html>
\ No newline at end of file
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_site_status.html</string> </value> <value> <string>gadget_slapos_status.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_site_status_html</string> </value> <value> <string>rjs_gadget_slapos_status_html</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Gadget SlapOS Site Status</string> </value> <value> <string>Gadget SlapOS Status</string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>966.58781.43824.3635</string> </value> <value> <string>1000.54034.1029.62310</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -296,7 +296,7 @@ ...@@ -296,7 +296,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1530120162.62</float> <float>1656702663.09</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*globals console, window, rJS, i18n, domsugar*/
/*jslint indent: 2, nomen: true, maxlen: 80*/
(function (window, rJS, domsugar) {
"use strict";
var gadget_klass = rJS(window);
function getInstanceStatus(options) {
if ((!options) || (options && !options.text)) {
return 'ui-btn-no-data';
}
if (options.text.startsWith("#access")) {
return 'ui-btn-ok';
}
if (options.no_data) {
return 'ui-btn-no-data';
}
if (options.is_slave) {
return 'ui-btn-is-slave';
}
if (options.is_stopped) {
return 'ui-btn-is-stopped';
}
if (options.is_destroyed) {
return 'ui-btn-is-destroyed';
}
return 'ui-btn-error';
}
function getInstanceTreeStatus(options) {
var instance;
if ((!options) || (options && !options.instance)) {
return 'ui-btn-no-data';
}
if (options.is_slave) {
return 'ui-btn-is-slave';
}
if (options.is_stopped) {
return 'ui-btn-is-stopped';
}
if (options.is_destroyed) {
return 'ui-btn-is-destroyed';
}
for (instance in options.instance) {
if (options.instance.hasOwnProperty(instance)) {
if (options.instance[instance].text.startsWith("#error")) {
return 'ui-btn-error';
}
}
}
return 'ui-btn-ok';
}
function getComputeNodeStatus(options) {
if (!options || !options.text) {
return 'ui-btn-no-data';
}
if (options.text.startsWith("#access")) {
if (options.no_data_since_15_minutes) {
return 'ui-btn-error';
}
if (options.no_data_since_5_minutes) {
return 'ui-btn-warning';
}
return 'ui-btn-ok';
}
if (options.no_data) {
return 'ui-btn-no-data';
}
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) {
if ((!options) || (options && !options.text)) {
return 'ui-btn-no-data';
}
if (options.text.startsWith("#access")) {
return 'ui-btn-ok';
}
if (options.text.startsWith("#building")) {
return 'ui-btn-is-building';
}
if (options.no_data) {
return 'ui-btn-no-data';
}
return 'ui-btn-error';
}
function getComputeNodeStatusList(options) {
var previous_status = "START",
status = 'ui-btn-no-data',
i;
if (!options || !options.compute_node) {
return status;
}
for (i in options.compute_node) {
if (options.compute_node.hasOwnProperty(i)) {
status = getComputeNodeStatus(options.compute_node[i]);
if (previous_status === "START") {
previous_status = status;
}
if (previous_status !== status) {
if ((previous_status === 'ui-btn-error') &&
(status === 'ui-btn-ok')) {
// XXX drop warning
return 'ui-btn-warning';
}
if ((status === 'ui-btn-error') &&
(previous_status === 'ui-btn-ok')) {
// XXX drop warning
return 'ui-btn-warning';
}
if (status === 'ui-btn-no-data') {
status = previous_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) {
var i, status_class = 'ui-btn-no-data',
right_class = 'ui-btn-no-data',
main_status_div = gadget.element.querySelector(".main-status"),
sub_status_div = gadget.element.querySelector(".sub-status"),
monitor_url = '',
main_link_configuration_dict = {
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) {
monitor_url = result.monitor_url
}
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 = 'Compute Node';
sub_link_configuration_dict.href = monitor_url;
sub_link_configuration_dict.target = "_target";
sub_link_configuration_dict.text = 'Partitions';
if (result && result.news && result.news.compute_node) {
status_class = getComputeNodeStatus(result.news.compute_node);
}
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
if (result && result.news && result.news.partition) {
right_class = getComputePartitionStatus(
{compute_partition_news: result.news.partition}
);
}
}
} else if (result && result.portal_type &&
result.portal_type === "Software Installation") {
if (result && result.news) {
status_class = getSoftwareInstallationStatus(result.news);
}
main_link_configuration_dict.text = "Installation";
right_class = "ui-btn-hide";
if (status_class === "ui-btn-is-building") {
main_link_configuration_dict.text = "Building";
status_class = "ui-btn-no-data";
} else if (status_class === "ui-btn-ok") {
main_link_configuration_dict.text = "Available";
} else if (status_class === "ui-btn-error") {
main_link_configuration_dict.text = "Error";
}
} else if (result && result.portal_type && (
result.portal_type === "Software Instance" ||
result.portal_type === "Slave Instance"
)) {
status_class = getInstanceStatus(result);
right_class = "ui-btn-hide";
if (status_class === 'ui-btn-is-slave') {
status_class = 'ui-btn-no-data ui-btn-color-white';
main_link_configuration_dict.text = 'Slave';
} else if (status_class === 'ui-btn-is-stopped') {
status_class = 'ui-btn-no-data ui-btn-color-white';
main_link_configuration_dict.text = 'Stopped';
} else if (status_class === 'ui-btn-is-destroyed') {
status_class = 'ui-btn-no-data ui-btn-color-white';
main_link_configuration_dict.text = 'Destroyed';
} else {
main_link_configuration_dict.href = monitor_url;
main_link_configuration_dict.target = "_target";
main_link_configuration_dict.text = 'Instance';
}
} else if (result && result.portal_type &&
result.portal_type === "Instance Tree") {
if (result && result.news) {
status_class = getInstanceTreeStatus(result.news);
}
// it should verify if the monitor-base-url is ready.
right_class = "ui-btn-hide";
if (status_class === 'ui-btn-is-slave') {
status_class = 'ui-btn-no-data ui-btn-color-white';
main_link_configuration_dict.text = 'Slave Only';
} else if (status_class === 'ui-btn-is-stopped') {
status_class = 'ui-btn-no-data ui-btn-color-white';
main_link_configuration_dict.text = 'Stopped';
} else if (status_class === 'ui-btn-is-destroyed') {
status_class = 'ui-btn-no-data ui-btn-color-white';
main_link_configuration_dict.text = 'Destroyed';
} else {
main_link_configuration_dict.href = monitor_url;
main_link_configuration_dict.target = "_target";
main_link_configuration_dict.text = 'Instance';
}
} else {
main_link_configuration_dict.href = monitor_url;
main_link_configuration_dict.target = "_target";
main_link_configuration_dict.text = 'Compute Node';
sub_link_configuration_dict.href = monitor_url;
sub_link_configuration_dict.target = "_target";
sub_link_configuration_dict.text = 'Partitions';
status_class = getComputeNodeStatusList(result.news);
if ((status_class === 'ui-btn-error') ||
(status_class === 'ui-btn-no-data')) {
right_class = status_class;
} else {
right_class = getComputePartitionStatusList(result.news);
}
}
domsugar(main_status_div.querySelector('div'),
{
class: "ui-bar ui-corner-all first-child " + status_class
}, [
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)
]);
return gadget;
}
gadget_klass
.declareAcquiredMethod("jio_get", "jio_get")
.declareMethod("getContent", function () {
return {};
})
.onLoop(function () {
var gadget = this;
if (gadget.state.jio_key) {
return gadget.jio_get(gadget.state.jio_key)
.push(function (result) {
var state_dict = result.news || {};
state_dict.jio_key = gadget.state.jio_key;
return gadget.changeState(state_dict);
});
}
}, 300000)
.onStateChange(function () {
return getStatus(this, this.state);
})
.declareMethod("render", function (options) {
// Save will force the gadget to be updated so
// result is empty.
var state_dict = options.value.result || {};
state_dict.jio_key = options.value.jio_key;
state_dict.portal_type = options.value.portal_type;
return this.changeState(state_dict);
});
}(window, rJS, domsugar));
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_slapos_site_status.js</string> </value> <value> <string>gadget_slapos_status.js</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>rjs_gadget_slapos_site_status_js</string> </value> <value> <string>rjs_gadget_slapos_status_js</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Gadget SlapOS Site Status JS</string> </value> <value> <string>Gadget SlapOS Status JS</string> </value>
</item> </item>
<item> <item>
<key> <string>version</string> </key> <key> <string>version</string> </key>
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.62049.17150.785</string> </value> <value> <string>1001.50668.64434.580</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1555352069.34</float> <float>1658520198.62</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,4 +10,7 @@ for compute_node in compute_node_list: ...@@ -10,4 +10,7 @@ for compute_node in compute_node_list:
compute_partition_dict[compute_node.getReference()] = news_dict["partition"] compute_partition_dict[compute_node.getReference()] = news_dict["partition"]
return {"compute_node": compute_node_dict, return {"compute_node": compute_node_dict,
"partition": compute_partition_dict} "partition": compute_partition_dict,
"reference": context.getReference(),
"portal_type": context.getPortalType(),
"monitor_url": context.Base_getStatusMonitorUrl()}
base_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND '
if context.getPortalType() == "Organisation":
compute_node_reference = ",".join([ '"' + i.getReference() + '"' for i in context.Organisation_getComputeNodeTrackingList()])
return base_url + "aggregate_reference:(%s)" % compute_node_reference
if context.getPortalType() == "Project":
compute_node_reference = ",".join([ '"' + i.getReference() + '"' for i in context.Project_getComputeNodeTrackingList()])
return base_url + "aggregate_reference:(%s)" % compute_node_reference
if context.getPortalType() == "Computer Network":
compute_node_reference = ",".join([ '"' + i.getReference() + '"' for i in context.getSubordinationRelatedValueList(portal_type="Compute Node")])
return base_url + "aggregate_reference:(%s)" % compute_node_reference
if context.getPortalType() == "Instance Tree":
for connection_parameter in context.InstanceTree_getConnectionParameterList():
if connection_parameter['connection_key'] == "monitor-setup-url":
return context.REQUEST.RESPONSE.redirect(connection_parameter['connection_key'])
base_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Instance Tree" AND '
return base_url + "title:(%s)" % context.getTitle()
if context.getPortalType() in ["Software Instance", "Slave Instance"]:
return base_url + "reference:%s" % context.getReference()
if context.getPortalType() == "Compute Node":
return base_url + "aggregate_reference:%s" % context.getReference()
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Base_redirectToMonitor</string> </value> <value> <string>Base_getStatusMonitorUrl</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
base_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND '
if context.getPortalType() == "Organisation":
compute_node_reference = ",".join([ '"' + i.getReference() + '"' for i in context.Organisation_getComputeNodeTrackingList()])
return context.REQUEST.RESPONSE.redirect(base_url + "aggregate_reference:(%s)" % compute_node_reference)
if context.getPortalType() == "Project":
compute_node_reference = ",".join([ '"' + i.getReference() + '"' for i in context.Project_getComputeNodeTrackingList()])
return context.REQUEST.RESPONSE.redirect(base_url + "aggregate_reference:(%s)" % compute_node_reference)
...@@ -11,7 +11,10 @@ def get_compute_partition_dict(reference): ...@@ -11,7 +11,10 @@ def get_compute_partition_dict(reference):
compute_partition_dict[compute_partition.getTitle()] = software_instance.getAccessStatus() compute_partition_dict[compute_partition.getTitle()] = software_instance.getAccessStatus()
return {"compute_node": compute_node_dict, return {"compute_node": compute_node_dict,
"partition": compute_partition_dict} "partition": compute_partition_dict,
"portal_type": compute_node_dict['portal_type'],
"reference": compute_node_dict['reference'],
"monitor_url": context.Base_getStatusMonitorUrl()}
# Use Cache here, at least transactional one. # Use Cache here, at least transactional one.
return get_compute_partition_dict(context.getReference()) return get_compute_partition_dict(context.getReference())
portal = context.getPortalObject()
return portal.portal_catalog(
portal_type="Compute Node",
validation_state="validated",
subordination__uid=context.getUid(),
default_strict_allocation_scope_uid="!=%s" % portal.portal_categories.allocation_scope.close.forever.getUid()
)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<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>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputerNetwork_getComputeNodeList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
import json import json
return json.dumps(len(context.ComputerNetwork_getComputeNodeList()))
return json.dumps(len(context.getSubordinationRelatedList(portal_type="Compute Node")))
news_dict = {"instance" : []} news_dict = {"instance" : []}
news_dict = {
"portal_type": context.getPortalType(),
"reference": context.getReference(),
"title": context.getTitle(),
"monitor_url": context.Base_getStatusMonitorUrl(),
"instance" : []}
if context.getSlapState() == 'stop_requested': if context.getSlapState() == 'stop_requested':
news_dict["is_stopped"] = 1 news_dict["is_stopped"] = 1
...@@ -8,5 +14,5 @@ elif context.getRootSlave(): ...@@ -8,5 +14,5 @@ elif context.getRootSlave():
news_dict["is_slave"] = 1 news_dict["is_slave"] = 1
else: else:
news_dict["instance"] = [instance.SoftwareInstance_getNewsDict() for instance in context.getSpecialiseRelatedValueList(portal_type="Software Instance")] news_dict["instance"] = [instance.SoftwareInstance_getNewsDict() for instance in context.getSpecialiseRelatedValueList(portal_type="Software Instance")]
return news_dict return news_dict
import json import json
kw = {"node_uid": context.getUid(), return json.dumps(len(context.Organisation_getComputeNodeTrackingList()))
"at_date": DateTime(),
"limit": 1}
return json.dumps(len(context.portal_simulation.getCurrentTrackingList(**kw)))
# This script might not be efficient to a large quantities of
# Compute Nodes
from DateTime import DateTime
import json import json
kw = {"project_uid": context.getUid(), return json.dumps(len(context.Project_getComputeNodeTrackingList()))
"at_date": DateTime(),
"limit": 1}
return json.dumps(len(context.portal_simulation.getCurrentTrackingList(**kw)))
...@@ -7,6 +7,7 @@ if portal_type == "Slave Instance": ...@@ -7,6 +7,7 @@ if portal_type == "Slave Instance":
return { return {
"user": "SlapOS Master", "user": "SlapOS Master",
"text": "#nodata is a slave %s" % context.getReference(), "text": "#nodata is a slave %s" % context.getReference(),
"monitor_url": context.Base_getStatusMonitorUrl(),
"is_slave": 1 "is_slave": 1
} }
...@@ -15,6 +16,7 @@ if portal_type == "Software Instance" and slap_state == "stop_requested": ...@@ -15,6 +16,7 @@ if portal_type == "Software Instance" and slap_state == "stop_requested":
return { return {
"user": "SlapOS Master", "user": "SlapOS Master",
"text": "#nodata is an stopped instance %s" % context.getReference(), "text": "#nodata is an stopped instance %s" % context.getReference(),
"monitor_url": context.Base_getStatusMonitorUrl(),
"is_stopped": 1 "is_stopped": 1
} }
...@@ -22,7 +24,10 @@ if portal_type == "Software Instance" and slap_state == "destroy_requested": ...@@ -22,7 +24,10 @@ if portal_type == "Software Instance" and slap_state == "destroy_requested":
return { return {
"user": "SlapOS Master", "user": "SlapOS Master",
"text": "#nodata is an destroyed instance %s" % context.getReference(), "text": "#nodata is an destroyed instance %s" % context.getReference(),
"monitor_url": context.Base_getStatusMonitorUrl(),
"is_destroyed": 1 "is_destroyed": 1
} }
return context.getAccessStatus() news_dict = context.getAccessStatus()
news_dict["monitor_url"] = context.Base_getStatusMonitorUrl()
return news_dict
...@@ -28,6 +28,10 @@ from Products.ERP5Type.Cache import DEFAULT_CACHE_SCOPE ...@@ -28,6 +28,10 @@ from Products.ERP5Type.Cache import DEFAULT_CACHE_SCOPE
from DateTime import DateTime from DateTime import DateTime
import json import json
def _decode_with_json(value):
# Ensure value is serisalisable as json
return json.loads(json.dumps(value))
def fakeStopRequestedSlapState(): def fakeStopRequestedSlapState():
return "stop_requested" return "stop_requested"
...@@ -56,7 +60,9 @@ class TestSlapOSHalJsonStyleMixin(SlapOSTestCaseMixinWithAbort): ...@@ -56,7 +60,9 @@ class TestSlapOSHalJsonStyleMixin(SlapOSTestCaseMixinWithAbort):
'created_at': '%s' % self.created_at, 'created_at': '%s' % self.created_at,
'text': '%s' % text, 'text': '%s' % text,
'since': '%s' % self.created_at, 'since': '%s' % self.created_at,
'state': state 'state': state,
'reference': document.getReference(),
'portal_type': document.getPortalType()
}) })
cache_duration = document._getAccessStatusCacheFactory().cache_duration cache_duration = document._getAccessStatusCacheFactory().cache_duration
document._getAccessStatusPlugin().set(document._getAccessStatusCacheKey(), document._getAccessStatusPlugin().set(document._getAccessStatusCacheKey(),
...@@ -151,37 +157,57 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -151,37 +157,57 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin):
def test(self): def test(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
news_dict = instance_tree.InstanceTree_getNewsDict() news_dict = instance_tree.InstanceTree_getNewsDict()
expected_news_dict = {'instance': []} expected_news_dict = {
self.assertEqual(news_dict, expected_news_dict) 'instance': [],
# Ensure it don't raise error when converting to JSON 'portal_type': instance_tree.getPortalType(),
json.dumps(news_dict) 'reference': instance_tree.getReference(),
'title': instance_tree.getTitle(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Instance Tree" AND title:(Template Instance Tree)'
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_slave(self): def test_slave(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
instance_tree.setRootSlave(1) instance_tree.setRootSlave(1)
news_dict = instance_tree.InstanceTree_getNewsDict() news_dict = instance_tree.InstanceTree_getNewsDict()
expected_news_dict = {'instance': [], 'is_slave': 1} expected_news_dict = {'instance': [],
self.assertEqual(news_dict, expected_news_dict) 'portal_type': instance_tree.getPortalType(),
# Ensure it don't raise error when converting to JSON 'reference': instance_tree.getReference(),
json.dumps(news_dict) 'title': instance_tree.getTitle(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Instance Tree" AND title:(Template Instance Tree)',
'is_slave': 1
}
self.assertEqual(news_dict,
_decode_with_json(expected_news_dict))
def test_stopped(self): def test_stopped(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
instance_tree.getSlapState = fakeStopRequestedSlapState instance_tree.getSlapState = fakeStopRequestedSlapState
news_dict = instance_tree.InstanceTree_getNewsDict() news_dict = instance_tree.InstanceTree_getNewsDict()
expected_news_dict = {'instance': [], 'is_stopped': 1} expected_news_dict = {'instance': [],
self.assertEqual(news_dict, expected_news_dict) 'portal_type': instance_tree.getPortalType(),
# Ensure it don't raise error when converting to JSON 'reference': instance_tree.getReference(),
json.dumps(news_dict) 'title': instance_tree.getTitle(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Instance Tree" AND title:(Template Instance Tree)',
'is_stopped': 1
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_destroyed(self): def test_destroyed(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
instance_tree.getSlapState = fakeDestroyRequestedSlapState instance_tree.getSlapState = fakeDestroyRequestedSlapState
news_dict = instance_tree.InstanceTree_getNewsDict() news_dict = instance_tree.InstanceTree_getNewsDict()
expected_news_dict = {'instance': [], 'is_destroyed': 1} expected_news_dict = {'instance': [],
self.assertEqual(news_dict, expected_news_dict) 'portal_type': instance_tree.getPortalType(),
# Ensure it don't raise error when converting to JSON 'reference': instance_tree.getReference(),
json.dumps(news_dict) 'title': instance_tree.getTitle(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Instance Tree" AND title:(Template Instance Tree)',
'is_destroyed': 1
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_with_instance(self): def test_with_instance(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
...@@ -190,15 +216,25 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -190,15 +216,25 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin):
self.tic() self.tic()
self.changeSkin('Hal') self.changeSkin('Hal')
news_dict = instance_tree.InstanceTree_getNewsDict() news_dict = instance_tree.InstanceTree_getNewsDict()
expected_news_dict = {'instance': [{'created_at': self.created_at, expected_news_dict = {
'portal_type': instance_tree.getPortalType(),
'reference': instance_tree.getReference(),
'title': instance_tree.getTitle(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Instance Tree" AND title:(Template Instance Tree)',
'instance': [{'created_at': self.created_at,
'no_data': 1, 'no_data': 1,
'portal_type': instance.getPortalType(),
'reference': instance.getReference(),
'since': self.created_at, 'since': self.created_at,
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND reference:%s' % (
instance.getReference()
),
'state': '', 'state': '',
'text': '#error no data found for %s' % instance.getReference(), 'text': '#error no data found for %s' % instance.getReference(),
'user': 'SlapOS Master'}]} 'user': 'SlapOS Master'}]
self.assertEqual(news_dict, expected_news_dict) }
# Ensure it don't raise error when converting to JSON self.assertEqual(_decode_with_json(news_dict),
json.dumps(news_dict) _decode_with_json(expected_news_dict))
def test_with_slave_instance(self): def test_with_slave_instance(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
...@@ -207,10 +243,15 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -207,10 +243,15 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin):
self.tic() self.tic()
self.changeSkin('Hal') self.changeSkin('Hal')
news_dict = instance_tree.InstanceTree_getNewsDict() news_dict = instance_tree.InstanceTree_getNewsDict()
expected_news_dict = {'instance': []} expected_news_dict = {
self.assertEqual(news_dict, expected_news_dict) 'portal_type': instance_tree.getPortalType(),
# Ensure it don't raise error when converting to JSON 'reference': instance_tree.getReference(),
json.dumps(news_dict) 'title': instance_tree.getTitle(),
'instance': [],
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Instance Tree" AND title:(Template Instance Tree)'
}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_with_two_instance(self): def test_with_two_instance(self):
instance_tree = self._makeInstanceTree() instance_tree = self._makeInstanceTree()
...@@ -222,21 +263,37 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -222,21 +263,37 @@ class TestInstanceTree_getNewsDict(TestSlapOSHalJsonStyleMixin):
self.tic() self.tic()
self.changeSkin('Hal') self.changeSkin('Hal')
news_dict = instance_tree.InstanceTree_getNewsDict() news_dict = instance_tree.InstanceTree_getNewsDict()
expected_news_dict = {'instance': [{'created_at': self.created_at, expected_news_dict = {
'no_data': 1, 'portal_type': instance_tree.getPortalType(),
'since': self.created_at, 'reference': instance_tree.getReference(),
'state': '', 'title': instance_tree.getTitle(),
'text': '#error no data found for %s' % instance0.getReference(), 'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Instance Tree" AND title:(Template Instance Tree)',
'user': 'SlapOS Master'}, 'instance': [
{'created_at': self.created_at, {'created_at': self.created_at,
'no_data': 1, 'no_data': 1,
'since': self.created_at, 'portal_type': instance0.getPortalType(),
'state': '', 'reference': instance0.getReference(),
'text': '#error no data found for %s' % instance.getReference(), 'since': self.created_at,
'user': 'SlapOS Master'}]} 'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND reference:%s' % (
self.assertEqual(news_dict["instance"], expected_news_dict["instance"]) instance0.getReference()
# Ensure it don't raise error when converting to JSON ),
json.dumps(news_dict) 'state': '',
'text': '#error no data found for %s' % instance0.getReference(),
'user': 'SlapOS Master'},
{'created_at': self.created_at,
'no_data': 1,
'portal_type': instance.getPortalType(),
'reference': instance.getReference(),
'since': self.created_at,
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND reference:%s' % (
instance.getReference()
),
'state': '',
'text': '#error no data found for %s' % instance.getReference(),
'user': 'SlapOS Master'}]}
self.assertEqual(_decode_with_json(news_dict["instance"]),
_decode_with_json(expected_news_dict["instance"]))
class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin): class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
...@@ -245,15 +302,19 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -245,15 +302,19 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
self._logFakeAccess(instance) self._logFakeAccess(instance)
news_dict = instance.SoftwareInstance_getNewsDict() news_dict = instance.SoftwareInstance_getNewsDict()
expected_news_dict = {'created_at': self.created_at, expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'since': self.created_at, 'portal_type': instance.getPortalType(),
'state': 'start_requested', 'reference': instance.getReference(),
'text': '#access OK', 'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND reference:%s' % (
'user': 'SlapOS Master'} instance.getReference()
self.assertEqual(news_dict, expected_news_dict) ),
# Ensure it don't raise error when converting to JSON 'since': self.created_at,
json.dumps(news_dict) 'state': 'start_requested',
'text': '#access OK',
'user': 'SlapOS Master'}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
def test_no_data(self): def test_no_data(self):
...@@ -263,49 +324,68 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -263,49 +324,68 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
news_dict = instance.SoftwareInstance_getNewsDict() news_dict = instance.SoftwareInstance_getNewsDict()
expected_news_dict = {'created_at': self.created_at, expected_news_dict = {'created_at': self.created_at,
'no_data': 1, 'no_data': 1,
'portal_type': instance.getPortalType(),
'reference': instance.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': '', 'state': '',
'text': '#error no data found for %s' % instance.getReference(), 'text': '#error no data found for %s' % instance.getReference(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND reference:%s' % (
instance.getReference()
),
'user': 'SlapOS Master'} 'user': 'SlapOS Master'}
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON self.assertEqual(_decode_with_json(news_dict),
json.dumps(news_dict) _decode_with_json(expected_news_dict))
def test_slave(self): def test_slave(self):
instance = self._makeSlaveInstance() instance = self._makeSlaveInstance()
news_dict = instance.SoftwareInstance_getNewsDict() news_dict = instance.SoftwareInstance_getNewsDict()
expected_news_dict = {'is_slave': 1, expected_news_dict = {
'portal_type': instance.getPortalType(),
'reference': instance.getReference(),
'is_slave': 1,
'text': '#nodata is a slave %s' % instance.getReference(), 'text': '#nodata is a slave %s' % instance.getReference(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND reference:%s' % (
instance.getReference()
),
'user': 'SlapOS Master'} 'user': 'SlapOS Master'}
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_stopped(self): def test_stopped(self):
instance = self._makeInstance() instance = self._makeInstance()
instance.getSlapState = fakeStopRequestedSlapState instance.getSlapState = fakeStopRequestedSlapState
news_dict = instance.SoftwareInstance_getNewsDict() news_dict = instance.SoftwareInstance_getNewsDict()
expected_news_dict = { expected_news_dict = {
"portal_type": instance.getPortalType(),
"reference": instance.getReference(),
"user": "SlapOS Master", "user": "SlapOS Master",
"text": "#nodata is an stopped instance %s" % instance.getReference(), "text": "#nodata is an stopped instance %s" % instance.getReference(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND reference:%s' % (
instance.getReference()
),
"is_stopped": 1 "is_stopped": 1
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_destroyed(self): def test_destroyed(self):
instance = self._makeInstance() instance = self._makeInstance()
instance.getSlapState = fakeDestroyRequestedSlapState instance.getSlapState = fakeDestroyRequestedSlapState
news_dict = instance.SoftwareInstance_getNewsDict() news_dict = instance.SoftwareInstance_getNewsDict()
expected_news_dict = { expected_news_dict = {
"portal_type": instance.getPortalType(),
"reference": instance.getReference(),
"user": "SlapOS Master", "user": "SlapOS Master",
"text": "#nodata is an destroyed instance %s" % instance.getReference(), "text": "#nodata is an destroyed instance %s" % instance.getReference(),
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND reference:%s' % (
instance.getReference()
),
"is_destroyed": 1 "is_destroyed": 1
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin): class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
def test(self): def test(self):
...@@ -315,13 +395,15 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -315,13 +395,15 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict = {'created_at': self.created_at, expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': installation.getPortalType(),
'reference': installation.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': 'start_requested', 'state': 'start_requested',
'text': '#access OK', 'text': '#access OK',
'user': 'SlapOS Master'} 'user': 'SlapOS Master'}
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_stopped(self): def test_stopped(self):
installation = self._makeSoftwareInstallation() installation = self._makeSoftwareInstallation()
...@@ -333,13 +415,15 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -333,13 +415,15 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict = {'created_at': self.created_at, expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': installation.getPortalType(),
'reference': installation.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': 'stop_requested', 'state': 'stop_requested',
'text': '#access OK', 'text': '#access OK',
'user': 'SlapOS Master'} 'user': 'SlapOS Master'}
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_destroyed(self): def test_destroyed(self):
installation = self._makeSoftwareInstallation() installation = self._makeSoftwareInstallation()
...@@ -351,26 +435,31 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -351,26 +435,31 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict = {'created_at': self.created_at, expected_news_dict = {'created_at': self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': installation.getPortalType(),
'reference': installation.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': 'destroy_requested', 'state': 'destroy_requested',
'text': '#access OK', 'text': '#access OK',
'user': 'SlapOS Master'} 'user': 'SlapOS Master'}
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_no_data(self): def test_no_data(self):
installation = self._makeSoftwareInstallation() installation = self._makeSoftwareInstallation()
news_dict = installation.SoftwareInstallation_getNewsDict() news_dict = installation.SoftwareInstallation_getNewsDict()
expected_news_dict = {'created_at': self.created_at, expected_news_dict = {'created_at': self.created_at,
'no_data': 1, 'no_data': 1,
'portal_type': installation.getPortalType(),
'reference': installation.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': '', 'state': '',
'text': '#error no data found for %s' % installation.getReference(), 'text': '#error no data found for %s' % installation.getReference(),
'user': 'SlapOS Master'} 'user': 'SlapOS Master'
self.assertEqual(news_dict, expected_news_dict) }
# Ensure it don't raise error when converting to JSON self.assertEqual(_decode_with_json(news_dict),
json.dumps(news_dict) _decode_with_json(expected_news_dict))
class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin): class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...@@ -378,19 +467,24 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -378,19 +467,24 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
compute_node = self._makeComputeNode() compute_node = self._makeComputeNode()
self._logFakeAccess(compute_node) self._logFakeAccess(compute_node)
news_dict = compute_node.ComputeNode_getNewsDict() news_dict = compute_node.ComputeNode_getNewsDict()
monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s' % (compute_node.getReference())
expected_news_dict = {'compute_node': expected_news_dict = {'compute_node':
{'created_at': self.created_at, {'created_at': self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': 'start_requested', 'state': 'start_requested',
'text': '#access OK', 'text': '#access OK',
'user': 'SlapOS Master'}, 'user': 'SlapOS Master'},
'partition': {} 'partition': {},
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'monitor_url': monitor_url
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_stopped(self): def test_stopped(self):
compute_node = self._makeComputeNode() compute_node = self._makeComputeNode()
...@@ -398,20 +492,25 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -398,20 +492,25 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
state='stop_requested') state='stop_requested')
news_dict = compute_node.ComputeNode_getNewsDict() news_dict = compute_node.ComputeNode_getNewsDict()
compute_node.getSlapState = fakeStopRequestedSlapState compute_node.getSlapState = fakeStopRequestedSlapState
monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s' % (compute_node.getReference())
expected_news_dict = {'compute_node': expected_news_dict = {'compute_node':
{'created_at': self.created_at, {'created_at': self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': 'stop_requested', 'state': 'stop_requested',
'text': '#access OK', 'text': '#access OK',
'user': 'SlapOS Master'}, 'user': 'SlapOS Master'},
'partition': {} 'partition': {},
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'monitor_url': monitor_url
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_destroyed(self): def test_destroyed(self):
compute_node = self._makeComputeNode() compute_node = self._makeComputeNode()
...@@ -419,41 +518,52 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -419,41 +518,52 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
state='destroy_requested') state='destroy_requested')
news_dict = compute_node.ComputeNode_getNewsDict() news_dict = compute_node.ComputeNode_getNewsDict()
compute_node.getSlapState = fakeDestroyRequestedSlapState compute_node.getSlapState = fakeDestroyRequestedSlapState
monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s' % (compute_node.getReference())
expected_news_dict = {'compute_node': expected_news_dict = {'compute_node':
{'created_at': self.created_at, {'created_at': self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': 'destroy_requested', 'state': 'destroy_requested',
'text': '#access OK', 'text': '#access OK',
'user': 'SlapOS Master'}, 'user': 'SlapOS Master'},
'partition': {} 'partition': {},
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'monitor_url': monitor_url
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_no_data(self): def test_no_data(self):
compute_node = self._makeComputeNode() compute_node = self._makeComputeNode()
news_dict = compute_node.ComputeNode_getNewsDict() news_dict = compute_node.ComputeNode_getNewsDict()
monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s' % (compute_node.getReference())
expected_news_dict = {'compute_node': expected_news_dict = {'compute_node':
{'created_at': self.created_at, {'created_at': self.created_at,
'no_data': 1, 'no_data': 1,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': '', 'state': '',
'text': '#error no data found for %s' % compute_node.getReference(), 'text': '#error no data found for %s' % compute_node.getReference(),
'user': 'SlapOS Master'}, 'user': 'SlapOS Master'},
'partition': {} 'partition': {},
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'monitor_url': monitor_url
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_with_instance(self): def test_with_instance(self):
compute_node = self._makeComputeNode() compute_node = self._makeComputeNode()
instance = self._makeInstance() instance = self._makeInstance()
instance.setAggregateValue(compute_node.slappart0) instance.setAggregateValue(compute_node.slappart0)
monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s' % (compute_node.getReference())
self.tic() self.tic()
self._logFakeAccess(compute_node) self._logFakeAccess(compute_node)
...@@ -462,20 +572,26 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -462,20 +572,26 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
{u'created_at': u'%s' % self.created_at, {u'created_at': u'%s' % self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
u'since': u'%s' % self.created_at, u'since': u'%s' % self.created_at,
u'state': u'start_requested', u'state': u'start_requested',
u'text': u'#access OK', u'text': u'#access OK',
u'user': u'SlapOS Master'}, u'user': u'SlapOS Master'},
'partition': {'slappart0': {'created_at': self.created_at, 'partition': {'slappart0': {'created_at': self.created_at,
'no_data': 1, 'no_data': 1,
'portal_type': instance.getPortalType(),
'reference': instance.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': '', 'state': '',
'text': '#error no data found for %s' % (instance.getReference()), 'text': '#error no data found for %s' % (instance.getReference()),
'user': 'SlapOS Master'}} 'user': 'SlapOS Master'}},
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
'monitor_url': monitor_url
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin): class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin):
...@@ -494,14 +610,23 @@ class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -494,14 +610,23 @@ class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin):
{u'created_at': u'%s' % self.created_at, {u'created_at': u'%s' % self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
u'since': u'%s' % self.created_at, u'since': u'%s' % self.created_at,
u'state': u'start_requested', u'state': u'start_requested',
u'text': u'#access OK', u'text': u'#access OK',
u'user': u'SlapOS Master'}}, u'user': u'SlapOS Master'}},
'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:("%s")' % (
compute_node.getReference()
),
'portal_type': network.getPortalType(),
'reference': network.getReference(),
'partition': 'partition':
{ compute_node.getReference(): { compute_node.getReference():
{'slappart0': {'created_at': self.created_at, {'slappart0': {'created_at': self.created_at,
'no_data': 1, 'no_data': 1,
'portal_type': instance.getPortalType(),
'reference': instance.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': '', 'state': '',
'text': '#error no data found for %s' % (instance.getReference()), 'text': '#error no data found for %s' % (instance.getReference()),
...@@ -511,17 +636,20 @@ class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -511,17 +636,20 @@ class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin):
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_no_data(self): def test_no_data(self):
network = self._makeComputerNetwork() network = self._makeComputerNetwork()
news_dict = network.ComputerNetwork_getNewsDict() news_dict = network.ComputerNetwork_getNewsDict()
expected_news_dict = {'compute_node': {}, 'partition': {}} expected_news_dict = {
self.assertEqual(news_dict, expected_news_dict) 'compute_node': {},
# Ensure it don't raise error when converting to JSON 'partition': {},
json.dumps(news_dict) 'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:()',
'portal_type': network.getPortalType(),
'reference': network.getReference()}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
class TestOrganisation_getNewsDict(TestSlapOSHalJsonStyleMixin): class TestOrganisation_getNewsDict(TestSlapOSHalJsonStyleMixin):
...@@ -537,39 +665,52 @@ class TestOrganisation_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -537,39 +665,52 @@ class TestOrganisation_getNewsDict(TestSlapOSHalJsonStyleMixin):
self.tic() self.tic()
self._logFakeAccess(compute_node) self._logFakeAccess(compute_node)
news_dict = organisation.Organisation_getNewsDict() news_dict = organisation.Organisation_getNewsDict()
expected_news_dict = {'compute_node': expected_news_dict = {
{ compute_node.getReference(): 'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:("%s")' % (
{u'created_at': u'%s' % self.created_at, compute_node.getReference()
'no_data_since_15_minutes': 0, ),
'no_data_since_5_minutes': 0, 'portal_type': 'Organisation',
u'since': u'%s' % self.created_at, 'reference': organisation.getReference(),
u'state': u'start_requested', 'compute_node':
u'text': u'#access OK', { compute_node.getReference():
u'user': u'SlapOS Master'}}, {u'created_at': u'%s' % self.created_at,
'partition': 'no_data_since_15_minutes': 0,
{ compute_node.getReference(): 'no_data_since_5_minutes': 0,
{'slappart0': {'created_at': self.created_at, 'portal_type': compute_node.getPortalType(),
'no_data': 1, 'reference': compute_node.getReference(),
'since': self.created_at, u'since': u'%s' % self.created_at,
'state': '', u'state': u'start_requested',
'text': '#error no data found for %s' % (instance.getReference()), u'text': u'#access OK',
'user': 'SlapOS Master'} u'user': u'SlapOS Master'}},
} 'partition':
} { compute_node.getReference():
} {'slappart0': {'created_at': self.created_at,
'no_data': 1,
'portal_type': instance.getPortalType(),
'reference': instance.getReference(),
'since': self.created_at,
'state': '',
'text': '#error no data found for %s' % (instance.getReference()),
'user': 'SlapOS Master'}
}
}
}
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_no_data(self): def test_no_data(self):
organisation = self._makeOrganisation() organisation = self._makeOrganisation()
news_dict = organisation.Organisation_getNewsDict() news_dict = organisation.Organisation_getNewsDict()
expected_news_dict = {'compute_node': {}, 'partition': {}} expected_news_dict = {
self.assertEqual(news_dict, expected_news_dict) 'compute_node': {},
# Ensure it don't raise error when converting to JSON 'partition': {},
json.dumps(news_dict) 'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:()',
'portal_type': 'Organisation',
'reference': organisation.getReference()}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin): class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin):
...@@ -585,11 +726,20 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -585,11 +726,20 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin):
self.tic() self.tic()
self._logFakeAccess(compute_node) self._logFakeAccess(compute_node)
news_dict = project.Project_getNewsDict() news_dict = project.Project_getNewsDict()
expected_news_dict = {'compute_node': monitor_url = 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:("%s")' % (
compute_node.getReference()
)
expected_news_dict = {
'monitor_url': monitor_url,
'portal_type': 'Project',
'reference': project.getReference(),
'compute_node':
{ compute_node.getReference(): { compute_node.getReference():
{u'created_at': u'%s' % self.created_at, {u'created_at': u'%s' % self.created_at,
'no_data_since_15_minutes': 0, 'no_data_since_15_minutes': 0,
'no_data_since_5_minutes': 0, 'no_data_since_5_minutes': 0,
'portal_type': compute_node.getPortalType(),
'reference': compute_node.getReference(),
u'since': u'%s' % self.created_at, u'since': u'%s' % self.created_at,
u'state': u'start_requested', u'state': u'start_requested',
u'text': u'#access OK', u'text': u'#access OK',
...@@ -598,6 +748,8 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -598,6 +748,8 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin):
{ compute_node.getReference(): { compute_node.getReference():
{'slappart0': {'created_at': self.created_at, {'slappart0': {'created_at': self.created_at,
'no_data': 1, 'no_data': 1,
'portal_type': instance.getPortalType(),
'reference': instance.getReference(),
'since': self.created_at, 'since': self.created_at,
'state': '', 'state': '',
'text': '#error no data found for %s' % (instance.getReference()), 'text': '#error no data found for %s' % (instance.getReference()),
...@@ -607,17 +759,21 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin): ...@@ -607,17 +759,21 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin):
} }
self.assertEqual(news_dict, expected_news_dict) self.assertEqual(_decode_with_json(news_dict),
# Ensure it don't raise error when converting to JSON _decode_with_json(expected_news_dict))
json.dumps(news_dict)
def test_no_data(self): def test_no_data(self):
project = self._makeProject() project = self._makeProject()
news_dict = project.Project_getNewsDict() news_dict = project.Project_getNewsDict()
expected_news_dict = {'compute_node': {}, 'partition': {}} expected_news_dict = {
self.assertEqual(news_dict, expected_news_dict) 'compute_node': {},
# Ensure it don't raise error when converting to JSON 'partition': {},
json.dumps(news_dict) 'monitor_url': 'https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:()',
'portal_type': 'Project',
'reference': project.getReference()}
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
class TestPerson_newLogin(TestSlapOSHalJsonStyleMixin): class TestPerson_newLogin(TestSlapOSHalJsonStyleMixin):
def test_Person_newLogin_as_superuser(self): def test_Person_newLogin_as_superuser(self):
...@@ -819,10 +975,18 @@ class TestComputerNetwork_hasComputeNode(TestSlapOSHalJsonStyleMixin): ...@@ -819,10 +975,18 @@ class TestComputerNetwork_hasComputeNode(TestSlapOSHalJsonStyleMixin):
compute_node = self._makeComputeNode() compute_node = self._makeComputeNode()
compute_node.setSubordinationValue(network) compute_node.setSubordinationValue(network)
compute_node.setAllocationScopeValue(
self.portal.portal_categories.allocation_scope.open.public)
self.tic() self.tic()
self.changeSkin("Hal") self.changeSkin("Hal")
self.assertEqual(json.loads(network.ComputerNetwork_hasComputeNode()), 1) self.assertEqual(json.loads(network.ComputerNetwork_hasComputeNode()), 1)
compute_node.setAllocationScopeValue(
self.portal.portal_categories.allocation_scope.close.forever)
self.tic()
self.changeSkin("Hal")
self.assertEqual(json.loads(network.ComputerNetwork_hasComputeNode()), 0)
class TestBase_getCredentialToken(TestSlapOSHalJsonStyleMixin): class TestBase_getCredentialToken(TestSlapOSHalJsonStyleMixin):
......
...@@ -165,35 +165,23 @@ web_page_module/rjs_gadget_slapos_alert_listbox_field_js ...@@ -165,35 +165,23 @@ web_page_module/rjs_gadget_slapos_alert_listbox_field_js
web_page_module/rjs_gadget_slapos_appcache web_page_module/rjs_gadget_slapos_appcache
web_page_module/rjs_gadget_slapos_compute_node_map_html web_page_module/rjs_gadget_slapos_compute_node_map_html
web_page_module/rjs_gadget_slapos_compute_node_map_js web_page_module/rjs_gadget_slapos_compute_node_map_js
web_page_module/rjs_gadget_slapos_compute_node_status_css web_page_module/rjs_gadget_slapos_status_css
web_page_module/rjs_gadget_slapos_compute_node_status_html
web_page_module/rjs_gadget_slapos_compute_node_status_js
web_page_module/rjs_gadget_slapos_event_discussion_entry_css web_page_module/rjs_gadget_slapos_event_discussion_entry_css
web_page_module/rjs_gadget_slapos_event_discussion_entry_html web_page_module/rjs_gadget_slapos_event_discussion_entry_html
web_page_module/rjs_gadget_slapos_event_discussion_entry_js web_page_module/rjs_gadget_slapos_event_discussion_entry_js
web_page_module/rjs_gadget_slapos_header_html web_page_module/rjs_gadget_slapos_header_html
web_page_module/rjs_gadget_slapos_header_js web_page_module/rjs_gadget_slapos_header_js
web_page_module/rjs_gadget_slapos_instance_tree_status_html
web_page_module/rjs_gadget_slapos_instance_tree_status_js
web_page_module/rjs_gadget_slapos_installation_status_html
web_page_module/rjs_gadget_slapos_installation_status_js
web_page_module/rjs_gadget_slapos_instance_status_html
web_page_module/rjs_gadget_slapos_instance_status_js
web_page_module/rjs_gadget_slapos_invoice_printout_html web_page_module/rjs_gadget_slapos_invoice_printout_html
web_page_module/rjs_gadget_slapos_invoice_printout_js web_page_module/rjs_gadget_slapos_invoice_printout_js
web_page_module/rjs_gadget_slapos_invoice_state_html web_page_module/rjs_gadget_slapos_invoice_state_html
web_page_module/rjs_gadget_slapos_invoice_state_js web_page_module/rjs_gadget_slapos_invoice_state_js
web_page_module/rjs_gadget_slapos_label_listbox_field_html web_page_module/rjs_gadget_slapos_label_listbox_field_html
web_page_module/rjs_gadget_slapos_label_listbox_field_js web_page_module/rjs_gadget_slapos_label_listbox_field_js
web_page_module/rjs_gadget_slapos_network_status_html
web_page_module/rjs_gadget_slapos_network_status_js
web_page_module/rjs_gadget_slapos_panel_html web_page_module/rjs_gadget_slapos_panel_html
web_page_module/rjs_gadget_slapos_panel_js web_page_module/rjs_gadget_slapos_panel_js
web_page_module/rjs_gadget_slapos_payment_result_js** web_page_module/rjs_gadget_slapos_payment_result_js**
web_page_module/rjs_gadget_slapos_project_status_html web_page_module/rjs_gadget_slapos_status_html
web_page_module/rjs_gadget_slapos_project_status_js web_page_module/rjs_gadget_slapos_status_js
web_page_module/rjs_gadget_slapos_site_status_html
web_page_module/rjs_gadget_slapos_site_status_js
web_page_module/rjs_gadget_slapos_translation_data_js web_page_module/rjs_gadget_slapos_translation_data_js
web_page_module/rjs_gadget_slapos_translation_html web_page_module/rjs_gadget_slapos_translation_html
web_page_module/rjs_gadget_slapos_utils_js web_page_module/rjs_gadget_slapos_utils_js
......
...@@ -171,20 +171,11 @@ web_page_module/rjs_gadget_slapos_annotated_helper_js ...@@ -171,20 +171,11 @@ web_page_module/rjs_gadget_slapos_annotated_helper_js
web_page_module/rjs_gadget_slapos_appcache web_page_module/rjs_gadget_slapos_appcache
web_page_module/rjs_gadget_slapos_compute_node_map_html web_page_module/rjs_gadget_slapos_compute_node_map_html
web_page_module/rjs_gadget_slapos_compute_node_map_js web_page_module/rjs_gadget_slapos_compute_node_map_js
web_page_module/rjs_gadget_slapos_compute_node_status_css
web_page_module/rjs_gadget_slapos_compute_node_status_html
web_page_module/rjs_gadget_slapos_compute_node_status_js
web_page_module/rjs_gadget_slapos_event_discussion_entry_css web_page_module/rjs_gadget_slapos_event_discussion_entry_css
web_page_module/rjs_gadget_slapos_event_discussion_entry_html web_page_module/rjs_gadget_slapos_event_discussion_entry_html
web_page_module/rjs_gadget_slapos_event_discussion_entry_js web_page_module/rjs_gadget_slapos_event_discussion_entry_js
web_page_module/rjs_gadget_slapos_header_html web_page_module/rjs_gadget_slapos_header_html
web_page_module/rjs_gadget_slapos_header_js web_page_module/rjs_gadget_slapos_header_js
web_page_module/rjs_gadget_slapos_installation_status_html
web_page_module/rjs_gadget_slapos_installation_status_js
web_page_module/rjs_gadget_slapos_instance_status_html
web_page_module/rjs_gadget_slapos_instance_status_js
web_page_module/rjs_gadget_slapos_instance_tree_status_html
web_page_module/rjs_gadget_slapos_instance_tree_status_js
web_page_module/rjs_gadget_slapos_invoice_printout_html web_page_module/rjs_gadget_slapos_invoice_printout_html
web_page_module/rjs_gadget_slapos_invoice_printout_js web_page_module/rjs_gadget_slapos_invoice_printout_js
web_page_module/rjs_gadget_slapos_invoice_state_html web_page_module/rjs_gadget_slapos_invoice_state_html
...@@ -192,15 +183,12 @@ web_page_module/rjs_gadget_slapos_invoice_state_js ...@@ -192,15 +183,12 @@ web_page_module/rjs_gadget_slapos_invoice_state_js
web_page_module/rjs_gadget_slapos_label_listbox_field_html web_page_module/rjs_gadget_slapos_label_listbox_field_html
web_page_module/rjs_gadget_slapos_label_listbox_field_js web_page_module/rjs_gadget_slapos_label_listbox_field_js
web_page_module/rjs_gadget_slapos_login_page_css web_page_module/rjs_gadget_slapos_login_page_css
web_page_module/rjs_gadget_slapos_network_status_html
web_page_module/rjs_gadget_slapos_network_status_js
web_page_module/rjs_gadget_slapos_panel_html web_page_module/rjs_gadget_slapos_panel_html
web_page_module/rjs_gadget_slapos_panel_js web_page_module/rjs_gadget_slapos_panel_js
web_page_module/rjs_gadget_slapos_payment_result_js** web_page_module/rjs_gadget_slapos_payment_result_js**
web_page_module/rjs_gadget_slapos_project_status_html web_page_module/rjs_gadget_slapos_status_css
web_page_module/rjs_gadget_slapos_project_status_js web_page_module/rjs_gadget_slapos_status_html
web_page_module/rjs_gadget_slapos_site_status_html web_page_module/rjs_gadget_slapos_status_js
web_page_module/rjs_gadget_slapos_site_status_js
web_page_module/rjs_gadget_slapos_translation_data_js web_page_module/rjs_gadget_slapos_translation_data_js
web_page_module/rjs_gadget_slapos_translation_html web_page_module/rjs_gadget_slapos_translation_html
web_page_module/rjs_gadget_slapos_utils_js web_page_module/rjs_gadget_slapos_utils_js
......
...@@ -11,7 +11,7 @@ from AccessControl.SecurityManagement import newSecurityManager ...@@ -11,7 +11,7 @@ from AccessControl.SecurityManagement import newSecurityManager
import xml_marshaller import xml_marshaller
def ComputeNode_simulateSlapgridCP(self, instance_connection_dict=None, def ComputeNode_simulateSlapgridInstance(self, instance_connection_dict=None,
slave_connection_dict=None): slave_connection_dict=None):
if slave_connection_dict is None: if slave_connection_dict is None:
...@@ -73,6 +73,30 @@ def ComputeNode_simulateSlapgridCP(self, instance_connection_dict=None, ...@@ -73,6 +73,30 @@ def ComputeNode_simulateSlapgridCP(self, instance_connection_dict=None,
finally: finally:
setSecurityManager(sm) setSecurityManager(sm)
def ComputeNode_simulateSlapgridSoftware(self):
sm = getSecurityManager()
portal = self.getPortalObject()
compute_node_user_id = self.getUserId()
try:
newSecurityManager(None, portal.acl_users.getUserById(compute_node_user_id))
compute_node_xml = portal.portal_slap.getFullComputerInformation(
computer_id=self.getReference())
if not isinstance(compute_node_xml, str):
compute_node_xml = compute_node_xml.getBody()
slap_compute_node = xml_marshaller.xml_marshaller.loads(compute_node_xml)
assert 'Computer' == slap_compute_node.__class__.__name__
for software_release in slap_compute_node._software_release_list:
if software_release._requested_state == 'destroyed':
portal.portal_slap.destroyedSoftwareRelease(
software_release._software_release,
self.getReference())
else:
portal.portal_slap.availableSoftwareRelease(
software_release._software_release,
self.getReference())
finally:
setSecurityManager(sm)
def ComputeNode_simulateSlapgridFormat(self, partition_count=10): def ComputeNode_simulateSlapgridFormat(self, partition_count=10):
portal = self.getPortalObject() portal = self.getPortalObject()
......
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>SlapOSUiTest</string> </value> <value> <string>SlapOSUiTest</string> </value>
...@@ -55,28 +49,13 @@ ...@@ -55,28 +49,13 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -89,7 +68,7 @@ ...@@ -89,7 +68,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -98,7 +77,7 @@ ...@@ -98,7 +77,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
......
...@@ -64,6 +64,40 @@ ...@@ -64,6 +64,40 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tal:block define="menu_item python: 'Networks'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK 1"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK 1"]</td>
<td></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK 1"]</td>
<td></td>
</tr>
<tal:block define="menu_item python: 'Networks'; header menu_item"> <tal:block define="menu_item python: 'Networks'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
...@@ -95,6 +129,108 @@ ...@@ -95,6 +129,108 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block> </tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK-COMPUTER 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Compute Node: ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK-COMPUTER 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td colspan="3"><b> Update Allocation Scope</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@id="allocation_scope"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@id="allocation_scope"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@id="allocation_scope"]</td>
<td tal:content="python: '%s' % (here.Base_translateString('Closed forever', lang=lang))"></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tr>
<td colspan="3"><b> Delete Network </b></td>
</tr>
<tal:block define="menu_item python: 'Networks'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK 1"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK 1"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-NETWORK 1"]</td>
<td></td>
</tr>
<tal:block tal:define="delete_configuration python: {'header_title': 'Delete Network: ${title}', <tal:block tal:define="delete_configuration python: {'header_title': 'Delete Network: ${title}',
'notification_text': 'Network is Deleted.'}; 'notification_text': 'Network is Deleted.'};
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK 1'})"> dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-NETWORK 1'})">
...@@ -119,4 +255,4 @@ ...@@ -119,4 +255,4 @@
</table> </table>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -30,15 +30,9 @@ ...@@ -30,15 +30,9 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" />
<!-- check site --> <tal:block define="document_title python: 'TEST-SLAPOSJS-PROJECT-COMPUTER 0';">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/create_simple_compute_node" />
<!-- Broken history to return </tal:block>
<tr>
<td>click</td>
<td>//a[@data-i18n="Project : TEST-SLAPOSJS-PROJECT 0"]</td>
<td></td>
</tr>
-->
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
...@@ -91,6 +85,223 @@ ...@@ -91,6 +85,223 @@
<td>TEST-SLAPOSJS-PROJECT DESCRIPTION</td> <td>TEST-SLAPOSJS-PROJECT DESCRIPTION</td>
</tr> </tr>
<tr>
<td rowspan="1" colspan="3">Add server into the project</td>
</tr>
<tal:block define="menu_item python: 'Servers'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT-COMPUTER 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Compute Node: ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-PROJECT-COMPUTER 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td colspan="3"><b tal:content="python: 'Transfer Compute Node to a Project'"> Menu Item </b></td>
</tr>
<tal:block tal:define="menu_action python: 'Transfer'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block define="header python: 'Transfer Compute Node'; ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="destination_project"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="destination_project"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="destination_project"]</td>
<td>TEST-SLAPOSJS-PROJECT 0</td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Compute Node is transferred.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_call_slapgrid" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tal:block define="menu_item python: 'Projects'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT 0"]</td>
<td></td>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Project : ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-PROJECT 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<!-- Check on listbox -->
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT-COMPUTER 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Compute Node: ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-PROJECT-COMPUTER 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td colspan="3"><b> Update Allocation Scope</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@id="allocation_scope"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@id="allocation_scope"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@id="allocation_scope"]</td>
<td tal:content="python: '%s' % (here.Base_translateString('Closed forever', lang=lang))"></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" />
<tal:block define="menu_item python: 'Projects'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-PROJECT 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Project : ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-PROJECT 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tal:block tal:define="delete_configuration python: {'header_title': 'Delete Project: ${title}', <tal:block tal:define="delete_configuration python: {'header_title': 'Delete Project: ${title}',
'notification_text': 'Project is Deleted.'}; 'notification_text': 'Project is Deleted.'};
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-PROJECT 0'})"> dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-PROJECT 0'})">
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/create_simple_compute_node" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/create_simple_compute_node" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_call_slapgrid" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
...@@ -196,6 +198,7 @@ ...@@ -196,6 +198,7 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block> </tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_call_slapgrid" />
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
...@@ -219,6 +222,16 @@ ...@@ -219,6 +222,16 @@
<td>//a[text()="TEST-SLAPOSJS-COMPUTER 0"]</td> <td>//a[text()="TEST-SLAPOSJS-COMPUTER 0"]</td>
<td></td> <td></td>
</tr> </tr>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td>//a[text()="TEST-SLAPOSJS-COMPUTER 0"]</td> <td>//a[text()="TEST-SLAPOSJS-COMPUTER 0"]</td>
...@@ -230,6 +243,26 @@ ...@@ -230,6 +243,26 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block> </tal:block>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr> <tr>
<td>click</td> <td>click</td>
<td tal:content="python: '//th/a[text()=\'%s\']' % (here.Base_translateString('Software Release', lang=lang))"></td> <td tal:content="python: '//th/a[text()=\'%s\']' % (here.Base_translateString('Software Release', lang=lang))"></td>
...@@ -255,6 +288,17 @@ ...@@ -255,6 +288,17 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block> </tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[contains(@class, 'main-status')]//div[contains(@class, 'ui-btn-ok')]//a[contains(text(), 'Available')]</td>
<td></td>
</tr>
<tal:block define="menu_action python: 'Destroy'"> <tal:block define="menu_action python: 'Destroy'">
<tr> <tr>
<td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td> <td colspan="3"><b tal:content="python: 'Click on %s' % menu_action"> Menu Item </b></td>
......
...@@ -56,18 +56,241 @@ ...@@ -56,18 +56,241 @@
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" />
<!-- check site --> <tal:block define="document_title python: 'TEST-SLAPOSJS-SITE-COMPUTER 0';">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/create_simple_compute_node" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tal:block define="menu_item python: 'Sites'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SET 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SET 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-SET 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Site : ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SET 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td rowspan="1" colspan="3">Add server into the site</td>
</tr>
<tal:block define="menu_item python: 'Servers'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
</tal:block>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SITE-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SITE-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-SITE-COMPUTER 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Compute Node: ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SITE-COMPUTER 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td colspan="3"><b tal:content="python: 'Transfer Compute Node to a Site'"> Menu Item </b></td>
</tr>
<tal:block tal:define="menu_action python: 'Transfer'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_submenu_action" />
</tal:block>
<tal:block define="header python: 'Transfer Compute Node'; ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//select[@name="destination"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@name="destination"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@name="destination"]</td>
<td>TEST-SLAPOSJS-SET 0</td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/click_proceed" />
<tal:block tal:define="notification_configuration python: {'class': 'success',
'text': 'Compute Node is transferred.'}">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/wait_for_notification" />
</tal:block>
<!-- Broken history to return <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_call_slapgrid" />
<tr>
<td>click</td>
<td>//a[@data-i18n="Site : TEST-SLAPOSJS-SET 0"]</td>
<td></td>
</tr>
-->
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/slapos_wait_for_activities_and_front_page" />
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SET 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SET 0"]</td>
<td></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-SET 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Site : ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SET 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<tr>
<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></td>
</tr>
<!-- Check on listbox -->
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tal:block tal:define="pagination_configuration python: {'header': '(1)', 'footer': '${count} Records'};
dummy python: context.REQUEST.set('mapping', {'count': '1'})">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/check_listbox_pagination_text" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SITE-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[text()="TEST-SLAPOSJS-SITE-COMPUTER 0"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="TEST-SLAPOSJS-SITE-COMPUTER 0"]</td>
<td></td>
</tr>
<tal:block tal:define="header python: 'Compute Node: ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SITE-COMPUTER 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block>
<tr>
<td colspan="3"><b> Update Allocation Scope</b></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//select[@id="allocation_scope"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//select[@id="allocation_scope"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//select[@id="allocation_scope"]</td>
<td tal:content="python: '%s' % (here.Base_translateString('Closed forever', lang=lang))"></td>
</tr>
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" />
<tal:block define="menu_item python: 'Sites'; header menu_item"> <tal:block define="menu_item python: 'Sites'; header menu_item">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" />
...@@ -94,12 +317,15 @@ ...@@ -94,12 +317,15 @@
<td></td> <td></td>
</tr> </tr>
<tal:block tal:define="header python: 'Site : ${title}'; <tal:block tal:define="header python: 'Site : ${title}';
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SET 0'}) "> dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SET 0'}) ">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/assert_page_header" />
</tal:block> </tal:block>
<tr>
<td colspan="3"><b> Delete Site...</b></td>
</tr>
<tal:block tal:define="delete_configuration python: {'header_title': 'Delete Site: ${title}', <tal:block tal:define="delete_configuration python: {'header_title': 'Delete Site: ${title}',
'notification_text': 'Site is Deleted.'}; 'notification_text': 'Site is Deleted.'};
dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SET 0'})"> dummy python: context.REQUEST.set('mapping', {'title': 'TEST-SLAPOSJS-SET 0'})">
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_function</string> </key> <key> <string>_function</string> </key>
<value> <string>ComputeNode_simulateSlapgridCP</string> </value> <value> <string>ComputeNode_simulateSlapgridInstance</string> </value>
</item> </item>
<item> <item>
<key> <string>_module</string> </key> <key> <string>_module</string> </key>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>ComputeNode_simulateSlapgridCP</string> </value> <value> <string>ComputeNode_simulateSlapgridInstance</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>ComputeNode_simulateSlapgridSoftware</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>SlapOSUiTest</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ComputeNode_simulateSlapgridSoftware</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from DateTime import DateTime
portal = context.getPortalObject()
portal_membership=portal.portal_membership
demo_user_functional = portal_membership.getAuthenticatedMember().getUserValue()
for compute_node in portal.portal_catalog(
portal_type="Compute Node",
validation_state="validated",
default_source_administration_uid=demo_user_functional.getUid()):
if compute_node.getValidationState() == 'validated':
compute_node.ComputeNode_simulateSlapgridFormat()
compute_node.activate(
tag='ComputeNode_simulateSlapgridSoftware'
).ComputeNode_simulateSlapgridSoftware()
compute_node.activate(
after_tag='ComputeNode_simulateSlapgridSoftware'
).ComputeNode_simulateSlapgridInstance()
return 'Done.'
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<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>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_formatAndUpdateUserComputeNodeList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
</tal:block> </tal:block>
</tal:block> </tal:block>
<tal:block metal:define-macro="access_menu_item"> <tal:block metal:define-macro="access_menu_item">
<tal:block tal:define="panel_gadget_id python: 'gadget_slapos_panel.html'"> <tal:block tal:define="panel_gadget_id python: 'gadget_slapos_panel.html'">
<tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item_base" /> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item_base" />
...@@ -77,7 +76,7 @@ ...@@ -77,7 +76,7 @@
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>open</td> <td>openAndWait</td>
<td>${base_url}/ERP5Site_removeTestUserList</td> <td>${base_url}/ERP5Site_removeTestUserList</td>
<td></td> <td></td>
</tr> </tr>
...@@ -86,16 +85,9 @@ ...@@ -86,16 +85,9 @@
<td>Done.</td> <td>Done.</td>
<td></td> <td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" /> <tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr> <tr>
<td>assertTextPresent</td> <td>openAndWait</td>
<td>Done.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td tal:content="python:'${base_url}/web_site_module/%s/ERP5Site_createTestUserList' % web_site_id">.../ERP5Site_createTestUserList</td> <td tal:content="python:'${base_url}/web_site_module/%s/ERP5Site_createTestUserList' % web_site_id">.../ERP5Site_createTestUserList</td>
<td></td> <td></td>
</tr> </tr>
...@@ -106,13 +98,6 @@ ...@@ -106,13 +98,6 @@
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" /> <tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
</tal:block> </tal:block>
<tal:block metal:define-macro="slapos_login_base"> <tal:block metal:define-macro="slapos_login_base">
...@@ -122,7 +107,9 @@ ...@@ -122,7 +107,9 @@
<td tal:content="python:'${base_url}/web_site_module/%s/WebSite_logout' % web_site_id">.../WebSite_logout</td> <td tal:content="python:'${base_url}/web_site_module/%s/WebSite_logout' % web_site_id">.../WebSite_logout</td>
<td></td> <td></td>
</tr> </tr>
<!-- Initialize --> <tr>
<td colspan="3"><b> Login as demo_functional_user</b></td>
</tr>
<tr> <tr>
<td>open</td> <td>open</td>
<td tal:content="python:'${base_url}/web_site_module/%s/' % web_site_id"></td> <td tal:content="python:'${base_url}/web_site_module/%s/' % web_site_id"></td>
...@@ -220,14 +207,10 @@ ...@@ -220,14 +207,10 @@
<tal:block metal:define-macro="slapos_wait_for_activities_and_front_page_base"> <tal:block metal:define-macro="slapos_wait_for_activities_and_front_page_base">
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr> <tr>
<td>assertTextPresent</td> <td colspan="3"><b> Wait for activities and return to the front page </b></td>
<td>Done.</td>
<td></td>
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr> <tr>
<td>open</td> <td>open</td>
<td tal:content="python:'${base_url}/web_site_module/%s/' % web_site_id"></td> <td tal:content="python:'${base_url}/web_site_module/%s/' % web_site_id"></td>
...@@ -295,6 +278,25 @@ ...@@ -295,6 +278,25 @@
</tr> </tr>
</tal:block> </tal:block>
<tal:block metal:define-macro="slapos_wait_for_activities_and_call_slapgrid">
<tr>
<td colspan="3"><b> Wait for activities and simulate call Slapgrid </b></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>openAndWait</td>
<td>${base_url}/ERP5Site_formatAndUpdateUserComputeNodeList </td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Done.</td>
<td></td>
</tr>
</tal:block>
<tal:block metal:define-macro="slapos_logout"> <tal:block metal:define-macro="slapos_logout">
<tr> <tr>
<td colspan="3"><b>Logout the website</b></td> <td colspan="3"><b>Logout the website</b></td>
...@@ -343,7 +345,7 @@ ...@@ -343,7 +345,7 @@
</tal:block> </tal:block>
<tal:block metal:define-macro="access_menu_item_base"> <tal:block metal:define-macro="access_menu_item_base">
<tr> <tr>
<td colspan="3"><b tal:content="python: 'Access Entry on the Menu for : %s' % menu_item"> Menu Item </b></td> <td colspan="3"><b tal:content="python: 'Access Entry on the Menu for : %s' % menu_item"> Menu Item </b></td>
</tr> </tr>
<tr> <tr>
...@@ -1141,9 +1143,10 @@ ...@@ -1141,9 +1143,10 @@
<tal:block metal:define-macro="create_fake_invoice"> <tal:block metal:define-macro="create_fake_invoice">
<tr>
<td colspan="3"><b> Create a fake invoice</b></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" /> <tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr> <tr>
<td>assertTextPresent</td> <td>assertTextPresent</td>
<td>Done.</td> <td>Done.</td>
...@@ -1161,7 +1164,6 @@ ...@@ -1161,7 +1164,6 @@
</tr> </tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" /> <tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr> <tr>
<td>assertTextPresent</td> <td>assertTextPresent</td>
<td>Done.</td> <td>Done.</td>
...@@ -1211,4 +1213,4 @@ ...@@ -1211,4 +1213,4 @@
tal:define="global lang python: here.web_site_module[web_site_id].getDefaultAvailableLanguage()"> tal:define="global lang python: here.web_site_module[web_site_id].getDefaultAvailableLanguage()">
</tal:block> </tal:block>
</tal:block> </tal:block>
\ No newline at end of file
...@@ -651,6 +651,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -651,6 +651,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
<string>%(created_at)s</string> <string>%(created_at)s</string>
<string>no_data</string> <string>no_data</string>
<int>1</int> <int>1</int>
<string>portal_type</string>
<string>Compute Node</string>
<string>reference</string>
<string>%(compute_node_id)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -703,6 +707,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -703,6 +707,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Compute Node</string>
<string>reference</string>
<string>%(compute_node_id)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -815,6 +823,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -815,6 +823,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
<string>%(created_at)s</string> <string>%(created_at)s</string>
<string>no_data</string> <string>no_data</string>
<int>1</int> <int>1</int>
<string>portal_type</string>
<string>Software Installation</string>
<string>reference</string>
<string>%(reference)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -887,6 +899,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -887,6 +899,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Installation</string>
<string>reference</string>
<string>%(reference)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -902,6 +918,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -902,6 +918,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
since=since, since=since,
url_string=url_string, url_string=url_string,
compute_node_id=self.compute_node_id, compute_node_id=self.compute_node_id,
reference=software_installation.getReference()
) )
self.assertEqual(expected_xml, got_xml, self.assertEqual(expected_xml, got_xml,
'\n'.join([q for q in difflib.unified_diff(expected_xml.split('\n'), got_xml.split('\n'))])) '\n'.join([q for q in difflib.unified_diff(expected_xml.split('\n'), got_xml.split('\n'))]))
...@@ -936,6 +953,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -936,6 +953,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Installation</string>
<string>reference</string>
<string>%(reference)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -951,6 +972,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -951,6 +972,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
since=since, since=since,
url_string=url_string, url_string=url_string,
compute_node_id=self.compute_node_id, compute_node_id=self.compute_node_id,
reference=software_installation.getReference()
) )
self.assertEqual(expected_xml, got_xml, self.assertEqual(expected_xml, got_xml,
'\n'.join([q for q in difflib.unified_diff(expected_xml.split('\n'), got_xml.split('\n'))])) '\n'.join([q for q in difflib.unified_diff(expected_xml.split('\n'), got_xml.split('\n'))]))
...@@ -985,6 +1007,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -985,6 +1007,10 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Installation</string>
<string>reference</string>
<string>%(reference)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -1000,6 +1026,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin): ...@@ -1000,6 +1026,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
since=since, since=since,
url_string=url_string, url_string=url_string,
compute_node_id=self.compute_node_id, compute_node_id=self.compute_node_id,
reference=software_installation.getReference()
) )
self.assertEqual(expected_xml, got_xml, self.assertEqual(expected_xml, got_xml,
'\n'.join([q for q in difflib.unified_diff(expected_xml.split('\n'), got_xml.split('\n'))])) '\n'.join([q for q in difflib.unified_diff(expected_xml.split('\n'), got_xml.split('\n'))]))
...@@ -1324,6 +1351,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1324,6 +1351,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<string>%(created_at)s</string> <string>%(created_at)s</string>
<string>no_data</string> <string>no_data</string>
<int>1</int> <int>1</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -1375,6 +1406,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1375,6 +1406,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<string>%(created_at)s</string> <string>%(created_at)s</string>
<string>no_data</string> <string>no_data</string>
<int>1</int> <int>1</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -1749,6 +1784,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1749,6 +1784,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -1797,6 +1836,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1797,6 +1836,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -1847,6 +1890,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1847,6 +1890,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -1907,6 +1954,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1907,6 +1954,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -2227,6 +2278,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -2227,6 +2278,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -2274,6 +2329,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -2274,6 +2329,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -2520,6 +2579,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin): ...@@ -2520,6 +2579,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
<string>%(created_at)s</string> <string>%(created_at)s</string>
<string>no_data</string> <string>no_data</string>
<int>1</int> <int>1</int>
<string>portal_type</string>
<string>Compute Node</string>
<string>reference</string>
<string>%(compute_node_id)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -2572,6 +2635,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin): ...@@ -2572,6 +2635,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Compute Node</string>
<string>reference</string>
<string>%(compute_node_id)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -2649,6 +2716,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin): ...@@ -2649,6 +2716,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
<string>%(created_at)s</string> <string>%(created_at)s</string>
<string>no_data</string> <string>no_data</string>
<int>1</int> <int>1</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -2702,6 +2773,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin): ...@@ -2702,6 +2773,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
<string>%(created_at)s</string> <string>%(created_at)s</string>
<string>no_data</string> <string>no_data</string>
<int>1</int> <int>1</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -3013,6 +3088,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin): ...@@ -3013,6 +3088,10 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
<int>0</int> <int>0</int>
<string>no_data_since_5_minutes</string> <string>no_data_since_5_minutes</string>
<int>0</int> <int>0</int>
<string>portal_type</string>
<string>Software Instance</string>
<string>reference</string>
<string>%(instance_guid)s</string>
<string>since</string> <string>since</string>
<string>%(since)s</string> <string>%(since)s</string>
<string>state</string> <string>state</string>
...@@ -3027,6 +3106,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin): ...@@ -3027,6 +3106,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
created_at=created_at, created_at=created_at,
since=since, since=since,
person_reference=self.person_reference, person_reference=self.person_reference,
instance_guid=self.start_requested_software_instance.getReference()
) )
self.assertEqual(expected_xml, got_xml, self.assertEqual(expected_xml, got_xml,
'\n'.join([q for q in difflib.unified_diff(expected_xml.split('\n'), got_xml.split('\n'))])) '\n'.join([q for q in difflib.unified_diff(expected_xml.split('\n'), got_xml.split('\n'))]))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment