Commit 89a58c60 authored by Roque's avatar Roque

[WIP] erp5_web_monitoring: Romain changes in monitoring app

parent 4463bfb4
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Monitor Custom gadget display</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojsm_gadget_display.js"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div class='container'></div>
</form>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/public</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_ojsm_gadget_display.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_erp5_page_ojsm_gadget_display_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>OfficeJS Monitoring Display Custom Gadget</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1670427794.84</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1004.56797.28175.62498</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1670516932.22</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1670427290.57</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, RSVP, rJS, jIO, document) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.allowPublicAcquisition("getPromiseDocument", function (param_list) {
var gadget = this,
source = param_list[0],
url_suffix = param_list[1];
return gadget.jio_allDocs({
// select_list: [],
query: 'portal_type:promise AND source:"' + source + '" AND channel:' +
gadget.state.instance.specialise_title
})
.push(function (result) {
if (result.data.rows.length !== 1) {
throw new Error('Unexpected number of promise ' +
result.data.rows.length);
}
return gadget.jio_get(result.data.rows[0].id);
})
.push(function (result) {
return jIO.util.ajax({
type: "GET",
url: result.link + url_suffix,
dataType: "text",
headers: {
authorization: "Basic " + gadget.state.basic_login
},
xhrFields: {
withCredentials: false
}
});
})
.push(function (evt) {
return evt.target.responseText;
});
})
.onEvent('submit', function () {
// ON submit, refresh page
return this.redirect({command: 'reload'});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.declareJob("loadCustomGadget", function () {
var gadget = this,
container;
container = gadget.element.querySelector('.container');
return gadget.notifySubmitting()
.push(function () {
return gadget.declareGadget(
//gadget.state.gadget_url,
"https://softinst141426.host.vifib.net/share/public/html/software.cfg.html",
{
element: container,
scope: "custom_gadget",
sandbox: "iframe"
});
})
.push(function (custom_gadget) {
return new RSVP.Queue()
.push(function () {
return custom_gadget.render({
//channel: gadget.state.instance_tree.title,
//url: gadget.state.opml.url,
//username: gadget.state.opml.username,
//password: gadget.state.opml.password,
//basic_login: gadget.state.opml.basic_login
})
.push(function () {
return gadget.notifySubmitted({
message: "Gadget loaded.",
status: "success"
});
});
})
.push(undefined, function (error) {
// render does not exist or failed
console.error(error);
return gadget.notifySubmitted({
message: "Failed to render the gadget!",
status: "error"
});
});
}, function (error) {
// Failed to load the gadget. Probably not found!
console.error(error);
return gadget.notifySubmitted({
message: "Could not load gadget!",
status: "error"
});
});
})
.declareMethod("render", function (options) {
var gadget = this;
return gadget.jio_get(options.key)
.push(function (instance_doc) {
return gadget.changeState({instance: instance_doc});
})
.push(function () {
return gadget.jio_get(options.opml_url);
}).push(function (opml) {
return gadget.changeState({
basic_login: opml.basic_login,
gadget_url: gadget.state.instance.software_release + ".html"
});
})
.push(function () {
return gadget.getUrlFor({command: 'history_previous'});
})
.push(function (previous_url) {
var options = {
page_title: "Software Instance: " + gadget.state.instance.title,
selection_url: previous_url,
refresh_action: true
};
return gadget.updateHeader(options);
});
})
.onStateChange(function (modification_dict) {
var gadget = this;
if (!modification_dict.hasOwnProperty('gadget_url')) {
return;
}
return gadget.loadCustomGadget();
});
}(window, RSVP, rJS, jIO, document));
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/public</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_ojsm_gadget_display.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_erp5_page_ojsm_gadget_display_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>OfficeJS Monitoring Custom Gadget Display JS</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1670427783.78</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1004.56929.7100.42939</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1670517463.79</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1670427609.93</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Monitoring Delete OPML JS</string> </value> <value> <string>OfficeJS Monitoring OPML Delete JS</string> </value>
</item> </item>
<item> <item>
<key> <string>url_string</string> </key> <key> <string>url_string</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.27666.8050.30907</string> </value> <value> <string>1004.55433.58483.4608</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1510581396.39</float> <float>1670427603.2</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -41,16 +41,16 @@ ...@@ -41,16 +41,16 @@
data-gadget-sandbox="public"> data-gadget-sandbox="public">
</div> </div>
</form> </form>
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_cpu" class="graph graph-h-medium" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_cpu" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div> </div>
<div class="ui-grid-a ui-responsive"> <div class="ui-grid-a ui-responsive">
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_memory_used" class="graph graph-h-medium" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_memory_used" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div> </div>
<div class="ui-grid-a ui-responsive"> <div class="ui-grid-a ui-responsive">
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_io_read" class="graph graph-h-medium" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_io_read" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div> </div>
<div class="ui-grid-a ui-responsive"> <div class="ui-grid-a ui-responsive">
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_io_write" class="graph graph-h-medium" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_io_write" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div> </div>
</body> </body>
</html> </html>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>971.40737.38602.8192</string> </value> <value> <string>1004.34236.10343.40209</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1542206472.63</float> <float>1669244284.09</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,19 +5,23 @@ ...@@ -5,19 +5,23 @@
var gadget_klass = rJS(window); var gadget_klass = rJS(window);
function getDateWindow(data) { function padTo2Digits(num) {
var max_date, return num.toString().padStart(2, '0');
begin_date, }
end_date,
date_window = []; function formatDate(date) {
if (data.length > 0) { return (
max_date = data[data.length - 1].split(',')[0]; [
begin_date = new Date(max_date); date.getFullYear(),
end_date = new Date(max_date); padTo2Digits(date.getMonth() + 1),
begin_date.setHours(begin_date.getHours() - 8); padTo2Digits(date.getDate())
date_window = [Date.parse(begin_date), Date.parse(end_date)]; ].join('-') +
} ' ' +
return date_window; [
padTo2Digits(date.getHours()),
padTo2Digits(date.getMinutes())
].join(':')
);
} }
function loadGraphData(gadget, key) { function loadGraphData(gadget, key) {
...@@ -34,7 +38,6 @@ ...@@ -34,7 +38,6 @@
}); });
}) })
.push(function (jio_element) { .push(function (jio_element) {
gadget.property_dict.date_window = getDateWindow(gadget.property_dict.mem_data.data);
if (!jio_element.hasOwnProperty('data')) { if (!jio_element.hasOwnProperty('data')) {
return {data: []}; return {data: []};
} }
...@@ -53,14 +56,13 @@ ...@@ -53,14 +56,13 @@
}); });
} }
function updateIOData(gadget, date_window) { function updateIOData(gadget) {
var i, var i,
element, element,
prev_element, prev_element,
date_diff, date_diff,
line_list = [], date,
data_list = [], data_list = [];
axis_list = [];
function convertElement(element) { function convertElement(element) {
var element_list = element.split(','); var element_list = element.split(',');
...@@ -71,48 +73,36 @@ ...@@ -71,48 +73,36 @@
element_list[3].trim() element_list[3].trim()
]; ];
} }
//"date, io rw counter, io cycles counter, disk used" //"disk used" is not in the graph for now
line_list = ["io rw count (Kb/s)", "io cycles count (/1000)"]; //, "disk used"]; data_list.push({
axis_list.push({ value_dict: {
"0": { 0: [],
"title": "IO read/write counter", 1: []
"scale_type": "linear", },
"value_type": "date", colors: ['#AA069F'],
"zoom_range": date_window type: "line",
} title: "IO read/write counter"
});
axis_list.push({
"0": {
"title": "IO cycles counter",
"scale_type": "linear",
"value_type": "date",
"zoom_range": date_window
}
}); });
for (i = 0; i < line_list.length; i += 1) {
line_list[i] = line_list[i].trim();
data_list.push({ data_list.push({
value_dict: {"0": [], "1": []}, value_dict: {
type: "surface", 0: [],
axis_mapping_id_dict: {"1": "1_1"}, 1: []
title: line_list[i] },
colors: ['#FC7D02'],
type: "line",
title: "IO cycles counter"
}); });
axis_list[i]["1_1"] = {"title": line_list[i], "position": "right"};
}
if (gadget.property_dict.io_data.data.length > 2) { if (gadget.property_dict.io_data.data.length > 2) {
prev_element = convertElement(gadget.property_dict.io_data.data[1]); prev_element = convertElement(gadget.property_dict.io_data.data[1]);
for (i = 2; i < gadget.property_dict.io_data.data.length; i += 1) { for (i = 2; i < gadget.property_dict.io_data.data.length; i += 1) {
element = convertElement(gadget.property_dict.io_data.data[i]); element = convertElement(gadget.property_dict.io_data.data[i]);
date_diff = (new Date(element[0]).getTime() - new Date(prev_element[0]).getTime()) / 1000; date_diff = (new Date(element[0]).getTime() - new Date(prev_element[0]).getTime()) / 1000;
// XXX - repeating date everytime date = formatDate(new Date(element[0]));
data_list[0].value_dict["0"].push(element[0]); data_list[0].value_dict["0"].push(date);
data_list[0].value_dict["1"].push((element[1] - prev_element[1]) / (1024 * date_diff)); data_list[0].value_dict["1"].push((element[1] - prev_element[1]) / (1024 * date_diff));
// XXX - repeating date everytime // XXX - repeating date everytime
data_list[1].value_dict["0"].push(element[0]); data_list[1].value_dict["0"].push(date);
data_list[1].value_dict["1"].push((element[2] - prev_element[2]) / 1000); data_list[1].value_dict["1"].push((element[2] - prev_element[2]) / 1000);
// XXX - repeating date everytime
/*data_list[2].value_dict["0"].push(element[0]);
data_list[2].value_dict["1"].push(element[3]);*/
prev_element = element; prev_element = element;
} }
} }
...@@ -121,7 +111,15 @@ ...@@ -121,7 +111,15 @@
value: { value: {
data: [data_list[0]], data: [data_list[0]],
layout: { layout: {
axis_dict : axis_list[0], axis_dict : {
0: {"title": "Date"},
1: {"title": "io rw count (Kb/s)", "value_type": "Kb/s"}
},
datazoom: {
type: 'inside',
start: 80,
end: 100
},
title: "IO write counter" title: "IO write counter"
} }
} }
...@@ -130,7 +128,15 @@ ...@@ -130,7 +128,15 @@
value: { value: {
data: [data_list[1]], data: [data_list[1]],
layout: { layout: {
axis_dict : axis_list[1], axis_dict : {
0: {"title": "Date"},
1: {"title": "io cycles count (x1000)", "value_type": "number"}
},
datazoom: {
type: 'inside',
start: 80,
end: 100
},
title: "IO cycles counter" title: "IO cycles counter"
} }
} }
...@@ -156,7 +162,7 @@ ...@@ -156,7 +162,7 @@
return RSVP.all(promise_list); return RSVP.all(promise_list);
}) })
.push(function () { .push(function () {
var data = updateIOData(gadget, gadget.property_dict.date_window); var data = updateIOData(gadget);
return RSVP.all([ return RSVP.all([
gadget.property_dict.graph_io_read.render(data[0]), gadget.property_dict.graph_io_read.render(data[0]),
gadget.property_dict.graph_io_write.render(data[1]) gadget.property_dict.graph_io_write.render(data[1])
...@@ -165,55 +171,44 @@ ...@@ -165,55 +171,44 @@
}) })
.push(function () { .push(function () {
var data_list = [], var data_list = [],
axis_dict = {},
line_list, line_list,
i; i;
axis_dict = {
"0": {
"title": "Memory resources usage (Mo)",
"scale_type": "linear",
"value_type": "date",
"zoom_range": gadget.property_dict.date_window
},
"1_2": {
"title": "Memory used percent",
"position": "right"
},
"1_1": {
"title": "Memory used",
"position": "right"
}
};
/*data_list.push({
value_dict: {"0": [], "1": []},
type: "surface",
axis_mapping_id_dict: {"1": "1_1"},
title: "Memory used percent"
});*/
data_list.push({ data_list.push({
value_dict: {"0": [], "1": []}, value_dict: {
type: "surface", 0: [],
axis_mapping_id_dict: {"1": "1_2"}, 1: []
},
colors: ['#61a0a8'],
type: "line",
fillarea: true,
title: "Memory used" title: "Memory used"
}); });
for (i = 1; i < gadget.property_dict.mem_data.data.length; i += 1) { for (i = 1; i < gadget.property_dict.mem_data.data.length; i += 1) {
line_list = gadget.property_dict.mem_data.data[i].split(','); line_list = gadget.property_dict.mem_data.data[i].split(',');
data_list[0].value_dict["0"].push(line_list[0]); data_list[0].value_dict["0"].push(formatDate(new Date(line_list[0])));
data_list[0].value_dict["1"].push(line_list[2]); data_list[0].value_dict["1"].push(line_list[2]);
} }
return gadget.property_dict.graph_mem_used.render({ return gadget.property_dict.graph_mem_used.render({
value: { value: {
data: data_list, data: data_list,
layout: { layout: {
axis_dict : axis_dict, axis_dict : {
0: {"title": "Date"},
1: {"title": "Memory usage (Mb)", "value_type": "Mb"}
},
datazoom: {
type: 'inside',
start: 80,
end: 100
},
title: "Memory resources usage" title: "Memory resources usage"
} }
} }
}); });
}) })
.push(function () { .push(function () {
//return gadget.element.querySelector('form button[type="submit"]').click();
return gadget.getDeclaredGadget('form_cpu_graph') return gadget.getDeclaredGadget('form_cpu_graph')
.push(function (form_gadget) { .push(function (form_gadget) {
return form_gadget.getContent(); return form_gadget.getContent();
...@@ -224,7 +219,6 @@ ...@@ -224,7 +219,6 @@
}) })
.push(function (cpu_graph_key) { .push(function (cpu_graph_key) {
var data_list = [], var data_list = [],
axis_dict = {},
previous_time = 0, previous_time = 0,
line_list, line_list,
graph_index = 1, graph_index = 1,
...@@ -235,6 +229,7 @@ ...@@ -235,6 +229,7 @@
cpu_threads: "CPU threads", cpu_threads: "CPU threads",
cpu_process: "total process" cpu_process: "total process"
}, },
label,
i, i,
j; j;
...@@ -266,25 +261,22 @@ ...@@ -266,25 +261,22 @@
break; break;
} }
} }
axis_dict["0"] = {
"title": line_list[graph_index],
"scale_type": "linear",
"value_type": "date",
"zoom_range": gadget.property_dict.date_window
};
axis_dict["1_1"] = {"title": line_list[graph_index], "position": "right"};
data_list.push({ data_list.push({
value_dict: {"0": [], "1": []}, value_dict: {
0: [],
1: []
},
colors: ['#61a0a8'],
type: "line", type: "line",
axis_mapping_id_dict: {"1": "1_1"},
title: line_list[graph_index] title: line_list[graph_index]
}); });
label = line_list[graph_index];
for (i = 1; i < gadget.property_dict.process_data.data.length; i += 1) { for (i = 1; i < gadget.property_dict.process_data.data.length; i += 1) {
line_list = gadget.property_dict.process_data.data[i].split(','); line_list = gadget.property_dict.process_data.data[i].split(',');
for (j = 1; j < line_list.length; j += 1) { for (j = 1; j < line_list.length; j += 1) {
// Date // Date
if (j === graph_index) { if (j === graph_index) {
data_list[0].value_dict["0"].push(line_list[0]); data_list[0].value_dict["0"].push(formatDate(new Date(line_list[0])));
if (j === cpu_time_index) { if (j === cpu_time_index) {
data_list[0].value_dict["1"].push(getCPUTime(line_list[j])); data_list[0].value_dict["1"].push(getCPUTime(line_list[j]));
} else { } else {
...@@ -297,7 +289,15 @@ ...@@ -297,7 +289,15 @@
value: { value: {
data: data_list, data: data_list,
layout: { layout: {
axis_dict : axis_dict, axis_dict : {
0: {"title": "Date"},
1: {"title": label, "value_type": "number"}
},
datazoom: {
type: 'inside',
start: 80,
end: 100
},
title: "Process resources usage" title: "Process resources usage"
} }
} }
...@@ -465,7 +465,6 @@ ...@@ -465,7 +465,6 @@
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted') .declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
//.declareAcquiredMethod("notifySubmitting", 'notifySubmitting')
.onLoop(function () { .onLoop(function () {
if (!this.property_dict.disable_update) { if (!this.property_dict.disable_update) {
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>971.43798.57526.26624</string> </value> <value> <string>1004.34930.23605.8738</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1542387970.17</float> <float>1669283952.25</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/> <link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script class="render-link-template" type="text/x-handlebars-template">
<a href="{{url}}" target="{{target}}">{{title}}</a>
</script>
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="gadget_officejs_jio_instance_tree_view.js"></script> <script src="gadget_officejs_jio_instance_tree_view.js"></script>
...@@ -15,25 +18,13 @@ ...@@ -15,25 +18,13 @@
</head> </head>
<body> <body>
<br/> <div class="center">
<article class="ui-content ui-body-c">
<section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c">
<span class="ui-icon ui-icon-custom ui-icon-cubes">&nbsp;</span>
<span class="hosting-title"></span>
</h3>
</section>
<section class="ui-body-c ui-content-section">
<p class="text-info">To change monitor password, go to <i>Monitoring Configuration</i>.</p>
<div class="parameters-box">
</div>
</section>
</article>
<div class="bottom">
<div data-gadget-url="gadget_erp5_form.html" <div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_list" data-gadget-scope="form_list"
data-gadget-sandbox="public"> data-gadget-sandbox="public">
</div> </div>
</div> </div>
<div class="bottom custom-gadget">
</div>
</body> </body>
</html> </html>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>971.13402.51340.4454</string> </value> <value> <string>1004.26520.12594.3771</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1540563538.46</float> <float>1670343169.06</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, document, RSVP, escape */ /*global window, rJS, document, RSVP, escape */
/*jslint nomen: true, indent: 2, maxerr: 3*/ /*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, document, RSVP, escape) { (function (window, rJS, document, Handlebars, RSVP, jIO, escape) {
"use strict"; "use strict";
var gadget_klass = rJS(window); var gadget_klass = rJS(window),
source = gadget_klass.__template_element
.querySelector(".render-link-template")
.innerHTML,
link_template = Handlebars.compile(source);
gadget_klass gadget_klass
.setState({ .setState({
...@@ -31,11 +35,7 @@ ...@@ -31,11 +35,7 @@
param_list[0].select_list.push('parameters'); param_list[0].select_list.push('parameters');
return gadget.jio_allDocs(param_list[0]) return gadget.jio_allDocs(param_list[0])
.push(function (result) { .push(function (result) {
return gadget.changeState({instance_dict: result}); var i,
})
.push(function () {
var result = gadget.state.instance_dict,
i,
value, value,
len = result.data.total_rows; len = result.data.total_rows;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
...@@ -171,63 +171,9 @@ ...@@ -171,63 +171,9 @@
.onStateChange(function (modification_dict) { .onStateChange(function (modification_dict) {
var gadget = this; var gadget = this;
if (!modification_dict.hasOwnProperty('ouline_list') && if (!modification_dict.hasOwnProperty('ouline_list')) {
!modification_dict.hasOwnProperty('instance_dict')) {
return; return;
} }
if (modification_dict.hasOwnProperty('instance_dict')) {
// render parameter form
return new RSVP.Queue()
.push(function () {
var promise_list = [],
i,
element = gadget.element.querySelector('.parameters-box'),
gadget_element;
//cleanup
while (element.hasChildNodes()) {
element.removeChild(element.lastChild);
}
for (i = 0; i < gadget.state.instance_dict.data.total_rows; i += 1) {
if (gadget.state.instance_dict.data.rows[i]
.value.aggregate_reference === undefined) {
// Instance is not Synchronized!
promise_list.push(false);
continue;
}
gadget_element = document.createElement("div");
element.appendChild(gadget_element);
promise_list.push(
gadget.declareGadget("gadget_officejs_monitoring_parameter_view.html",
{element: gadget_element,
scope: 'p_' + gadget.state.instance_dict.data.rows[i].id,
sandbox: "public"}
)
);
}
return RSVP.all(promise_list);
})
.push(function (parameter_gadget_list) {
var i,
promise_list = [];
gadget.props.parameter_form_list = parameter_gadget_list;
for (i = 0; i < parameter_gadget_list.length; i += 1) {
if (parameter_gadget_list[i]) {
promise_list.push(
parameter_gadget_list[i].render({
url: gadget.state.instance_dict.data.rows[i].value._links.private_url.href
.replace('jio_private', 'private') + '/config',
basic_login: gadget.state.opml.basic_login,
title: "Parameters " + gadget.state.instance_dict.data.rows[i].value.title,
parameters: gadget.state.instance_dict.data.rows[i].value.parameters
})
);
}
}
return RSVP.all(promise_list);
});
}
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return gadget.getDeclaredGadget('form_list'); return gadget.getDeclaredGadget('form_list');
...@@ -253,6 +199,92 @@ ...@@ -253,6 +199,92 @@
return form_list.render({ return form_list.render({
erp5_document: { erp5_document: {
"_embedded": {"_view": { "_embedded": {"_view": {
"your_title": {
"description": "",
"title": "Instance Tree",
"default": gadget.state.instance_tree.title,
"css_class": "",
"required": 0,
"editable": 0,
"key": "instance_tree_title",
"hidden": 0,
"type": "EditorField"
},
"your_status": {
"description": "",
"title": "Status",
"default": gadget.state.instance_tree.status,
"css_class": "",
"required": 1,
"editable": 0,
"key": "status",
"hidden": 0,
"url": "gadget_erp5_field_status.html",
"type": "GadgetField"
},
"your_status_date": {
"description": "",
"title": "Status Date",
"default": gadget.state.instance_tree.status_date,
"css_class": "",
"required": 0,
"editable": 0,
"key": "status_date",
"hidden": 0,
"timezone_style": 1,
"date_only": 0,
"type": "DateTimeField"
},
"your_instance_amount": {
"description": "",
"title": "Instance Amount",
"default": gadget.state.instance_tree.instance_amount,
"css_class": "",
"required": 0,
"editable": 0,
"key": "instance_amount",
"hidden": 0,
"type": "StringField"
},
"your_portal_type": {
"description": "",
"title": "Portal Type",
"default": gadget.state.instance_tree.portal_type,
"css_class": "",
"required": 0,
"editable": 0,
"key": "portal_type",
"hidden": 0,
"type": "StringField"
},
"your_opml_url": {
"description": "",
"title": "OMPL Url",
"default": link_template({
url: gadget.state.instance_tree.opml_url || "",
title: gadget.state.instance_tree.opml_url || "",
target: "_blank"
}),
"css_class": "",
"required": 0,
"editable": 0,
"key": "opml_url",
"type": "EditorField"
},
"your_software_release_url": {
"description": "",
"title": "Software Release",
"default": link_template({
url: gadget.state.instance_tree.software_release || "",
title: gadget.state.instance_tree.software_release || "",
target: "_blank"
}),
"css_class": "",
"required": 0,
"editable": 0,
"key": "software_release_url",
"type": "EditorField"
},
"listbox": { "listbox": {
"column_list": column_list, "column_list": column_list,
"show_anchor": 0, "show_anchor": 0,
...@@ -280,10 +312,29 @@ ...@@ -280,10 +312,29 @@
} }
}, },
form_definition: { form_definition: {
group_list: [[ group_list: [
[
"left",
[
["your_title"], ["your_status"], ["your_status_date"]
]
],
[
"right",
[
["your_instance_amount"], ["your_portal_type"],
["your_opml_url"]
]
],
[
"center",
[["your_software_release_url"]]
],
[
"bottom", "bottom",
[["listbox"]] [["listbox"]]
]] ]
]
} }
}); });
}) })
...@@ -301,23 +352,19 @@ ...@@ -301,23 +352,19 @@
}) })
.push(function (url_list) { .push(function (url_list) {
if (gadget.state.instance_tree.instance_amount === 0) { if (gadget.state.instance_tree.instance_amount === 0) {
gadget.element.querySelector('.hosting-title').textContent = gadget.state.instance_tree.title += " - Not synchronized!";
gadget.state.instance_tree.title + " - Not synchronized!";
return gadget.updateHeader({ return gadget.updateHeader({
page_title: "Instance Tree: " + gadget.state.instance_tree.title, page_title: "Instance Tree: " + gadget.state.instance_tree.title,
selection_url: url_list[0], selection_url: url_list[0],
jump_url: url_list[1] jump_url: url_list[1]
}); });
} }
gadget.element.querySelector('.hosting-title').textContent =
gadget.state.instance_tree.title;
return gadget.updateHeader({ return gadget.updateHeader({
page_title: "Instance Tree: " + gadget.state.instance_tree.title, page_title: "Instance Tree: " + gadget.state.instance_tree.title,
selection_url: url_list[0], selection_url: url_list[0],
jump_url: url_list[1], jump_url: url_list[1]
save_action: true
}); });
}); });
}); });
}(window, rJS, document, RSVP, escape)); }(window, rJS, document, Handlebars, RSVP, jIO, escape));
\ No newline at end of file \ No newline at end of file
...@@ -79,7 +79,9 @@ ...@@ -79,7 +79,9 @@
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
...@@ -250,7 +252,7 @@ ...@@ -250,7 +252,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.4007.38246.25361</string> </value> <value> <string>1004.56923.1101.33536</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +272,7 @@ ...@@ -270,7 +272,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1543845609.21</float> <float>1670517705.78</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -3,6 +3,25 @@ ...@@ -3,6 +3,25 @@
(function (window, rJS, RSVP, Handlebars, atob) { (function (window, rJS, RSVP, Handlebars, atob) {
"use strict"; "use strict";
function padTo2Digits(num) {
return num.toString().padStart(2, '0');
}
function formatDate(date) {
return (
[
date.getFullYear(),
padTo2Digits(date.getMonth() + 1),
padTo2Digits(date.getDate())
].join('-') +
' ' +
[
padTo2Digits(date.getHours()),
padTo2Digits(date.getMinutes())
].join(':')
);
}
var gadget_klass = rJS(window), var gadget_klass = rJS(window),
source = gadget_klass.__template_element source = gadget_klass.__template_element
.querySelector(".render-link-template") .querySelector(".render-link-template")
...@@ -219,58 +238,49 @@ ...@@ -219,58 +238,49 @@
], ],
data = element_dict.data || promise_data, data = element_dict.data || promise_data,
data_list = [], data_list = [],
data_dict = {date_list: [], success_list: [], error_list: []},
line_list, line_list,
i; i;
for (i = 1; i < data.length; i += 1) {
line_list = data[i].split(',');
data_dict.date_list.push(formatDate(new Date(line_list[0])));
data_dict.success_list.push(line_list[1]);
data_dict.error_list.push(line_list[2]);
}
data_list.push({ data_list.push({
value_dict: {"0": [], "1": []}, value_dict: {
type: "scatter", 0: data_dict.date_list,
axis_mapping_id_dict: {"1": "1_1"}, 1: data_dict.success_list
},
colors: ['#61a0a8'],
type: "line",
title: "promises success" title: "promises success"
}); }, {
data_list.push({ value_dict: {
value_dict: {"0": [], "1": []}, 0: data_dict.date_list,
type: "scatter", 1: data_dict.error_list
axis_mapping_id_dict: {"1": "1_2"}, },
colors: ['#c23531'],
type: "line",
title: "promises error" title: "promises error"
}); });
for (i = 1; i < data.length; i += 1) {
line_list = data[i].split(',');
data_list[0].value_dict["0"].push(line_list[0]);
data_list[0].value_dict["1"].push(line_list[1]);
// XXX repeating date entry
data_list[1].value_dict["0"].push(line_list[0]);
data_list[1].value_dict["1"].push(line_list[2]);
}
return data_list; return data_list;
}; };
graph_options.data_dict = { graph_options.data_dict = {
data: {}, data: [],
layout: { layout: {
axis_dict : { axis_dict : {
"0": { 0: {"title": "date"},
"title": "Promises Failure Progression", 1: {"title": "value", "value_type": "number"}
"scale_type": "linear",
"value_type": "date"
}, },
"1_1": { title: "Promises Success/Failure Progression"
"title": "Promises success",
"position": "right"
},
"1_2": {
"title": "Promises error",
"position": "right"
}
},
title: "Promises Failure Progression"
} }
}; };
return graph_options; return graph_options;
}) })
.push(function (g) { .push(function (g) {
graph_data = g; graph_data = g;
//gadget.element.querySelector('.template-view').innerHTML = html;
return gadget.getDeclaredGadget('form_view'); return gadget.getDeclaredGadget('form_view');
}) })
.push(function (form_gadget) { .push(function (form_gadget) {
...@@ -542,6 +552,11 @@ ...@@ -542,6 +552,11 @@
gadget.getUrlFor({command: 'push_history', options: { gadget.getUrlFor({command: 'push_history', options: {
page: 'ojsm_processes_view', page: 'ojsm_processes_view',
key: gadget.state.opml_outline.reference key: gadget.state.opml_outline.reference
}}),
gadget.getUrlFor({command: 'push_history', options: {
page: 'ojsm_gadget_display',
key: gadget.state.instance.reference,
opml_url: gadget.state.opml_outline.parent_url
}}) }})
]); ]);
}) })
...@@ -556,6 +571,7 @@ ...@@ -556,6 +571,7 @@
if (gadget.state.instance._links !== undefined) { if (gadget.state.instance._links !== undefined) {
options.resources_url = url_list[3]; options.resources_url = url_list[3];
options.processes_url = url_list[4]; options.processes_url = url_list[4];
options.gadget_url = url_list[5];
} }
return gadget.updateHeader(options); return gadget.updateHeader(options);
}); });
......
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.4061.47106.61696</string> </value> <value> <string>1004.56556.50306.8192</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1543848850.64</float> <float>1670494974.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -63,7 +63,8 @@ ...@@ -63,7 +63,8 @@
['edit_properties', 'Properties', 'info'], ['edit_properties', 'Properties', 'info'],
['change_password', 'Change Password', 'pencil-square-o'], ['change_password', 'Change Password', 'pencil-square-o'],
['resources_url', 'Resources', 'picture-o'], ['resources_url', 'Resources', 'picture-o'],
['processes_url', 'Processes', 'list-alt'] ['processes_url', 'Processes', 'list-alt'],
['gadget_url', 'Script', 'puzzle-piece']
]; ];
gadget_klass gadget_klass
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.27666.8050.30907</string> </value> <value> <string>1004.15047.64260.56968</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1542277962.83</float> <float>1670494589.86</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -108,6 +108,27 @@ ...@@ -108,6 +108,27 @@
<key> <string>language</string> </key> <key> <string>language</string> </key>
<value> <string>en</string> </value> <value> <string>en</string> </value>
</item> </item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1455284352.46</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value> <value> <string>Web Page</string> </value>
......
...@@ -108,6 +108,27 @@ ...@@ -108,6 +108,27 @@
<key> <string>language</string> </key> <key> <string>language</string> </key>
<value> <string>en</string> </value> <value> <string>en</string> </value>
</item> </item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1455284352.21</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value> <value> <string>Web Page</string> </value>
......
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
</head> </head>
<body> <body>
<div data-gadget-url="gadget_officejs_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_officejs_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_gadget" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_gadget" data-gadget-sandbox="public" class="graph graph-medium"></div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.25931.6156.58743</string> </value> <value> <string>1005.8558.21408.14438</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1514370606.61</float> <float>1671547158.99</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -601,7 +601,8 @@ ...@@ -601,7 +601,8 @@
var i, var i,
j, j,
start, start,
extra_dict; extra_dict,
software_release_url;
function applyItemToTree(item, item_result, extra_dict) { function applyItemToTree(item, item_result, extra_dict) {
var id_hash, var id_hash,
...@@ -657,6 +658,13 @@ ...@@ -657,6 +658,13 @@
reference: id_hash, reference: id_hash,
active: true active: true
}); });
if (!software_release_url &&
element.portal_type == "Software Instance" &&
element.software_release) {
// OPML has no software release URL, we get it from the first
// which has it.
software_release_url = element.software_release;
}
opml_document_list.push({ opml_document_list.push({
id: id_hash, id: id_hash,
doc: element doc: element
...@@ -726,6 +734,7 @@ ...@@ -726,6 +734,7 @@
} }
} }
} }
instance_tree.software_release = software_release_url || '';
opml_document_list.push({ opml_document_list.push({
id: id, id: id,
doc: instance_tree doc: instance_tree
......
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.3978.30023.34679</string> </value> <value> <string>1011.60237.8337.45209</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1543851108.12</float> <float>1697754171.94</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -311,7 +311,7 @@ ...@@ -311,7 +311,7 @@
</item> </item>
<item> <item>
<key> <string>configuration_content_security_policy</string> </key> <key> <string>configuration_content_security_policy</string> </key>
<value> <string>default-src \'self\'; img-src \'self\' data:; media-src \'self\' blob:; connect-src \'self\' https://content.dropboxapi.com https://api.dropboxapi.com data: * localhost:5378 *.vifib.erp5.net *.host.vifib.net *.node.vifib.com *.erp5.net; script-src \'self\' \'unsafe-eval\' \'unsafe-inline\'; font-src \'self\'; style-src \'self\' \'unsafe-inline\' data:; frame-src \'self\' data:</string> </value> <value> <string>default-src \'self\'; img-src \'self\' data:; media-src \'self\' blob:; connect-src \'self\' https://content.dropboxapi.com https://api.dropboxapi.com data: * localhost:5378 *.vifib.erp5.net *.host.vifib.net *.node.vifib.com *.erp5.net; script-src \'self\' \'unsafe-eval\' \'unsafe-inline\'; font-src \'self\'; style-src \'self\' \'unsafe-inline\' data:; frame-src \'self\' * data:</string> </value>
</item> </item>
<item> <item>
<key> <string>configuration_default_jio_document_page_gadget_url</string> </key> <key> <string>configuration_default_jio_document_page_gadget_url</string> </key>
...@@ -576,7 +576,7 @@ ...@@ -576,7 +576,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>992.64257.46798.35242</string> </value> <value> <string>1011.60641.7001.46387</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -596,7 +596,7 @@ ...@@ -596,7 +596,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1625247788.8</float> <float>1697748086.87</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,6 +5,8 @@ url_list = [ ...@@ -5,6 +5,8 @@ url_list = [
"gadget_global.js", "gadget_global.js",
"gadget_field_graph_dygraph.html", "gadget_field_graph_dygraph.html",
"gadget_field_graph_dygraph.js", "gadget_field_graph_dygraph.js",
"gadget_field_graph_echarts.html",
"gadget_field_graph_echarts.js",
"gadget_jio.html", "gadget_jio.html",
"gadget_jio.js", "gadget_jio.js",
"gadget_translate.html", "gadget_translate.html",
...@@ -79,6 +81,8 @@ url_list = [ ...@@ -79,6 +81,8 @@ url_list = [
"gadget_erp5_sort_editor.html", "gadget_erp5_sort_editor.html",
"gadget_erp5_sort_editor.js", "gadget_erp5_sort_editor.js",
"gadget_officejs_monitoring_jio.html", "gadget_officejs_monitoring_jio.html",
"gadget_erp5_page_ojsm_gadget_display.html",
"gadget_erp5_page_ojsm_gadget_display.js",
"gadget_erp5_page_ojsm_instance_tree_list.html", "gadget_erp5_page_ojsm_instance_tree_list.html",
"gadget_officejs_monitoring_parameter_view.html", "gadget_officejs_monitoring_parameter_view.html",
"gadget_erp5_page_settings_configurator.html", "gadget_erp5_page_settings_configurator.html",
......
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