Commit c4330fb6 authored by Romain Courteaud's avatar Romain Courteaud

Show if there is free partition for the instanciation.

parent c7de01eb
<?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>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
tool = context.getPortalObject().portal_vifib_rest_api\n
return """\n
<script>\n
$(document).ready(function () {\n
var current_context = $(".allocable_to_check"),\n
checkallocable;\n
\n
checkallocable = function (context) {\n
$.vifiballocable({\n
context: context,\n
url: \'%s/v1/instance/request\', \n
slave: false, \n
software_release: context.attr("data-url"), \n
software_type: "default", \n
sla: {},\n
success: function(data) {\n
if (data.result === true) {\n
$(this).text("There is space!");\n
} else {\n
$(this).text("Sorry, no space left in the cloud :(");\n
}\n
}, \n
error: function(data) {\n
$(this).text("Unable to check if there is space");\n
}, \n
complete: function () {\n
var context = $(this);\n
setTimeout(function() {\n
checkallocable(context);\n
}, 60000);\n
},\n
});\n
};\n
checkallocable(current_context);\n
});\n
\n
\n
</script>\n
""" % tool.absolute_url()\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareRelease_getRequestDialogJS</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
<string>your_ad</string> <string>your_ad</string>
<string>your_instance_xml</string> <string>your_instance_xml</string>
<string>your_description</string> <string>your_description</string>
<string>your_monitoring_status</string>
<string>your_monitoring_status_js</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
return (\'jquery/core/jquery.js\',\n return (\'jquery/core/jquery.js\',\n
\'vifib_hosting_js/erp5_acknowledgement.js\',\n \'vifib_hosting_js/erp5_acknowledgement.js\',\n
\'vifib_hosting_js/vifib_monitoring.js\',\n \'vifib_hosting_js/vifib_monitoring.js\',\n
\'vifib_hosting_js/vifib_allocable.js\',\n
\'vifib_hosting_js/vifib_hosting.js\',)\n \'vifib_hosting_js/vifib_hosting.js\',)\n
</string> </value> </string> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>vifib_allocable.js</string> </value>
</item>
<item>
<key> <string>_vars</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>globals</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>raw</string> </key>
<value> <string>/*\n
Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
along with this program; if not, write to the Free Software\n
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
*/\n
"use strict";\n
\n
(function ($) {\n
\n
$.vifiballocable = function(options) {\n
return $.ajax($.extend({\n
type: \'GET\',\n
async: false,\n
contentType: \'application/json\',\n
data: {\n
slave: options.slave,\n
software_release: options.software_release,\n
software_type: options.software_type,\n
sla: JSON.stringify(options.sla)},\n
}, options));\n
};\n
\n
}(jQuery));\n
</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
452 453
\ No newline at end of file \ No newline at end of file
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