diff --git a/product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Activity%20Tool/watch_report.xml b/product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Activity%20Tool/watch_report.xml index e136939ddcfc2482bfcf714480c3daf5362c789a..91f34515cbe2076afd907b2461c6d7cca560c549 100644 --- a/product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Activity%20Tool/watch_report.xml +++ b/product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/Activity%20Tool/watch_report.xml @@ -16,13 +16,13 @@ <key> <string>categories</string> </key> <value> <tuple> - <string>action_type/object_report</string> + <string>action_type/object_jio_report</string> </tuple> </value> </item> <item> <key> <string>category</string> </key> - <value> <string>object_report</string> </value> + <value> <string>object_jio_report</string> </value> </item> <item> <key> <string>condition</string> </key> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ActivityTool_viewWatcher.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ActivityTool_viewWatcher.xml index 3325c439a9d0629854a30aa0c31b735b3e809bbd..93b405f30fefd77730d0fa9cb8ffa54ab97eacd8 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ActivityTool_viewWatcher.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ActivityTool_viewWatcher.xml @@ -120,7 +120,7 @@ </item> <item> <key> <string>pt</string> </key> - <value> <string>form_view_dialog</string> </value> + <value> <string>form_dialog</string> </value> </item> <item> <key> <string>row_length</string> </key> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ActivityTool_viewWatcher/activity_watcher_gadget.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ActivityTool_viewWatcher/activity_watcher_gadget.xml index d9944002d8e1f59c7947f4b2405a11e77376a99f..69ac01e3749e31bebb74f666815d9a56b6940fef 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ActivityTool_viewWatcher/activity_watcher_gadget.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ActivityTool_viewWatcher/activity_watcher_gadget.xml @@ -12,6 +12,7 @@ <list> <string>editable</string> <string>gadget_url</string> + <string>renderjs_extra</string> <string>title</string> </list> </value> @@ -50,6 +51,10 @@ <key> <string>tales</string> </key> <value> <dictionary> + <item> + <key> <string>editable</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> @@ -64,6 +69,16 @@ <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> </value> </item> + <item> + <key> <string>renderjs_extra</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> </dictionary> </value> </item> @@ -87,6 +102,12 @@ <key> <string>gadget_url</string> </key> <value> <string></string> </value> </item> + <item> + <key> <string>renderjs_extra</string> </key> + <value> + <list/> + </value> + </item> <item> <key> <string>title</string> </key> <value> <string>Watcher</string> </value> @@ -110,4 +131,17 @@ </dictionary> </pickle> </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: {\'read_activity_list_url\': here.absolute_url() + \'/ActivityTool_getSqlStatisticList\'}</string> </value> + </item> + </dictionary> + </pickle> + </record> </ZopeData> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_activity_watcher.html.html b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_activity_watcher.html.html index 4eb9b4b5a4c8778c427366628a911773c7a54980..8a2ef0664e4aa41dc3f5600bf309d7c41bb4acd1 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_activity_watcher.html.html +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_activity_watcher.html.html @@ -8,6 +8,7 @@ <script id="getData" type="text/x-handlebars-template"> Date : {{time}} <table> + <thead> <tr> <th>Type</th> <th>Count</th> @@ -16,6 +17,7 @@ <th>Min pri</th> <th>Max pri</th> </tr> + </thead><tbody> {{#each messageList1}} <tr> <td>{{this.messagetype}} </td> @@ -36,8 +38,10 @@ <td>{{this.max_pri}}</td> </tr> {{/each}} + </tbody> </table> <table> + <thead> <tr> <th>Type</th> <th>Priority</th> @@ -45,6 +49,7 @@ <th>Avg</th> <th>Max</th> </tr> + </thead><tbody> {{#each messagePri1}} <tr> <td>{{this.messagetype}} </td> @@ -63,6 +68,7 @@ <td>{{this.max}}</td> </tr> {{/each}} + </tbody> </table> </script> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_activity_watcher.js.js b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_activity_watcher.js.js index 6105cdbbd2c73437a9debefb68e15e4ab466f189..061b7b30cdfd3fae6a05cc1bb1c5d9e01fe8182f 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_activity_watcher.js.js +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_activity_watcher.js.js @@ -1,4 +1,4 @@ -/*global window, rJS, RSVP, Handlebars, jIO, location, console */ +/*global window, rJS, RSVP, Handlebars, jIO, console */ /*jslint nomen: true, maxlen:80, indent:2*/ (function (rJS, jIO, Handlebars, RSVP, window) { "use strict"; @@ -17,15 +17,24 @@ } rJS(window) + .declareMethod('render', function (options) { + console.log(options); + return this.changeState(options); + }) + .onLoop(function () { - var form_gadget = this, - basedir = location.pathname.split('/').slice(0, -1).join('/') + '/'; + var form_gadget = this; + if (!form_gadget.state.read_activity_list_url) { + // renderjs has not yet been called + // gadget doesn't know which URL to call + return; + } return new RSVP.Queue() .push(function () { return jIO.util.ajax( { - "type": "POST", - "url": basedir + 'ActivityTool_getSqlStatisticList', + "type": "GET", + "url": form_gadget.state.read_activity_list_url, "xhrFields": { withCredentials: true } @@ -35,15 +44,13 @@ .push(function (evt) { var data = JSON.parse(evt.target.response); form_gadget.element.querySelector(".activity_watcher_gadget") - .innerHTML = get_data_template( - { + .innerHTML = get_data_template({ time: new Date().toTimeString(), messageList1: putMessageType(data, 'dict', 'SQLDict'), messageList2: putMessageType(data, 'queue', 'SQLQueue'), - messagePri1 : putMessageType(data, 'dict', 'SQLDict2'), - messagePri2 : putMessageType(data, 'queue', 'SQLQueue2') - } - ); + messagePri1: putMessageType(data, 'dict', 'SQLDict2'), + messagePri2: putMessageType(data, 'queue', 'SQLQueue2') + }); }, function (error) { //Exception is raised if network is lost for some reasons,