diff --git a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getCurrentInstallationStatus.xml b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getCurrentInstallationStatus.xml new file mode 100644 index 0000000000000000000000000000000000000000..70ce14bcf95a829e73295cb59c7fb888c028a19b --- /dev/null +++ b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getCurrentInstallationStatus.xml @@ -0,0 +1,126 @@ +<?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> diff --git a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_viewRunningInstallationMessage.xml b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_viewRunningInstallationMessage.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f07e623d6f01a1ba2da2d4e3974a2a3d8698231 --- /dev/null +++ b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_viewRunningInstallationMessage.xml @@ -0,0 +1,178 @@ +<?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> diff --git a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_viewRunningInstallationMessageRenderer.xml b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_viewRunningInstallationMessageRenderer.xml index 84d054e3e9de7b74b740b00d8d2dfca108880ec0..9837daccddbbb490aa432b84df4d09ced818e9c8 100644 --- a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_viewRunningInstallationMessageRenderer.xml +++ b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_viewRunningInstallationMessageRenderer.xml @@ -39,17 +39,38 @@ <key> <string>_text</string> </key> <value> <string encoding="cdata"><![CDATA[ -<h3 i18n:translate=""\n - i18n:domain="ui"> \n - ERP5 installation process is running.</h3>\n +<tal:block tal:define="percentage options/percentage;\n + coefficient python: 4;">\n \n -<p i18n:translate=""\n - i18n:domain="ui"> \n - Please be patient and do not move from current page until you get \n - confirmation that the installation is over. \n - It will last approximately 5 to 10 minutes.\n -</p>\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 + ERP5 installation process is running.</h3>\n + \n + <p i18n:translate=""\n + i18n:domain="ui"> \n + Please be patient and do not move from current page until you get \n + confirmation that the installation is over. \n + It will last approximately 5 to 10 minutes.\n + </p>\n +</tal:block> ]]></string> </value> </item> diff --git a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/Wizard_generateJavaScript.xml b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/Wizard_generateJavaScript.xml index cedb040aab78d3e2c2420ff56a001af0a620d7f4..0ee586ac42ee9f6908be73991030aed027431fea 100644 --- a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/Wizard_generateJavaScript.xml +++ b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/Wizard_generateJavaScript.xml @@ -79,7 +79,7 @@ js_string = """\n }\n \n function checkClientInstallation() {\n - time_out = window.setTimeout( "checkClientInstallation()", 15000 );\n + time_out = window.setTimeout( "checkClientInstallation()", 5000 );\n var xhr_object = null;\n xhr_object = getNewXMLHTTP();\n xhr_object.onreadystatechange = function()\n diff --git a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/Wizard_viewInstallationStatus.xml b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/Wizard_viewInstallationStatus.xml index 06df47e8aacb417af0d69cd8023dbbc97a6b0914..04a13e35c8de6983583df8e59f3d380cf4cd18f9 100644 --- a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/Wizard_viewInstallationStatus.xml +++ b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/Wizard_viewInstallationStatus.xml @@ -64,16 +64,16 @@ tal:content="here/Wizard_generateJavaScript"/>\n \n <div class="dialog_box">\n +<!--\n <h2 i18n:translate=""\n - i18n:domain="ui">Installation Report</h2>\n + i18n:domain="ui">Installation Report</h2>-->\n \n <div id="server_installation_status" \n tal:content="structure here/portal_wizard/getInstallationStatusReportFromServer">\n </div>\n - <br/>\n - \n +\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 </div>\n </div>\n diff --git a/bt5/erp5_wizard/bt/revision b/bt5/erp5_wizard/bt/revision index d7f3668a68034370ad1e355d05f4659541b0db5e..d97edbb29fa140807215ea46cfdc2b84f4c97dcd 100644 --- a/bt5/erp5_wizard/bt/revision +++ b/bt5/erp5_wizard/bt/revision @@ -1 +1 @@ -98 \ No newline at end of file +99 \ No newline at end of file