Commit 65d20860 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Fixup to not display Closed Forever Computers

   Do not List Closed Forever Computer on Computer Network view
parent c272087e
...@@ -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")
...@@ -107,7 +108,8 @@ ...@@ -107,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) {
...@@ -190,11 +192,11 @@ ...@@ -190,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>1001.20432.33862.6946</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>1656703816.43</float> <float>1658167069.0</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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")))
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