Commit 08b035fc authored by Ivan Tyagov's avatar Ivan Tyagov

Decrease back timeout for status refresh.

Add simple progress bar and needed styling for it.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23924 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 307493a2
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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>"""\n
Estimate current installation status """\n
activity_threshold = 46\n
\n
\n
return 100\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>activity_threshold</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WizardTool_getCurrentInstallationStatus</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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[
# different part of the configuration process in estimatd percentages\n
# values for machine with pystones =(1.3600000000000012, 36764.705882352908)\n
building_bt5_part_percentage = 15.0\n
installation_bt5_part_percentage = 26.0\n
activity_part_percentage = 59.0\n
calc_percentage = 0.0\n
is_activities_running = len(installation_status[\'activity_list\'])!=0\n
is_bt5_building_running = installation_status[\'bt5\'][\'all\']==0 and \\\n
not is_activities_running\n
is_bt5_installation_running = installation_status[\'bt5\'][\'all\']!=0 and \\\n
not is_activities_running \n
\n
if not is_bt5_building_running:\n
all_bt5s = float(installation_status[\'bt5\'][\'all\'])\n
current_bt5s = float(installation_status[\'bt5\'][\'current\'])\n
bt5_percent_of_total = current_bt5s / all_bt5s\n
calc_percentage = calc_percentage + building_bt5_part_percentage + \\\n
bt5_percent_of_total*installation_bt5_part_percentage\n
\n
if is_activities_running:\n
activity_list = installation_status[\'activity_list\']\n
all_activities = float(max(activity_list))\n
current_activities = float(activity_list[-1])\n
activity_percent_of_total = (all_activities - current_activities)/all_activities\n
calc_percentage += activity_percent_of_total*activity_part_percentage\n
#context.log(\'%s\\nLast:%s\\nAll:%s\\-->%s\' %(activity_list, current_activities, all_activities, activity_percent_of_total))\n
\n
return context.WizardTool_viewRunningInstallationMessageRenderer(percentage=int(calc_percentage))\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>installation_status</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>installation_status</string>
<string>building_bt5_part_percentage</string>
<string>installation_bt5_part_percentage</string>
<string>activity_part_percentage</string>
<string>calc_percentage</string>
<string>len</string>
<string>_getitem_</string>
<string>is_activities_running</string>
<string>is_bt5_building_running</string>
<string>is_bt5_installation_running</string>
<string>float</string>
<string>all_bt5s</string>
<string>current_bt5s</string>
<string>bt5_percent_of_total</string>
<string>activity_list</string>
<string>max</string>
<string>all_activities</string>
<string>current_activities</string>
<string>activity_percent_of_total</string>
<string>_inplacevar_</string>
<string>_getattr_</string>
<string>context</string>
<string>int</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WizardTool_viewRunningInstallationMessage</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Calculate percentages and show installation message</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -39,17 +39,38 @@ ...@@ -39,17 +39,38 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
<h3 i18n:translate=""\n <tal:block tal:define="percentage options/percentage;\n
coefficient python: 4;">\n
\n
<div style="width:400px; \n
height:25px; \n
background-color:lightgray;\n
border:1px solid black;">\n
<div tal:attributes="style python: \'text-align:right;;\n
height: 25px;; \n
background-color:#f09400;; \n
width: %spx;;\' %(coefficient*percentage)">\n
<div style="height:20px; \n
padding-top: 5px; \n
padding-right: 3px; \n
font-weight:bold;"\n
tal:condition="python: int(percentage) != 0">\n
<span tal:content="percentage"/>%\n
</div>\n
</div>\n
</div>\n
\n
<h3 i18n:translate=""\n
i18n:domain="ui"> \n i18n:domain="ui"> \n
ERP5 installation process is running.</h3>\n ERP5 installation process is running.</h3>\n
\n \n
<p i18n:translate=""\n <p i18n:translate=""\n
i18n:domain="ui"> \n i18n:domain="ui"> \n
Please be patient and do not move from current page until you get \n Please be patient and do not move from current page until you get \n
confirmation that the installation is over. \n confirmation that the installation is over. \n
It will last approximately 5 to 10 minutes.\n It will last approximately 5 to 10 minutes.\n
</p>\n </p>\n
</tal:block>
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -79,7 +79,7 @@ js_string = """\n ...@@ -79,7 +79,7 @@ js_string = """\n
}\n }\n
\n \n
function checkClientInstallation() {\n function checkClientInstallation() {\n
time_out = window.setTimeout( "checkClientInstallation()", 15000 );\n time_out = window.setTimeout( "checkClientInstallation()", 5000 );\n
var xhr_object = null;\n var xhr_object = null;\n
xhr_object = getNewXMLHTTP();\n xhr_object = getNewXMLHTTP();\n
xhr_object.onreadystatechange = function()\n xhr_object.onreadystatechange = function()\n
......
...@@ -64,16 +64,16 @@ ...@@ -64,16 +64,16 @@
tal:content="here/Wizard_generateJavaScript"/>\n tal:content="here/Wizard_generateJavaScript"/>\n
\n \n
<div class="dialog_box">\n <div class="dialog_box">\n
<!--\n
<h2 i18n:translate=""\n <h2 i18n:translate=""\n
i18n:domain="ui">Installation Report</h2>\n i18n:domain="ui">Installation Report</h2>-->\n
\n \n
<div id="server_installation_status" \n <div id="server_installation_status" \n
tal:content="structure here/portal_wizard/getInstallationStatusReportFromServer">\n tal:content="structure here/portal_wizard/getInstallationStatusReportFromServer">\n
</div>\n </div>\n
<br/>\n \n
\n
<div id="client_installation_status"\n <div id="client_installation_status"\n
style="background-color: #FFFFFF; padding: 0.5em;">\n style="background-color: #FFFFFF; padding: 0.5em; margin-top: 0.5em;">\n
Loading ...\n Loading ...\n
</div>\n </div>\n
</div>\n </div>\n
......
98 99
\ 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